diff options
author | Justin Clarke Casey | 2008-11-11 17:02:46 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-11 17:02:46 +0000 |
commit | 97816f8c901bf56e3b29bdbd5f8e320de352f45f (patch) | |
tree | 30fdd6962a11fda115da1b2cb8340a4d64b763b1 /OpenSim/Grid | |
parent | Mantis#2604. Thank you kindly, Diva for a patch that: (diff) | |
download | opensim-SC_OLD-97816f8c901bf56e3b29bdbd5f8e320de352f45f.zip opensim-SC_OLD-97816f8c901bf56e3b29bdbd5f8e320de352f45f.tar.gz opensim-SC_OLD-97816f8c901bf56e3b29bdbd5f8e320de352f45f.tar.bz2 opensim-SC_OLD-97816f8c901bf56e3b29bdbd5f8e320de352f45f.tar.xz |
* Implement basic region filtering as described in https://lists.berlios.de/pipermail/opensim-dev/2008-November/003468.html
* This is done by sending a 'major interface version' number on sim registration. Developers must increment this every time they make a change that would make the previous
OpenSim revision failure incompatible with the new one (non-fatal incompatibilities are fine).
* This number resides in OpenSim.Framework.Servers.VersionInfo.MajorInterfaceVersion
* This allows the grid service to stop older, incompatible regions from connecting
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/GridServer/GridManager.cs | 40 | ||||
-rw-r--r-- | OpenSim/Grid/GridServer/GridServerBase.cs | 2 |
2 files changed, 35 insertions, 7 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 0fc2147..32b7554 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -53,6 +53,22 @@ namespace OpenSim.Grid.GridServer | |||
53 | private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); | 53 | private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); |
54 | 54 | ||
55 | public GridConfig Config; | 55 | public GridConfig Config; |
56 | |||
57 | /// <value> | ||
58 | /// Used to notify old regions as to which OpenSim version to upgrade to | ||
59 | /// </value> | ||
60 | private string m_opensimVersion; | ||
61 | |||
62 | /// <summary> | ||
63 | /// Constructor | ||
64 | /// </summary> | ||
65 | /// <param name="opensimVersion"> | ||
66 | /// Used to notify old regions as to which OpenSim version to upgrade to | ||
67 | /// </param> | ||
68 | public GridManager(string opensimVersion) | ||
69 | { | ||
70 | m_opensimVersion = opensimVersion; | ||
71 | } | ||
56 | 72 | ||
57 | /// <summary> | 73 | /// <summary> |
58 | /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. | 74 | /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. |
@@ -360,7 +376,7 @@ namespace OpenSim.Grid.GridServer | |||
360 | 376 | ||
361 | if (!requestData.ContainsKey("UUID") || !UUID.TryParse((string)requestData["UUID"], out uuid)) | 377 | if (!requestData.ContainsKey("UUID") || !UUID.TryParse((string)requestData["UUID"], out uuid)) |
362 | { | 378 | { |
363 | m_log.Warn("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response."); | 379 | m_log.Debug("[LOGIN PRELUDE]: Region connected without a UUID, sending back error response."); |
364 | return ErrorResponse("No UUID passed to grid server - unable to connect you"); | 380 | return ErrorResponse("No UUID passed to grid server - unable to connect you"); |
365 | } | 381 | } |
366 | 382 | ||
@@ -370,21 +386,33 @@ namespace OpenSim.Grid.GridServer | |||
370 | } | 386 | } |
371 | catch (FormatException e) | 387 | catch (FormatException e) |
372 | { | 388 | { |
373 | m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); | 389 | m_log.Debug("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); |
374 | return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); | 390 | return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); |
375 | } | 391 | } |
392 | |||
393 | m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName); | ||
376 | 394 | ||
377 | if (!Config.AllowRegionRegistration) | 395 | if (!Config.AllowRegionRegistration) |
378 | { | 396 | { |
379 | m_log.InfoFormat( | 397 | m_log.DebugFormat( |
380 | "[LOGIN END]: Disabled region registration blocked login request from simulator: {0}", | 398 | "[LOGIN END]: Disabled region registration blocked login request from simulator: {0}", |
381 | sim.regionName); | 399 | sim.regionName); |
382 | 400 | ||
383 | return ErrorResponse("The grid is currently not accepting region registrations."); | 401 | return ErrorResponse("This grid is currently not accepting region registrations."); |
402 | } | ||
403 | |||
404 | int majorInterfaceVersion = 0; | ||
405 | if (requestData.ContainsKey("major_interface_version")) | ||
406 | int.TryParse((string)requestData["major_interface_version"], out majorInterfaceVersion); | ||
407 | |||
408 | if (majorInterfaceVersion != VersionInfo.MajorInterfaceVersion) | ||
409 | { | ||
410 | return ErrorResponse( | ||
411 | String.Format( | ||
412 | "Your region is the wrong version to connect to this grid. Try changing to version {0} (interface version {1})", | ||
413 | m_opensimVersion, VersionInfo.MajorInterfaceVersion)); | ||
384 | } | 414 | } |
385 | 415 | ||
386 | m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName); | ||
387 | |||
388 | existingSim = GetRegion(sim.regionHandle); | 416 | existingSim = GetRegion(sim.regionHandle); |
389 | 417 | ||
390 | if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID) | 418 | if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID) |
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 36ea238..9652765 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs | |||
@@ -153,7 +153,7 @@ namespace OpenSim.Grid.GridServer | |||
153 | protected virtual void SetupGridManager() | 153 | protected virtual void SetupGridManager() |
154 | { | 154 | { |
155 | m_log.Info("[DATA]: Connecting to Storage Server"); | 155 | m_log.Info("[DATA]: Connecting to Storage Server"); |
156 | m_gridManager = new GridManager(); | 156 | m_gridManager = new GridManager(m_version); |
157 | m_gridManager.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); | 157 | m_gridManager.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); |
158 | m_gridManager.Config = m_config; | 158 | m_gridManager.Config = m_config; |
159 | } | 159 | } |