Exemple #1
0
        protected override void DoHandle(LeaveRoomResult res)
        {
            _leaveRoomResult.Write(res, Time.time);

            if (res == null)
            {
                return;
            }

            if (res.result == ResultCode.OK)
            {
                UpdateRoom(res.room);

                _chooseRoomResult.ClearNotInvalidate();
                _chooseRoomFail.ClearNotInvalidate();

                _gLoginResult.ClearAndInvalidate(Time.time);
            }

            if (res.result == ResultCode.LEAVE_WILL_PUNISH)
            {
                _dialogManager.ShowDialog <PunishTipDialog>(DialogName.PunishTipDialog, false, false,
                                                            (dialog) =>
                {
                    dialog.ApplyData(
                        _currentRoom.Read(),
                        "依然退出",
                        () => _remoteAPI.LeaveRoom(true)
                        );
                    dialog.Show();
                });
            }

            if (_network.GetServer() == Server.GServer)
            {
                _network.StartConnectHServer();
            }
        }