Exemplo n.º 1
0
        private void Handle(NetworkPacket packet)
        {
            NetworkCommand command = NetworkCommandFactory.GetCommand(packet.mHead.mType);

            if (command != null)
            {
                command.HandlePacket(packet);
            }
        }
Exemplo n.º 2
0
 public void Initialize(string spacename, Assembly ass)
 {
     if (!isInitialized)
     {
         NetworkCommandFactory.RegisterCommand(spacename, ass);
         isInitialized  = true;
         mWaitHandle    = new AutoResetEvent(false);
         mCommandPacket = new Queue <NetworkPacket>();
         isClose        = false;
         mHandleThread  = new Thread(HandlePacket)
         {
             IsBackground = true
         };
         mHandleThread.Start();
     }
 }