Merge branch 'master' into 0.8.2-post-fixes

Conflicts:
	OpenSim/Framework/VersionInfo.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
0.8.2-post-fixes
Diva Canto 2015-11-10 20:34:18 -08:00
commit 465abf01c0
61 changed files with 311 additions and 166 deletions

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.Groups", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.Groups", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.OfflineIM", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.OfflineIM", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.ApplicationPlugins.RegionModulesController", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.ApplicationPlugins.RegionModulesController", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim", OpenSim.VersionInfo.VersionNumber)]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.ApplicationPlugins.RemoteController", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.ApplicationPlugins.RemoteController", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim", OpenSim.VersionInfo.VersionNumber)]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -873,8 +873,8 @@ namespace OpenSim.Framework.Servers
protected string GetVersionText() protected string GetVersionText()
{ {
return String.Format("Version: {0} (interface version {1}, SIMULATION/{2})", return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})",
m_version, VersionInfo.MajorInterfaceVersion, VersionInfo.SimulationServiceVersion); m_version, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax);
} }
/// <summary> /// <summary>
@ -1045,4 +1045,4 @@ namespace OpenSim.Framework.Servers
/// </summary> /// </summary>
protected virtual void ShutdownSpecific() {} protected virtual void ShutdownSpecific() {}
} }
} }

View File

