diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 023a44c601..2924b9213a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs @@ -256,5 +256,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid } } + #region SYNC SERVER + // Stubs for actor and quark management. Only implementation is in SimianGridService + public virtual bool RegisterActor(GridActorInfo gai, List lgqi) + { + return m_GridService.RegisterActor(gai, lgqi); + } + public virtual bool RegisterActor(GridActorInfo gai, GridQuarkInfo gqi) + { + return m_GridService.RegisterActor(gai, gqi); + } + public virtual List LookupQuark(GridQuarkInfo gqi) + { + return m_GridService.LookupQuark(gqi); + } + public virtual List LookupQuark(GridQuarkInfo gqi, string actorType) + { + return m_GridService.LookupQuark(gqi, actorType); + } + #endregion SYNC SERVER + } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 33cc838322..7869e8f433 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs @@ -288,5 +288,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid return flags; } #endregion + + #region SYNC SERVER + // Stubs for actor and quark management. Only implementation is in SimianGridService + public virtual bool RegisterActor(GridActorInfo gai, List lgqi) + { + return m_RemoteGridService.RegisterActor(gai, lgqi); + } + public virtual bool RegisterActor(GridActorInfo gai, GridQuarkInfo gqi) + { + return m_RemoteGridService.RegisterActor(gai, gqi); + } + public virtual List LookupQuark(GridQuarkInfo gqi) + { + return LookupQuark(gqi); + } + public virtual List LookupQuark(GridQuarkInfo gqi, string actorType) + { + return LookupQuark(gqi, actorType); + } + #endregion SYNC SERVER } } diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 5092d741e6..9e556ecb9b 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -653,5 +653,25 @@ namespace OpenSim.Services.Connectors #endregion + #region SYNC SERVER + // Stubs for actor and quark management. Only implementation is in SimianGridService + public virtual bool RegisterActor(GridActorInfo gai, List lgqi) + { + return false; + } + public virtual bool RegisterActor(GridActorInfo gai, GridQuarkInfo gqi) + { + return false; + } + public virtual List LookupQuark(GridQuarkInfo gqi) + { + return null; + } + public virtual List LookupQuark(GridQuarkInfo gqi, string actorType) + { + return null; + } + #endregion SYNC SERVER + } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 918544f1f6..dd1fe48a39 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -432,5 +432,123 @@ namespace OpenSim.Services.Connectors.SimianGrid return region; } + + #region SYNC SERVER + // Stubs for actor and quark management. Only implementation is in SimianGridService + public virtual bool RegisterActor(GridActorInfo gai, List lgqi) + { + OSDArray quarks = new OSDArray(); + foreach (GridQuarkInfo gqi in lgqi) + { + OSDMap quarkMap = new OSDMap + { + { "locX", OSD.FromInteger(gqi.locX) }, + { "locY", OSD.FromInteger(gqi.locY) } + }; + quarks.Add(quarkMap); + } + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "RegisterActor" }, + { "actorID", gai.actorID }, + { "type", gai.type }, + { "address", gai.address }, + { "port", gai.port.ToString() }, + { "quarks", OSDParser.SerializeJsonString(quarks) } + }; + + OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); + if (response["Success"].AsBoolean()) + { + return true; + } + return false; + } + + public virtual bool RegisterActor(GridActorInfo gai, GridQuarkInfo gqi) + { + OSDMap quarkMap = new OSDMap + { + { "locX", OSD.FromInteger(gqi.locX) }, + { "locY", OSD.FromInteger(gqi.locY) } + }; + OSDArray quarks = new OSDArray(); + quarks.Add(quarkMap); + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "RegisterActor" }, + { "actorID", gai.actorID }, + { "actorType", gai.type }, + { "address", gai.address }, + { "port", gai.port.ToString() }, + { "quarks", OSDParser.SerializeJsonString(quarks) } + }; + + OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); + if (response["Success"].AsBoolean()) + { + return true; + } + return false; + } + + public virtual List LookupQuark(GridQuarkInfo gqi) + { + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "LookupQuark" }, + { "locX", gqi.locX.ToString() }, + { "locY", gqi.locY.ToString() } + }; + + OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); + if (response["Success"].AsBoolean()) + { + List lgai = new List(); + OSDArray gridActors = (OSDArray)response["actors"]; + for (int ii = 0; ii < gridActors.Count; ii++) + { + OSDMap thisGridActor = (OSDMap)gridActors[ii]; + GridActorInfo gai = new GridActorInfo(); + gai.actorID = thisGridActor["actorID"].AsString(); + gai.type = thisGridActor["actorType"].AsString(); + gai.address = thisGridActor["address"].AsString(); + gai.port = thisGridActor["port"].AsInteger(); + lgai.Add(gai); + } + return lgai; + } + return null; + } + public virtual List LookupQuark(GridQuarkInfo gqi, string actorType) + { + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "LookupQuark" }, + { "locX", gqi.locX.ToString() }, + { "locY", gqi.locY.ToString() }, + { "actorType", actorType } + }; + + OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); + if (response["Success"].AsBoolean()) + { + List lgai = new List(); + OSDArray gridActors = (OSDArray)response["actors"]; + for (int ii = 0; ii < gridActors.Count; ii++) + { + OSDMap thisGridActor = (OSDMap)gridActors[ii]; + GridActorInfo gai = new GridActorInfo(); + gai.actorID = thisGridActor["actorID"].AsString(); + gai.type = thisGridActor["actorType"].AsString(); + gai.address = thisGridActor["address"].AsString(); + gai.port = thisGridActor["port"].AsInteger(); + lgai.Add(gai); + } + return lgai; + } + return null; + } + #endregion SYNC SERVER } } diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 125c2be8cf..b26e04deaf 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -548,5 +548,25 @@ namespace OpenSim.Services.GridService m_Database.Store(r); } } + + #region SYNC SERVER + // Stubs for actor and quark management. Only implementation is in SimianGridService + public virtual bool RegisterActor(GridActorInfo gai, List lgqi) + { + return false; + } + public virtual bool RegisterActor(GridActorInfo gai, GridQuarkInfo gqi) + { + return false; + } + public virtual List LookupQuark(GridQuarkInfo gqi) + { + return null; + } + public virtual List LookupQuark(GridQuarkInfo gqi, string actorType) + { + return null; + } + #endregion SYNC SERVER } } diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index a34f0bebf6..72c970a404 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -95,6 +95,24 @@ namespace OpenSim.Services.Interfaces List GetHyperlinks(UUID scopeID); int GetRegionFlags(UUID scopeID, UUID regionID); + + bool RegisterActor(GridActorInfo gai, List lgqi); + bool RegisterActor(GridActorInfo gai, GridQuarkInfo gqi); + List LookupQuark(GridQuarkInfo gqi); + List LookupQuark(GridQuarkInfo gqi, string actorType); + } + + public class GridQuarkInfo + { + public int locX; + public int locY; + } + public class GridActorInfo + { + public string address; + public int port; + public string type; + public string actorID; } public class GridRegion : Object