123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
-
- using System;
- using System.Collections.Generic;
- using OpenMetaverse;
- using log4net;
- using Nini.Config;
- using System.Reflection;
- using OpenSim.Services.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Data;
- using OpenSim.Framework;
- using OpenSim.Region.Framework.Interfaces;
- using OpenSim.Region.Framework.Scenes;
- namespace OpenSim.Services.SimulationService
- {
- public class SimulationDataService : ServiceBase, ISimulationDataService
- {
- protected ISimulationDataStore m_database;
- public SimulationDataService(IConfigSource config)
- : base(config)
- {
- string dllName = String.Empty;
- string connString = String.Empty;
-
- IConfig dbConfig = config.Configs["DatabaseService"];
- if (dbConfig != null)
- {
- dllName = dbConfig.GetString("StorageProvider", String.Empty);
- connString = dbConfig.GetString("ConnectionString", String.Empty);
- }
-
- IConfig simConfig = config.Configs["SimulationDataStore"];
- if (simConfig != null)
- {
- dllName = simConfig.GetString("StorageProvider", dllName);
- connString = simConfig.GetString("ConnectionString", connString);
- }
-
- if (dllName == String.Empty)
- throw new Exception("No StorageProvider configured");
- m_database = LoadPlugin<ISimulationDataStore>(dllName, new Object[] { connString });
- if (m_database == null)
- throw new Exception("Could not find a storage interface in the given module");
- }
- public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
- {
- m_database.StoreObject(obj, regionUUID);
- }
- public void RemoveObject(UUID uuid, UUID regionUUID)
- {
- m_database.RemoveObject(uuid, regionUUID);
- }
- public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
- {
- m_database.StorePrimInventory(primID, items);
- }
- public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
- {
- return m_database.LoadObjects(regionUUID);
- }
- public void StoreTerrain(TerrainData terrain, UUID regionID)
- {
- m_database.StoreTerrain(terrain, regionID);
- }
- public void StoreTerrain(double[,] terrain, UUID regionID)
- {
- m_database.StoreTerrain(terrain, regionID);
- }
- public double[,] LoadTerrain(UUID regionID)
- {
- return m_database.LoadTerrain(regionID);
- }
- public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
- {
- return m_database.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ);
- }
- public void StoreLandObject(ILandObject Parcel)
- {
- m_database.StoreLandObject(Parcel);
- }
- public void RemoveLandObject(UUID globalID)
- {
- m_database.RemoveLandObject(globalID);
- }
- public List<LandData> LoadLandObjects(UUID regionUUID)
- {
- return m_database.LoadLandObjects(regionUUID);
- }
- public void StoreRegionSettings(RegionSettings rs)
- {
- m_database.StoreRegionSettings(rs);
- }
- public RegionSettings LoadRegionSettings(UUID regionUUID)
- {
- return m_database.LoadRegionSettings(regionUUID);
- }
- public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
- {
- return m_database.LoadRegionWindlightSettings(regionUUID);
- }
- public void StoreRegionWindlightSettings(RegionLightShareData wl)
- {
- m_database.StoreRegionWindlightSettings(wl);
- }
- public void RemoveRegionWindlightSettings(UUID regionID)
- {
- m_database.RemoveRegionWindlightSettings(regionID);
- }
- public string LoadRegionEnvironmentSettings(UUID regionUUID)
- {
- return m_database.LoadRegionEnvironmentSettings(regionUUID);
- }
- public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
- {
- m_database.StoreRegionEnvironmentSettings(regionUUID, settings);
- }
- public void RemoveRegionEnvironmentSettings(UUID regionUUID)
- {
- m_database.RemoveRegionEnvironmentSettings(regionUUID);
- }
- public void SaveExtra(UUID regionID, string name, string val)
- {
- m_database.SaveExtra(regionID, name, val);
- }
- public void RemoveExtra(UUID regionID, string name)
- {
- m_database.RemoveExtra(regionID, name);
- }
- public Dictionary<string, string> GetExtra(UUID regionID)
- {
- return m_database.GetExtra(regionID);
- }
- }
- }
|