@ -1818,17 +1818,26 @@ namespace OpenSim.Framework
/// <returns></returns> /// <returns></returns>
public static byte[] StringToBytes256(string str) public static byte[] StringToBytes256(string str)
{ {
if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; } if (String.IsNullOrEmpty(str))
if (str.Length > 254) str = str.Remove(254); return Utils.EmptyBytes;
if (!str.EndsWith("\0")) { str += "\0"; }
if (!str.EndsWith("\0"))
str += "\0";
// Because this is UTF-8 encoding and not ASCII, it's possible we // Because this is UTF-8 encoding and not ASCII, it's possible we
// might have gotten an oversized array even after the string trim // might have gotten an oversized array even after the string trim
byte[] data = UTF8.GetBytes(str); byte[] data = UTF8.GetBytes(str);
if (data.Length > 256) if (data.Length > 256)
{ {
Array.Resize<byte>(ref data, 256); int cut = 255;
data[255] = 0; if((data[cut] & 0x80 ) != 0 )
{
while(cut > 0 && (data[cut] & 0xc0) != 0xc0)
cut--;
}
Array.Resize<byte>(ref data, cut + 1);
data[cut] = 0;
} }
return data; return data;
@ -1860,17 +1869,26 @@ namespace OpenSim.Framework
/// <returns></returns> /// <returns></returns>
public static byte[] StringToBytes1024(string str) public static byte[] StringToBytes1024(string str)
{ {
if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; } if (String.IsNullOrEmpty(str))
if (str.Length > 1023) str = str.Remove(1023); return Utils.EmptyBytes;
if (!str.EndsWith("\0")) { str += "\0"; }
if (!str.EndsWith("\0"))
str += "\0";
// Because this is UTF-8 encoding and not ASCII, it's possible we // Because this is UTF-8 encoding and not ASCII, it's possible we
// might have gotten an oversized array even after the string trim // might have gotten an oversized array even after the string trim
byte[] data = UTF8.GetBytes(str); byte[] data = UTF8.GetBytes(str);
if (data.Length > 1024) if (data.Length > 1024)
{ {
Array.Resize<byte>(ref data, 1024); int cut = 1023;
data[1023] = 0; if((data[cut] & 0x80 ) != 0 )
{
while(cut > 0 && (data[cut] & 0xc0) != 0xc0)
cut--;
}
Array.Resize<byte>(ref data, cut + 1);
data[cut] = 0;
} }
return data; return data;

View File

@ -31,6 +31,8 @@ namespace OpenSim
{ {
public const string VersionNumber = "0.8.2.0"; public const string VersionNumber = "0.8.2.0";
private const Flavour VERSION_FLAVOUR = Flavour.RC1; private const Flavour VERSION_FLAVOUR = Flavour.RC1;
public const string VersionNumber = "0.8.3.0";
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour public enum Flavour
{ {
@ -61,7 +63,9 @@ namespace OpenSim
/// This is the external interface version. It is separate from the OpenSimulator project version. /// This is the external interface version. It is separate from the OpenSimulator project version.
/// ///
/// </value> /// </value>
public readonly static int MajorInterfaceVersion = 8; /// Commented because it's not used anymore, see below for new
/// versioning method.
//public readonly static int MajorInterfaceVersion = 8;
/// <summary> /// <summary>
/// This rules versioning regarding teleports, and compatibility between simulators in that regard. /// This rules versioning regarding teleports, and compatibility between simulators in that regard.
@ -80,6 +84,9 @@ namespace OpenSim
/// "SIMULATION/0.1" /// "SIMULATION/0.1"
/// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before. /// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before.
/// </remarks> /// </remarks>
public readonly static float SimulationServiceVersion = 0.3f; public readonly static float SimulationServiceVersionAcceptedMin = 0.3f;
public readonly static float SimulationServiceVersionAcceptedMax = 0.4f;
public readonly static float SimulationServiceVersionSupportedMin = 0.3f;
public readonly static float SimulationServiceVersionSupportedMax = 0.4f;
} }
} }

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: AddinRoot("OpenSim", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinRoot("OpenSim", OpenSim.VersionInfo.VersionNumber)]
[assembly: ImportAddinAssembly("OpenSim.Framework.dll")] [assembly: ImportAddinAssembly("OpenSim.Framework.dll")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("LindenUDP", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("LindenUDP", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -802,6 +802,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0)); Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
} }
/*
[Test] [Test]
public void TestSameSimulatorNeighbouringRegionsTeleportV1() public void TestSameSimulatorNeighbouringRegionsTeleportV1()
{ {
@ -841,7 +842,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule()); sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule());
// FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour
lscm.ServiceVersion = "SIMULATION/0.1"; lscm.ServiceVersion = 0.1f;
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1); UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1);
@ -909,6 +910,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
// Check events // Check events
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0)); Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
} }
*/
[Test] [Test]
public void TestSameSimulatorNeighbouringRegionsTeleportV2() public void TestSameSimulatorNeighbouringRegionsTeleportV2()

View File

@ -57,13 +57,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public const int DefaultMaxTransferDistance = 4095; public const int DefaultMaxTransferDistance = 4095;
public const bool WaitForAgentArrivedAtDestinationDefault = true; public const bool WaitForAgentArrivedAtDestinationDefault = true;
public static readonly string OutgoingTransferVersionName = "SIMULATION";
/// <summary>
/// Determine the entity transfer version we will use for teleports.
/// </summary>
public static readonly float OutgoingTransferVersion = VersionInfo.SimulationServiceVersion;
/// <summary> /// <summary>
/// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
/// </summary> /// </summary>
@ -726,10 +719,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.Name, sp.Scene.Name, finalDestination.RegionName); sp.Name, sp.Scene.Name, finalDestination.RegionName);
string reason; string reason;
string version; EntityTransferContext ctx = new EntityTransferContext();
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
if (!Scene.SimulationService.QueryAccess( if (!Scene.SimulationService.QueryAccess(
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason)) finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, sp.Scene.GetFormatsOffered(), ctx, out reason))
{ {
sp.ControllingClient.SendTeleportFailed(reason); sp.ControllingClient.SendTeleportFailed(reason);
@ -746,8 +739,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_interRegionTeleportAttempts.Value++; m_interRegionTeleportAttempts.Value++;
m_log.DebugFormat( m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}", "[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}",
sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version); sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion);
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions // both regions
@ -795,21 +788,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
} }
// We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing // We're going to fallback to V1 if the destination gives us anything smaller than 0.2
// use of the earlier protocol if (ctx.OutboundVersion >= 0.2f)
float versionNumber = 0.1f; TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, ctx, out reason);
string[] versionComponents = version.Split(new char[] { '/' });
if (versionComponents.Length >= 2)
float.TryParse(versionComponents[1], out versionNumber);
if (versionNumber >= 0.2f)
TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
else else
TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, ctx, out reason);
} }
private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, string version, out string reason) IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, EntityTransferContext ctx, out string reason)
{ {
ulong destinationHandle = finalDestination.RegionHandle; ulong destinationHandle = finalDestination.RegionHandle;
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
@ -1022,13 +1009,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
/*
// TODO: This may be 0.6. Check if still needed
// For backwards compatibility // For backwards compatibility
if (version == "Unknown" || version == string.Empty) if (version == 0f)
{ {
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one..."); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one...");
CrossAttachmentsIntoNewRegion(finalDestination, sp, true); CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
} }
*/
// May need to logout or other cleanup // May need to logout or other cleanup
AgentHasMovedAway(sp, logout); AgentHasMovedAway(sp, logout);
@ -1064,7 +1054,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, string version, out string reason) IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, EntityTransferContext ctx, out string reason)
{ {
ulong destinationHandle = finalDestination.RegionHandle; ulong destinationHandle = finalDestination.RegionHandle;
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
@ -1444,9 +1434,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// point is actually in. // point is actually in.
// Returns the coordinates and information of the new region or 'null' of it doesn't exist. // Returns the coordinates and information of the new region or 'null' of it doesn't exist.
public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos,
out string version, out Vector3 newpos, out string failureReason) EntityTransferContext ctx, out Vector3 newpos, out string failureReason)
{ {
version = String.Empty;
newpos = pos; newpos = pos;
failureReason = string.Empty; failureReason = string.Empty;
string homeURI = scene.GetAgentHomeURI(agentID); string homeURI = scene.GetAgentHomeURI(agentID);
@ -1482,9 +1471,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
// Check to see if we have access to the target region. // Check to see if we have access to the target region.
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
if (neighbourRegion != null if (neighbourRegion != null
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason)) && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, scene.GetFormatsOffered(), ctx, out failureReason))
{ {
// remember banned // remember banned
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
@ -1515,11 +1503,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public bool Cross(ScenePresence agent, bool isFlying) public bool Cross(ScenePresence agent, bool isFlying)
{ {
Vector3 newpos; Vector3 newpos;
string version; EntityTransferContext ctx = new EntityTransferContext();
string failureReason; string failureReason;
GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition,
out version, out newpos, out failureReason); ctx, out newpos, out failureReason);
if (neighbourRegion == null) if (neighbourRegion == null)
{ {
agent.ControllingClient.SendAlertMessage(failureReason); agent.ControllingClient.SendAlertMessage(failureReason);
@ -1529,7 +1517,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.IsInTransit = true; agent.IsInTransit = true;
CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync; CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;
d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d); d.BeginInvoke(agent, newpos, neighbourRegion, isFlying, ctx, CrossAgentToNewRegionCompleted, d);
Scene.EventManager.TriggerCrossAgentToNewRegion(agent, isFlying, neighbourRegion); Scene.EventManager.TriggerCrossAgentToNewRegion(agent, isFlying, neighbourRegion);
@ -1627,7 +1615,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// </summary> /// </summary>
public ScenePresence CrossAgentToNewRegionAsync( public ScenePresence CrossAgentToNewRegionAsync(
ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
bool isFlying, string version) bool isFlying, EntityTransferContext ctx)
{ {
try try
{ {
@ -1646,7 +1634,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.ResetFromTransit(agent.UUID); m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
} }
CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, version); CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx);
} }
catch (Exception e) catch (Exception e)
{ {
@ -1703,7 +1691,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
bool isFlying, string version) bool isFlying, EntityTransferContext ctx)
{ {
agent.ControllingClient.RequestClientInfo(); agent.ControllingClient.RequestClientInfo();
@ -1755,14 +1743,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.SendOtherAgentsAvatarDataToClient(); agent.SendOtherAgentsAvatarDataToClient();
agent.SendOtherAgentsAppearanceToClient(); agent.SendOtherAgentsAppearanceToClient();
// TODO: Check since what version this wasn't needed anymore. May be as old as 0.6
/*
// Backwards compatibility. Best effort // Backwards compatibility. Best effort
if (version == "Unknown" || version == string.Empty) if (version == 0f)
{ {
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
} }
*/
// Next, let's close the child agent connections that are too far away. // Next, let's close the child agent connections that are too far away.
uint neighbourx; uint neighbourx;
uint neighboury; uint neighboury;

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.Region.CoreModules", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.Region.CoreModules", OpenSim.VersionInfo.VersionNumber)]

View File

@ -45,11 +45,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Version of this service.
/// </summary>
public string ServiceVersion { get; set; }
/// <summary> /// <summary>
/// Map region ID to scene. /// Map region ID to scene.
/// </summary> /// </summary>
@ -81,8 +76,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
public void InitialiseService(IConfigSource configSource) public void InitialiseService(IConfigSource configSource)
{ {
ServiceVersion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
m_log.InfoFormat("[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion);
} }
public void PostInitialise() public void PostInitialise()
@ -251,10 +244,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return true; return true;
} }
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, EntityTransferContext ctx, out string reason)
{ {
reason = "Communications failure"; reason = "Communications failure";
version = ServiceVersion;
if (destination == null) if (destination == null)
return false; return false;
@ -263,19 +255,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
// m_log.DebugFormat( // m_log.DebugFormat(
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
// s.RegionInfo.RegionName, destination.RegionHandle); // s.RegionInfo.RegionName, destination.RegionHandle);
uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; uint sizeX = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
uint sizeY = m_scenes[destination.RegionID].RegionInfo.RegionSizeY;
float theirVersionNumber = 0f;
string[] versionComponents = theirversion.Split(new char[] { '/' });
if (versionComponents.Length >= 2)
float.TryParse(versionComponents[1], out theirVersionNumber);
// Var regions here, and the requesting simulator is in an older version. // Var regions here, and the requesting simulator is in an older version.
// We will forbide this, because it crashes the viewers // We will forbide this, because it crashes the viewers
if (theirVersionNumber < 0.3f && size > 256) if (ctx.OutboundVersion < 0.3f && (sizeX != 256 || sizeY != 256))
{ {
reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from older simulator was denied");
return false; return false;
} }

View File

@ -205,21 +205,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return m_remoteConnector.UpdateAgent(destination, cAgentData); return m_remoteConnector.UpdateAgent(destination, cAgentData);
} }
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, EntityTransferContext ctx, out string reason)
{ {
reason = "Communications failure"; reason = "Communications failure";
version = "Unknown";
if (destination == null) if (destination == null)
return false; return false;
// Try local first // Try local first
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason))
return true; return true;
// else do the remote thing // else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionID)) if (!m_localBackend.IsLocalRegion(destination.RegionID))
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason);
return false; return false;
} }

