Example #1
0
        public static void HandlePacket(WorldClient client, CMSG msgID, BinReader data)
        {
            DebugLogger.ILog("Handling CMSG packet: " + msgID);

            bool handled = false;

            try {
                IWorldClientPacketHandler handler = (IWorldClientPacketHandler)worldClientHandlers[msgID];
                if (handler != null)
                {
                    handler.HandlePacket(client, msgID, data);
                    handled = true;
                }
                WorldClientPacketDelegate wcpd = (WorldClientPacketDelegate)worldClientDelegates[(int)msgID];
                if (wcpd != null)
                {
                    wcpd(client, msgID, data);
                    handled = true;
                }
            } catch (Exception exp) {
                DebugLogger.Logger.Log("", exp);
            }

            if (handled == false)
            {
                DebugLogger.ILog("Unhandled CMSG: " + msgID.ToString());
            }
        }
Example #2
0
        public static void HandlePacket(WorldClient client, CMSG msgID, BinReader data)
        {
            IWorldClientPacketHandler handler = (IWorldClientPacketHandler)worldClientHandlers[msgID];

            if (handler != null)
            {
                handler.HandlePacket(client, msgID, data);
            }
            WorldClientPacketDelegate wcpd = (WorldClientPacketDelegate)worldClientDelegates[(int)msgID];

            if (wcpd != null)
            {
                wcpd(client, msgID, data);
            }
        }
 public static void HandlePacket(WorldClient client, CMSG msgID, BinReader data)
 {
     try {
         IWorldClientPacketHandler handler = (IWorldClientPacketHandler)worldClientHandlers[msgID];
         if (handler != null)
         {
             handler.HandlePacket(client, msgID, data);
         }
         WorldClientPacketDelegate wcpd = (WorldClientPacketDelegate)worldClientDelegates[(int)msgID];
         if (wcpd != null)
         {
             wcpd(client, msgID, data);
         }
     } catch (Exception exp) {
         DebugLogger.Log("", exp);
     }
 }