Пример #1
0
 public Action5001(ActionGetter actionGetter)
     : base((short)5001, actionGetter)
 {
     m_RequestPacket  = null;
     m_ResponsePacket = null;
     m_UserId         = 0;
 }
Пример #2
0
        public override bool Verify(Message message)
        {
            m_Request = message.Packet as CRGetRoomInfo;
            m_Session = message.Session;
            if (m_Room.Token != m_Request.Token)
            {
                CustomActionDispatcher.PushError((int)ActionType, message.Session, (int)ErrorType.WrongToken, "Token error");
                return(false);
            }
            bool InRoom = false;

            if (m_Room.Players.ContainsKey(m_Request.PlayerId))
            {
                InRoom = true;
            }
            if (!InRoom)
            {
                CustomActionDispatcher.PushError((int)ActionType, message.Session, (int)ErrorType.WrongUserId, "RoomId or UserId error");
                return(false);
            }
            return(true);
        }
Пример #3
0
 public override bool GetUrlElement()
 {
     m_UserId        = actionGetter.GetSession().UserId;
     m_RequestPacket = ProtoBufUtils.Deserialize <CRGetRoomInfo>((byte[])actionGetter.GetMessage());
     return(true);
 }