View File

@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
m_console.Commands.AddCommand( m_console.Commands.AddCommand(
"Regions", false, "region set", "Regions", false, "region set",
"region get", "region set",
"Set control information for the currently selected region.", "Set control information for the currently selected region.",
"Currently, the following parameters can be set:\n" "Currently, the following parameters can be set:\n"
+ "agent-limit <int> - Current root agent limit. This is persisted over restart.\n" + "agent-limit <int> - Current root agent limit. This is persisted over restart.\n"

View File

@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Interfaces namespace OpenSim.Region.Framework.Interfaces
{ {
public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx);
public interface IEntityTransferModule public interface IEntityTransferModule
{ {
@ -92,12 +92,12 @@ namespace OpenSim.Region.Framework.Interfaces
void EnableChildAgent(ScenePresence agent, GridRegion region); void EnableChildAgent(ScenePresence agent, GridRegion region);
GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, EntityTransferContext ctx,
out Vector3 newpos, out string reason); out Vector3 newpos, out string reason);
void Cross(SceneObjectGroup sog, Vector3 position, bool silent); void Cross(SceneObjectGroup sog, Vector3 position, bool silent);
ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx);
bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition); bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition);
} }

View File

@ -31,6 +31,6 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: AddinRoot("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinRoot("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -41,6 +41,7 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.PhysicsModules.SharedBase; using OpenSim.Region.PhysicsModules.SharedBase;
using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Framework.Scenes.Serialization;
using PermissionMask = OpenSim.Framework.PermissionMask; using PermissionMask = OpenSim.Framework.PermissionMask;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.Framework.Scenes namespace OpenSim.Region.Framework.Scenes
{ {
@ -447,12 +448,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns> /// <returns></returns>
public bool IsAttachmentCheckFull() public bool IsAttachmentCheckFull()
{ {
if(IsAttachment) return (IsAttachment ||
return true; (m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0));
IsAttachment = (m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0);
return IsAttachment;
} }
private struct avtocrossInfo private struct avtocrossInfo
@ -480,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes
) )
{ {
IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
string version = String.Empty; EntityTransferContext ctx = new EntityTransferContext();
Vector3 newpos = Vector3.Zero; Vector3 newpos = Vector3.Zero;
string failureReason = String.Empty; string failureReason = String.Empty;
OpenSim.Services.Interfaces.GridRegion destination = null; OpenSim.Services.Interfaces.GridRegion destination = null;
@ -500,7 +497,7 @@ namespace OpenSim.Region.Framework.Scenes
// We set the avatar position as being the object // We set the avatar position as being the object
// position to get the region to send to // position to get the region to send to
if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out version, out newpos, out failureReason)) == null) if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, ctx, out newpos, out failureReason)) == null)
{ {
canCross = false; canCross = false;
break; break;
@ -561,14 +558,14 @@ namespace OpenSim.Region.Framework.Scenes
// threads rather than any replace threadpool that we might be using. // threads rather than any replace threadpool that we might be using.
if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest)
{ {
entityTransfer.CrossAgentToNewRegionAsync(av, val, destination, av.Flying, version); entityTransfer.CrossAgentToNewRegionAsync(av, val, destination, av.Flying, ctx);
CrossAgentToNewRegionCompleted(av); CrossAgentToNewRegionCompleted(av);
} }
else else
{ {
CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
d.BeginInvoke( d.BeginInvoke(
av, val, destination, av.Flying, version, av, val, destination, av.Flying, ctx,
ar => CrossAgentToNewRegionCompleted(d.EndInvoke(ar)), null); ar => CrossAgentToNewRegionCompleted(d.EndInvoke(ar)), null);
} }
} }

