From dc6d9eadf33b9a0321664d676030b07b2bd04bed Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 31 Oct 2015 00:01:35 +0100 Subject: Testing stage of the new versioning system. Use at own risk. May not work. Will eat your babies. Yada. Yada. --- .../Simulation/SimulationServiceConnector.cs | 32 ++++++++++++++++------ .../Services/HypergridService/GatekeeperService.cs | 5 ++-- OpenSim/Services/Interfaces/ISimulationService.cs | 2 +- OpenSim/Services/LLLoginService/LLLoginService.cs | 5 ++-- 4 files changed, 29 insertions(+), 15 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 1eedbef..5ee2c9c 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -282,10 +282,10 @@ namespace OpenSim.Services.Connectors.Simulation } - public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List featuresAvailable, out string version, out string reason) + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List featuresAvailable, out float version, out string reason) { reason = "Failed to contact destination"; - version = "Unknown"; + version = 0f; // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); @@ -298,7 +298,14 @@ namespace OpenSim.Services.Connectors.Simulation OSDMap request = new OSDMap(); request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); request.Add("position", OSD.FromString(position.ToString())); - request.Add("my_version", OSD.FromString(myversion)); + // To those who still understad this field, we're telling them + // the lowest version just to be safe + request.Add("my_version", OSD.FromString(String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersionSupportedMin))); + // New simulation service negotiation + request.Add("simulation_service_supported_min", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMin)); + request.Add("simulation_service_supported_max", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMax)); + request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin)); + request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax)); OSDArray features = new OSDArray(); foreach (UUID feature in featuresAvailable) @@ -322,15 +329,24 @@ namespace OpenSim.Services.Connectors.Simulation success = data["success"]; reason = data["reason"].AsString(); - if (data["version"] != null && data["version"].AsString() != string.Empty) - version = data["version"].AsString(); + if (data["negotiated_version"] != null) + { + version = (float)data["negotiated_version"].AsReal(); + } + else if (data["version"] != null && data["version"].AsString() != string.Empty) + { + string versionString = data["version"].AsString(); + String[] parts = versionString.Split(new char[] {'/'}); + if (parts.Length > 1) + version = float.Parse(parts[1]); + } m_log.DebugFormat( - "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})", - uri, success, reason, version, data["version"].AsString()); + "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version SIMULATION/{3}", + uri, success, reason, version); } - if (!success) + if (!success || version == 0f) { // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the // actual failure message diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index bee3db3..a2c5327 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -452,12 +452,11 @@ namespace OpenSim.Services.HypergridService m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); - string version; + float version; - string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); if (!m_SimulationService.QueryAccess( destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(), - true, aCircuit.startpos, myversion, new List(), out version, out reason)) + true, aCircuit.startpos, new List(), out version, out reason)) return false; return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 42c414d..6f205ad 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -92,7 +92,7 @@ namespace OpenSim.Services.Interfaces /// Version that the target simulator is running /// [out] Optional error message /// True: ok; False: not allowed - bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List features, out string version, out string reason); + bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List features, out float version, out string reason); /// /// Message from receiving region to departing region, telling it got contacted by the client. diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 9e12f9d..4f8f459 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -983,11 +983,10 @@ namespace OpenSim.Services.LLLoginService private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) { - string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); - string version; + float version; if (!simConnector.QueryAccess( - region, aCircuit.AgentID, null, true, aCircuit.startpos, myversion, new List(), out version, out reason)) + region, aCircuit.AgentID, null, true, aCircuit.startpos, new List(), out version, out reason)) return false; return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); -- cgit v1.1