예제 #1
0
 public void putPacket(int packetId, Player player) {
   if (packetId < 0) {
     throw new IllegalArgumentException("Invalid packet ID: " + packetId);
   }
   if (packetId >= 128) {
     putByte(((packetId >> 8) + 128) + player.getEncodingCipher().nextInt());
     putByte(packetId + player.getEncodingCipher().nextInt());
   } else {
     putByte(packetId + player.getEncodingCipher().nextInt());
   }
 }
예제 #2
0
 public void putCipheredByte(int val, Player player, int shift) {
   putByte((val + player.getEncodingCipher().nextInt()) >> shift);
 }