fix transfer protocol version in string format. Let that case have tests identical to new format (this still isnt for your babies keep them safe...)

avinationmerge
UbitUmarov 2015-10-31 21:50:24 +00:00
parent ea56f4f27c
commit 19e5667451
1 changed files with 17 additions and 5 deletions

View File

@ -192,12 +192,22 @@ namespace OpenSim.Server.Handlers.Simulation
} }
version = theirVersion; version = theirVersion;
outboundVersion = version;
inboundVersion = version;
if (version < VersionInfo.SimulationServiceVersionAcceptedMin || if (outboundVersion < VersionInfo.SimulationServiceVersionAcceptedMin ||
version > VersionInfo.SimulationServiceVersionAcceptedMax ) outboundVersion > VersionInfo.SimulationServiceVersionAcceptedMax )
{ {
resp["success"] = OSD.FromBoolean(false); resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and we accept only {1} - {2}. No version overlap.", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); resp["reason"] = OSD.FromString(String.Format("Your region provide protocol version {0} and we accept only {1} - {2}. No version overlap.", outboundVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
if (inboundVersion > VersionInfo.SimulationServiceVersionSupportedMax ||
inboundVersion < VersionInfo.SimulationServiceVersionSupportedMin)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("You require region protocol version {0} and we provide only {2} - {3}. No version overlap.", inboundVersion, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return; return;
} }
@ -239,6 +249,8 @@ namespace OpenSim.Server.Handlers.Simulation
{ {
// If the single version can't resolve, fall back to safest. This will only affect very old regions. // If the single version can't resolve, fall back to safest. This will only affect very old regions.
version = 0.1f; version = 0.1f;
outboundVersion = version;
inboundVersion = version;
} }
} }