Beispiel #1
0
 public override void Dispatch(BasePacket packet)
 {
     if (packet.ProcessType == PacketEnum.ProcessType.RPC &&
         MEngine.Instance.IsServer == true)
     {
         // RPC Handling
         RPCGateWay.PushPacket(packet);
         RPCWait.Set();
     }
     else
     {
         // Logic Handling
         LogicGateWay.PushPacket(packet);
         LogicWait.Set();
     }
 }
Beispiel #2
0
        public void LogicThreadProcess()
        {
            while (IsLogicEnd == false)
            {
                LogicWait.WaitOne();

                BasePacket packet;

                do
                {
                    packet = LogicGateWay.PopPacket();

                    if (packet != null)
                    {
                        LogicHandler.ProcessPacket(packet);
                    }
                } while (LogicGateWay.Count() != 0);
            }
        }