aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Simulation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation')
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs43
1 files changed, 18 insertions, 25 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index e8456b4..6faeefd 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -156,8 +156,8 @@ namespace OpenSim.Server.Handlers.Simulation
156 } 156 }
157 157
158 // Decode the new versioning data 158 // Decode the new versioning data
159// float minVersionRequired = 0f; 159 float minVersionRequired = 0f;
160// float maxVersionRequired = 0f; 160 float maxVersionRequired = 0f;
161 float minVersionProvided = 0f; 161 float minVersionProvided = 0f;
162 float maxVersionProvided = 0f; 162 float maxVersionProvided = 0f;
163 163
@@ -166,10 +166,10 @@ namespace OpenSim.Server.Handlers.Simulation
166 if (args.ContainsKey("simulation_service_supported_max")) 166 if (args.ContainsKey("simulation_service_supported_max"))
167 maxVersionProvided = (float)args["simulation_service_supported_max"].AsReal(); 167 maxVersionProvided = (float)args["simulation_service_supported_max"].AsReal();
168 168
169// if (args.ContainsKey("simulation_service_accepted_min")) 169 if (args.ContainsKey("simulation_service_accepted_min"))
170// minVersionRequired = (float)args["simulation_service_accepted_min"].AsReal(); 170 minVersionRequired = (float)args["simulation_service_accepted_min"].AsReal();
171// if (args.ContainsKey("simulation_service_accepted_max")) 171 if (args.ContainsKey("simulation_service_accepted_max"))
172// maxVersionRequired = (float)args["simulation_service_accepted_max"].AsReal(); 172 maxVersionRequired = (float)args["simulation_service_accepted_max"].AsReal();
173 173
174 responsedata["int_response_code"] = HttpStatusCode.OK; 174 responsedata["int_response_code"] = HttpStatusCode.OK;
175 OSDMap resp = new OSDMap(3); 175 OSDMap resp = new OSDMap(3);
@@ -195,14 +195,13 @@ namespace OpenSim.Server.Handlers.Simulation
195 version > VersionInfo.SimulationServiceVersionAcceptedMax ) 195 version > VersionInfo.SimulationServiceVersionAcceptedMax )
196 { 196 {
197 resp["success"] = OSD.FromBoolean(false); 197 resp["success"] = OSD.FromBoolean(false);
198 resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and destiny accepts only {1} - {2}", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax)); 198 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));
199 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); 199 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
200 return; 200 return;
201 } 201 }
202 } 202 }
203 else 203 else
204 { 204 {
205/*
206 // Test for no overlap 205 // Test for no overlap
207 if (minVersionProvided > VersionInfo.SimulationServiceVersionAcceptedMax || 206 if (minVersionProvided > VersionInfo.SimulationServiceVersionAcceptedMax ||
208 maxVersionProvided < VersionInfo.SimulationServiceVersionAcceptedMin) 207 maxVersionProvided < VersionInfo.SimulationServiceVersionAcceptedMin)
@@ -221,9 +220,16 @@ namespace OpenSim.Server.Handlers.Simulation
221 return; 220 return;
222 } 221 }
223 222
224 // Determine version to use 223 // Determine versions to use
224 float inboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax);
225 float outboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax);
226
227 // In this stage, we use only a single version number. Future regions may use asymmetrical protocols.
228 // Here, the two versions we determined are combined into a single version for now.
229 version = Math.Max(inboundVersion, outboundVersion);
225 230
226 version = Math.Max(Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax), Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax)); 231 // Since only using a single version, we must do this check. Once the plumbing is in for asymmetrical
232 // protocols, this will go away, allowing more working combinations.
227 if (version < VersionInfo.SimulationServiceVersionAcceptedMin || 233 if (version < VersionInfo.SimulationServiceVersionAcceptedMin ||
228 version > VersionInfo.SimulationServiceVersionAcceptedMax || 234 version > VersionInfo.SimulationServiceVersionAcceptedMax ||
229 version < VersionInfo.SimulationServiceVersionSupportedMin || 235 version < VersionInfo.SimulationServiceVersionSupportedMin ||
@@ -234,20 +240,6 @@ namespace OpenSim.Server.Handlers.Simulation
234 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true); 240 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
235 return; 241 return;
236 } 242 }
237*/
238 // find max possible version to use
239 version = Math.Min(VersionInfo.SimulationServiceVersionAcceptedMax, maxVersionProvided);
240 // check if within lower bounds
241 if(version < VersionInfo.SimulationServiceVersionAcceptedMin ||
242 version < minVersionProvided)
243 {
244 resp["success"] = OSD.FromBoolean(false);
245 resp["reason"] = OSD.FromString(String.Format("Region protocol versions are incompatible. Destiny accepts {0} - {1} and source provides {2} - {3}.", VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax,
246 minVersionProvided,
247 maxVersionProvided));
248 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
249 return;
250 }
251 } 243 }
252 244
253 List<UUID> features = new List<UUID>(); 245 List<UUID> features = new List<UUID>();
@@ -271,7 +263,8 @@ namespace OpenSim.Server.Handlers.Simulation
271 resp["reason"] = OSD.FromString(reason); 263 resp["reason"] = OSD.FromString(reason);
272 string legacyVersion = String.Format("SIMULATION/{0}", version); 264 string legacyVersion = String.Format("SIMULATION/{0}", version);
273 resp["version"] = OSD.FromString(legacyVersion); 265 resp["version"] = OSD.FromString(legacyVersion);
274 resp["negotiated_version"] = OSD.FromReal(version); 266 resp["negotiated_inbound_version"] = OSD.FromReal(version); //inboundVersion);
267 resp["negotiated_outbound_version"] = OSD.FromReal(version); //outboundVersion);
275 resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); 268 resp["variable_wearables_count_supported"] = OSD.FromBoolean(true);
276 269
277 OSDArray featuresWanted = new OSDArray(); 270 OSDArray featuresWanted = new OSDArray();