mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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.
This commit is contained in:
@@ -57,12 +57,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
public const int DefaultMaxTransferDistance = 4095;
|
||||
public const bool WaitForAgentArrivedAtDestinationDefault = true;
|
||||
|
||||
public string OutgoingTransferVersionName { get; set; }
|
||||
public static readonly string OutgoingTransferVersionName = "SIMULATION";
|
||||
|
||||
/// <summary>
|
||||
/// Determine the maximum entity transfer version we will use for teleports.
|
||||
/// Determine the entity transfer version we will use for teleports.
|
||||
/// </summary>
|
||||
public float MaxOutgoingTransferVersion { get; set; }
|
||||
public static readonly float OutgoingTransferVersion = VersionInfo.SimulationServiceVersion;
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// <param name="source"></param>
|
||||
protected virtual void InitialiseCommon(IConfigSource source)
|
||||
{
|
||||
string transferVersionName = "SIMULATION";
|
||||
float maxTransferVersion = 0.3f;
|
||||
|
||||
IConfig hypergridConfig = source.Configs["Hypergrid"];
|
||||
if (hypergridConfig != null)
|
||||
{
|
||||
@@ -225,33 +222,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
IConfig transferConfig = source.Configs["EntityTransfer"];
|
||||
if (transferConfig != null)
|
||||
{
|
||||
string rawVersion
|
||||
= transferConfig.GetString(
|
||||
"MaxOutgoingTransferVersion",
|
||||
string.Format("{0}/{1}", transferVersionName, maxTransferVersion));
|
||||
|
||||
string[] rawVersionComponents = rawVersion.Split(new char[] { '/' });
|
||||
|
||||
bool versionValid = false;
|
||||
|
||||
if (rawVersionComponents.Length >= 2)
|
||||
versionValid = float.TryParse(rawVersionComponents[1], out maxTransferVersion);
|
||||
|
||||
if (!versionValid)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ENTITY TRANSFER MODULE]: MaxOutgoingTransferVersion {0} is invalid, using {1}",
|
||||
rawVersion, string.Format("{0}/{1}", transferVersionName, maxTransferVersion));
|
||||
}
|
||||
else
|
||||
{
|
||||
transferVersionName = rawVersionComponents[0];
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[ENTITY TRANSFER MODULE]: MaxOutgoingTransferVersion set to {0}",
|
||||
string.Format("{0}/{1}", transferVersionName, maxTransferVersion));
|
||||
}
|
||||
|
||||
DisableInterRegionTeleportCancellation
|
||||
= transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false);
|
||||
|
||||
@@ -265,9 +235,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
MaxTransferDistance = DefaultMaxTransferDistance;
|
||||
}
|
||||
|
||||
OutgoingTransferVersionName = transferVersionName;
|
||||
MaxOutgoingTransferVersion = maxTransferVersion;
|
||||
|
||||
m_entityTransferStateMachine = new EntityTransferStateMachine(this);
|
||||
|
||||
m_Enabled = true;
|
||||
@@ -760,7 +727,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
string reason;
|
||||
string version;
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
|
||||
if (!Scene.SimulationService.QueryAccess(
|
||||
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason))
|
||||
{
|
||||
@@ -779,8 +746,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
m_interRegionTeleportAttempts.Value++;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: {0} max transfer version is {1}/{2}, {3} max version is {4}",
|
||||
sp.Scene.Name, OutgoingTransferVersionName, MaxOutgoingTransferVersion, finalDestination.RegionName, version);
|
||||
"[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}",
|
||||
sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version);
|
||||
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
@@ -835,7 +802,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (versionComponents.Length >= 2)
|
||||
float.TryParse(versionComponents[1], out versionNumber);
|
||||
|
||||
if (versionNumber >= 0.2f && MaxOutgoingTransferVersion >= versionNumber)
|
||||
if (versionNumber >= 0.2f)
|
||||
TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
|
||||
else
|
||||
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
|
||||
}
|
||||
|
||||
// Check to see if we have access to the target region.
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
|
||||
if (neighbourRegion != null
|
||||
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user