mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 18:26:06 +01:00
Fix consistency issues in /sub version
The version command looks a little different in SubServers.Host. Let's fix that.
This commit is contained in:
parent
52c6da2517
commit
a9f5c387cc
@ -48,19 +48,38 @@ public final class Launch {
|
|||||||
parser.accepts("noconsole");
|
parser.accepts("noconsole");
|
||||||
joptsimple.OptionSet options = parser.parse(args);
|
joptsimple.OptionSet options = parser.parse(args);
|
||||||
if(options.has("version") || options.has("v")) {
|
if(options.has("version") || options.has("v")) {
|
||||||
boolean build = false;
|
String osarch;
|
||||||
try {
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
Field f = Version.class.getDeclaredField("type");
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
f.setAccessible(true);
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
build = f.get(SubPlugin.version) != VersionType.SNAPSHOT && SubPlugin.class.getPackage().getSpecificationTitle() != null;
|
|
||||||
f.setAccessible(false);
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
} catch (Exception e) {}
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ',');
|
System.out.println(System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"") + ',');
|
||||||
System.out.println("Java " + System.getProperty("java.version") + ",");
|
System.out.println("Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"") + ',');
|
||||||
System.out.println("BungeeCord" + ((patched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
System.out.println("BungeeCord" + ((patched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
||||||
System.out.println("SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
|
System.out.println("SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((SubPlugin.class.getPackage().getSpecificationTitle() != null)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# SubCreator Sponge Forge Script
|
# SubCreator Sponge Forge Build Script
|
||||||
# Usage: "bash build.sh <forge version> <sponge version>"
|
# Usage: "bash build.sh <forge version> <sponge version>"
|
||||||
#
|
#
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
@ -61,9 +61,36 @@ public final class SubCommand extends CommandX {
|
|||||||
if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) {
|
if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) {
|
||||||
sender.sendMessages(printHelp());
|
sender.sendMessages(printHelp());
|
||||||
} else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
|
} else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
|
||||||
sender.sendMessage("SubServers > These are the platforms and versions that are running SubServers.Bungee:");
|
String osarch;
|
||||||
sender.sendMessage(" " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ',');
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
sender.sendMessage(" Java " + System.getProperty("java.version") + ',');
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
|
|
||||||
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
|
|
||||||
|
sender.sendMessage("SubServers > These are the platforms and versions that are running SubServers.Sync:");
|
||||||
|
sender.sendMessage(" " + System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"") + ',');
|
||||||
|
sender.sendMessage(" Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"") + ',');
|
||||||
sender.sendMessage(" " + plugin.getBungeeName() + ((plugin.isPatched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
sender.sendMessage(" " + plugin.getBungeeName() + ((plugin.isPatched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
||||||
sender.sendMessage(" SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((plugin.api.getWrapperBuild() != null)?" (" + plugin.api.getWrapperBuild() + ')':""));
|
sender.sendMessage(" SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((plugin.api.getWrapperBuild() != null)?" (" + plugin.api.getWrapperBuild() + ')':""));
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
@ -356,7 +383,7 @@ public final class SubCommand extends CommandX {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("SubServers > Usage: " + label + " " + args[1].toLowerCase() + " [proxy|host|group|server] <Name>");
|
sender.sendMessage("SubServers > Usage: " + label + " " + args[0].toLowerCase() + " [proxy|host|group|server] <Name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("start")) {
|
} else if (args[0].equalsIgnoreCase("start")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
|
@ -44,9 +44,35 @@ public final class SubCommand implements CommandExecutor {
|
|||||||
if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) {
|
if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) {
|
||||||
sender.sendMessage(printHelp(label));
|
sender.sendMessage(printHelp(label));
|
||||||
} else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
|
} else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
|
||||||
|
String osarch;
|
||||||
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
|
|
||||||
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version").replace("$str$", "SubServers.Client.Bukkit"));
|
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version").replace("$str$", "SubServers.Client.Bukkit"));
|
||||||
sender.sendMessage(ChatColor.WHITE + " " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ChatColor.RESET + ',');
|
sender.sendMessage(ChatColor.WHITE + " " + System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"") + ChatColor.RESET + ',');
|
||||||
sender.sendMessage(ChatColor.WHITE + " Java " + System.getProperty("java.version") + ChatColor.RESET + ',');
|
sender.sendMessage(ChatColor.WHITE + " Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"") + ChatColor.RESET + ',');
|
||||||
sender.sendMessage(ChatColor.WHITE + " " + Bukkit.getName() + ' ' + Bukkit.getVersion() + ChatColor.RESET + ',');
|
sender.sendMessage(ChatColor.WHITE + " " + Bukkit.getName() + ' ' + Bukkit.getVersion() + ChatColor.RESET + ',');
|
||||||
sender.sendMessage(ChatColor.WHITE + " SubServers.Client.Bukkit v" + plugin.version.toExtendedString() + ((plugin.api.getPluginBuild() != null)?" (" + plugin.api.getPluginBuild() + ')':""));
|
sender.sendMessage(ChatColor.WHITE + " SubServers.Client.Bukkit v" + plugin.version.toExtendedString() + ((plugin.api.getPluginBuild() != null)?" (" + plugin.api.getPluginBuild() + ')':""));
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
|
@ -147,13 +147,40 @@ public final class SubCommand implements CommandExecutor {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public CommandResult execute(CommandSource sender, CommandContext args) throws CommandException {
|
public CommandResult execute(CommandSource sender, CommandContext args) throws CommandException {
|
||||||
if (canRun(sender)) {
|
if (canRun(sender)) {
|
||||||
|
String osarch;
|
||||||
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
|
|
||||||
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
|
|
||||||
PluginContainer container = null;
|
PluginContainer container = null;
|
||||||
if (container == null) container = Util.getDespiteException(() -> (PluginContainer) Platform.class.getMethod("getContainer", Class.forName("org.spongepowered.api.Platform$Component")).invoke(Sponge.getPlatform(), Enum.valueOf((Class<Enum>) Class.forName("org.spongepowered.api.Platform$Component"), "IMPLEMENTATION")), null);
|
if (container == null) container = Util.getDespiteException(() -> (PluginContainer) Platform.class.getMethod("getContainer", Class.forName("org.spongepowered.api.Platform$Component")).invoke(Sponge.getPlatform(), Enum.valueOf((Class<Enum>) Class.forName("org.spongepowered.api.Platform$Component"), "IMPLEMENTATION")), null);
|
||||||
if (container == null) container = Util.getDespiteException(() -> (PluginContainer) Platform.class.getMethod("getImplementation").invoke(Sponge.getPlatform()), null);
|
if (container == null) container = Util.getDespiteException(() -> (PluginContainer) Platform.class.getMethod("getImplementation").invoke(Sponge.getPlatform()), null);
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.convertColor(plugin.api.getLang("SubServers","Command.Version").replace("$str$", "SubServers.Client.Sponge")));
|
sender.sendMessage(ChatColor.convertColor(plugin.api.getLang("SubServers","Command.Version").replace("$str$", "SubServers.Client.Sponge")));
|
||||||
sender.sendMessage(Text.builder(" " + System.getProperty("os.name") + ' ' + System.getProperty("os.version")).color(TextColors.WHITE).append(Text.of(",")).build());
|
sender.sendMessage(Text.builder(" " + System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"")).color(TextColors.WHITE).append(Text.of(",")).build());
|
||||||
sender.sendMessage(Text.builder(" Java " + System.getProperty("java.version")).color(TextColors.WHITE).append(Text.of(",")).build());
|
sender.sendMessage(Text.builder(" Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"")).color(TextColors.WHITE).append(Text.of(",")).build());
|
||||||
sender.sendMessage(Text.builder(" " + container.getName() + ' ' + container.getVersion().get()).color(TextColors.WHITE).append(Text.of(",")).build());
|
sender.sendMessage(Text.builder(" " + container.getName() + ' ' + container.getVersion().get()).color(TextColors.WHITE).append(Text.of(",")).build());
|
||||||
sender.sendMessage(Text.builder(" SubServers.Client.Sponge v" + plugin.version.toExtendedString() + ((plugin.api.getPluginBuild() != null)?" (" + plugin.api.getPluginBuild() + ')':"")).color(TextColors.WHITE).build());
|
sender.sendMessage(Text.builder(" SubServers.Client.Sponge v" + plugin.version.toExtendedString() + ((plugin.api.getPluginBuild() != null)?" (" + plugin.api.getPluginBuild() + ')':"")).color(TextColors.WHITE).build());
|
||||||
sender.sendMessage(Text.EMPTY);
|
sender.sendMessage(Text.EMPTY);
|
||||||
|
@ -66,11 +66,37 @@ public final class ExHost {
|
|||||||
parser.accepts("noconsole");
|
parser.accepts("noconsole");
|
||||||
joptsimple.OptionSet options = parser.parse(args);
|
joptsimple.OptionSet options = parser.parse(args);
|
||||||
if(options.has("version") || options.has("v")) {
|
if(options.has("version") || options.has("v")) {
|
||||||
|
String osarch;
|
||||||
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
|
|
||||||
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
|
|
||||||
Version galaxi = Version.fromString(GalaxiEngine.class.getAnnotation(Plugin.class).version());
|
Version galaxi = Version.fromString(GalaxiEngine.class.getAnnotation(Plugin.class).version());
|
||||||
Version subservers = Version.fromString(ExHost.class.getAnnotation(Plugin.class).version());
|
Version subservers = Version.fromString(ExHost.class.getAnnotation(Plugin.class).version());
|
||||||
Version galaxibuild = null;
|
Version galaxibuild = null;
|
||||||
Version subserversbuild = null;
|
Version subserversbuild = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Manifest manifest = new Manifest(GalaxiEngine.class.getResourceAsStream("/META-INF/GalaxiEngine.MF"));
|
Manifest manifest = new Manifest(GalaxiEngine.class.getResourceAsStream("/META-INF/GalaxiEngine.MF"));
|
||||||
if (manifest.getMainAttributes().getValue("Implementation-Version") != null && manifest.getMainAttributes().getValue("Implementation-Version").length() > 0)
|
if (manifest.getMainAttributes().getValue("Implementation-Version") != null && manifest.getMainAttributes().getValue("Implementation-Version").length() > 0)
|
||||||
@ -84,8 +110,8 @@ public final class ExHost {
|
|||||||
} catch (Exception e) {}
|
} catch (Exception e) {}
|
||||||
|
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ',');
|
System.out.println(System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"") + ',');
|
||||||
System.out.println("Java " + System.getProperty("java.version") + ",");
|
System.out.println("Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"") + ',');
|
||||||
System.out.println(GalaxiEngine.class.getAnnotation(Plugin.class).name() + " v" + galaxi.toExtendedString() + ((galaxibuild != null)?" (" + galaxibuild + ')':"")
|
System.out.println(GalaxiEngine.class.getAnnotation(Plugin.class).name() + " v" + galaxi.toExtendedString() + ((galaxibuild != null)?" (" + galaxibuild + ')':"")
|
||||||
+ ((GalaxiEngine.class.getProtectionDomain().getCodeSource().getLocation().equals(ExHost.class.getProtectionDomain().getCodeSource().getLocation()))?" [Patched]":"") + ',');
|
+ ((GalaxiEngine.class.getProtectionDomain().getCodeSource().getLocation().equals(ExHost.class.getProtectionDomain().getCodeSource().getLocation()))?" [Patched]":"") + ',');
|
||||||
System.out.println(ExHost.class.getAnnotation(Plugin.class).name() + " v" + subservers.toExtendedString() + ((subserversbuild != null)?" (" + subserversbuild + ')':""));
|
System.out.println(ExHost.class.getAnnotation(Plugin.class).name() + " v" + subservers.toExtendedString() + ((subserversbuild != null)?" (" + subserversbuild + ')':""));
|
||||||
|
@ -266,7 +266,7 @@ public class SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
host.log.message.println("SubServers > Usage: " + handle + " " + args[1].toLowerCase() + " [proxy|host|group|server] <Name>");
|
host.log.message.println("SubServers > Usage: /" + handle + " [proxy|host|group|server] <Name>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.usage("[proxy|host|group|server]", "<Name>").description("Gets information about an Object").help(
|
}.usage("[proxy|host|group|server]", "<Name>").description("Gets information about an Object").help(
|
||||||
|
@ -48,19 +48,38 @@ public final class Launch {
|
|||||||
parser.accepts("noconsole");
|
parser.accepts("noconsole");
|
||||||
joptsimple.OptionSet options = parser.parse(args);
|
joptsimple.OptionSet options = parser.parse(args);
|
||||||
if(options.has("version") || options.has("v")) {
|
if(options.has("version") || options.has("v")) {
|
||||||
boolean build = false;
|
String osarch;
|
||||||
try {
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
Field f = Version.class.getDeclaredField("type");
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
f.setAccessible(true);
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
build = f.get(SubPlugin.version) != VersionType.SNAPSHOT && SubPlugin.class.getPackage().getSpecificationTitle() != null;
|
|
||||||
f.setAccessible(false);
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
} catch (Exception e) {}
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ',');
|
System.out.println(System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"") + ',');
|
||||||
System.out.println("Java " + System.getProperty("java.version") + ",");
|
System.out.println("Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"") + ',');
|
||||||
System.out.println("BungeeCord" + ((patched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
System.out.println("BungeeCord" + ((patched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
||||||
System.out.println("SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
|
System.out.println("SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((SubPlugin.class.getPackage().getSpecificationTitle() != null)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
@ -59,9 +59,36 @@ public final class SubCommand extends CommandX {
|
|||||||
if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) {
|
if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) {
|
||||||
sender.sendMessages(printHelp());
|
sender.sendMessages(printHelp());
|
||||||
} else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
|
} else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
|
||||||
|
String osarch;
|
||||||
|
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
|
||||||
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
|
|
||||||
|
osarch = arch != null && arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64")?"x64":"x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("86")) {
|
||||||
|
osarch = "x86";
|
||||||
|
} else if (System.getProperty("os.arch").endsWith("64")) {
|
||||||
|
osarch = "x64";
|
||||||
|
} else {
|
||||||
|
osarch = System.getProperty("os.arch");
|
||||||
|
}
|
||||||
|
|
||||||
|
String javaarch = null;
|
||||||
|
switch (System.getProperty("sun.arch.data.model")) {
|
||||||
|
case "32":
|
||||||
|
javaarch = "x86";
|
||||||
|
break;
|
||||||
|
case "64":
|
||||||
|
javaarch = "x64";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!System.getProperty("sun.arch.data.model").equalsIgnoreCase("unknown"))
|
||||||
|
javaarch = System.getProperty("sun.arch.data.model");
|
||||||
|
}
|
||||||
|
|
||||||
sender.sendMessage("SubServers > These are the platforms and versions that are running SubServers.Sync:");
|
sender.sendMessage("SubServers > These are the platforms and versions that are running SubServers.Sync:");
|
||||||
sender.sendMessage(" " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ',');
|
sender.sendMessage(" " + System.getProperty("os.name") + ((!System.getProperty("os.name").toLowerCase().startsWith("windows"))?' ' + System.getProperty("os.version"):"") + ((osarch != null)?" [" + osarch + ']':"") + ',');
|
||||||
sender.sendMessage(" Java " + System.getProperty("java.version") + ',');
|
sender.sendMessage(" Java " + System.getProperty("java.version") + ((javaarch != null)?" [" + javaarch + ']':"") + ',');
|
||||||
sender.sendMessage(" " + plugin.getBungeeName() + ((plugin.isPatched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
sender.sendMessage(" " + plugin.getBungeeName() + ((plugin.isPatched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
|
||||||
sender.sendMessage(" SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((plugin.api.getWrapperBuild() != null)?" (" + plugin.api.getWrapperBuild() + ')':""));
|
sender.sendMessage(" SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((plugin.api.getWrapperBuild() != null)?" (" + plugin.api.getWrapperBuild() + ')':""));
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
@ -302,7 +329,7 @@ public final class SubCommand extends CommandX {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("SubServers > Usage: " + label + " " + args[1].toLowerCase() + " [proxy|host|group|server] <Name>");
|
sender.sendMessage("SubServers > Usage: " + label + " " + args[0].toLowerCase() + " [proxy|host|group|server] <Name>");
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("start")) {
|
} else if (args[0].equalsIgnoreCase("start")) {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
|
@ -380,12 +380,10 @@ public final class SubPlugin extends BungeeCord implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void connect(ServerContainer server, String address) {
|
public void connect(ServerContainer server, String address) {
|
||||||
System.out.println("SubServers > Networked Server: " + server.getName());
|
|
||||||
server.setSubData(address);
|
server.setSubData(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disconnect(ServerContainer server) {
|
public void disconnect(ServerContainer server) {
|
||||||
System.out.println("SubServers > Unnetworked Server: " + server.getName());
|
|
||||||
server.setSubData(null);
|
server.setSubData(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user