Exemplo n.º 1
0
        /// <summary>
        /// 返回 断线重连消息
        /// </summary>
        /// <returns></returns>
        public string ReEnterRoom(tb_User _tempuser, cs_reenterroom _data)
        {
            //自动找到gameid,levelid,tableid;
            UserStatus     _curStatus = BaseLobby.instanceBase.GetUserStatusbyUserID(_tempuser.UserID);
            sc_reenterroom _senddata  = new sc_reenterroom()
            {
                result = 0, fn = "sc_reenterroom"
            };

            if (_curStatus != null)
            {
                if (_curStatus.Gameid == 42)
                {
                    BullFight100Table _bftable = BullFight100Lobby.instance.GetTableByRoomIDandTableID(_curStatus.RoomID, _curStatus.TableID);
                    if (_bftable != null)
                    {
                        lock (_bftable)
                        {
                            _senddata.result              = 1;
                            _senddata.gameid              = _curStatus.Gameid;
                            _senddata.levelid             = _curStatus.RoomID;
                            _senddata.tableid             = _curStatus.TableID;
                            _senddata._tableEnterSendData = _bftable.GetEnterDisList(_tempuser.UserID);
                            _senddata._tableSendData      = _bftable.GetDisList(_tempuser.UserID);
                            _senddata._pos2Gold           = _bftable._judge.GetCurrentPosGold();
                            _senddata._numpertable        = _bftable._numpertable;
                            _senddata._isStarted          = _bftable._haveCheckRoomCard;
                            _senddata.gametype            = _bftable._judge._gametype;
                            _senddata.gameModel           = _bftable._judge._gameCoin2Room1;
                            _bftable.NotifyReConnect(_tempuser.UserID);
                        }
                    }
                    else
                    {
                        _curStatus.Status = UserStatusEnum.InLobby;
                        BaseLobby.instanceBase.AddorUpdateUserStatus(_curStatus);
                    }
                }
            }

            return(JsonUtils.Serialize(_senddata));
        }
Exemplo n.º 2
0
        public void SetNotifyReConnect(int userid)
        {
            UserStatus _us = BaseLobby.instanceBase.GetUserStatusbyUserID(userid);

            if (_us == null)
            {
                return;
            }
            if (_us.TableID == 0)
            {
                return;
            }

            if (_us.Gameid == 42)
            {   //如果 在房间里,打牌需要处理状态
                BullFight100Table _bftable = BullFight100Lobby.instance.GetTableByRoomIDandTableID(_us.RoomID, _us.TableID);
                if (_bftable == null)
                {
                    return;
                }
                _bftable.NotifyReConnect(userid);
            }
        }