Exemplo n.º 1
0
 public void registerHandler(RecvOpcode code, MaplePacketHandler handler) {
   try {
     handlers[code.getValue()] = handler;
   } catch (ArrayIndexOutOfBoundsException e) {
     Output.print("Error registering handler - " + code.name());
   }
 }
Exemplo n.º 2
0
 private PacketProcessor() {
   int maxRecvOp = 0;
   for (RecvOpcode op : RecvOpcode.values()) {
     if (op.getValue() > maxRecvOp) {
       maxRecvOp = op.getValue();
     }
   }
   handlers = new MaplePacketHandler[maxRecvOp + 1];
 }