Ejemplo n.º 1
0
        //===================================================================
        //野外分线相关处理
        //===================================================================
        internal void RequestSceneRoomInfo(ulong guid)
        {
            UserProcessScheduler dataProcess = LobbyServer.Instance.UserProcessScheduler;
            UserInfo             user        = dataProcess.GetUserInfo(guid);

            if (null != user)
            {
                if (user.CurrentState == UserState.Room)
                {
                    RoomInfo room = user.Room;
                    if (null != room)
                    {
                        SceneRoomInfo info = m_LobbyInfo.GetSceneRoomInfo(room.SceneType, room.RoomId);
                        if (null != info)
                        {
                            string            chapterName;
                            TableConfig.Level cfg = TableConfig.LevelProvider.Instance.GetLevel(info.m_SceneId);
                            if (null != cfg)
                            {
                                chapterName = "unknown";
                            }
                            else
                            {
                                chapterName = "unknown";
                            }
                            LobbyServer.Instance.SendStoryMessage(user, "onroominfo", info.m_RoomIndex, info.m_UserCount, info.m_TotalUserCount, info.m_RoomId, info.m_SceneId, chapterName);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        internal List <SceneRoomInfo> GetSceneRoomList(int sceneId)
        {
            List <SceneRoomInfo> infos = new List <SceneRoomInfo>();
            SceneRoomsInfo       info;

            if (m_SceneInfos.TryGetValue(sceneId, out info))
            {
                int ct = info.m_RoomIds.Count;
                for (int i = 0; i < ct; ++i)
                {
                    int      id   = info.m_RoomIds[i];
                    RoomInfo room = GetRoomByID(id);
                    if (null != room && m_RoomServerInfos.ContainsKey(room.RoomServerName))
                    {
                        SceneRoomInfo tinfo = new SceneRoomInfo();
                        tinfo.m_SceneId        = sceneId;
                        tinfo.m_RoomId         = id;
                        tinfo.m_RoomIndex      = i + 1;
                        tinfo.m_UserCount      = room.UserCount;
                        tinfo.m_TotalUserCount = room.TotalCount;
                        infos.Add(tinfo);
                    }
                }
            }
            return(infos);
        }
Ejemplo n.º 3
0
        internal SceneRoomInfo GetSceneRoomInfo(int sceneId, int roomId)
        {
            SceneRoomInfo  ret = null;
            SceneRoomsInfo info;

            if (m_SceneInfos.TryGetValue(sceneId, out info))
            {
                ret           = new SceneRoomInfo();
                ret.m_SceneId = sceneId;
                ret.m_RoomId  = roomId;
                int ix = info.m_RoomIds.IndexOf(roomId);
                ret.m_RoomIndex = ix + 1;
                RoomInfo room = GetRoomByID(roomId);
                if (null != room)
                {
                    ret.m_UserCount      = room.UserCount;
                    ret.m_TotalUserCount = room.TotalCount;
                }
            }
            return(ret);
        }
Ejemplo n.º 4
0
 internal List<SceneRoomInfo> GetSceneRoomList(int sceneId)
 {
     List<SceneRoomInfo> infos = new List<SceneRoomInfo>();
     SceneRoomsInfo info;
     if (m_SceneInfos.TryGetValue(sceneId, out info)) {
         int ct = info.m_RoomIds.Count;
         for (int i = 0; i < ct; ++i) {
             int id = info.m_RoomIds[i];
             RoomInfo room = GetRoomByID(id);
             if (null != room && m_RoomServerInfos.ContainsKey(room.RoomServerName)) {
                 SceneRoomInfo tinfo = new SceneRoomInfo();
                 tinfo.m_SceneId = sceneId;
                 tinfo.m_RoomId = id;
                 tinfo.m_RoomIndex = i + 1;
                 tinfo.m_UserCount = room.UserCount;
                 tinfo.m_TotalUserCount = room.TotalCount;
                 infos.Add(tinfo);
             }
         }
     }
     return infos;
 }
Ejemplo n.º 5
0
 internal SceneRoomInfo GetSceneRoomInfo(int sceneId, int roomId)
 {
     SceneRoomInfo ret = null;
     SceneRoomsInfo info;
     if (m_SceneInfos.TryGetValue(sceneId, out info)) {
         ret = new SceneRoomInfo();
         ret.m_SceneId = sceneId;
         ret.m_RoomId = roomId;
         int ix = info.m_RoomIds.IndexOf(roomId);
         ret.m_RoomIndex = ix + 1;
         RoomInfo room = GetRoomByID(roomId);
         if (null != room) {
             ret.m_UserCount = room.UserCount;
             ret.m_TotalUserCount = room.TotalCount;
         }
     }
     return ret;
 }