Plumb the rest of the context stuff. Well, what I see so far anyway

avinationmerge
Melanie Thielker 2015-11-02 00:23:38 +01:00
parent 3da0a318b3
commit f88e4a1ec9
4 changed files with 20 additions and 6 deletions

View File

@ -62,7 +62,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
} }
protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason)
{ {
return m_GatekeeperService.LoginAgent(source, aCircuit, destination, out reason); return m_GatekeeperService.LoginAgent(source, aCircuit, destination, out reason);
} }

View File

@ -118,7 +118,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason)
{ {
return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason); return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason);
} }

View File

@ -120,6 +120,8 @@ namespace OpenSim.Server.Handlers.Simulation
protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID) protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID)
{ {
EntityTransferContext ctx = new EntityTransferContext();
if (m_SimulationService == null) if (m_SimulationService == null)
{ {
m_log.Debug("[AGENT HANDLER]: Agent QUERY called. Harmless but useless."); m_log.Debug("[AGENT HANDLER]: Agent QUERY called. Harmless but useless.");
@ -155,6 +157,9 @@ namespace OpenSim.Server.Handlers.Simulation
theirVersion = float.Parse(parts[1]); theirVersion = float.Parse(parts[1]);
} }
if (args.ContainsKey("context"))
ctx.Unpack((OSDMap)args["context"]);
// Decode the new versioning data // Decode the new versioning data
float minVersionRequired = 0f; float minVersionRequired = 0f;
float maxVersionRequired = 0f; float maxVersionRequired = 0f;
@ -245,7 +250,6 @@ namespace OpenSim.Server.Handlers.Simulation
string reason; string reason;
// We're sending the version numbers down to the local connector to do the varregion check. // We're sending the version numbers down to the local connector to do the varregion check.
EntityTransferContext ctx = new EntityTransferContext();
ctx.InboundVersion = inboundVersion; ctx.InboundVersion = inboundVersion;
ctx.OutboundVersion = outboundVersion; ctx.OutboundVersion = outboundVersion;
if (minVersionProvided == 0f) if (minVersionProvided == 0f)
@ -406,6 +410,8 @@ namespace OpenSim.Server.Handlers.Simulation
protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id)
{ {
EntityTransferContext ctx = new EntityTransferContext();
OSDMap args = Utils.GetOSDMap((string)request["body"]); OSDMap args = Utils.GetOSDMap((string)request["body"]);
if (args == null) if (args == null)
{ {
@ -414,6 +420,9 @@ namespace OpenSim.Server.Handlers.Simulation
return; return;
} }
if (args.ContainsKey("context"))
ctx.Unpack((OSDMap)args["context"]);
AgentDestinationData data = CreateAgentDestinationData(); AgentDestinationData data = CreateAgentDestinationData();
UnpackData(args, data, request); UnpackData(args, data, request);
@ -461,7 +470,7 @@ namespace OpenSim.Server.Handlers.Simulation
//m_regionClient.AdjustUserInformation(aCircuit); //m_regionClient.AdjustUserInformation(aCircuit);
//bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, out reason); bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, ctx, out reason);
resp["reason"] = OSD.FromString(reason); resp["reason"] = OSD.FromString(reason);
resp["success"] = OSD.FromBoolean(result); resp["success"] = OSD.FromBoolean(result);
@ -536,12 +545,11 @@ namespace OpenSim.Server.Handlers.Simulation
// subclasses can override this // subclasses can override this
protected virtual bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, protected virtual bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason)
{ {
reason = String.Empty; reason = String.Empty;
// The data and protocols are already defined so this is just a dummy to satisfy the interface // The data and protocols are already defined so this is just a dummy to satisfy the interface
// TODO: make this end-to-end // TODO: make this end-to-end
EntityTransferContext ctx = new EntityTransferContext();
if ((teleportFlags & (uint)TeleportFlags.ViaLogin) == 0) if ((teleportFlags & (uint)TeleportFlags.ViaLogin) == 0)
{ {
Util.FireAndForget(x => Util.FireAndForget(x =>
@ -683,6 +691,8 @@ namespace OpenSim.Server.Handlers.Simulation
UUID.TryParse(args["destination_uuid"].AsString(), out uuid); UUID.TryParse(args["destination_uuid"].AsString(), out uuid);
if (args.ContainsKey("destination_name") && args["destination_name"] != null) if (args.ContainsKey("destination_name") && args["destination_name"] != null)
regionname = args["destination_name"].ToString(); regionname = args["destination_name"].ToString();
if (args.ContainsKey("context"))
ctx.Unpack((OSDMap)args["context"]);
GridRegion destination = new GridRegion(); GridRegion destination = new GridRegion();
destination.RegionID = uuid; destination.RegionID = uuid;

View File

@ -122,6 +122,7 @@ namespace OpenSim.Services.Connectors.Simulation
try try
{ {
OSDMap args = aCircuit.PackAgentCircuitData(ctx); OSDMap args = aCircuit.PackAgentCircuitData(ctx);
args["context"] = ctx.Pack();
PackData(args, source, aCircuit, destination, flags); PackData(args, source, aCircuit, destination, flags);
OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
@ -266,6 +267,7 @@ namespace OpenSim.Services.Connectors.Simulation
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_name"] = OSD.FromString(destination.RegionName);
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
args["context"] = ctx.Pack();
OSDMap result = WebUtil.PutToServiceCompressed(uri, args, timeout); OSDMap result = WebUtil.PutToServiceCompressed(uri, args, timeout);
if (result["Success"].AsBoolean()) if (result["Success"].AsBoolean())
@ -308,6 +310,8 @@ namespace OpenSim.Services.Connectors.Simulation
request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin)); request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin));
request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax)); request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax));
request.Add("context", ctx.Pack());
OSDArray features = new OSDArray(); OSDArray features = new OSDArray();
foreach (UUID feature in featuresAvailable) foreach (UUID feature in featuresAvailable)
features.Add(OSD.FromString(feature.ToString())); features.Add(OSD.FromString(feature.ToString()));