예제 #1
0
 private void HandlePacket(InPacket packet)
 {
     try
     {
         LastInOpcode      = packet.Header.Command;
         _lastInOpcodeTime = DateTime.Now;
         PacketHandler handler;
         if (PacketHandlers.TryGetValue(packet.Header.Command, out handler))
         {
             Game.UI.LogDebug(string.Format("Received {0}", packet.Header.Command));
             handler(packet);
         }
         else
         {
             if (!IgnoredOpcodes.Contains(packet.Header.Command) && !NotYetImplementedOpcodes.Contains(packet.Header.Command))
             {
                 Game.UI.LogDebug(string.Format("Unknown or unhandled command '{0}'", packet.Header.Command));
             }
         }
         Game.HandleTriggerInput(TriggerActionType.Opcode, packet);
     }
     catch (Exception ex)
     {
         Game.UI.LogException(ex);
     }
     finally
     {
         packet.Dispose();
     }
 }
예제 #2
0
 private void HandlePacket(InPacket packet)
 {
     try
     {
         LastInOpcode = packet.Header.Command;
         PacketHandler handler;
         if (PacketHandlers.TryGetValue(packet.Header.Command, out handler))
         {
             Game.UI.LogDebug(string.Format("Received {0}", packet.Header.Command));
             handler(packet);
         }
         else
         {
             if (!IgnoredOpcodes.Contains(packet.Header.Command) && !NotYetImplementedOpcodes.Contains(packet.Header.Command))
                 Game.UI.LogDebug(string.Format("Unknown or unhandled command '{0}'", packet.Header.Command));
         }
         Game.HandleTriggerInput(TriggerActionType.Opcode, packet);
     }
     catch(Exception ex)
     {
         Game.UI.LogException(ex);
     }
     finally
     {
         packet.Dispose();
     }
 }