private void HandleReconnectUser(Msg_LR_ReconnectUser urMsg, PBChannel channel, int handle, uint seq) { bool isFieldThread; int ix = GetActiveRoomThreadIndex(urMsg.RoomID, out isFieldThread); if (ix < 0) { Msg_RL_ReplyReconnectUser replyBuilder = new Msg_RL_ReplyReconnectUser(); replyBuilder.UserGuid = urMsg.UserGuid; replyBuilder.RoomID = urMsg.RoomID; replyBuilder.Result = (int)Msg_RL_ReplyReconnectUser.ReconnectResultEnum.NotExist; channel.Send(replyBuilder); } else { if (isFieldThread) { RoomThread roomThread = field_roomthread_list_[ix]; roomThread.QueueAction(roomThread.HandleReconnectUser, urMsg, channel, handle, seq); } else { RoomThread roomThread = roomthread_list_[ix]; roomThread.QueueAction(roomThread.HandleReconnectUser, urMsg, channel, handle, seq); } } }
internal void HandleReconnectUser(Msg_LR_ReconnectUser urMsg, PBChannel channel, int handle, uint seq) { Msg_RL_ReplyReconnectUser.ReconnectResultEnum result; User us = GetUserByGuid(urMsg.UserGuid); if (null != us) { if ((int)UserControlState.UserDropped == us.UserControlState || !us.IsConnected()) { result = Msg_RL_ReplyReconnectUser.ReconnectResultEnum.Drop; } else { result = Msg_RL_ReplyReconnectUser.ReconnectResultEnum.Online; } } else { result = Msg_RL_ReplyReconnectUser.ReconnectResultEnum.NotExist; } Msg_RL_ReplyReconnectUser replyBuilder = new Msg_RL_ReplyReconnectUser(); replyBuilder.UserGuid = urMsg.UserGuid; replyBuilder.RoomID = urMsg.RoomID; replyBuilder.Result = (int)result; channel.Send(replyBuilder); }
internal void UserRelogin(ulong guid, int srcHandle) { UserInfo user = LobbyServer.Instance.UserProcessScheduler.GetUserInfo(guid); if (user != null) { if (user.CurrentState == UserState.Room) { RoomInfo room = m_LobbyInfo.GetRoomByID(user.CurrentRoomID); if (room != null) { //向RoomServer发送消息,重新进入房间 Msg_LR_ReconnectUser urBuilder = new Msg_LR_ReconnectUser(); urBuilder.UserGuid = guid; urBuilder.RoomID = user.CurrentRoomID; LobbyServer.Instance.RoomSvrChannel.Send(room.RoomServerName, urBuilder); LogSys.Log(LOG_TYPE.INFO, "User Restart GameClient , guid:{0}", guid); } else { //房间已经关闭 user.ResetRoomInfo(); user.CurrentState = UserState.Online; Msg_BL_QueryUserStateResult builder = new Msg_BL_QueryUserStateResult(); builder.Guid = guid; builder.State = (int)UserState.Online; LobbyServer.Instance.UserChannel.Send(srcHandle, builder); } } } else { Msg_BL_QueryUserStateResult builder = new Msg_BL_QueryUserStateResult(); builder.Guid = guid; builder.State = (int)UserState.DropOrOffline; LobbyServer.Instance.UserChannel.Send(srcHandle, builder); } }