diff options
author | Diva Canto | 2015-10-18 16:06:31 -0700 |
---|---|---|
committer | Diva Canto | 2015-10-18 16:06:31 -0700 |
commit | 70a46fe0907c822a5244e36c338bf559ffbec965 (patch) | |
tree | 6b275cb6256e90e000cbef4b3ce00380912dda99 /OpenSim/Region/CoreModules | |
parent | The protocol version checking on the grid server connector seemed to have a b... (diff) | |
download | opensim-SC-70a46fe0907c822a5244e36c338bf559ffbec965.zip opensim-SC-70a46fe0907c822a5244e36c338bf559ffbec965.tar.gz opensim-SC-70a46fe0907c822a5244e36c338bf559ffbec965.tar.bz2 opensim-SC-70a46fe0907c822a5244e36c338bf559ffbec965.tar.xz |
Clean up of simulation version, the number that rules the compatibility of teleports:
- It's not configurable anymore, it's fixed in code. Each number means an increase in features of the teleport procedure
- Its definition moved to the global VersionInfo class
As of now it's still 0.3.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 49 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 22 |
2 files changed, 10 insertions, 61 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index f3acff2..155a085 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -57,12 +57,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
57 | public const int DefaultMaxTransferDistance = 4095; | 57 | public const int DefaultMaxTransferDistance = 4095; |
58 | public const bool WaitForAgentArrivedAtDestinationDefault = true; | 58 | public const bool WaitForAgentArrivedAtDestinationDefault = true; |
59 | 59 | ||
60 | public string OutgoingTransferVersionName { get; set; } | 60 | public static readonly string OutgoingTransferVersionName = "SIMULATION"; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Determine the maximum entity transfer version we will use for teleports. | 63 | /// Determine the entity transfer version we will use for teleports. |
64 | /// </summary> | 64 | /// </summary> |
65 | public float MaxOutgoingTransferVersion { get; set; } | 65 | public static readonly float OutgoingTransferVersion = VersionInfo.SimulationServiceVersion; |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
68 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | 68 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. |
@@ -207,9 +207,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
207 | /// <param name="source"></param> | 207 | /// <param name="source"></param> |
208 | protected virtual void InitialiseCommon(IConfigSource source) | 208 | protected virtual void InitialiseCommon(IConfigSource source) |
209 | { | 209 | { |
210 | string transferVersionName = "SIMULATION"; | ||
211 | float maxTransferVersion = 0.3f; | ||
212 | |||
213 | IConfig hypergridConfig = source.Configs["Hypergrid"]; | 210 | IConfig hypergridConfig = source.Configs["Hypergrid"]; |
214 | if (hypergridConfig != null) | 211 | if (hypergridConfig != null) |
215 | { | 212 | { |
@@ -225,33 +222,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
225 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 222 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
226 | if (transferConfig != null) | 223 | if (transferConfig != null) |
227 | { | 224 | { |
228 | string rawVersion | ||
229 | = transferConfig.GetString( | ||
230 | "MaxOutgoingTransferVersion", | ||
231 | string.Format("{0}/{1}", transferVersionName, maxTransferVersion)); | ||
232 | |||
233 | string[] rawVersionComponents = rawVersion.Split(new char[] { '/' }); | ||
234 | |||
235 | bool versionValid = false; | ||
236 | |||
237 | if (rawVersionComponents.Length >= 2) | ||
238 | versionValid = float.TryParse(rawVersionComponents[1], out maxTransferVersion); | ||
239 | |||
240 | if (!versionValid) | ||
241 | { | ||
242 | m_log.ErrorFormat( | ||
243 | "[ENTITY TRANSFER MODULE]: MaxOutgoingTransferVersion {0} is invalid, using {1}", | ||
244 | rawVersion, string.Format("{0}/{1}", transferVersionName, maxTransferVersion)); | ||
245 | } | ||
246 | else | ||
247 | { | ||
248 | transferVersionName = rawVersionComponents[0]; | ||
249 | |||
250 | m_log.InfoFormat( | ||
251 | "[ENTITY TRANSFER MODULE]: MaxOutgoingTransferVersion set to {0}", | ||
252 | string.Format("{0}/{1}", transferVersionName, maxTransferVersion)); | ||
253 | } | ||
254 | |||
255 | DisableInterRegionTeleportCancellation | 225 | DisableInterRegionTeleportCancellation |
256 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); | 226 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); |
257 | 227 | ||
@@ -265,9 +235,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
265 | MaxTransferDistance = DefaultMaxTransferDistance; | 235 | MaxTransferDistance = DefaultMaxTransferDistance; |
266 | } | 236 | } |
267 | 237 | ||
268 | OutgoingTransferVersionName = transferVersionName; | ||
269 | MaxOutgoingTransferVersion = maxTransferVersion; | ||
270 | |||
271 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); | 238 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); |
272 | 239 | ||
273 | m_Enabled = true; | 240 | m_Enabled = true; |
@@ -760,7 +727,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
760 | 727 | ||
761 | string reason; | 728 | string reason; |
762 | string version; | 729 | string version; |
763 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); | 730 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion); |
764 | if (!Scene.SimulationService.QueryAccess( | 731 | if (!Scene.SimulationService.QueryAccess( |
765 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason)) | 732 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason)) |
766 | { | 733 | { |
@@ -779,8 +746,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
779 | m_interRegionTeleportAttempts.Value++; | 746 | m_interRegionTeleportAttempts.Value++; |
780 | 747 | ||
781 | m_log.DebugFormat( | 748 | m_log.DebugFormat( |
782 | "[ENTITY TRANSFER MODULE]: {0} max transfer version is {1}/{2}, {3} max version is {4}", | 749 | "[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}", |
783 | sp.Scene.Name, OutgoingTransferVersionName, MaxOutgoingTransferVersion, finalDestination.RegionName, version); | 750 | sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version); |
784 | 751 | ||
785 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 752 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
786 | // both regions | 753 | // both regions |
@@ -835,7 +802,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
835 | if (versionComponents.Length >= 2) | 802 | if (versionComponents.Length >= 2) |
836 | float.TryParse(versionComponents[1], out versionNumber); | 803 | float.TryParse(versionComponents[1], out versionNumber); |
837 | 804 | ||
838 | if (versionNumber >= 0.2f && MaxOutgoingTransferVersion >= versionNumber) | 805 | if (versionNumber >= 0.2f) |
839 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 806 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
840 | else | 807 | else |
841 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 808 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
@@ -1515,7 +1482,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1515 | } | 1482 | } |
1516 | 1483 | ||
1517 | // Check to see if we have access to the target region. | 1484 | // Check to see if we have access to the target region. |
1518 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); | 1485 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion); |
1519 | if (neighbourRegion != null | 1486 | if (neighbourRegion != null |
1520 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason)) | 1487 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason)) |
1521 | { | 1488 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index adf3a91..3800b3f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -48,11 +48,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Version of this service. | 49 | /// Version of this service. |
50 | /// </summary> | 50 | /// </summary> |
51 | /// <remarks> | ||
52 | /// Currently valid versions are "SIMULATION/0.1" and "SIMULATION/0.2" | ||
53 | /// </remarks> | ||
54 | public string ServiceVersion { get; set; } | 51 | public string ServiceVersion { get; set; } |
55 | private float m_VersionNumber = 0.3f; | ||
56 | 52 | ||
57 | /// <summary> | 53 | /// <summary> |
58 | /// Map region ID to scene. | 54 | /// Map region ID to scene. |
@@ -85,22 +81,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
85 | 81 | ||
86 | public void InitialiseService(IConfigSource configSource) | 82 | public void InitialiseService(IConfigSource configSource) |
87 | { | 83 | { |
88 | ServiceVersion = "SIMULATION/0.3"; | 84 | ServiceVersion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); |
89 | IConfig config = configSource.Configs["SimulationService"]; | 85 | m_log.InfoFormat("[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion); |
90 | if (config != null) | ||
91 | { | ||
92 | ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion); | ||
93 | |||
94 | if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2" && ServiceVersion != "SIMULATION/0.3") | ||
95 | throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); | ||
96 | |||
97 | string[] versionComponents = ServiceVersion.Split(new char[] { '/' }); | ||
98 | if (versionComponents.Length >= 2) | ||
99 | float.TryParse(versionComponents[1], out m_VersionNumber); | ||
100 | |||
101 | m_log.InfoFormat( | ||
102 | "[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion); | ||
103 | } | ||
104 | } | 86 | } |
105 | 87 | ||
106 | public void PostInitialise() | 88 | public void PostInitialise() |