Support 1.3 pings.
This commit is contained in:
parent
328f23a4fd
commit
2252bb27c6
@ -77,13 +77,24 @@ public class InitialHandler implements Runnable
|
|||||||
userCon.connect(BungeeCord.instance.config.getServer(handshake.username, handshake.host));
|
userCon.connect(BungeeCord.instance.config.getServer(handshake.username, handshake.host));
|
||||||
break;
|
break;
|
||||||
case 0xFE:
|
case 0xFE:
|
||||||
|
socket.setSoTimeout(100);
|
||||||
|
boolean newPing = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
socket.getInputStream().read();
|
||||||
|
newPing = false;
|
||||||
|
} catch (IOException ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
Configuration conf = BungeeCord.instance.config;
|
Configuration conf = BungeeCord.instance.config;
|
||||||
throw new KickException(ChatColor.COLOR_CHAR + "1"
|
String ping = (newPing) ? ChatColor.COLOR_CHAR + "1"
|
||||||
+ "\00" + conf.protcolVersion
|
+ "\00" + conf.protcolVersion
|
||||||
+ "\00" + conf.gameVersion
|
+ "\00" + conf.gameVersion
|
||||||
+ "\00" + conf.motd
|
+ "\00" + conf.motd
|
||||||
+ "\00" + BungeeCord.instance.connections.size()
|
+ "\00" + BungeeCord.instance.connections.size()
|
||||||
+ "\00" + conf.maxPlayers);
|
+ "\00" + conf.maxPlayers
|
||||||
|
: conf.motd + ChatColor.COLOR_CHAR + BungeeCord.instance.connections.size() + ChatColor.COLOR_CHAR + conf.maxPlayers;
|
||||||
|
throw new KickException(ping);
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("Wasn't ready for packet id " + Util.hex(id));
|
throw new IllegalArgumentException("Wasn't ready for packet id " + Util.hex(id));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user