Пример #1
0
        private void UpdateFrame()
        {
            if (this.Queue.Count == 0)
            {
                return;
            }
            SessionFrameMessage sessionFrameMessage = this.Queue.Dequeue();

            this.Frame = sessionFrameMessage.FrameMessage.Frame;

            for (int i = 0; i < sessionFrameMessage.FrameMessage.Messages.Count; ++i)
            {
                AFrameMessage message = sessionFrameMessage.FrameMessage.Messages[i];
                Opcode        opcode  = Game.Scene.GetComponent <OpcodeTypeComponent>().GetOpcode(message.GetType());
                Game.Scene.GetComponent <MessageDispatherComponent>().Handle(sessionFrameMessage.Session, new MessageInfo()
                {
                    Opcode = opcode, Message = message
                });
            }
        }
Пример #2
0
 public static void Add(this ServerFrameComponent self, AFrameMessage message)
 {
     self.FrameMessage.Messages.Add(message);
 }