Merge branch 'master' into gamemodes

This commit is contained in:
Tim Ekl 2011-09-14 19:11:47 -04:00
commit 40c4ce0a37
5 changed files with 69 additions and 11 deletions

@ -1 +1 @@
Subproject commit 5f40678ac750210a3121921af0c4e58e6516bfdb
Subproject commit 18c55a9070a5e64b2cb0737940290643f324fa7d

@ -1 +1 @@
Subproject commit ac9d8c94e483589ccfb9e85bb34b7129b83a6881
Subproject commit ad5c57e56cb44061b1b0f6429ada625da26d434d

View File

@ -90,7 +90,7 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
private Configuration configMV = null;
private WorldManager worldManager = new WorldManager(this);
// Setup the block/player/entity listener.
private MVPlayerListener playerListener = new MVPlayerListener(this);
@ -105,12 +105,13 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
// HashMap to contain information relating to the Players.
private HashMap<String, MVPlayerSession> playerSessions;
private GenericBank bank = null;
private AllPay banker = new AllPay(this, tag + " ");
private AllPay banker;
protected MVConfigMigrator migrator = new MVCoreConfigMigrator(this);
protected int pluginCount;
private DestinationFactory destFactory;
private SpoutInterface spoutInterface = null;
private double allpayversion = 3;
private double chversion = 1;
@Override
public void onLoad() {
@ -130,6 +131,12 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
}
public void onEnable() {
// Perform initial checks for AllPay
if (!this.validateAllpay() || !this.validateCH()) {
this.getServer().getPluginManager().disablePlugin(this);
return;
}
this.banker = new AllPay(this, tag + " ");
// Output a little snippet to show it's enabled.
this.log(Level.INFO, "- Version " + this.getDescription().getVersion() + " Enabled - By " + getAuthors());
this.checkServerProps();
@ -147,7 +154,6 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
this.registerCommands();
this.playerSessions = new HashMap<String, MVPlayerSession>();
// Start the Update Checker
// updateCheck = new UpdateChecker(this.getDescription().getName(), this.getDescription().getVersion());
@ -164,6 +170,50 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
}
}
private boolean validateAllpay() {
try {
this.banker = new AllPay(this, "Verify");
if (this.banker.getVersion() >= allpayversion) {
return true;
} else {
log.info(tag + " - Version " + this.getDescription().getVersion() + " was NOT ENABLED!!!");
log.info(tag + " A plugin that has loaded before " + this.getDescription().getName() + " has an incompatable version of AllPay!");
log.info(tag + " The Following Plugins MAY out of date!");
log.info(tag + " This plugin needs AllPay v" + allpayversion + " or higher and another plugin has loaded v" + this.banker.getVersion() + "!");
log.info(tag + AllPay.pluginsThatUseUs.toString());
return false;
}
} catch (Throwable t) {
}
log.info(tag + " - Version " + this.getDescription().getVersion() + " was NOT ENABLED!!!");
log.info(tag + " A plugin that has loaded before " + this.getDescription().getName() + " has an incompatable version of AllPay!");
log.info(tag + " Check the logs for [AllPay] - Version ... for PLUGIN NAME to find the culprit! Then Yell at that dev!");
log.info(tag + " Or update that plugin :P");
log.info(tag + " This plugin needs AllPay v" + allpayversion + " or higher!");
return false;
}
private boolean validateCH() {
try {
this.commandHandler = new CommandHandler(this, null);
if (this.commandHandler.getVersion() >= chversion) {
return true;
} else {
log.info(tag + " - Version " + this.getDescription().getVersion() + " was NOT ENABLED!!!");
log.info(tag + " A plugin that has loaded before " + this.getDescription().getName() + " has an incompatable version of CommandHandler (an internal library)!");
log.info(tag + " Please contact this plugin author!!!!!!!");
log.info(tag + " This plugin needs CommandHandler v" + chversion + " or higher and another plugin has loaded v" + this.commandHandler.getVersion() + "!");
return false;
}
} catch (Throwable t) {
}
log.info(tag + " - Version " + this.getDescription().getVersion() + " was NOT ENABLED!!!");
log.info(tag + " A plugin that has loaded before " + this.getDescription().getName() + " has an incompatable version of CommandHandler (an internal library)!");
log.info(tag + " Please contact this plugin author!!!!!!!");
log.info(tag + " This plugin needs CommandHandler v" + chversion + " or higher!");
return false;
}
private void initializeDestinationFactory() {
this.destFactory = new DestinationFactory(this);
this.destFactory.registerDestinationType(WorldDestination.class, "");
@ -206,7 +256,7 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
new DefaultConfig(getDataFolder(), "worlds.yml", this.migrator);
// Now grab the Configuration Files.
this.configMV = new Configuration(new File(getDataFolder(), "config.yml"));
this.worldManager.loadWorldConfig(new File(getDataFolder(), "worlds.yml"));
// Now attempt to Load the configurations.
@ -292,7 +342,7 @@ public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
*/
@Deprecated
public boolean removeWorldFromConfig(String name) {
return this.worldManager.removeWorldFromConfig(name);
return this.worldManager.removeWorldFromConfig(name);
}
/**

View File

@ -14,7 +14,7 @@ public class DebugCommand extends MultiverseCommand {
public DebugCommand(MultiverseCore plugin) {
super(plugin);
this.setName("Turn Debug on/off?");
this.setCommandUsage("/mv who" + ChatColor.GOLD + " [1|2|3|off]");
this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off]");
this.setArgRange(0, 1);
this.addKey("mv debug");
this.addKey("mv d");

View File

@ -6,6 +6,9 @@ import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
@ -72,10 +75,15 @@ public class VersionCommand extends MultiverseCommand {
private String postToPasteBin() {
try {
String data = URLEncoder.encode("api_dev_key", "UTF-8") + "=" + URLEncoder.encode("33ab32380506d99d872b69d35dc9d007", "UTF-8");
String data = URLEncoder.encode("api_dev_key", "UTF-8") + "=" + URLEncoder.encode("d61d68d31e8e0392b59b50b277411c71", "UTF-8");
data += "&" + URLEncoder.encode("api_option", "UTF-8") + "=" + URLEncoder.encode("paste", "UTF-8");
data += "&" + URLEncoder.encode("api_paste_code", "UTF-8") + "=" + URLEncoder.encode(this.pasteBinBuffer, "UTF-8");
data += "&" + URLEncoder.encode("api_paste_private", "UTF-8") + "=" + URLEncoder.encode("1", "UTF-8");
data += "&" + URLEncoder.encode("api_paste_format", "UTF-8") + "=" + URLEncoder.encode("yaml", "UTF-8");
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
data += "&" + URLEncoder.encode("api_paste_name", "UTF-8") + "=" + URLEncoder.encode("Multiverse 2 Dump " + dateFormat.format(date), "UTF-8");
data += "&" + URLEncoder.encode("api_user_key", "UTF-8") + "=" + URLEncoder.encode("c052ac52d2b0db88d36cc32ca462d151", "UTF-8");
URL url = new URL("http://pastebin.com/api/api_post.php");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);