forked from xjboss/KCauldronX
Merge branch 'kcx-1614' of https://git.xjboss.net/KC-RELOADED/KCauldronX
This commit is contained in:
@ -29,7 +29,7 @@ public class KCauldron {
|
||||
while (resources.hasMoreElements()) {
|
||||
URL url = resources.nextElement();
|
||||
manifest.load(url.openStream());
|
||||
String version = manifest.getProperty("KCauldron-Version");
|
||||
String version = manifest.getProperty("KCauldronX-Version");
|
||||
if (version != null) {
|
||||
String path = url.getPath();
|
||||
String jarFilePath = path.substring(path.indexOf(":") + 1,
|
||||
@ -38,11 +38,11 @@ public class KCauldron {
|
||||
sServerLocation = new File(jarFilePath);
|
||||
|
||||
sCurrentVersion = version;
|
||||
sGroup = manifest.getProperty("KCauldron-Group");
|
||||
sBranch = manifest.getProperty("KCauldron-Branch");
|
||||
sChannel = manifest.getProperty("KCauldron-Channel");
|
||||
sLegacy = Boolean.parseBoolean(manifest.getProperty("KCauldron-Legacy"));
|
||||
sOfficial = Boolean.parseBoolean(manifest.getProperty("KCauldron-Official"));
|
||||
sGroup = manifest.getProperty("KCauldronX-Group");
|
||||
sBranch = manifest.getProperty("KCauldronX-Branch");
|
||||
sChannel = manifest.getProperty("KCauldronX-Channel");
|
||||
sLegacy = Boolean.parseBoolean(manifest.getProperty("KCauldronX-Legacy"));
|
||||
sOfficial = Boolean.parseBoolean(manifest.getProperty("KCauldronX-Official"));
|
||||
break;
|
||||
}
|
||||
manifest.clear();
|
||||
|
@ -38,8 +38,8 @@ public class KCauldronCommand extends Command {
|
||||
super(NAME);
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(String.format("/%s check - Check to update\n", NAME));
|
||||
builder.append(String.format("/%s update [version] - Update to specified or latest version\n", NAME));
|
||||
//builder.append(String.format("/%s check - Check to update\n", NAME));
|
||||
//builder.append(String.format("/%s update [version] - Update to specified or latest version\n", NAME));
|
||||
builder.append(String.format("/%s tps - Show tps statistics\n", NAME));
|
||||
builder.append(String.format("/%s restart - Restart server\n", NAME));
|
||||
builder.append(String.format("/%s dump - Dump statistics into kcauldron.dump file\n", NAME));
|
||||
@ -80,10 +80,14 @@ public class KCauldronCommand extends Command {
|
||||
if ("check".equals(action)) {
|
||||
if (!testPermission(sender, CHECK))
|
||||
return true;
|
||||
/*
|
||||
sender.sendMessage(ChatColor.GREEN + "Initiated version check...");
|
||||
KVersionRetriever.startServer(new CommandSenderUpdateCallback(sender), false);
|
||||
*/
|
||||
} else if ("update".equals(action)) {
|
||||
/*
|
||||
KCauldronUpdater.initUpdate(sender, args.length > 1 ? args[1] : null);
|
||||
*/
|
||||
} else if ("tps".equals(action)) {
|
||||
if (!testPermission(sender, TPS))
|
||||
return true;
|
||||
|
@ -21,6 +21,7 @@ public class DefaultUpdateCallback implements IVersionCheckCallback {
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (hasPermission(player)) {
|
||||
/*
|
||||
if (KCauldron.isLegacy()) {
|
||||
player.sendMessage(ChatColor.YELLOW + "We're running on legacy version on KCauldron, please update your version");
|
||||
}
|
||||
@ -30,6 +31,7 @@ public class DefaultUpdateCallback implements IVersionCheckCallback {
|
||||
if (mHasUpdate) {
|
||||
sendUpdate(player);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.client.LaxRedirectStrategy;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
|
||||
public class KVersionRetriever implements Runnable, UncaughtExceptionHandler {
|
||||
private static final boolean DEBUG;
|
||||
private static final KLog sLogger;
|
||||
@ -76,7 +75,7 @@ public class KVersionRetriever implements Runnable, UncaughtExceptionHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private void check() {
|
||||
try {
|
||||
HttpUriRequest request = RequestBuilder
|
||||
|
Reference in New Issue
Block a user