Massive varp/varbit related refactoring + new client command
This commit is contained in:
@@ -7,8 +7,14 @@ import core.net.packet.context.VarbitContext;
|
||||
public class Varbit implements OutgoingPacket<VarbitContext> {
|
||||
@Override
|
||||
public void send(VarbitContext varbitContext) {
|
||||
IoBuffer buffer = new IoBuffer(37);
|
||||
buffer.put((byte) varbitContext.value);
|
||||
IoBuffer buffer;
|
||||
if(varbitContext.value > 255){
|
||||
buffer = new IoBuffer(84);
|
||||
buffer.putLEInt((128 | varbitContext.value) & 255);
|
||||
} else {
|
||||
buffer = new IoBuffer(37);
|
||||
buffer.put((byte) 128 | varbitContext.value);
|
||||
}
|
||||
buffer.putLEShort(varbitContext.varbitId);
|
||||
varbitContext.getPlayer().getSession().write(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user