예제 #1
0
        public override bool TakeAction()
        {
            if (!m_RequestPacket.Accept)
            {
                m_ResponsePacket.Accept          = false;
                m_ResponsePacket.InviterPlayerId = m_RequestPacket.InviterPlayerId;
                m_ResponsePacket.TeamId          = m_RequestPacket.TeamId;
                return(true);
            }
            PlayerFoundryLogic pf = new PlayerFoundryLogic();

            pf.SetUser(m_UserId);
            if (!pf.JoinRoom(m_RequestPacket.TeamId))
            {
                ErrorCode = (int)ErrorType.RequireNotMet;
                ErrorInfo = "Room is full";
                return(false);
            }
            m_ResponsePacket.Accept          = true;
            m_ResponsePacket.Data            = pf.GetAllFoundryData();
            m_ResponsePacket.InviterPlayerId = m_RequestPacket.InviterPlayerId;
            m_ResponsePacket.TeamId          = m_RequestPacket.TeamId;
            pf.PushRoomPlayerChangedNotify();
            return(true);
        }