mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Testing stage of the new versioning system. Use at own risk. May not
work. Will eat your babies. Yada. Yada.
This commit is contained in:
@@ -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<UUID> featuresAvailable, out string version, out string reason)
|
||||
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> 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
|
||||
|
||||
@@ -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<UUID>(), out version, out reason))
|
||||
true, aCircuit.startpos, new List<UUID>(), out version, out reason))
|
||||
return false;
|
||||
|
||||
return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);
|
||||
|
||||
@@ -92,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, List<UUID> features, out string version, out string reason);
|
||||
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out float version, out string reason);
|
||||
|
||||
/// <summary>
|
||||
/// Message from receiving region to departing region, telling it got contacted by the client.
|
||||
|
||||
@@ -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<UUID>(), out version, out reason))
|
||||
region, aCircuit.AgentID, null, true, aCircuit.startpos, new List<UUID>(), out version, out reason))
|
||||
return false;
|
||||
|
||||
return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);
|
||||
|
||||
Reference in New Issue
Block a user