Removed hard-coded client version...

This commit is contained in:
CodeForFame 2011-05-16 19:31:12 -05:00
parent bee6a45477
commit 1d7ded4829
3 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package org.moparscape.msc.gs.phandler.client;
import org.apache.mina.common.IoSession;
import org.moparscape.msc.config.Config;
import org.moparscape.msc.gs.builders.RSCPacketBuilder;
import org.moparscape.msc.gs.connection.Packet;
import org.moparscape.msc.gs.model.Player;
@ -14,7 +15,7 @@ public class DummyPacket implements PacketHandler {
if (p.getLength() > 2) { // 1 for byte, 2 for short
byte b = p.readByte();
int clientVersion = p.readShort();
if (clientVersion > 34 && clientVersion < 40) {
if (clientVersion > Config.SERVER_VERSION - 5 && clientVersion < Config.SERVER_VERSION + 1) {
RSCPacketBuilder pb = new RSCPacketBuilder();
pb.setBare(true);
pb.addByte((byte) 4); // client update

View File

@ -62,7 +62,7 @@ public class PlayerLogin implements PacketHandler {
}
else {
player.load(username, password, 0, reconnecting);
if (clientVersion < 39) {
if (clientVersion < Config.SERVER_VERSION) {
player.clientWarn(true);
}
return;