예제 #1
0
        private void ChangeSkin(IUserToken token, _DTO_byte dto)
        {
            PResult result = this._roomBiz.GetUserRoom(token, out Room room);

            if (result != PResult.SUCCESS)
            {
                this.Reply(token, Module.ROOM, Command.QCMD_CHANGE_SKIN, result);
                return;
            }
            User user = this._userBiz.GetUser(token);

            result = this._roomBiz.ChangeSkin(room, user.id, dto.value);
            if (result != PResult.SUCCESS)
            {
                this.Reply(token, Module.ROOM, Command.QCMD_CHANGE_SKIN, result);
            }
            else
            {
                this.BrocastRoomInfo(room);
            }
        }
예제 #2
0
        private void HandleEndBattle(IUserToken token, _DTO_byte dto)
        {
            User user = this._userBiz.GetUser(token);

            if (user == null)
            {
                return;
            }

            if (!this._battleBiz.UserInBattle(user.id))
            {
                return;
            }

            PResult result = this._battleBiz.HandleEndBattle(user.id);

            if (result == PResult.SUCCESS)
            {
                StepLocker stepLocker = this._battleBiz.GetFromUserId(user.id);
                stepLocker.Brocast(ProtocolManager.PACKET_BATTLE_ACMD_BATTLE_END(dto.value));                    //todo 信任任何一个客户端带来的胜利消息
            }
        }