View File

@ -1753,8 +1753,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment if ((!isPhantom || isPhysical || _VolumeDetectActive)
&& !(Shape.PathCurve == (byte)Extrusion.Flexible)) && !ParentGroup.IsAttachmentCheckFull()
&& !(Shape.PathCurve == (byte)Extrusion.Flexible))
{ {
AddToPhysics(isPhysical, isPhantom, isPhysical); AddToPhysics(isPhysical, isPhantom, isPhysical);
} }
@ -4241,7 +4242,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
if (SetPhantom if (SetPhantom
|| ParentGroup.IsAttachment || ParentGroup.IsAttachmentCheckFull()
|| PhysicsShapeType == (byte)PhysShapeType.none || PhysicsShapeType == (byte)PhysShapeType.none
|| (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
{ {

View File

@ -105,6 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); // Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
} }
/*
[Test] [Test]
public void TestSameSimulatorIsolatedRegionsV1() public void TestSameSimulatorIsolatedRegionsV1()
{ {
@ -136,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
// FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour
lscm.ServiceVersion = "SIMULATION/0.1"; lscm.ServiceVersion = 0.1f;
Vector3 teleportPosition = new Vector3(10, 11, 12); Vector3 teleportPosition = new Vector3(10, 11, 12);
Vector3 teleportLookAt = new Vector3(20, 21, 22); Vector3 teleportLookAt = new Vector3(20, 21, 22);
@ -178,6 +179,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// position instead). // position instead).
// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); // Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
} }
*/
[Test] [Test]
public void TestSameSimulatorIsolatedRegionsV2() public void TestSameSimulatorIsolatedRegionsV2()
@ -488,6 +490,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// TestHelpers.DisableLogging(); // TestHelpers.DisableLogging();
} }
/*
[Test] [Test]
public void TestSameSimulatorNeighbouringRegionsV1() public void TestSameSimulatorNeighbouringRegionsV1()
{ {
@ -519,7 +522,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB);
// FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour
lscm.ServiceVersion = "SIMULATION/0.1"; lscm.ServiceVersion = 0.1f;
Vector3 teleportPosition = new Vector3(10, 11, 12); Vector3 teleportPosition = new Vector3(10, 11, 12);
Vector3 teleportLookAt = new Vector3(20, 21, 22); Vector3 teleportLookAt = new Vector3(20, 21, 22);
@ -573,6 +576,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// TestHelpers.DisableLogging(); // TestHelpers.DisableLogging();
} }
*/
[Test] [Test]
public void TestSameSimulatorNeighbouringRegionsV2() public void TestSameSimulatorNeighbouringRegionsV2()
@ -658,4 +662,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// TestHelpers.DisableLogging(); // TestHelpers.DisableLogging();
} }
} }
} }

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.Region.OptionalModules", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.Region.OptionalModules", OpenSim.VersionInfo.VersionNumber)]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.Region.PhysicsModule.BulletS", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.Region.PhysicsModule.BulletS", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.Region.PhysicsModules.Meshing", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.Region.PhysicsModules.Meshing", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]
[assembly: Addin("OpenSim.Region.ScriptEngine.XEngine", OpenSim.VersionInfo.VersionNumber)] [assembly: Addin("OpenSim.Region.ScriptEngine.XEngine", OpenSim.VersionInfo.VersionNumber)]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -145,9 +145,90 @@ namespace OpenSim.Server.Handlers.Simulation
if (args.ContainsKey("agent_home_uri")) if (args.ContainsKey("agent_home_uri"))
agentHomeURI = args["agent_home_uri"].AsString(); agentHomeURI = args["agent_home_uri"].AsString();
string theirVersion = string.Empty; // Decode the legacy (string) version and extract the number
float theirVersion = 0f;
if (args.ContainsKey("my_version")) if (args.ContainsKey("my_version"))
theirVersion = args["my_version"].AsString(); {
string theirVersionStr = args["my_version"].AsString();
string[] parts = theirVersionStr.Split(new char[] {'/'});
if (parts.Length > 1)
theirVersion = float.Parse(parts[1]);
}
// Decode the new versioning data
float minVersionRequired = 0f;
float maxVersionRequired = 0f;
float minVersionProvided = 0f;
float maxVersionProvided = 0f;
if (args.ContainsKey("simulation_service_supported_min"))
minVersionProvided = (float)args["simulation_service_supported_min"].AsReal();
if (args.ContainsKey("simulation_service_supported_max"))
maxVersionProvided = (float)args["simulation_service_supported_max"].AsReal();
if (args.ContainsKey("simulation_service_accepted_min"))
minVersionRequired = (float)args["simulation_service_accepted_min"].AsReal();
if (args.ContainsKey("simulation_service_accepted_max"))
maxVersionRequired = (float)args["simulation_service_accepted_max"].AsReal();
responsedata["int_response_code"] = HttpStatusCode.OK;
OSDMap resp = new OSDMap(3);
float version = 0f;
float outboundVersion = 0f;
float inboundVersion = 0f;
if (minVersionProvided == 0f) // string version or older
{
// If there is no version in the packet at all we're looking at 0.6 or
// even more ancient. Refuse it.
if(theirVersion == 0f)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString("Your region is running a old version of opensim no longer supported. Consider updating it");
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
version = theirVersion;
if (version < VersionInfo.SimulationServiceVersionAcceptedMin ||
version > VersionInfo.SimulationServiceVersionAcceptedMax )
{
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));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
}
else
{
// Test for no overlap
if (minVersionProvided > VersionInfo.SimulationServiceVersionAcceptedMax ||
maxVersionProvided < VersionInfo.SimulationServiceVersionAcceptedMin)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("Your region provide protocol versions {0} - {1} and we accept only {2} - {3}. No version overlap.", minVersionProvided, maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
if (minVersionRequired > VersionInfo.SimulationServiceVersionSupportedMax ||
maxVersionRequired < VersionInfo.SimulationServiceVersionSupportedMin)
{
resp["success"] = OSD.FromBoolean(false);
resp["reason"] = OSD.FromString(String.Format("You require region protocol versions {0} - {1} and we provide only {2} - {3}. No version overlap.", minVersionRequired, maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax));
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
return;
}
// Determine versions to use
// This is intentionally inverted. Inbound and Outbound refer to the direction of the transfer.
// Therefore outbound means from the sender to the receier and inbound means from the receiver to the sender.
// So outbound is what we will accept and inbound is what we will send. Confused yet?
outboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax);
inboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax);
}
List<UUID> features = new List<UUID>(); List<UUID> features = new List<UUID>();
@ -163,16 +244,24 @@ namespace OpenSim.Server.Handlers.Simulation
destination.RegionID = regionID; destination.RegionID = regionID;
string reason; string reason;
string version; // We're sending the version numbers down to the local connector to do the varregion check.
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, features, out version, out reason); EntityTransferContext ctx = new EntityTransferContext();
ctx.InboundVersion = inboundVersion;
ctx.OutboundVersion = outboundVersion;
if (minVersionProvided == 0f)
{
ctx.InboundVersion = version;
ctx.OutboundVersion = version;
}
responsedata["int_response_code"] = HttpStatusCode.OK; bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason);
OSDMap resp = new OSDMap(3);
resp["success"] = OSD.FromBoolean(result); resp["success"] = OSD.FromBoolean(result);
resp["reason"] = OSD.FromString(reason); resp["reason"] = OSD.FromString(reason);
resp["version"] = OSD.FromString(version); string legacyVersion = String.Format("SIMULATION/{0}", version);
resp["version"] = OSD.FromString(legacyVersion);
resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion);
resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion);
resp["variable_wearables_count_supported"] = OSD.FromBoolean(true); resp["variable_wearables_count_supported"] = OSD.FromBoolean(true);
OSDArray featuresWanted = new OSDArray(); OSDArray featuresWanted = new OSDArray();

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -282,10 +282,9 @@ namespace OpenSim.Services.Connectors.Simulation
} }
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> featuresAvailable, EntityTransferContext ctx, out string reason)
{ {
reason = "Failed to contact destination"; reason = "Failed to contact destination";
version = "Unknown";
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position);
@ -298,7 +297,14 @@ namespace OpenSim.Services.Connectors.Simulation
OSDMap request = new OSDMap(); OSDMap request = new OSDMap();
request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
request.Add("position", OSD.FromString(position.ToString())); request.Add("position", OSD.FromString(position.ToString()));
request.Add("my_version", OSD.FromString(myversion)); // To those who still understad this field, we're telling them
// the lowest version just to be safe
request.Add("my_version", OSD.FromString(String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersionSupportedMin)));
// New simulation service negotiation
request.Add("simulation_service_supported_min", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMin));
request.Add("simulation_service_supported_max", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMax));
request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin));
request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax));
OSDArray features = new OSDArray(); OSDArray features = new OSDArray();
foreach (UUID feature in featuresAvailable) foreach (UUID feature in featuresAvailable)
@ -322,15 +328,32 @@ namespace OpenSim.Services.Connectors.Simulation
success = data["success"]; success = data["success"];
reason = data["reason"].AsString(); reason = data["reason"].AsString();
if (data["version"] != null && data["version"].AsString() != string.Empty) // We will need to plumb this and start sing the outbound version as well
version = data["version"].AsString(); // TODO: lay the pipe for version plumbing
if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null)
{
ctx.InboundVersion = (float)data["negotiated_inbound_version"].AsReal();
ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal();
}
else if (data["version"] != null && data["version"].AsString() != string.Empty)
{
string versionString = data["version"].AsString();
String[] parts = versionString.Split(new char[] {'/'});
if (parts.Length > 1)
{
ctx.InboundVersion = float.Parse(parts[1]);
ctx.OutboundVersion = float.Parse(parts[1]);
}
}
if (data.ContainsKey("variable_wearables_count_supported"))
ctx.VariableWearablesSupported = true;
m_log.DebugFormat( m_log.DebugFormat(
"[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})", "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}",
uri, success, reason, version, data["version"].AsString()); uri, success, reason, ctx.InboundVersion, ctx.OutboundVersion);
} }
if (!success) if (!success || ctx.InboundVersion == 0f || ctx.OutboundVersion == 0f)
{ {
// If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the
// actual failure message // actual failure message

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -452,12 +452,11 @@ namespace OpenSim.Services.HypergridService
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag);
string version; EntityTransferContext ctx = new EntityTransferContext();
string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
if (!m_SimulationService.QueryAccess( if (!m_SimulationService.QueryAccess(
destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(), destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(),
true, aCircuit.startpos, myversion, new List<UUID>(), out version, out reason)) true, aCircuit.startpos, new List<UUID>(), ctx, out reason))
return false; return false;
return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -162,10 +162,15 @@ namespace OpenSim.Services.Interfaces
} }
// Visual Params // Visual Params
string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; //string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
byte[] binary = appearance.VisualParams; //byte[] binary = appearance.VisualParams;
for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++)
byte[] binary = appearance.VisualParams;
string[] vps = new string[binary.Length];
for (int i = 0; i < binary.Length; i++)
{ {
vps[i] = binary[i].ToString(); vps[i] = binary[i].ToString();
} }
@ -202,7 +207,13 @@ namespace OpenSim.Services.Interfaces
appearance.Serial = Int32.Parse(Data["Serial"]); appearance.Serial = Int32.Parse(Data["Serial"]);
if (Data.ContainsKey("AvatarHeight")) if (Data.ContainsKey("AvatarHeight"))
appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); {
float h = float.Parse(Data["AvatarHeight"]);
if( h == 0f)
h = 1.9f;
appearance.AvatarHeight = h;
}
// Legacy Wearables // Legacy Wearables
if (Data.ContainsKey("BodyItem")) if (Data.ContainsKey("BodyItem"))
@ -273,9 +284,13 @@ namespace OpenSim.Services.Interfaces
if (Data.ContainsKey("VisualParams")) if (Data.ContainsKey("VisualParams"))
{ {
string[] vps = Data["VisualParams"].Split(new char[] {','}); string[] vps = Data["VisualParams"].Split(new char[] {','});
byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; //byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) //for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
byte[] binary = new byte[vps.Length];
for (int i = 0; i < vps.Length; i++)
binary[i] = (byte)Convert.ToInt32(vps[i]); binary[i] = (byte)Convert.ToInt32(vps[i]);
appearance.VisualParams = binary; appearance.VisualParams = binary;

View File

@ -34,6 +34,20 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Services.Interfaces namespace OpenSim.Services.Interfaces
{ {
public class EntityTransferContext
{
public EntityTransferContext()
{
InboundVersion = VersionInfo.SimulationServiceVersionAcceptedMax;
OutboundVersion = VersionInfo.SimulationServiceVersionSupportedMax;
VariableWearablesSupported = false;
}
public float InboundVersion { get; set; }
public float OutboundVersion { get; set; }
public bool VariableWearablesSupported { get; set; }
}
public interface ISimulationService public interface ISimulationService
{ {
/// <summary> /// <summary>
@ -92,7 +106,7 @@ namespace OpenSim.Services.Interfaces
/// <param name="version">Version that the target simulator is running</param> /// <param name="version">Version that the target simulator is running</param>
/// <param name="reason">[out] Optional error message</param> /// <param name="reason">[out] Optional error message</param>
/// <returns>True: ok; False: not allowed</returns> /// <returns>True: ok; False: not allowed</returns>
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason); bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, EntityTransferContext ctx, out string reason);
/// <summary> /// <summary>
/// Message from receiving region to departing region, telling it got contacted by the client. /// Message from receiving region to departing region, telling it got contacted by the client.

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -983,11 +983,10 @@ namespace OpenSim.Services.LLLoginService
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
{ {
string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); EntityTransferContext ctx = new EntityTransferContext();
string version;
if (!simConnector.QueryAccess( if (!simConnector.QueryAccess(
region, aCircuit.AgentID, null, true, aCircuit.startpos, myversion, new List<UUID>(), out version, out reason)) region, aCircuit.AgentID, null, true, aCircuit.startpos, new List<UUID>(), ctx, out reason))
return false; return false;
return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("0.8.2.*")] [assembly: AssemblyVersion("0.8.3.*")]