diff options
34 files changed, 460 insertions, 255 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 4b5710a..bb0a5b5 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -638,7 +638,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
638 | // Set the estate | 638 | // Set the estate |
639 | 639 | ||
640 | // Check for an existing estate | 640 | // Check for an existing estate |
641 | List<int> estateIDs = m_application.StorageManager.EstateDataStore.GetEstates((string) requestData["estate_name"]); | 641 | List<int> estateIDs = m_application.EstateDataService.GetEstates((string) requestData["estate_name"]); |
642 | if (estateIDs.Count < 1) | 642 | if (estateIDs.Count < 1) |
643 | { | 643 | { |
644 | UUID userID = UUID.Zero; | 644 | UUID userID = UUID.Zero; |
@@ -666,7 +666,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
666 | } | 666 | } |
667 | 667 | ||
668 | // Create a new estate with the name provided | 668 | // Create a new estate with the name provided |
669 | region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(region.RegionID, true); | 669 | region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, true); |
670 | 670 | ||
671 | region.EstateSettings.EstateName = (string) requestData["estate_name"]; | 671 | region.EstateSettings.EstateName = (string) requestData["estate_name"]; |
672 | region.EstateSettings.EstateOwner = userID; | 672 | region.EstateSettings.EstateOwner = userID; |
@@ -676,10 +676,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
676 | else | 676 | else |
677 | { | 677 | { |
678 | int estateID = estateIDs[0]; | 678 | int estateID = estateIDs[0]; |
679 | 679 | ||
680 | region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(estateID); | 680 | region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID); |
681 | 681 | ||
682 | if (!m_application.StorageManager.EstateDataStore.LinkRegion(region.RegionID, estateID)) | 682 | if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID)) |
683 | throw new Exception("Failed to join estate."); | 683 | throw new Exception("Failed to join estate."); |
684 | } | 684 | } |
685 | 685 | ||
diff --git a/OpenSim/Data/MSSQL/MSSQLEstateData.cs b/OpenSim/Data/MSSQL/MSSQLEstateData.cs index 80bf106..e9a0935 100644 --- a/OpenSim/Data/MSSQL/MSSQLEstateData.cs +++ b/OpenSim/Data/MSSQL/MSSQLEstateData.cs | |||
@@ -50,6 +50,15 @@ namespace OpenSim.Data.MSSQL | |||
50 | 50 | ||
51 | #region Public methods | 51 | #region Public methods |
52 | 52 | ||
53 | public MSSQLEstateStore() | ||
54 | { | ||
55 | } | ||
56 | |||
57 | public MSSQLEstateStore(string connectionString) | ||
58 | { | ||
59 | Initialise(connectionString); | ||
60 | } | ||
61 | |||
53 | /// <summary> | 62 | /// <summary> |
54 | /// Initialises the estatedata class. | 63 | /// Initialises the estatedata class. |
55 | /// </summary> | 64 | /// </summary> |
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index ae105d5..8532af4 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -55,6 +55,16 @@ namespace OpenSim.Data.MSSQL | |||
55 | /// </summary> | 55 | /// </summary> |
56 | private MSSQLManager _Database; | 56 | private MSSQLManager _Database; |
57 | private string m_connectionString; | 57 | private string m_connectionString; |
58 | |||
59 | public MSSQLSimulationData() | ||
60 | { | ||
61 | } | ||
62 | |||
63 | public MSSQLSimulationData(string connectionString) | ||
64 | { | ||
65 | Initialise(connectionString); | ||
66 | } | ||
67 | |||
58 | /// <summary> | 68 | /// <summary> |
59 | /// Initialises the region datastore | 69 | /// Initialises the region datastore |
60 | /// </summary> | 70 | /// </summary> |
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 9158f7a..c42c687 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -54,6 +54,15 @@ namespace OpenSim.Data.MySQL | |||
54 | private Dictionary<string, FieldInfo> m_FieldMap = | 54 | private Dictionary<string, FieldInfo> m_FieldMap = |
55 | new Dictionary<string, FieldInfo>(); | 55 | new Dictionary<string, FieldInfo>(); |
56 | 56 | ||
57 | public MySQLEstateStore() | ||
58 | { | ||
59 | } | ||
60 | |||
61 | public MySQLEstateStore(string connectionString) | ||
62 | { | ||
63 | Initialise(connectionString); | ||
64 | } | ||
65 | |||
57 | public void Initialise(string connectionString) | 66 | public void Initialise(string connectionString) |
58 | { | 67 | { |
59 | m_connectionString = connectionString; | 68 | m_connectionString = connectionString; |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 36f73ef..ac752f6 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -52,6 +52,15 @@ namespace OpenSim.Data.MySQL | |||
52 | private string m_connectionString; | 52 | private string m_connectionString; |
53 | private object m_dbLock = new object(); | 53 | private object m_dbLock = new object(); |
54 | 54 | ||
55 | public MySQLSimulationData() | ||
56 | { | ||
57 | } | ||
58 | |||
59 | public MySQLSimulationData(string connectionString) | ||
60 | { | ||
61 | Initialise(connectionString); | ||
62 | } | ||
63 | |||
55 | public void Initialise(string connectionString) | 64 | public void Initialise(string connectionString) |
56 | { | 65 | { |
57 | m_connectionString = connectionString; | 66 | m_connectionString = connectionString; |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index fcf041e..d1d67eb 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -49,6 +49,15 @@ namespace OpenSim.Data.SQLite | |||
49 | private Dictionary<string, FieldInfo> m_FieldMap = | 49 | private Dictionary<string, FieldInfo> m_FieldMap = |
50 | new Dictionary<string, FieldInfo>(); | 50 | new Dictionary<string, FieldInfo>(); |
51 | 51 | ||
52 | public SQLiteEstateStore() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | public SQLiteEstateStore(string connectionString) | ||
57 | { | ||
58 | Initialise(connectionString); | ||
59 | } | ||
60 | |||
52 | public void Initialise(string connectionString) | 61 | public void Initialise(string connectionString) |
53 | { | 62 | { |
54 | m_connectionString = connectionString; | 63 | m_connectionString = connectionString; |
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 1820f78..7e62e84 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -70,6 +70,15 @@ namespace OpenSim.Data.SQLite | |||
70 | 70 | ||
71 | private String m_connectionString; | 71 | private String m_connectionString; |
72 | 72 | ||
73 | public SQLiteSimulationData() | ||
74 | { | ||
75 | } | ||
76 | |||
77 | public SQLiteSimulationData(string connectionString) | ||
78 | { | ||
79 | Initialise(connectionString); | ||
80 | } | ||
81 | |||
73 | // Temporary attribute while this is experimental | 82 | // Temporary attribute while this is experimental |
74 | 83 | ||
75 | /*********************************************************************** | 84 | /*********************************************************************** |
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs index bf8ee14..547ea6b 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs | |||
@@ -49,6 +49,15 @@ namespace OpenSim.Data.SQLiteLegacy | |||
49 | private Dictionary<string, FieldInfo> m_FieldMap = | 49 | private Dictionary<string, FieldInfo> m_FieldMap = |
50 | new Dictionary<string, FieldInfo>(); | 50 | new Dictionary<string, FieldInfo>(); |
51 | 51 | ||
52 | public SQLiteEstateStore() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | public SQLiteEstateStore(string connectionString) | ||
57 | { | ||
58 | Initialise(connectionString); | ||
59 | } | ||
60 | |||
52 | public void Initialise(string connectionString) | 61 | public void Initialise(string connectionString) |
53 | { | 62 | { |
54 | m_connectionString = connectionString; | 63 | m_connectionString = connectionString; |
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs index e9c6aa5..2dde926 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs | |||
@@ -69,6 +69,15 @@ namespace OpenSim.Data.SQLiteLegacy | |||
69 | 69 | ||
70 | private String m_connectionString; | 70 | private String m_connectionString; |
71 | 71 | ||
72 | public SQLiteSimulationData() | ||
73 | { | ||
74 | } | ||
75 | |||
76 | public SQLiteSimulationData(string connectionString) | ||
77 | { | ||
78 | Initialise(connectionString); | ||
79 | } | ||
80 | |||
72 | // Temporary attribute while this is experimental | 81 | // Temporary attribute while this is experimental |
73 | 82 | ||
74 | /*********************************************************************** | 83 | /*********************************************************************** |
diff --git a/OpenSim/Framework/ConfigSettings.cs b/OpenSim/Framework/ConfigSettings.cs index 8feaa37..be77341 100644 --- a/OpenSim/Framework/ConfigSettings.cs +++ b/OpenSim/Framework/ConfigSettings.cs | |||
@@ -124,22 +124,6 @@ namespace OpenSim.Framework | |||
124 | set { m_standaloneUserSource = value; } | 124 | set { m_standaloneUserSource = value; } |
125 | } | 125 | } |
126 | 126 | ||
127 | protected string m_storageConnectionString; | ||
128 | |||
129 | public string StorageConnectionString | ||
130 | { | ||
131 | get { return m_storageConnectionString; } | ||
132 | set { m_storageConnectionString = value; } | ||
133 | } | ||
134 | |||
135 | protected string m_estateConnectionString; | ||
136 | |||
137 | public string EstateConnectionString | ||
138 | { | ||
139 | get { return m_estateConnectionString; } | ||
140 | set { m_estateConnectionString = value; } | ||
141 | } | ||
142 | |||
143 | protected string m_librariesXMLFile; | 127 | protected string m_librariesXMLFile; |
144 | public string LibrariesXMLFile | 128 | public string LibrariesXMLFile |
145 | { | 129 | { |
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index e69e3fc..e2e0640 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -345,10 +345,6 @@ namespace OpenSim | |||
345 | 345 | ||
346 | m_configSettings.StorageDll = startupConfig.GetString("storage_plugin"); | 346 | m_configSettings.StorageDll = startupConfig.GetString("storage_plugin"); |
347 | 347 | ||
348 | m_configSettings.StorageConnectionString | ||
349 | = startupConfig.GetString("storage_connection_string"); | ||
350 | m_configSettings.EstateConnectionString | ||
351 | = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString); | ||
352 | m_configSettings.ClientstackDll | 348 | m_configSettings.ClientstackDll |
353 | = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); | 349 | = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); |
354 | } | 350 | } |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index d2d2607..74ad168 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -45,6 +45,7 @@ using OpenSim.Region.Framework; | |||
45 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Framework.Scenes; | 46 | using OpenSim.Region.Framework.Scenes; |
47 | using OpenSim.Region.Physics.Manager; | 47 | using OpenSim.Region.Physics.Manager; |
48 | using OpenSim.Server.Base; | ||
48 | 49 | ||
49 | namespace OpenSim | 50 | namespace OpenSim |
50 | { | 51 | { |
@@ -186,6 +187,24 @@ namespace OpenSim | |||
186 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); | 187 | userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); |
187 | } | 188 | } |
188 | 189 | ||
190 | // Load the simulation data service | ||
191 | IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; | ||
192 | if (simDataConfig == null) | ||
193 | throw new Exception("Configuration file is missing the [SimulationDataStore] section"); | ||
194 | string module = simDataConfig.GetString("LocalServiceModule", String.Empty); | ||
195 | if (String.IsNullOrEmpty(module)) | ||
196 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section"); | ||
197 | m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source }); | ||
198 | |||
199 | // Load the estate data service | ||
200 | IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; | ||
201 | if (estateDataConfig == null) | ||
202 | throw new Exception("Configuration file is missing the [EstateDataStore] section"); | ||
203 | module = estateDataConfig.GetString("LocalServiceModule", String.Empty); | ||
204 | if (String.IsNullOrEmpty(module)) | ||
205 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); | ||
206 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { m_config.Source }); | ||
207 | |||
189 | base.StartupSpecific(); | 208 | base.StartupSpecific(); |
190 | 209 | ||
191 | m_stats = StatsManager.StartCollectingSimExtraStats(); | 210 | m_stats = StatsManager.StartCollectingSimExtraStats(); |
@@ -536,7 +555,7 @@ namespace OpenSim | |||
536 | 555 | ||
537 | regionInfo.InternalEndPoint.Port = (int) port; | 556 | regionInfo.InternalEndPoint.Port = (int) port; |
538 | 557 | ||
539 | Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); | 558 | Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); |
540 | 559 | ||
541 | if (m_autoCreateClientStack) | 560 | if (m_autoCreateClientStack) |
542 | { | 561 | { |
@@ -552,30 +571,19 @@ namespace OpenSim | |||
552 | return scene; | 571 | return scene; |
553 | } | 572 | } |
554 | 573 | ||
555 | protected override StorageManager CreateStorageManager() | ||
556 | { | ||
557 | return | ||
558 | CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString); | ||
559 | } | ||
560 | |||
561 | protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) | ||
562 | { | ||
563 | return new StorageManager(m_configSettings.StorageDll, connectionstring, estateconnectionstring); | ||
564 | } | ||
565 | |||
566 | protected override ClientStackManager CreateClientStackManager() | 574 | protected override ClientStackManager CreateClientStackManager() |
567 | { | 575 | { |
568 | return new ClientStackManager(m_configSettings.ClientstackDll); | 576 | return new ClientStackManager(m_configSettings.ClientstackDll); |
569 | } | 577 | } |
570 | 578 | ||
571 | protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, | 579 | protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, |
572 | AgentCircuitManager circuitManager) | 580 | IEstateDataService estateDataService, AgentCircuitManager circuitManager) |
573 | { | 581 | { |
574 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); | 582 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); |
575 | 583 | ||
576 | return new Scene( | 584 | return new Scene( |
577 | regionInfo, circuitManager, sceneGridService, | 585 | regionInfo, circuitManager, sceneGridService, |
578 | storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, | 586 | simDataService, estateDataService, m_moduleLoader, false, m_configSettings.PhysicalPrim, |
579 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); | 587 | m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); |
580 | } | 588 | } |
581 | 589 | ||
@@ -792,21 +800,23 @@ namespace OpenSim | |||
792 | /// </param> | 800 | /// </param> |
793 | public void PopulateRegionEstateInfo(RegionInfo regInfo) | 801 | public void PopulateRegionEstateInfo(RegionInfo regInfo) |
794 | { | 802 | { |
795 | if (m_storageManager.EstateDataStore != null) | 803 | IEstateDataService estateDataService = EstateDataService; |
804 | |||
805 | if (estateDataService != null) | ||
796 | { | 806 | { |
797 | regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false); | 807 | regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false); |
798 | } | 808 | } |
799 | 809 | ||
800 | if (regInfo.EstateSettings.EstateID == 0) // No record at all | 810 | if (regInfo.EstateSettings.EstateID == 0) // No record at all |
801 | { | 811 | { |
802 | MainConsole.Instance.Output("Your region is not part of an estate."); | 812 | MainConsole.Instance.Output("Your region is not part of an estate."); |
803 | while (true) | 813 | while (true) |
804 | { | 814 | { |
805 | string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"}); | 815 | string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() { "yes", "no" }); |
806 | if (response == "no") | 816 | if (response == "no") |
807 | { | 817 | { |
808 | // Create a new estate | 818 | // Create a new estate |
809 | regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true); | 819 | regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true); |
810 | 820 | ||
811 | regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); | 821 | regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); |
812 | //regInfo.EstateSettings.Save(); | 822 | //regInfo.EstateSettings.Save(); |
@@ -818,7 +828,7 @@ namespace OpenSim | |||
818 | if (response == "None") | 828 | if (response == "None") |
819 | continue; | 829 | continue; |
820 | 830 | ||
821 | List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response); | 831 | List<int> estateIDs = estateDataService.GetEstates(response); |
822 | if (estateIDs.Count < 1) | 832 | if (estateIDs.Count < 1) |
823 | { | 833 | { |
824 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); | 834 | MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); |
@@ -827,9 +837,9 @@ namespace OpenSim | |||
827 | 837 | ||
828 | int estateID = estateIDs[0]; | 838 | int estateID = estateIDs[0]; |
829 | 839 | ||
830 | regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); | 840 | regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID); |
831 | 841 | ||
832 | if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID)) | 842 | if (estateDataService.LinkRegion(regInfo.RegionID, estateID)) |
833 | break; | 843 | break; |
834 | 844 | ||
835 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); | 845 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 46b68ec..ea1317a 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -36,6 +36,7 @@ using OpenSim.Framework.Communications; | |||
36 | using OpenSim.Framework.Servers; | 36 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Framework.Servers.HttpServer; | 37 | using OpenSim.Framework.Servers.HttpServer; |
38 | using OpenSim.Region.Framework; | 38 | using OpenSim.Region.Framework; |
39 | using OpenSim.Region.Framework.Interfaces; | ||
39 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Region.Physics.Manager; | 41 | using OpenSim.Region.Physics.Manager; |
41 | 42 | ||
@@ -48,28 +49,16 @@ namespace OpenSim.Region.ClientStack | |||
48 | 49 | ||
49 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); | 50 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); |
50 | protected NetworkServersInfo m_networkServersInfo; | 51 | protected NetworkServersInfo m_networkServersInfo; |
51 | |||
52 | public NetworkServersInfo NetServersInfo | ||
53 | { | ||
54 | get { return m_networkServersInfo; } | ||
55 | } | ||
56 | |||
57 | protected uint m_httpServerPort; | 52 | protected uint m_httpServerPort; |
58 | 53 | protected ISimulationDataService m_simulationDataService; | |
59 | protected StorageManager m_storageManager; | 54 | protected IEstateDataService m_estateDataService; |
60 | |||
61 | public StorageManager StorageManager | ||
62 | { | ||
63 | get { return m_storageManager; } | ||
64 | } | ||
65 | |||
66 | protected ClientStackManager m_clientStackManager; | 55 | protected ClientStackManager m_clientStackManager; |
67 | |||
68 | public SceneManager SceneManager | ||
69 | { | ||
70 | get { return m_sceneManager; } | ||
71 | } | ||
72 | protected SceneManager m_sceneManager = new SceneManager(); | 56 | protected SceneManager m_sceneManager = new SceneManager(); |
57 | |||
58 | public SceneManager SceneManager { get { return m_sceneManager; } } | ||
59 | public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } | ||
60 | public ISimulationDataService SimulationDataService { get { return m_simulationDataService; } } | ||
61 | public IEstateDataService EstateDataService { get { return m_estateDataService; } } | ||
73 | 62 | ||
74 | protected abstract void Initialize(); | 63 | protected abstract void Initialize(); |
75 | 64 | ||
@@ -83,15 +72,11 @@ namespace OpenSim.Region.ClientStack | |||
83 | /// <returns></returns> | 72 | /// <returns></returns> |
84 | protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier); | 73 | protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier); |
85 | 74 | ||
86 | protected abstract StorageManager CreateStorageManager(); | ||
87 | protected abstract ClientStackManager CreateClientStackManager(); | 75 | protected abstract ClientStackManager CreateClientStackManager(); |
88 | protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, | 76 | protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); |
89 | AgentCircuitManager circuitManager); | ||
90 | 77 | ||
91 | protected override void StartupSpecific() | 78 | protected override void StartupSpecific() |
92 | { | 79 | { |
93 | m_storageManager = CreateStorageManager(); | ||
94 | |||
95 | m_clientStackManager = CreateClientStackManager(); | 80 | m_clientStackManager = CreateClientStackManager(); |
96 | 81 | ||
97 | Initialize(); | 82 | Initialize(); |
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 54845fd..7edb43e 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
200 | /// Backup the inventory to the given data store | 200 | /// Backup the inventory to the given data store |
201 | /// </summary> | 201 | /// </summary> |
202 | /// <param name="datastore"></param> | 202 | /// <param name="datastore"></param> |
203 | void ProcessInventoryBackup(ISimulationDataStore datastore); | 203 | void ProcessInventoryBackup(ISimulationDataService datastore); |
204 | 204 | ||
205 | uint MaskEffectivePermissions(); | 205 | uint MaskEffectivePermissions(); |
206 | 206 | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs new file mode 100644 index 0000000..95c9659 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenSim.Framework; | ||
31 | using OpenMetaverse; | ||
32 | |||
33 | namespace OpenSim.Region.Framework.Interfaces | ||
34 | { | ||
35 | public interface IEstateDataService | ||
36 | { | ||
37 | EstateSettings LoadEstateSettings(UUID regionID, bool create); | ||
38 | EstateSettings LoadEstateSettings(int estateID); | ||
39 | void StoreEstateSettings(EstateSettings es); | ||
40 | List<int> GetEstates(string search); | ||
41 | bool LinkRegion(UUID regionID, int estateID); | ||
42 | List<UUID> GetRegions(int estateID); | ||
43 | bool DeleteEstate(int estateID); | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 6b2e03e..72b8de8 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
57 | 57 | ||
58 | public event OnTerrainTickDelegate OnTerrainTick; | 58 | public event OnTerrainTickDelegate OnTerrainTick; |
59 | 59 | ||
60 | public delegate void OnBackupDelegate(ISimulationDataStore datastore, bool forceBackup); | 60 | public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); |
61 | 61 | ||
62 | public event OnBackupDelegate OnBackup; | 62 | public event OnBackupDelegate OnBackup; |
63 | 63 | ||
@@ -684,7 +684,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
687 | public void TriggerOnBackup(ISimulationDataStore dstore, bool forced) | 687 | public void TriggerOnBackup(ISimulationDataService dstore, bool forced) |
688 | { | 688 | { |
689 | OnBackupDelegate handlerOnAttach = OnBackup; | 689 | OnBackupDelegate handlerOnAttach = OnBackup; |
690 | if (handlerOnAttach != null) | 690 | if (handlerOnAttach != null) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 46b84bb..9a9ef5f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -100,10 +100,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
100 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); | 100 | protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); |
101 | protected string m_simulatorVersion = "OpenSimulator Server"; | 101 | protected string m_simulatorVersion = "OpenSimulator Server"; |
102 | protected ModuleLoader m_moduleLoader; | 102 | protected ModuleLoader m_moduleLoader; |
103 | protected StorageManager m_storageManager; | ||
104 | protected AgentCircuitManager m_authenticateHandler; | 103 | protected AgentCircuitManager m_authenticateHandler; |
105 | protected SceneCommunicationService m_sceneGridService; | 104 | protected SceneCommunicationService m_sceneGridService; |
106 | 105 | ||
106 | protected ISimulationDataService m_SimulationDataService; | ||
107 | protected IEstateDataService m_EstateDataService; | ||
107 | protected IAssetService m_AssetService; | 108 | protected IAssetService m_AssetService; |
108 | protected IAuthorizationService m_AuthorizationService; | 109 | protected IAuthorizationService m_AuthorizationService; |
109 | protected IInventoryService m_InventoryService; | 110 | protected IInventoryService m_InventoryService; |
@@ -216,6 +217,42 @@ namespace OpenSim.Region.Framework.Scenes | |||
216 | get { return m_sceneGridService; } | 217 | get { return m_sceneGridService; } |
217 | } | 218 | } |
218 | 219 | ||
220 | public ISimulationDataService SimulationDataService | ||
221 | { | ||
222 | get | ||
223 | { | ||
224 | if (m_SimulationDataService == null) | ||
225 | { | ||
226 | m_SimulationDataService = RequestModuleInterface<ISimulationDataService>(); | ||
227 | |||
228 | if (m_SimulationDataService == null) | ||
229 | { | ||
230 | throw new Exception("No ISimulationDataService available."); | ||
231 | } | ||
232 | } | ||
233 | |||
234 | return m_SimulationDataService; | ||
235 | } | ||
236 | } | ||
237 | |||
238 | public IEstateDataService EstateDataService | ||
239 | { | ||
240 | get | ||
241 | { | ||
242 | if (m_EstateDataService == null) | ||
243 | { | ||
244 | m_EstateDataService = RequestModuleInterface<IEstateDataService>(); | ||
245 | |||
246 | if (m_EstateDataService == null) | ||
247 | { | ||
248 | throw new Exception("No IEstateDataService available."); | ||
249 | } | ||
250 | } | ||
251 | |||
252 | return m_EstateDataService; | ||
253 | } | ||
254 | } | ||
255 | |||
219 | public IAssetService AssetService | 256 | public IAssetService AssetService |
220 | { | 257 | { |
221 | get | 258 | get |
@@ -468,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
468 | 505 | ||
469 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, | 506 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, |
470 | SceneCommunicationService sceneGridService, | 507 | SceneCommunicationService sceneGridService, |
471 | StorageManager storeManager, | 508 | ISimulationDataService simDataService, IEstateDataService estateDataService, |
472 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, | 509 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, |
473 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) | 510 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) |
474 | { | 511 | { |
@@ -504,7 +541,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
504 | m_moduleLoader = moduleLoader; | 541 | m_moduleLoader = moduleLoader; |
505 | m_authenticateHandler = authen; | 542 | m_authenticateHandler = authen; |
506 | m_sceneGridService = sceneGridService; | 543 | m_sceneGridService = sceneGridService; |
507 | m_storageManager = storeManager; | 544 | m_SimulationDataService = simDataService; |
545 | m_EstateDataService = estateDataService; | ||
508 | m_regInfo = regInfo; | 546 | m_regInfo = regInfo; |
509 | m_regionHandle = m_regInfo.RegionHandle; | 547 | m_regionHandle = m_regInfo.RegionHandle; |
510 | m_regionName = m_regInfo.RegionName; | 548 | m_regionName = m_regInfo.RegionName; |
@@ -523,11 +561,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
523 | #region Region Settings | 561 | #region Region Settings |
524 | 562 | ||
525 | // Load region settings | 563 | // Load region settings |
526 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); | 564 | m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID); |
527 | if (m_storageManager.EstateDataStore != null) | 565 | if (estateDataService != null) |
528 | { | 566 | m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); |
529 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | ||
530 | } | ||
531 | 567 | ||
532 | #endregion Region Settings | 568 | #endregion Region Settings |
533 | 569 | ||
@@ -537,9 +573,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
537 | 573 | ||
538 | //Bind Storage Manager functions to some land manager functions for this scene | 574 | //Bind Storage Manager functions to some land manager functions for this scene |
539 | EventManager.OnLandObjectAdded += | 575 | EventManager.OnLandObjectAdded += |
540 | new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject); | 576 | new EventManager.LandObjectAdded(simDataService.StoreLandObject); |
541 | EventManager.OnLandObjectRemoved += | 577 | EventManager.OnLandObjectRemoved += |
542 | new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); | 578 | new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); |
543 | 579 | ||
544 | m_sceneGraph = new SceneGraph(this, m_regInfo); | 580 | m_sceneGraph = new SceneGraph(this, m_regInfo); |
545 | 581 | ||
@@ -1085,7 +1121,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1085 | { | 1121 | { |
1086 | if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) | 1122 | if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) |
1087 | { | 1123 | { |
1088 | ((SceneObjectGroup)entity).ProcessBackup(m_storageManager.DataStore, false); | 1124 | ((SceneObjectGroup)entity).ProcessBackup(SimulationDataService, false); |
1089 | } | 1125 | } |
1090 | } | 1126 | } |
1091 | 1127 | ||
@@ -1526,7 +1562,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1526 | { | 1562 | { |
1527 | lock (m_returns) | 1563 | lock (m_returns) |
1528 | { | 1564 | { |
1529 | EventManager.TriggerOnBackup(m_storageManager.DataStore, forced); | 1565 | EventManager.TriggerOnBackup(SimulationDataService, forced); |
1530 | m_backingup = false; | 1566 | m_backingup = false; |
1531 | 1567 | ||
1532 | foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns) | 1568 | foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns) |
@@ -1567,7 +1603,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1567 | { | 1603 | { |
1568 | if (group != null) | 1604 | if (group != null) |
1569 | { | 1605 | { |
1570 | group.ProcessBackup(m_storageManager.DataStore, true); | 1606 | group.ProcessBackup(SimulationDataService, true); |
1571 | } | 1607 | } |
1572 | } | 1608 | } |
1573 | 1609 | ||
@@ -1609,19 +1645,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1609 | /// </summary> | 1645 | /// </summary> |
1610 | public void SaveTerrain() | 1646 | public void SaveTerrain() |
1611 | { | 1647 | { |
1612 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1648 | SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
1613 | } | 1649 | } |
1614 | 1650 | ||
1615 | public void StoreWindlightProfile(RegionLightShareData wl) | 1651 | public void StoreWindlightProfile(RegionLightShareData wl) |
1616 | { | 1652 | { |
1617 | m_regInfo.WindlightSettings = wl; | 1653 | m_regInfo.WindlightSettings = wl; |
1618 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); | 1654 | SimulationDataService.StoreRegionWindlightSettings(wl); |
1619 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | 1655 | m_eventManager.TriggerOnSaveNewWindlightProfile(); |
1620 | } | 1656 | } |
1621 | 1657 | ||
1622 | public void LoadWindlightProfile() | 1658 | public void LoadWindlightProfile() |
1623 | { | 1659 | { |
1624 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID); | 1660 | m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID); |
1625 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | 1661 | m_eventManager.TriggerOnSaveNewWindlightProfile(); |
1626 | } | 1662 | } |
1627 | 1663 | ||
@@ -1632,13 +1668,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1632 | { | 1668 | { |
1633 | try | 1669 | try |
1634 | { | 1670 | { |
1635 | double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); | 1671 | double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID); |
1636 | if (map == null) | 1672 | if (map == null) |
1637 | { | 1673 | { |
1638 | m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain."); | 1674 | m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain."); |
1639 | Heightmap = new TerrainChannel(); | 1675 | Heightmap = new TerrainChannel(); |
1640 | 1676 | ||
1641 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1677 | SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
1642 | } | 1678 | } |
1643 | else | 1679 | else |
1644 | { | 1680 | { |
@@ -1655,7 +1691,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1655 | { | 1691 | { |
1656 | Heightmap = new TerrainChannel(); | 1692 | Heightmap = new TerrainChannel(); |
1657 | 1693 | ||
1658 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1694 | SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
1659 | } | 1695 | } |
1660 | } | 1696 | } |
1661 | catch (Exception e) | 1697 | catch (Exception e) |
@@ -1702,7 +1738,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1702 | public void loadAllLandObjectsFromStorage(UUID regionID) | 1738 | public void loadAllLandObjectsFromStorage(UUID regionID) |
1703 | { | 1739 | { |
1704 | m_log.Info("[SCENE]: Loading land objects from storage"); | 1740 | m_log.Info("[SCENE]: Loading land objects from storage"); |
1705 | List<LandData> landData = m_storageManager.DataStore.LoadLandObjects(regionID); | 1741 | List<LandData> landData = SimulationDataService.LoadLandObjects(regionID); |
1706 | 1742 | ||
1707 | if (LandChannel != null) | 1743 | if (LandChannel != null) |
1708 | { | 1744 | { |
@@ -1733,7 +1769,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1733 | LoadingPrims = true; | 1769 | LoadingPrims = true; |
1734 | m_log.Info("[SCENE]: Loading objects from datastore"); | 1770 | m_log.Info("[SCENE]: Loading objects from datastore"); |
1735 | 1771 | ||
1736 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); | 1772 | List<SceneObjectGroup> PrimsFromDB = SimulationDataService.LoadObjects(regionID); |
1737 | 1773 | ||
1738 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); | 1774 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); |
1739 | 1775 | ||
@@ -2102,12 +2138,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2102 | // group has recently been delinked from another group but that this change has not been persisted | 2138 | // group has recently been delinked from another group but that this change has not been persisted |
2103 | // to the DB. | 2139 | // to the DB. |
2104 | ForceSceneObjectBackup(so); | 2140 | ForceSceneObjectBackup(so); |
2105 | so.DetachFromBackup(); | 2141 | so.DetachFromBackup(); |
2106 | m_storageManager.DataStore.RemoveObject(so.UUID, m_regInfo.RegionID); | 2142 | SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID); |
2107 | } | 2143 | } |
2108 | 2144 | ||
2109 | // We need to keep track of this state in case this group is still queued for further backup. | 2145 | // We need to keep track of this state in case this group is still queued for further backup. |
2110 | so.IsDeleted = true; | 2146 | so.IsDeleted = true; |
2111 | 2147 | ||
2112 | return true; | 2148 | return true; |
2113 | } | 2149 | } |
@@ -4408,7 +4444,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4408 | 4444 | ||
4409 | public void DeleteFromStorage(UUID uuid) | 4445 | public void DeleteFromStorage(UUID uuid) |
4410 | { | 4446 | { |
4411 | m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID); | 4447 | SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID); |
4412 | } | 4448 | } |
4413 | 4449 | ||
4414 | public int GetHealth() | 4450 | public int GetHealth() |
@@ -4817,17 +4853,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
4817 | 4853 | ||
4818 | public List<UUID> GetEstateRegions(int estateID) | 4854 | public List<UUID> GetEstateRegions(int estateID) |
4819 | { | 4855 | { |
4820 | if (m_storageManager.EstateDataStore == null) | 4856 | IEstateDataService estateDataService = EstateDataService; |
4821 | return new List<UUID>(); | 4857 | if (estateDataService == null) |
4858 | return new List<UUID>(0); | ||
4822 | 4859 | ||
4823 | return m_storageManager.EstateDataStore.GetRegions(estateID); | 4860 | return estateDataService.GetRegions(estateID); |
4824 | } | 4861 | } |
4825 | 4862 | ||
4826 | public void ReloadEstateData() | 4863 | public void ReloadEstateData() |
4827 | { | 4864 | { |
4828 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | 4865 | IEstateDataService estateDataService = EstateDataService; |
4829 | 4866 | if (estateDataService != null) | |
4830 | TriggerEstateSunUpdate(); | 4867 | { |
4868 | m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); | ||
4869 | TriggerEstateSunUpdate(); | ||
4870 | } | ||
4831 | } | 4871 | } |
4832 | 4872 | ||
4833 | public void TriggerEstateSunUpdate() | 4873 | public void TriggerEstateSunUpdate() |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 4024328..454f031 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1378 | /// Processes backup. | 1378 | /// Processes backup. |
1379 | /// </summary> | 1379 | /// </summary> |
1380 | /// <param name="datastore"></param> | 1380 | /// <param name="datastore"></param> |
1381 | public virtual void ProcessBackup(ISimulationDataStore datastore, bool forcedBackup) | 1381 | public virtual void ProcessBackup(ISimulationDataService datastore, bool forcedBackup) |
1382 | { | 1382 | { |
1383 | if (!m_isBackedUp) | 1383 | if (!m_isBackedUp) |
1384 | { | 1384 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 1984d45..e45d488 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
848 | /// Process inventory backup | 848 | /// Process inventory backup |
849 | /// </summary> | 849 | /// </summary> |
850 | /// <param name="datastore"></param> | 850 | /// <param name="datastore"></param> |
851 | public void ProcessInventoryBackup(ISimulationDataStore datastore) | 851 | public void ProcessInventoryBackup(ISimulationDataService datastore) |
852 | { | 852 | { |
853 | if (HasInventoryChanged) | 853 | if (HasInventoryChanged) |
854 | { | 854 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index e3ef263..d634840 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
292 | // scene backup thread. | 292 | // scene backup thread. |
293 | scene.Backup(true); | 293 | scene.Backup(true); |
294 | 294 | ||
295 | List<SceneObjectGroup> storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); | 295 | List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); |
296 | 296 | ||
297 | Assert.That(storedObjects.Count, Is.EqualTo(1)); | 297 | Assert.That(storedObjects.Count, Is.EqualTo(1)); |
298 | Assert.That(storedObjects[0].Children.Count, Is.EqualTo(2)); | 298 | Assert.That(storedObjects[0].Children.Count, Is.EqualTo(2)); |
@@ -335,7 +335,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
335 | SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); | 335 | SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); |
336 | scene.DeleteSceneObject(groupToDelete, false); | 336 | scene.DeleteSceneObject(groupToDelete, false); |
337 | 337 | ||
338 | List<SceneObjectGroup> storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); | 338 | List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); |
339 | 339 | ||
340 | Assert.That(storedObjects.Count, Is.EqualTo(1)); | 340 | Assert.That(storedObjects.Count, Is.EqualTo(1)); |
341 | Assert.That(storedObjects[0].Children.Count, Is.EqualTo(1)); | 341 | Assert.That(storedObjects[0].Children.Count, Is.EqualTo(1)); |
diff --git a/OpenSim/Region/Framework/StorageManager.cs b/OpenSim/Region/Framework/StorageManager.cs deleted file mode 100644 index c858d56..0000000 --- a/OpenSim/Region/Framework/StorageManager.cs +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using log4net; | ||
31 | using OpenSim.Region.Framework.Interfaces; | ||
32 | |||
33 | namespace OpenSim.Region.Framework | ||
34 | { | ||
35 | public class StorageManager | ||
36 | { | ||
37 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
38 | |||
39 | public readonly ISimulationDataStore DataStore; | ||
40 | public readonly IEstateDataStore EstateDataStore; | ||
41 | |||
42 | public StorageManager(string dllName, string connectionstring, string estateconnectionstring) | ||
43 | { | ||
44 | m_log.Info("[DATASTORE]: Attempting to load " + dllName); | ||
45 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | ||
46 | |||
47 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
48 | { | ||
49 | if (pluginType.IsPublic) | ||
50 | { | ||
51 | Type typeInterface = pluginType.GetInterface("ISimulationDataStore", true); | ||
52 | |||
53 | if (typeInterface != null) | ||
54 | { | ||
55 | ISimulationDataStore plug = | ||
56 | (ISimulationDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
57 | plug.Initialise(connectionstring); | ||
58 | |||
59 | DataStore = plug; | ||
60 | |||
61 | m_log.Info("[DATASTORE]: Added ISimulationDataStore Interface"); | ||
62 | } | ||
63 | |||
64 | typeInterface = pluginType.GetInterface("IEstateDataStore", true); | ||
65 | |||
66 | if (typeInterface != null) | ||
67 | { | ||
68 | IEstateDataStore estPlug = | ||
69 | (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
70 | estPlug.Initialise(estateconnectionstring); | ||
71 | |||
72 | EstateDataStore = estPlug; | ||
73 | } | ||
74 | } | ||
75 | } | ||
76 | |||
77 | //TODO: Add checking and warning to make sure it initialised. | ||
78 | } | ||
79 | } | ||
80 | } | ||
diff --git a/OpenSim/Services/Connectors/Simulation/EstateDataService.cs b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs new file mode 100644 index 0000000..87c49d3 --- /dev/null +++ b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using log4net; | ||
32 | using Mono.Addins; | ||
33 | using Nini.Config; | ||
34 | using System.Reflection; | ||
35 | using OpenSim.Services.Base; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | using OpenSim.Data; | ||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Region.Framework.Interfaces; | ||
40 | using OpenSim.Region.Framework.Scenes; | ||
41 | |||
42 | namespace OpenSim.Services.Connectors | ||
43 | { | ||
44 | public class EstateDataService : ServiceBase, IEstateDataService | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | protected IEstateDataStore m_database; | ||
51 | |||
52 | public EstateDataService(IConfigSource config) | ||
53 | : base(config) | ||
54 | { | ||
55 | string dllName = String.Empty; | ||
56 | string connString = String.Empty; | ||
57 | |||
58 | // Try reading the [DatabaseService] section, if it exists | ||
59 | IConfig dbConfig = config.Configs["DatabaseService"]; | ||
60 | if (dbConfig != null) | ||
61 | { | ||
62 | dllName = dbConfig.GetString("StorageProvider", String.Empty); | ||
63 | connString = dbConfig.GetString("EstateConnectionString", String.Empty); | ||
64 | if (String.IsNullOrEmpty(connString)) | ||
65 | connString = dbConfig.GetString("ConnectionString", String.Empty); | ||
66 | } | ||
67 | |||
68 | // We tried, but this doesn't exist. We can't proceed | ||
69 | if (dllName == String.Empty) | ||
70 | throw new Exception("No StorageProvider configured"); | ||
71 | |||
72 | m_database = LoadPlugin<IEstateDataStore>(dllName, new Object[] { connString }); | ||
73 | if (m_database == null) | ||
74 | throw new Exception("Could not find a storage interface in the given module"); | ||
75 | } | ||
76 | |||
77 | public EstateSettings LoadEstateSettings(UUID regionID, bool create) | ||
78 | { | ||
79 | return m_database.LoadEstateSettings(regionID, create); | ||
80 | } | ||
81 | |||
82 | public EstateSettings LoadEstateSettings(int estateID) | ||
83 | { | ||
84 | return m_database.LoadEstateSettings(estateID); | ||
85 | } | ||
86 | |||
87 | public void StoreEstateSettings(EstateSettings es) | ||
88 | { | ||
89 | m_database.StoreEstateSettings(es); | ||
90 | } | ||
91 | |||
92 | public List<int> GetEstates(string search) | ||
93 | { | ||
94 | return m_database.GetEstates(search); | ||
95 | } | ||
96 | |||
97 | public bool LinkRegion(UUID regionID, int estateID) | ||
98 | { | ||
99 | return m_database.LinkRegion(regionID, estateID); | ||
100 | } | ||
101 | |||
102 | public List<UUID> GetRegions(int estateID) | ||
103 | { | ||
104 | return m_database.GetRegions(estateID); | ||
105 | } | ||
106 | |||
107 | public bool DeleteEstate(int estateID) | ||
108 | { | ||
109 | return m_database.DeleteEstate(estateID); | ||
110 | } | ||
111 | } | ||
112 | } | ||
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index 93147d4..946f7e4 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs | |||
@@ -27,99 +27,114 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using OpenMetaverse; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using System.Reflection; |
35 | using OpenSim.Services.Base; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | using OpenSim.Data; | ||
34 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
35 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Server.Base; | ||
38 | 41 | ||
39 | namespace OpenSim.Services.Connectors.Simulation | 42 | namespace OpenSim.Services.Connectors |
40 | { | 43 | { |
41 | public class SimulationDataServiceConnector : ISimulationDataService | 44 | public class SimulationDataService : ServiceBase, ISimulationDataService |
42 | { | 45 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | 49 | ||
45 | private ISimulationDataStore m_simDataStore; | 50 | protected ISimulationDataStore m_database; |
46 | 51 | ||
47 | public SimulationDataServiceConnector() | 52 | public SimulationDataService(IConfigSource config) |
53 | : base(config) | ||
48 | { | 54 | { |
49 | } | 55 | string dllName = String.Empty; |
56 | string connString = String.Empty; | ||
50 | 57 | ||
51 | public SimulationDataServiceConnector(IConfigSource config) | 58 | // Try reading the [DatabaseService] section, if it exists |
52 | { | 59 | IConfig dbConfig = config.Configs["DatabaseService"]; |
53 | Initialise(config); | 60 | if (dbConfig != null) |
54 | } | 61 | { |
55 | 62 | dllName = dbConfig.GetString("StorageProvider", String.Empty); | |
56 | public virtual void Initialise(IConfigSource config) | 63 | connString = dbConfig.GetString("ConnectionString", String.Empty); |
57 | { | 64 | } |
58 | IConfig serverConfig = config.Configs["SimulationDataStore"]; | ||
59 | if (serverConfig == null) | ||
60 | throw new Exception("No section 'SimulationDataStore' in config file"); | ||
61 | 65 | ||
62 | string simDataStore = serverConfig.GetString("StoreModule", String.Empty); | 66 | // We tried, but this doesn't exist. We can't proceed |
67 | if (dllName == String.Empty) | ||
68 | throw new Exception("No StorageProvider configured"); | ||
63 | 69 | ||
64 | Object[] args = new Object[] { config }; | 70 | m_database = LoadPlugin<ISimulationDataStore>(dllName, new Object[] { connString }); |
65 | m_simDataStore = ServerUtils.LoadPlugin<ISimulationDataStore>(simDataStore, args); | 71 | if (m_database == null) |
72 | throw new Exception("Could not find a storage interface in the given module"); | ||
66 | } | 73 | } |
67 | 74 | ||
68 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) | 75 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) |
69 | { | 76 | { |
77 | m_database.StoreObject(obj, regionUUID); | ||
70 | } | 78 | } |
71 | 79 | ||
72 | public void RemoveObject(UUID uuid, UUID regionUUID) | 80 | public void RemoveObject(UUID uuid, UUID regionUUID) |
73 | { | 81 | { |
82 | m_database.RemoveObject(uuid, regionUUID); | ||
74 | } | 83 | } |
75 | 84 | ||
76 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) | 85 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) |
77 | { | 86 | { |
87 | m_database.StorePrimInventory(primID, items); | ||
78 | } | 88 | } |
79 | 89 | ||
80 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) | 90 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) |
81 | { | 91 | { |
82 | return new List<SceneObjectGroup>(0); | 92 | return m_database.LoadObjects(regionUUID); |
83 | } | 93 | } |
84 | 94 | ||
85 | public void StoreTerrain(double[,] terrain, UUID regionID) | 95 | public void StoreTerrain(double[,] terrain, UUID regionID) |
86 | { | 96 | { |
97 | m_database.StoreTerrain(terrain, regionID); | ||
87 | } | 98 | } |
88 | 99 | ||
89 | public double[,] LoadTerrain(UUID regionID) | 100 | public double[,] LoadTerrain(UUID regionID) |
90 | { | 101 | { |
91 | return new double[Constants.RegionSize, Constants.RegionSize]; | 102 | return m_database.LoadTerrain(regionID); |
92 | } | 103 | } |
93 | 104 | ||
94 | public void StoreLandObject(ILandObject Parcel) | 105 | public void StoreLandObject(ILandObject Parcel) |
95 | { | 106 | { |
107 | m_database.StoreLandObject(Parcel); | ||
96 | } | 108 | } |
97 | 109 | ||
98 | public void RemoveLandObject(UUID globalID) | 110 | public void RemoveLandObject(UUID globalID) |
99 | { | 111 | { |
112 | m_database.RemoveLandObject(globalID); | ||
100 | } | 113 | } |
101 | 114 | ||
102 | public List<LandData> LoadLandObjects(UUID regionUUID) | 115 | public List<LandData> LoadLandObjects(UUID regionUUID) |
103 | { | 116 | { |
104 | return new List<LandData>(0); | 117 | return m_database.LoadLandObjects(regionUUID); |
105 | } | 118 | } |
106 | 119 | ||
107 | public void StoreRegionSettings(RegionSettings rs) | 120 | public void StoreRegionSettings(RegionSettings rs) |
108 | { | 121 | { |
122 | m_database.StoreRegionSettings(rs); | ||
109 | } | 123 | } |
110 | 124 | ||
111 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 125 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
112 | { | 126 | { |
113 | return null; | 127 | return m_database.LoadRegionSettings(regionUUID); |
114 | } | 128 | } |
115 | 129 | ||
116 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) | 130 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
117 | { | 131 | { |
118 | return null; | 132 | return m_database.LoadRegionWindlightSettings(regionUUID); |
119 | } | 133 | } |
120 | 134 | ||
121 | public void StoreRegionWindlightSettings(RegionLightShareData wl) | 135 | public void StoreRegionWindlightSettings(RegionLightShareData wl) |
122 | { | 136 | { |
137 | m_database.StoreRegionWindlightSettings(wl); | ||
123 | } | 138 | } |
124 | } | 139 | } |
125 | } | 140 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 615e519..4511228 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs | |||
@@ -31,6 +31,7 @@ using OpenSim.Framework; | |||
31 | using OpenSim.Framework.Communications; | 31 | using OpenSim.Framework.Communications; |
32 | using OpenSim.Framework.Servers; | 32 | using OpenSim.Framework.Servers; |
33 | using OpenSim.Region.Framework; | 33 | using OpenSim.Region.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | ||
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
35 | 36 | ||
36 | namespace OpenSim.Tests.Common.Mock | 37 | namespace OpenSim.Tests.Common.Mock |
@@ -39,20 +40,15 @@ namespace OpenSim.Tests.Common.Mock | |||
39 | { | 40 | { |
40 | public TestScene( | 41 | public TestScene( |
41 | RegionInfo regInfo, AgentCircuitManager authen, | 42 | RegionInfo regInfo, AgentCircuitManager authen, |
42 | SceneCommunicationService sceneGridService, StorageManager storeManager, | 43 | SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, |
43 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, | 44 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, |
44 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) | 45 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) |
45 | : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, | 46 | : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, |
46 | dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) | 47 | dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) |
47 | { | 48 | { |
48 | } | 49 | } |
49 | 50 | ||
50 | /// <summary> | 51 | /// <summary> |
51 | /// Allow retrieval for test check purposes | ||
52 | /// </summary> | ||
53 | public StorageManager StorageManager { get { return m_storageManager; } } | ||
54 | |||
55 | /// <summary> | ||
56 | /// Temporarily override session authentication for tests (namely teleport). | 52 | /// Temporarily override session authentication for tests (namely teleport). |
57 | /// </summary> | 53 | /// </summary> |
58 | /// | 54 | /// |
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 9318a27..ffd0078 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -157,11 +157,12 @@ namespace OpenSim.Tests.Common.Setup | |||
157 | AgentCircuitManager acm = new AgentCircuitManager(); | 157 | AgentCircuitManager acm = new AgentCircuitManager(); |
158 | SceneCommunicationService scs = new SceneCommunicationService(); | 158 | SceneCommunicationService scs = new SceneCommunicationService(); |
159 | 159 | ||
160 | StorageManager sm = new StorageManager("OpenSim.Tests.Common.dll", "", ""); | 160 | ISimulationDataService simDataService = null; |
161 | IEstateDataService estateDataService = null; | ||
161 | IConfigSource configSource = new IniConfigSource(); | 162 | IConfigSource configSource = new IniConfigSource(); |
162 | 163 | ||
163 | TestScene testScene = new TestScene( | 164 | TestScene testScene = new TestScene( |
164 | regInfo, acm, scs, sm, null, false, false, false, configSource, null); | 165 | regInfo, acm, scs, simDataService, estateDataService, null, false, false, false, configSource, null); |
165 | 166 | ||
166 | INonSharedRegionModule capsModule = new CapabilitiesModule(); | 167 | INonSharedRegionModule capsModule = new CapabilitiesModule(); |
167 | capsModule.Initialise(new IniConfigSource()); | 168 | capsModule.Initialise(new IniConfigSource()); |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 08726ea..8d714ce 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -106,33 +106,6 @@ | |||
106 | ; ## PRIM STORAGE | 106 | ; ## PRIM STORAGE |
107 | ; ## | 107 | ; ## |
108 | 108 | ||
109 | ; *** Prim Storage - only leave one storage_plugin uncommented *** | ||
110 | ; --- Null stores nothing - effectively disabling persistence: | ||
111 | ;storage_plugin = "OpenSim.Data.Null.dll" | ||
112 | |||
113 | ; --- To use sqlite as region storage: | ||
114 | ; | ||
115 | ; PLEASE NOTE: Unfortunately, the current SQLite database plugin (necessary to use SQLite with Mono on Linux) is | ||
116 | ; not compatible with the sqlite3 library installed on Mac OSX. If you're using Mono 2.4 you can still use the old sqlite | ||
117 | ; library by uncommenting the SQLiteLegacy.dll storage plugin (and commenting out SQLite.dll). Unfortunately, the older library | ||
118 | ; will not work with Mono 2.6 on Mac OSX so you will either need to replace the OSX sqlite3 system library or use MySQL instead | ||
119 | ; | ||
120 | ; You will also need to do the same thing in config-include/StandaloneCommon.ini if you are running in standalone mode | ||
121 | storage_plugin = "OpenSim.Data.SQLite.dll" | ||
122 | ;storage_plugin = "OpenSim.Data.SQLiteLegacy.dll" | ||
123 | storage_connection_string="URI=file:OpenSim.db,version=3"; | ||
124 | |||
125 | ; --- To use MySQL storage, supply your own connection string (this is only an example): | ||
126 | ; note that the supplied account needs create privilegies if you want it to auto-create needed tables. | ||
127 | ; | ||
128 | ; -->>> There are multiple connection strings defined in several places. Check it carefully! | ||
129 | ; | ||
130 | ; storage_plugin="OpenSim.Data.MySQL.dll" | ||
131 | ; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"; | ||
132 | ; If you want to use a different database/server for estate data, then | ||
133 | ; uncomment and change this connect string. Defaults to the above if not set | ||
134 | ; estate_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"; | ||
135 | |||
136 | ; Persistence of changed objects happens during regular sweeps. The following control that behaviour to | 109 | ; Persistence of changed objects happens during regular sweeps. The following control that behaviour to |
137 | ; prevent frequently changing objects from heavily loading the region data store. | 110 | ; prevent frequently changing objects from heavily loading the region data store. |
138 | ; If both of these values are set to zero then persistence of all changed objects will happen on every sweep. | 111 | ; If both of these values are set to zero then persistence of all changed objects will happen on every sweep. |
diff --git a/bin/config-include/Grid.ini b/bin/config-include/Grid.ini index 9a75f19..4a6a082 100644 --- a/bin/config-include/Grid.ini +++ b/bin/config-include/Grid.ini | |||
@@ -27,6 +27,11 @@ | |||
27 | SimulationServiceInConnector = true | 27 | SimulationServiceInConnector = true |
28 | LibraryModule = true | 28 | LibraryModule = true |
29 | 29 | ||
30 | [SimulationDataStore] | ||
31 | LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" | ||
32 | |||
33 | [EstateDataStore] | ||
34 | LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" | ||
30 | 35 | ||
31 | [GridService] | 36 | [GridService] |
32 | LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" | 37 | LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" |
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example index a19591b..c2cd5c3 100644 --- a/bin/config-include/GridCommon.ini.example +++ b/bin/config-include/GridCommon.ini.example | |||
@@ -1,3 +1,24 @@ | |||
1 | [DatabaseService] | ||
2 | ; | ||
3 | ; ### Choose the DB | ||
4 | ; | ||
5 | |||
6 | ; SQLite | ||
7 | Include-Storage = "config-include/storage/SQLiteStandalone.ini"; | ||
8 | |||
9 | ; Unfortunately the current SQLite database plugin is not compatible with Mac OSX. You can still use the older | ||
10 | ; legacy sqlite library if you are using Mono 2.4. Please see the notes in OpenSim.ini (search for sqlite) | ||
11 | ; for more details | ||
12 | ;Include-Storage = "config-include/storage/SQLiteLegacyStandalone.ini"; | ||
13 | |||
14 | ; MySql | ||
15 | ; Uncomment these lines if you want to use mysql storage | ||
16 | ; Change the connection string to your db details | ||
17 | ;StorageProvider = "OpenSim.Data.MySQL.dll" | ||
18 | ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;" | ||
19 | ; Uncomment this line if you are using MySQL and want to use a different database for estates | ||
20 | ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;" | ||
21 | |||
1 | [AssetService] | 22 | [AssetService] |
2 | 23 | ||
3 | DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" | 24 | DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" |
diff --git a/bin/config-include/GridHypergrid.ini b/bin/config-include/GridHypergrid.ini index ab29018..d69a945 100644 --- a/bin/config-include/GridHypergrid.ini +++ b/bin/config-include/GridHypergrid.ini | |||
@@ -30,6 +30,12 @@ | |||
30 | SimulationServiceInConnector = true | 30 | SimulationServiceInConnector = true |
31 | LibraryModule = true | 31 | LibraryModule = true |
32 | 32 | ||
33 | [SimulationDataStore] | ||
34 | LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" | ||
35 | |||
36 | [EstateDataStore] | ||
37 | LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" | ||
38 | |||
33 | [AssetService] | 39 | [AssetService] |
34 | LocalGridAssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector" | 40 | LocalGridAssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector" |
35 | HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector" | 41 | HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector" |
diff --git a/bin/config-include/HyperSimianGrid.ini b/bin/config-include/HyperSimianGrid.ini index 49ba2ca..29b51de 100644 --- a/bin/config-include/HyperSimianGrid.ini +++ b/bin/config-include/HyperSimianGrid.ini | |||
@@ -41,6 +41,12 @@ | |||
41 | 41 | ||
42 | AssetCaching = "FlotsamAssetCache" | 42 | AssetCaching = "FlotsamAssetCache" |
43 | 43 | ||
44 | [SimulationDataStore] | ||
45 | LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" | ||
46 | |||
47 | [EstateDataStore] | ||
48 | LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" | ||
49 | |||
44 | [Friends] | 50 | [Friends] |
45 | Connector = "OpenSim.Services.Connectors.dll:SimianFriendsServiceConnector" | 51 | Connector = "OpenSim.Services.Connectors.dll:SimianFriendsServiceConnector" |
46 | 52 | ||
diff --git a/bin/config-include/SimianGrid.ini b/bin/config-include/SimianGrid.ini index 9b27cc7..239ce30 100644 --- a/bin/config-include/SimianGrid.ini +++ b/bin/config-include/SimianGrid.ini | |||
@@ -41,6 +41,12 @@ | |||
41 | 41 | ||
42 | AssetCaching = "FlotsamAssetCache" | 42 | AssetCaching = "FlotsamAssetCache" |
43 | 43 | ||
44 | [SimulationDataStore] | ||
45 | LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" | ||
46 | |||
47 | [EstateDataStore] | ||
48 | LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" | ||
49 | |||
44 | [Friends] | 50 | [Friends] |
45 | Connector = "OpenSim.Services.Connectors.dll:SimianFriendsServiceConnector" | 51 | Connector = "OpenSim.Services.Connectors.dll:SimianFriendsServiceConnector" |
46 | 52 | ||
diff --git a/bin/config-include/Standalone.ini b/bin/config-include/Standalone.ini index eae9801..d74b50e 100644 --- a/bin/config-include/Standalone.ini +++ b/bin/config-include/Standalone.ini | |||
@@ -22,6 +22,12 @@ | |||
22 | LLLoginServiceInConnector = true | 22 | LLLoginServiceInConnector = true |
23 | GridInfoServiceInConnector = true | 23 | GridInfoServiceInConnector = true |
24 | 24 | ||
25 | [SimulationDataStore] | ||
26 | LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" | ||
27 | |||
28 | [EstateDataStore] | ||
29 | LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" | ||
30 | |||
25 | [AssetService] | 31 | [AssetService] |
26 | LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" | 32 | LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" |
27 | 33 | ||
diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index f862960..96ef602 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example | |||
@@ -18,6 +18,8 @@ | |||
18 | ; Change the connection string to your db details | 18 | ; Change the connection string to your db details |
19 | ;StorageProvider = "OpenSim.Data.MySQL.dll" | 19 | ;StorageProvider = "OpenSim.Data.MySQL.dll" |
20 | ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" | 20 | ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" |
21 | ; Uncomment this line if you are using MySQL and want to use a different database for estates | ||
22 | ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" | ||
21 | 23 | ||
22 | [AssetService] | 24 | [AssetService] |
23 | DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" | 25 | DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" |
diff --git a/prebuild.xml b/prebuild.xml index 7dec8ba..726991c 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -924,13 +924,15 @@ | |||
924 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> | 924 | <Reference name="OpenMetaverseTypes" path="../../../bin/"/> |
925 | <Reference name="OpenMetaverse" path="../../../bin/"/> | 925 | <Reference name="OpenMetaverse" path="../../../bin/"/> |
926 | <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/> | 926 | <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/> |
927 | <Reference name="OpenSim.Services.Interfaces"/> | 927 | <Reference name="OpenSim.Data"/> |
928 | <Reference name="OpenSim.Framework"/> | 928 | <Reference name="OpenSim.Framework"/> |
929 | <Reference name="OpenSim.Framework.Communications"/> | 929 | <Reference name="OpenSim.Framework.Communications"/> |
930 | <Reference name="OpenSim.Framework.Console"/> | 930 | <Reference name="OpenSim.Framework.Console"/> |
931 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> | 931 | <Reference name="OpenSim.Framework.Servers.HttpServer"/> |
932 | <Reference name="OpenSim.Region.Framework"/> | 932 | <Reference name="OpenSim.Region.Framework"/> |
933 | <Reference name="OpenSim.Server.Base"/> | 933 | <Reference name="OpenSim.Server.Base"/> |
934 | <Reference name="OpenSim.Services.Base"/> | ||
935 | <Reference name="OpenSim.Services.Interfaces"/> | ||
934 | <Reference name="Mono.Addins" path="../../../bin/"/> | 936 | <Reference name="Mono.Addins" path="../../../bin/"/> |
935 | <Reference name="Nini" path="../../../bin/"/> | 937 | <Reference name="Nini" path="../../../bin/"/> |
936 | <Reference name="log4net" path="../../../bin/"/> | 938 | <Reference name="log4net" path="../../../bin/"/> |
@@ -1653,6 +1655,7 @@ | |||
1653 | <Reference name="OpenSim.Region.CoreModules"/> | 1655 | <Reference name="OpenSim.Region.CoreModules"/> |
1654 | <Reference name="OpenSim.Region.ClientStack"/> | 1656 | <Reference name="OpenSim.Region.ClientStack"/> |
1655 | <Reference name="OpenSim.Framework.Communications"/> | 1657 | <Reference name="OpenSim.Framework.Communications"/> |
1658 | <Reference name="OpenSim.Server.Base"/> | ||
1656 | <Reference name="XMLRPC" path="../../../bin/"/> | 1659 | <Reference name="XMLRPC" path="../../../bin/"/> |
1657 | <Reference name="Nini" path="../../../bin/"/> | 1660 | <Reference name="Nini" path="../../../bin/"/> |
1658 | <Reference name="log4net" path="../../../bin/"/> | 1661 | <Reference name="log4net" path="../../../bin/"/> |