Exemplo n.º 1
0
        internal RoomData GenerateRoomData(UInt32 RoomId)
        {
            if (loadedRoomData.ContainsKey(RoomId))
            {
                return((RoomData)loadedRoomData[RoomId]);
            }

            RoomData Data = new RoomData();

            if (IsRoomLoaded(RoomId))
            {
                return(GetRoom(RoomId).RoomData);
            }
            else
            {
                DataRow Row = null;

                using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE id = " + RoomId);
                    Row = dbClient.getRow();
                }

                if (Row == null)
                {
                    return(null);
                }

                Data.Fill(Row);
                loadedRoomData.Add(RoomId, Data);
            }

            return(Data);
        }
Exemplo n.º 2
0
        internal RoomData FetchRoomData(UInt32 RoomId, DataRow dRow)
        {
            if (loadedRoomData.ContainsKey(RoomId))
            {
                return((RoomData)loadedRoomData[RoomId]);
            }
            else
            {
                RoomData data = new RoomData();
                if (IsRoomLoaded(RoomId))
                {
                    data.Fill(GetRoom(RoomId));
                }
                else
                {
                    data.Fill(dRow);
                }

                loadedRoomData.Add(RoomId, data);
                return(data);
            }
        }
Exemplo n.º 3
0
        internal RoomData GenerateRoomData(UInt32 RoomId)
        {
            if (loadedRoomData.ContainsKey(RoomId))
                return (RoomData)loadedRoomData[RoomId];

            RoomData Data = new RoomData();
            if (IsRoomLoaded(RoomId))
            {
                return GetRoom(RoomId).RoomData;
            }
            else
            {
                DataRow Row = null;

                using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.setQuery("SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE id = " + RoomId);
                    Row = dbClient.getRow();
                }

                if (Row == null)
                {
                    return null;
                }

                Data.Fill(Row);
                loadedRoomData.Add(RoomId, Data);
            }

            return Data;
        }
Exemplo n.º 4
0
        internal RoomData FetchRoomData(UInt32 RoomId, DataRow dRow)
        {
            if (loadedRoomData.ContainsKey(RoomId))
                return (RoomData)loadedRoomData[RoomId];
            else
            {
                RoomData data = new RoomData();
                if (IsRoomLoaded(RoomId))
                    data.Fill(GetRoom(RoomId));
                else
                    data.Fill(dRow);

                loadedRoomData.Add(RoomId, data);
                return data;
            }
        }