Code:
else if (p.loginStage == 0) {
try {
if (!fillStream(p, 2))
return;
} catch (Exception e) {
Misc.logger("Login","[login] Error: "+e);
return;
}
int connectionType = p.stream.readUnsignedByte();
if(connectionType == 85) {
int day = p.stream.readUnsignedByte();
int month = p.stream.readUnsignedByte()+1;
int year = ((p.stream.inBuffer[p.stream.inOffset++] & 0xff) << 8) + (p.stream.inBuffer[p.stream.inOffset++] & 0xff);
int country = ((p.stream.inBuffer[p.stream.inOffset++] & 0xff) << 8) + (p.stream.inBuffer[p.stream.inOffset++] & 0xff);
Misc.println("Day: "+day+" Month: "+month+" Year: "+year+" Country:"+country);
p.stream.writeByte(2);
directFlushStream(p);
}
else if (connectionType == 15) {
updateServer(p);
p.loginStage = -5;
return;
}
else if (connectionType != 14) {
p.loginStage = -1;
return;
}
int longPlayerName = p.stream.readUnsignedByte();
p.stream.writeByte(0);
p.stream.writeQWord(serverSessionKey);
directFlushStream(p);
p.loginStage++;
}
If I set !fillStream(p, 2) to !fillStream(p, 7), protocol 85 works fine. But I cant login...