Partial plumbing for the agent stateful module features negotiation

0.8.2-post-fixes
Melanie Thielker 2015-08-20 00:18:45 +02:00
parent 35cbe76f27
commit 028506cf3c
10 changed files with 41 additions and 14 deletions

View File

@ -762,7 +762,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
string version;
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
if (!Scene.SimulationService.QueryAccess(
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, out version, out reason))
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason))
{
sp.ControllingClient.SendTeleportFailed(reason);
@ -1517,7 +1517,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Check to see if we have access to the target region.
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
if (neighbourRegion != null
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, out version, out failureReason))
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason))
{
// remember banned
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);

View File

@ -269,7 +269,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return true;
}
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, out string version, out string reason)
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason)
{
reason = "Communications failure";
version = ServiceVersion;
@ -298,7 +298,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
}
return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason);
return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, features, out reason);
}
//m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
@ -394,4 +394,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
#endregion
}
}
}

View File

@ -27,6 +27,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
@ -205,7 +206,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return m_remoteConnector.UpdateAgent(destination, cAgentData);
}
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason)
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason)
{
reason = "Communications failure";
version = "Unknown";
@ -214,12 +215,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
// Try local first
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason))
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionID))
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason);
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason);
return false;
}

View File

@ -5810,7 +5810,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name='position'></param>
/// <param name='reason'></param>
/// <returns></returns>
public bool QueryAccess(UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string reason)
public bool QueryAccess(UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out string reason)
{
reason = string.Empty;

View File

@ -374,6 +374,13 @@ namespace OpenSim.Region.Framework.Scenes
return m_moduleCommanders;
}
public List<UUID> GetFormatsOffered()
{
List<UUID> ret = new List<UUID>(FormatsOffered);
return ret;
}
protected void CheckAndAddAgentDataFormats(object mod)
{
if (!(mod is IAgentStatefulModule))

View File

@ -27,6 +27,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.IO.Compression;
@ -148,12 +149,22 @@ namespace OpenSim.Server.Handlers.Simulation
if (args.ContainsKey("my_version"))
theirVersion = args["my_version"].AsString();
List<UUID> features = new List<UUID>();
if (args.ContainsKey("features"))
{
OSDArray array = (OSDArray)args["features"];
foreach (OSD o in array)
features.Add(new UUID(o.AsString()));
}
GridRegion destination = new GridRegion();
destination.RegionID = regionID;
string reason;
string version;
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, out version, out reason);
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, features, out version, out reason);
responsedata["int_response_code"] = HttpStatusCode.OK;

View File

@ -282,7 +282,7 @@ namespace OpenSim.Services.Connectors.Simulation
}
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, out string version, out string reason)
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason)
{
reason = "Failed to contact destination";
version = "Unknown";
@ -299,6 +299,13 @@ namespace OpenSim.Services.Connectors.Simulation
request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
request.Add("position", OSD.FromString(position.ToString()));
request.Add("my_version", OSD.FromString(myversion));
OSDArray features = new OSDArray();
foreach (UUID feature in featuresAvailable)
features.Add(OSD.FromString(feature.ToString()));
request.Add("features", features);
if (agentHomeURI != null)
request.Add("agent_home_uri", OSD.FromString(agentHomeURI));

View File

@ -453,7 +453,7 @@ namespace OpenSim.Services.HypergridService
if (!m_SimulationService.QueryAccess(
destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(),
true, aCircuit.startpos, "SIMULATION/0.3", out version, out reason))
true, aCircuit.startpos, "SIMULATION/0.3", new List<UUID>(), out version, out reason))
return false;
return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);

View File

@ -26,6 +26,7 @@
*/
using System;
using System.Collections.Generic;
using OpenSim.Framework;
using OpenMetaverse;
@ -91,7 +92,7 @@ namespace OpenSim.Services.Interfaces
/// <param name="version">Version that the target simulator is running</param>
/// <param name="reason">[out] Optional error message</param>
/// <returns>True: ok; False: not allowed</returns>
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason);
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason);
/// <summary>
/// Message from receiving region to departing region, telling it got contacted by the client.

View File

@ -983,7 +983,7 @@ namespace OpenSim.Services.LLLoginService
if (
!simConnector.QueryAccess(
region, aCircuit.AgentID, null, true, aCircuit.startpos, "SIMULATION/0.3", out version, out reason))
region, aCircuit.AgentID, null, true, aCircuit.startpos, "SIMULATION/0.3", new List<UUID>(), out version, out reason))
return false;
return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);