*Removed GridInfo class as it has been previously replaced with the much better NetworkServersInfo class
*Got the GridServer in OGS1 to go through with registering the region, but the actual storage of the region isnt working right now. **After this is fixed, grid mode should work!Sugilite
parent
898b48464a
commit
e06ffb3981
|
@ -31,16 +31,11 @@ using OpenSim.Framework.Types;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Framework.Communications
|
||||||
{
|
{
|
||||||
public class GridInfo
|
|
||||||
{
|
|
||||||
public string GridServerURI = "http://grid.deepgrid.com:8001/"; // Temporarily hardcoded.
|
|
||||||
public string GridServerSendKey = "badger";
|
|
||||||
public string GridServerRecvKey = "badger";
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface IGridServices
|
public interface IGridServices
|
||||||
{
|
{
|
||||||
RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo);
|
RegionCommsListener RegisterRegion(RegionInfo regionInfos);
|
||||||
List<RegionInfo> RequestNeighbours(RegionInfo regionInfo);
|
List<RegionInfo> RequestNeighbours(RegionInfo regionInfo);
|
||||||
RegionInfo RequestNeighbourInfo(ulong regionHandle);
|
RegionInfo RequestNeighbourInfo(ulong regionHandle);
|
||||||
List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
|
List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
|
||||||
|
|
|
@ -121,7 +121,7 @@ namespace OpenSim.Framework.Types
|
||||||
attri = configData.GetAttribute("GridServerURL");
|
attri = configData.GetAttribute("GridServerURL");
|
||||||
if (attri == "")
|
if (attri == "")
|
||||||
{
|
{
|
||||||
this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/");
|
this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:13801/");
|
||||||
configData.SetAttribute("GridServerURL", this.GridURL);
|
configData.SetAttribute("GridServerURL", this.GridURL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -217,7 +217,6 @@ namespace OpenSim.Grid.GridServer
|
||||||
/// <returns>Startup parameters</returns>
|
/// <returns>Startup parameters</returns>
|
||||||
public XmlRpcResponse XmlRpcSimulatorLoginMethod(XmlRpcRequest request)
|
public XmlRpcResponse XmlRpcSimulatorLoginMethod(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
Console.WriteLine("XMLRPC SIMULATOR LOGIN METHOD CALLED");
|
|
||||||
|
|
||||||
XmlRpcResponse response = new XmlRpcResponse();
|
XmlRpcResponse response = new XmlRpcResponse();
|
||||||
Hashtable responseData = new Hashtable();
|
Hashtable responseData = new Hashtable();
|
||||||
|
@ -229,7 +228,6 @@ namespace OpenSim.Grid.GridServer
|
||||||
Console.WriteLine(requestData.ToString());
|
Console.WriteLine(requestData.ToString());
|
||||||
if (requestData.ContainsKey("UUID"))
|
if (requestData.ContainsKey("UUID"))
|
||||||
{
|
{
|
||||||
Console.WriteLine("...VIA UUID");
|
|
||||||
TheSim = getRegion(new LLUUID((string)requestData["UUID"]));
|
TheSim = getRegion(new LLUUID((string)requestData["UUID"]));
|
||||||
logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID.");
|
logToDB((new LLUUID((string)requestData["UUID"])).ToStringHyphenated(),"XmlRpcSimulatorLoginMethod","", 5,"Region attempting login with UUID.");
|
||||||
}
|
}
|
||||||
|
@ -248,7 +246,6 @@ namespace OpenSim.Grid.GridServer
|
||||||
if (TheSim == null)
|
if (TheSim == null)
|
||||||
{
|
{
|
||||||
//NEW REGION
|
//NEW REGION
|
||||||
Console.WriteLine("THIS IS A NEW REGION...ADDING");
|
|
||||||
TheSim = new SimProfileData();
|
TheSim = new SimProfileData();
|
||||||
|
|
||||||
TheSim.regionRecvKey = config.SimRecvKey;
|
TheSim.regionRecvKey = config.SimRecvKey;
|
||||||
|
@ -277,7 +274,23 @@ namespace OpenSim.Grid.GridServer
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("ADDED");kvp.Value.AddProfile(TheSim);
|
DataResponse insertResponse = kvp.Value.AddProfile(TheSim);
|
||||||
|
switch(insertResponse)
|
||||||
|
{
|
||||||
|
case DataResponse.RESPONSE_OK:
|
||||||
|
Console.WriteLine("New sim creation successful: " + TheSim.regionName);
|
||||||
|
break;
|
||||||
|
case DataResponse.RESPONSE_ERROR:
|
||||||
|
Console.WriteLine("New sim creation failed (Error): " + TheSim.regionName);
|
||||||
|
break;
|
||||||
|
case DataResponse.RESPONSE_INVALIDCREDENTIALS:
|
||||||
|
Console.WriteLine("New sim creation failed (Invalid Credentials): " + TheSim.regionName);
|
||||||
|
break;
|
||||||
|
case DataResponse.RESPONSE_AUTHREQUIRED:
|
||||||
|
Console.WriteLine("New sim creation failed (Authentication Required): " + TheSim.regionName);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,10 +76,11 @@ namespace OpenSim.Grid.GridServer
|
||||||
|
|
||||||
private void Work()
|
private void Work()
|
||||||
{
|
{
|
||||||
|
m_console.Notice("Enter help for a list of commands\n");
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Thread.Sleep(5000);
|
m_console.MainLogPrompt();
|
||||||
// should flush the DB etc here
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +121,7 @@ namespace OpenSim.Grid.GridServer
|
||||||
m_gridManager.config = Cfg;
|
m_gridManager.config = Cfg;
|
||||||
|
|
||||||
m_console.Verbose( "Main.cs:Startup() - Starting HTTP process");
|
m_console.Verbose( "Main.cs:Startup() - Starting HTTP process");
|
||||||
BaseHttpServer httpServer = new BaseHttpServer(8001);
|
BaseHttpServer httpServer = new BaseHttpServer(13801);
|
||||||
//GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
|
//GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
|
||||||
|
|
||||||
httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod);
|
httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod);
|
||||||
|
@ -142,9 +143,9 @@ namespace OpenSim.Grid.GridServer
|
||||||
//break;
|
//break;
|
||||||
|
|
||||||
// lbsa71 : I guess these were never used?
|
// lbsa71 : I guess these were never used?
|
||||||
//Listener.Prefixes.Add("http://+:8001/gods/");
|
//Listener.Prefixes.Add("http://+:13801/gods/");
|
||||||
//Listener.Prefixes.Add("http://+:8001/highestuuid/");
|
//Listener.Prefixes.Add("http://+:13801/highestuuid/");
|
||||||
//Listener.Prefixes.Add("http://+:8001/uuidblocks/");
|
//Listener.Prefixes.Add("http://+:13801/uuidblocks/");
|
||||||
|
|
||||||
httpServer.Start();
|
httpServer.Start();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace OpenUser.Config.UserConfigDb4o
|
||||||
|
|
||||||
this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS");
|
this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS");
|
||||||
|
|
||||||
this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/");
|
this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:13801/");
|
||||||
this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null");
|
this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null");
|
||||||
this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null");
|
this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null");
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace OpenSim.Region.Communications.Local
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="regionInfo"></param>
|
/// <param name="regionInfo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo)
|
public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
|
//Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
|
||||||
if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
|
if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
|
||||||
|
|
|
@ -5,9 +5,10 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
{
|
{
|
||||||
public class CommunicationsOGS1 : CommunicationsManager
|
public class CommunicationsOGS1 : CommunicationsManager
|
||||||
{
|
{
|
||||||
private OGS1GridServices gridInterComms = new OGS1GridServices();
|
|
||||||
public CommunicationsOGS1(NetworkServersInfo serversInfo) :base(serversInfo)
|
public CommunicationsOGS1(NetworkServersInfo serversInfo) :base(serversInfo)
|
||||||
{
|
{
|
||||||
|
OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo);
|
||||||
GridServer = gridInterComms;
|
GridServer = gridInterComms;
|
||||||
InterRegion = gridInterComms;
|
InterRegion = gridInterComms;
|
||||||
UserServer = new OGS1UserServices(this);
|
UserServer = new OGS1UserServices(this);
|
||||||
|
|
|
@ -18,20 +18,28 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
public class OGS1GridServices : IGridServices, IInterRegionCommunications
|
public class OGS1GridServices : IGridServices, IInterRegionCommunications
|
||||||
{
|
{
|
||||||
public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>();
|
public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>();
|
||||||
public GridInfo grid;
|
|
||||||
public BaseHttpServer httpListener;
|
public BaseHttpServer httpListener;
|
||||||
|
public NetworkServersInfo serversInfo;
|
||||||
|
|
||||||
public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo)
|
public OGS1GridServices(NetworkServersInfo servers_info)
|
||||||
|
{
|
||||||
|
serversInfo = servers_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
|
||||||
{
|
{
|
||||||
Hashtable GridParams = new Hashtable();
|
Hashtable GridParams = new Hashtable();
|
||||||
|
|
||||||
grid = gridInfo;
|
|
||||||
|
|
||||||
// Login / Authentication
|
// Login / Authentication
|
||||||
GridParams["authkey"] = gridInfo.GridServerSendKey;
|
|
||||||
|
GridParams["authkey"] = serversInfo.GridSendKey;
|
||||||
GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated();
|
GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated();
|
||||||
GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString();
|
GridParams["sim_ip"] = regionInfo.InternalEndPoint.Address.ToString();
|
||||||
GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString();
|
GridParams["sim_port"] = regionInfo.InternalEndPoint.Port.ToString();
|
||||||
|
GridParams["region_locx"] = regionInfo.RegionLocX.ToString();
|
||||||
|
GridParams["region_locy"] = regionInfo.RegionLocY.ToString();
|
||||||
|
GridParams["sim_name"] = regionInfo.RegionName;
|
||||||
|
|
||||||
// Package into an XMLRPC Request
|
// Package into an XMLRPC Request
|
||||||
ArrayList SendParams = new ArrayList();
|
ArrayList SendParams = new ArrayList();
|
||||||
|
@ -41,7 +49,7 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
|
|
||||||
// Send Request
|
// Send Request
|
||||||
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
||||||
XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000);
|
XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
|
||||||
Hashtable GridRespData = (Hashtable)GridResp.Value;
|
Hashtable GridRespData = (Hashtable)GridResp.Value;
|
||||||
|
|
||||||
Hashtable griddatahash = GridRespData;
|
Hashtable griddatahash = GridRespData;
|
||||||
|
@ -149,7 +157,7 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
IList parameters = new ArrayList();
|
IList parameters = new ArrayList();
|
||||||
parameters.Add(param);
|
parameters.Add(param);
|
||||||
XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
|
XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
|
||||||
XmlRpcResponse resp = req.Send(grid.GridServerURI, 3000);
|
XmlRpcResponse resp = req.Send(serversInfo.GridURL, 3000);
|
||||||
Hashtable respData = (Hashtable)resp.Value;
|
Hashtable respData = (Hashtable)resp.Value;
|
||||||
return respData;
|
return respData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -603,8 +603,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RegisterRegionWithComms()
|
public void RegisterRegionWithComms()
|
||||||
{
|
{
|
||||||
GridInfo gridSettings = new GridInfo();
|
|
||||||
this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo, gridSettings);
|
this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo);
|
||||||
if (this.regionCommsHost != null)
|
if (this.regionCommsHost != null)
|
||||||
{
|
{
|
||||||
this.regionCommsHost.OnExpectUser += this.NewUserConnection;
|
this.regionCommsHost.OnExpectUser += this.NewUserConnection;
|
||||||
|
|
Loading…
Reference in New Issue