ProtocolVersion packet improvements.
This commit is contained in:
parent
1ff2b89dba
commit
61587c020a
@ -32,17 +32,24 @@ public class ProtocolVersion extends ClientBasePacket
|
|||||||
{
|
{
|
||||||
super(rawPacket);
|
super(rawPacket);
|
||||||
int version = readD();
|
int version = readD();
|
||||||
// _log.fine("Protocol Revision:" + version);
|
|
||||||
if (version != Config.CLIENT_PROTOCOL_VERSION)
|
// this packet is never encrypted
|
||||||
|
if (version == -2)
|
||||||
{
|
{
|
||||||
_log.warning("Client " + client.getLoginName() + " tryied to login with client protocol " + version);
|
// this is just a ping attempt from the client
|
||||||
throw new IOException("Wrong Protocol Version: " + version);
|
}
|
||||||
|
else if (version != Config.CLIENT_PROTOCOL_VERSION)
|
||||||
|
{
|
||||||
|
_log.warning("Wrong Protocol Version: " + version + ", " + client);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Connection con = client.getConnection();
|
||||||
|
KeyPacket pk = new KeyPacket();
|
||||||
|
pk.setKey(con.getCryptKey());
|
||||||
|
con.sendPacket(pk);
|
||||||
|
con.activateCryptKey();
|
||||||
}
|
}
|
||||||
Connection con = client.getConnection();
|
|
||||||
KeyPacket pk = new KeyPacket();
|
|
||||||
pk.setKey(con.getCryptKey());
|
|
||||||
con.sendPacket(pk);
|
|
||||||
con.activateCryptKey();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user