コード例 #1
0
ファイル: RoomManager.cs プロジェクト: myl2232/ArkCrossEngine
        private void HandleUserRelive(Msg_LR_UserReLive msg, PBChannel channel, int handle, uint seq)
        {
            int ix = GetActiveRoomThreadIndex(msg.RoomID);

            if (ix >= 0)
            {
                RoomThread roomThread = roomthread_list_[ix];
                roomThread.QueueAction(roomThread.HandleUserRelive, msg);
            }
        }
コード例 #2
0
ファイル: RoomManager.cs プロジェクト: myl2232/ArkCrossEngine
        private void HandleReconnectUser(Msg_LR_ReconnectUser urMsg, PBChannel channel, int handle, uint seq)
        {
            int ix = GetActiveRoomThreadIndex(urMsg.RoomID);

            if (ix < 0)
            {
                Msg_RL_ReplyReconnectUser.Builder replyBuilder = Msg_RL_ReplyReconnectUser.CreateBuilder();
                replyBuilder.SetUserGuid(urMsg.UserGuid);
                replyBuilder.SetRoomID(urMsg.RoomID);
                replyBuilder.SetIsSuccess(false);
                channel.Send(replyBuilder.Build());
            }
            else
            {
                RoomThread roomThread = roomthread_list_[ix];
                roomThread.QueueAction(roomThread.HandleReconnectUser, urMsg, channel, handle, seq);
            }
        }
コード例 #3
0
ファイル: RoomManager.cs プロジェクト: myl2232/ArkCrossEngine
        internal bool ActiveRoom(int roomid, int scenetype, User[] users)
        {
            int thread_id = GetIdleThread();

            if (thread_id < 0)
            {
                LogSys.Log(LOG_TYPE.ERROR, "all room are using, active room failed!");
                foreach (User u in users)
                {
                    LogSys.Log(LOG_TYPE.INFO, "FreeUser {0} for {1} {2}, [RoomManager.ActiveRoom]", u.LocalID, u.Guid, u.GetKey());
                    user_pool_.FreeUser(u.LocalID);
                }
                return(false);
            }
            RoomThread roomThread = roomthread_list_[thread_id];

            AddActiveRoom(roomid, thread_id);
            roomThread.PreActiveRoom();
            LogSys.Log(LOG_TYPE.INFO, "queue active room {0} scene {1} thread {2} for {3} users", roomid, scenetype, thread_id, users.Length);
            roomThread.QueueAction(roomThread.ActiveRoom, roomid, scenetype, users);
            return(true);
        }