Small bug fixes for making tests work.

slimupdates
Diva Canto 2010-02-21 18:56:44 -08:00
parent b92645ac56
commit 70de6956ff
5 changed files with 44 additions and 36 deletions

View File

@ -43,16 +43,18 @@ namespace OpenSim.Data.Null
public NullPresenceData(string connectionString, string realm) public NullPresenceData(string connectionString, string realm)
{ {
if (Instance == null) if (Instance == null)
{
Instance = this; Instance = this;
//Console.WriteLine("[XXX] NullRegionData constructor"); //Console.WriteLine("[XXX] NullRegionData constructor");
// Let's stick in a test presence // Let's stick in a test presence
PresenceData p = new PresenceData(); PresenceData p = new PresenceData();
p.SessionID = UUID.Zero; p.SessionID = UUID.Zero;
p.UserID = UUID.Zero.ToString(); p.UserID = UUID.Zero.ToString();
p.Data = new Dictionary<string, string>(); p.Data = new Dictionary<string, string>();
p.Data["Online"] = "true"; p.Data["Online"] = true.ToString();
m_presenceData.Add(UUID.Zero, p); m_presenceData.Add(UUID.Zero, p);
}
} }
public bool Store(PresenceData data) public bool Store(PresenceData data)
@ -70,7 +72,9 @@ namespace OpenSim.Data.Null
return Instance.Get(sessionID); return Instance.Get(sessionID);
if (m_presenceData.ContainsKey(sessionID)) if (m_presenceData.ContainsKey(sessionID))
{
return m_presenceData[sessionID]; return m_presenceData[sessionID];
}
return null; return null;
} }

View File

@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
config.AddConfig("GridService"); config.AddConfig("GridService");
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); 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); m_LocalConnector = new LocalGridServicesConnector(config);
} }
@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
r2.HttpPort = 9002; r2.HttpPort = 9002;
r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
s = new Scene(new RegionInfo()); s = new Scene(new RegionInfo());
s.RegionInfo.RegionID = r1.RegionID; s.RegionInfo.RegionID = r2.RegionID;
m_LocalConnector.AddRegion(s); m_LocalConnector.AddRegion(s);
GridRegion r3 = new GridRegion(); GridRegion r3 = new GridRegion();
@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
r3.HttpPort = 9003; r3.HttpPort = 9003;
r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
s = new Scene(new RegionInfo()); s = new Scene(new RegionInfo());
s.RegionInfo.RegionID = r1.RegionID; s.RegionInfo.RegionID = r3.RegionID;
m_LocalConnector.AddRegion(s); m_LocalConnector.AddRegion(s);
m_LocalConnector.RegisterRegion(UUID.Zero, r1); m_LocalConnector.RegisterRegion(UUID.Zero, r1);

View File

@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
config.AddConfig("PresenceService"); config.AddConfig("PresenceService");
config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector");
config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); 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); m_LocalConnector = new LocalPresenceServicesConnector(config);
} }

View File

@ -82,20 +82,22 @@ namespace OpenSim.Services.GridService
{ {
m_RootInstance = this; m_RootInstance = this;
MainConsole.Instance.Commands.AddCommand("grid", true, if (MainConsole.Instance != null)
"show region", {
"show region <Region name>", MainConsole.Instance.Commands.AddCommand("grid", true,
"Show details on a region", "show region",
String.Empty, "show region <Region name>",
HandleShowRegion); "Show details on a region",
String.Empty,
MainConsole.Instance.Commands.AddCommand("grid", true, HandleShowRegion);
"set region flags",
"set region flags <Region name> <flags>",
"Set database flags for region",
String.Empty,
HandleSetFlags);
MainConsole.Instance.Commands.AddCommand("grid", true,
"set region flags",
"set region flags <Region name> <flags>",
"Set database flags for region",
String.Empty,
HandleSetFlags);
}
m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
} }
} }

View File

@ -113,18 +113,20 @@ namespace OpenSim.Services.GridService
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
} }
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", if (MainConsole.Instance != null)
"link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", {
"Link a hypergrid region", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
"unlink-region <local name> or <HostName>:<HttpPort> <cr>", "Link a hypergrid region", RunCommand);
"Unlink a hypergrid region", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region",
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
"Set local coordinate to map HG regions to", RunCommand); "Unlink a hypergrid region", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "show hyperlinks", "show hyperlinks <cr>", MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
"List the HG regions", HandleShow); "Set local coordinate to map HG regions to", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "show hyperlinks", "show hyperlinks <cr>",
"List the HG regions", HandleShow);
}
} }