Exemplo n.º 1
0
		internal RoomData GenerateRoomData(uint RoomId)
		{
            if (this.loadedRoomData.Contains(RoomId))
			{
				return (RoomData)this.loadedRoomData[RoomId];
			}
			RoomData roomData = new RoomData();
			if (this.IsRoomLoaded(RoomId))
			{
				return this.GetRoom(RoomId).RoomData;
			}
			DataRow dataRow = null;
			using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
			{
				queryreactor.setQuery("SELECT * FROM rooms WHERE id = " + RoomId + " LIMIT 1");
				dataRow = queryreactor.getRow();
			}
			if (dataRow == null)
			{
				return null;
			}
			roomData.Fill(dataRow);
			this.loadedRoomData.Add(RoomId, roomData);
			return roomData;
		}
Exemplo n.º 2
0
		internal RoomData FetchRoomData(uint RoomId, DataRow dRow)
		{
            if (this.loadedRoomData.Contains(RoomId))
			{
				return (RoomData)this.loadedRoomData[RoomId];
			}
			RoomData roomData = new RoomData();
			if (this.IsRoomLoaded(RoomId))
			{
				roomData.Fill(this.GetRoom(RoomId));
			}
			else
			{
				roomData.Fill(dRow);
			}
			this.loadedRoomData.Add(RoomId, roomData);
			return roomData;
		}