diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index 40700cf178..5f786910c3 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs @@ -43,16 +43,18 @@ namespace OpenSim.Data.Null public NullPresenceData(string connectionString, string realm) { if (Instance == null) + { Instance = this; - //Console.WriteLine("[XXX] NullRegionData constructor"); - // Let's stick in a test presence - PresenceData p = new PresenceData(); - p.SessionID = UUID.Zero; - p.UserID = UUID.Zero.ToString(); - p.Data = new Dictionary(); - p.Data["Online"] = "true"; - m_presenceData.Add(UUID.Zero, p); + //Console.WriteLine("[XXX] NullRegionData constructor"); + // Let's stick in a test presence + PresenceData p = new PresenceData(); + p.SessionID = UUID.Zero; + p.UserID = UUID.Zero.ToString(); + p.Data = new Dictionary(); + p.Data["Online"] = true.ToString(); + m_presenceData.Add(UUID.Zero, p); + } } public bool Store(PresenceData data) @@ -70,7 +72,9 @@ namespace OpenSim.Data.Null return Instance.Get(sessionID); if (m_presenceData.ContainsKey(sessionID)) + { return m_presenceData[sessionID]; + } return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 2ca90f8229..95d8737122 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests config.AddConfig("GridService"); config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); - config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); + config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); m_LocalConnector = new LocalGridServicesConnector(config); } @@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests r2.HttpPort = 9002; r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); s = new Scene(new RegionInfo()); - s.RegionInfo.RegionID = r1.RegionID; + s.RegionInfo.RegionID = r2.RegionID; m_LocalConnector.AddRegion(s); GridRegion r3 = new GridRegion(); @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests r3.HttpPort = 9003; r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); s = new Scene(new RegionInfo()); - s.RegionInfo.RegionID = r1.RegionID; + s.RegionInfo.RegionID = r3.RegionID; m_LocalConnector.AddRegion(s); m_LocalConnector.RegisterRegion(UUID.Zero, r1); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs index 9ba1bdcecc..ca424615a0 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests config.AddConfig("PresenceService"); config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); - config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullPresenceData"); + config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); m_LocalConnector = new LocalPresenceServicesConnector(config); } diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 4dee7a4e8f..1368e46623 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -82,20 +82,22 @@ namespace OpenSim.Services.GridService { m_RootInstance = this; - MainConsole.Instance.Commands.AddCommand("grid", true, - "show region", - "show region ", - "Show details on a region", - String.Empty, - HandleShowRegion); - - MainConsole.Instance.Commands.AddCommand("grid", true, - "set region flags", - "set region flags ", - "Set database flags for region", - String.Empty, - HandleSetFlags); + if (MainConsole.Instance != null) + { + MainConsole.Instance.Commands.AddCommand("grid", true, + "show region", + "show region ", + "Show details on a region", + String.Empty, + HandleShowRegion); + MainConsole.Instance.Commands.AddCommand("grid", true, + "set region flags", + "set region flags ", + "Set database flags for region", + String.Empty, + HandleSetFlags); + } m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); } } diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 18d0586f4d..de5df9d645 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -113,18 +113,20 @@ namespace OpenSim.Services.GridService m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); } - - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", - "link-region :[:] ", - "Link a hypergrid region", RunCommand); - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", - "unlink-region or : ", - "Unlink a hypergrid region", RunCommand); - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [ ] ", - "Set local coordinate to map HG regions to", RunCommand); - MainConsole.Instance.Commands.AddCommand("hypergrid", false, "show hyperlinks", "show hyperlinks ", - "List the HG regions", HandleShow); + if (MainConsole.Instance != null) + { + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", + "link-region :[:] ", + "Link a hypergrid region", RunCommand); + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", + "unlink-region or : ", + "Unlink a hypergrid region", RunCommand); + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [ ] ", + "Set local coordinate to map HG regions to", RunCommand); + MainConsole.Instance.Commands.AddCommand("hypergrid", false, "show hyperlinks", "show hyperlinks ", + "List the HG regions", HandleShow); + } }