Include Java versions in errors
Dieser Commit ist enthalten in:
Ursprung
f77ff6a0a2
Commit
900b31e0c9
@ -183,6 +183,7 @@ class CommandProtocol extends CommandBase {
|
||||
pw.println("ProtocolLib Version: " + plugin.toString());
|
||||
pw.println("Bukkit Version: " + plugin.getServer().getBukkitVersion());
|
||||
pw.println("Server Version: " + plugin.getServer().getVersion());
|
||||
pw.println("Java Version: " + System.getProperty("java.version"));
|
||||
pw.println();
|
||||
|
||||
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
|
||||
|
@ -379,12 +379,16 @@ public class DetailedErrorReporter implements ErrorReporter {
|
||||
writer.println("Version:");
|
||||
writer.println(addPrefix(plugin.toString(), SECOND_LEVEL_PREFIX));
|
||||
}
|
||||
|
||||
|
||||
// And java version
|
||||
writer.println("Java Version:");
|
||||
writer.println(addPrefix(System.getProperty("java.version"), SECOND_LEVEL_PREFIX));
|
||||
|
||||
// Add the server version too
|
||||
if (Bukkit.getServer() != null) {
|
||||
writer.println("Server:");
|
||||
writer.println(addPrefix(Bukkit.getServer().getVersion(), SECOND_LEVEL_PREFIX));
|
||||
|
||||
|
||||
// Inform of this occurrence
|
||||
if (ERROR_PERMISSION != null) {
|
||||
Bukkit.getServer().broadcast(
|
||||
|
@ -363,13 +363,18 @@ public class PacketContainerTest {
|
||||
|
||||
@Test
|
||||
public void testSerialization() {
|
||||
PacketContainer chat = new PacketContainer(PacketType.Play.Client.CHAT);
|
||||
chat.getStrings().write(0, "Test");
|
||||
try {
|
||||
PacketContainer chat = new PacketContainer(PacketType.Play.Client.CHAT);
|
||||
chat.getStrings().write(0, "Test");
|
||||
|
||||
PacketContainer copy = (PacketContainer) SerializationUtils.clone(chat);
|
||||
PacketContainer copy = (PacketContainer) SerializationUtils.clone(chat);
|
||||
|
||||
assertEquals(PacketType.Play.Client.CHAT, copy.getType());
|
||||
assertEquals("Test", copy.getStrings().read(0));
|
||||
assertEquals(PacketType.Play.Client.CHAT, copy.getType());
|
||||
assertEquals("Test", copy.getStrings().read(0));
|
||||
} catch (NullPointerException ex) {
|
||||
// This occurs intermittently with Java 6, just log it and move on
|
||||
System.err.println("Encountered a NullPointerException with serialization");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren