示例#1
0
        private void HandleActiveScene(Msg_LR_ActiveScene msg, PBChannel channel, int handle, uint seq)
        {
            int          roomid    = msg.RoomID;
            int          sceneId   = msg.SceneID;
            List <ulong> users     = msg.UserGuids;
            int          thread_id = GetIdleThread();

            if (thread_id < 0)
            {
                LogSys.Log(LOG_TYPE.ERROR, "all room are using, active room failed!");
                Msg_RL_ActiveSceneResult retMsg = new Msg_RL_ActiveSceneResult();
                retMsg.UserGuids.AddRange(users);
                retMsg.RoomID = roomid;
                retMsg.Result = (int)SceneOperationResultEnum.Cant_Find_Room;
                return;
            }
            RoomThread roomThread = roomthread_list_[thread_id];

            AddActiveRoom(roomid, thread_id, false);
            roomThread.PreActiveRoom();
            LogSys.Log(LOG_TYPE.INFO, "queue active room {0} scene {1} thread {2}", roomid, sceneId, thread_id);
            roomThread.QueueAction(roomThread.ActiveRoom, roomid, sceneId, (MyAction <bool>)((bool val) => {
                Msg_RL_ActiveSceneResult retMsg = new Msg_RL_ActiveSceneResult();
                retMsg.UserGuids.AddRange(users);
                retMsg.RoomID = roomid;
                retMsg.Result = val ? (int)SceneOperationResultEnum.Success : (int)SceneOperationResultEnum.Cant_Find_Room;
            }));
        }
示例#2
0
        internal void OnActiveScene(List <ulong> guids, int sceneId)
        {
            Msg_LR_ActiveScene msg = new Msg_LR_ActiveScene();

            msg.UserGuids.AddRange(guids);
            msg.RoomId  = m_LobbyInfo.CreateAutoRoom(guids.ToArray(), sceneId);
            msg.SceneId = sceneId;

            RoomInfo room = m_LobbyInfo.GetRoomByID(msg.RoomId);

            if (null != room)
            {
                LobbyServer.Instance.RoomSvrChannel.Send(room.RoomServerName, msg);
            }
        }