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.cs0.8.2-post-fixes
commit
465abf01c0
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Groups", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.OfflineIM", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.ApplicationPlugins.RegionModulesController", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.ApplicationPlugins.RemoteController", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -873,8 +873,8 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
protected string GetVersionText()
|
||||
{
|
||||
return String.Format("Version: {0} (interface version {1}, SIMULATION/{2})",
|
||||
m_version, VersionInfo.MajorInterfaceVersion, VersionInfo.SimulationServiceVersion);
|
||||
return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})",
|
||||
m_version, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1818,17 +1818,26 @@ namespace OpenSim.Framework
|
|||
/// <returns></returns>
|
||||
public static byte[] StringToBytes256(string str)
|
||||
{
|
||||
if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; }
|
||||
if (str.Length > 254) str = str.Remove(254);
|
||||
if (!str.EndsWith("\0")) { str += "\0"; }
|
||||
if (String.IsNullOrEmpty(str))
|
||||
return Utils.EmptyBytes;
|
||||
|
||||
if (!str.EndsWith("\0"))
|
||||
str += "\0";
|
||||
|
||||
// Because this is UTF-8 encoding and not ASCII, it's possible we
|
||||
// might have gotten an oversized array even after the string trim
|
||||
byte[] data = UTF8.GetBytes(str);
|
||||
|
||||
if (data.Length > 256)
|
||||
{
|
||||
Array.Resize<byte>(ref data, 256);
|
||||
data[255] = 0;
|
||||
int cut = 255;
|
||||
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;
|
||||
|
@ -1860,17 +1869,26 @@ namespace OpenSim.Framework
|
|||
/// <returns></returns>
|
||||
public static byte[] StringToBytes1024(string str)
|
||||
{
|
||||
if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; }
|
||||
if (str.Length > 1023) str = str.Remove(1023);
|
||||
if (!str.EndsWith("\0")) { str += "\0"; }
|
||||
if (String.IsNullOrEmpty(str))
|
||||
return Utils.EmptyBytes;
|
||||
|
||||
if (!str.EndsWith("\0"))
|
||||
str += "\0";
|
||||
|
||||
// Because this is UTF-8 encoding and not ASCII, it's possible we
|
||||
// might have gotten an oversized array even after the string trim
|
||||
byte[] data = UTF8.GetBytes(str);
|
||||
|
||||
if (data.Length > 1024)
|
||||
{
|
||||
Array.Resize<byte>(ref data, 1024);
|
||||
data[1023] = 0;
|
||||
int cut = 1023;
|
||||
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;
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace OpenSim
|
|||
{
|
||||
public const string VersionNumber = "0.8.2.0";
|
||||
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
|
||||
{
|
||||
|
@ -61,7 +63,9 @@ namespace OpenSim
|
|||
/// This is the external interface version. It is separate from the OpenSimulator project version.
|
||||
///
|
||||
/// </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>
|
||||
/// This rules versioning regarding teleports, and compatibility between simulators in that regard.
|
||||
|
@ -80,6 +84,9 @@ namespace OpenSim
|
|||
/// "SIMULATION/0.1"
|
||||
/// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before.
|
||||
/// </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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: AddinRoot("OpenSim", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: ImportAddinAssembly("OpenSim.Framework.dll")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("LindenUDP", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -802,6 +802,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
|||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
/*
|
||||
[Test]
|
||||
public void TestSameSimulatorNeighbouringRegionsTeleportV1()
|
||||
{
|
||||
|
@ -841,7 +842,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
|||
sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule());
|
||||
|
||||
// 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);
|
||||
|
||||
|
@ -909,6 +910,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
|||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
|
||||
}
|
||||
*/
|
||||
|
||||
[Test]
|
||||
public void TestSameSimulatorNeighbouringRegionsTeleportV2()
|
||||
|
|
|
@ -57,13 +57,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
public const int DefaultMaxTransferDistance = 4095;
|
||||
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>
|
||||
/// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
|
||||
/// </summary>
|
||||
|
@ -726,10 +719,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
sp.Name, sp.Scene.Name, finalDestination.RegionName);
|
||||
|
||||
string reason;
|
||||
string version;
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
|
||||
EntityTransferContext ctx = new EntityTransferContext();
|
||||
|
||||
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);
|
||||
|
||||
|
@ -746,8 +739,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
m_interRegionTeleportAttempts.Value++;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}",
|
||||
sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version);
|
||||
"[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}",
|
||||
sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion);
|
||||
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
|
@ -795,21 +788,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
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
|
||||
// use of the earlier protocol
|
||||
float versionNumber = 0.1f;
|
||||
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);
|
||||
// We're going to fallback to V1 if the destination gives us anything smaller than 0.2
|
||||
if (ctx.OutboundVersion >= 0.2f)
|
||||
TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, ctx, out reason);
|
||||
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,
|
||||
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;
|
||||
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);
|
||||
|
||||
/*
|
||||
// TODO: This may be 0.6. Check if still needed
|
||||
// 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
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one...");
|
||||
CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
|
||||
}
|
||||
*/
|
||||
|
||||
// May need to logout or other cleanup
|
||||
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,
|
||||
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;
|
||||
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
||||
|
@ -1444,9 +1434,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// point is actually in.
|
||||
// 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,
|
||||
out string version, out Vector3 newpos, out string failureReason)
|
||||
EntityTransferContext ctx, out Vector3 newpos, out string failureReason)
|
||||
{
|
||||
version = String.Empty;
|
||||
newpos = pos;
|
||||
failureReason = string.Empty;
|
||||
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.
|
||||
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))
|
||||
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, scene.GetFormatsOffered(), ctx, out failureReason))
|
||||
{
|
||||
// remember banned
|
||||
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
|
||||
|
@ -1515,11 +1503,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
public bool Cross(ScenePresence agent, bool isFlying)
|
||||
{
|
||||
Vector3 newpos;
|
||||
string version;
|
||||
EntityTransferContext ctx = new EntityTransferContext();
|
||||
string failureReason;
|
||||
|
||||
GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition,
|
||||
out version, out newpos, out failureReason);
|
||||
ctx, out newpos, out failureReason);
|
||||
if (neighbourRegion == null)
|
||||
{
|
||||
agent.ControllingClient.SendAlertMessage(failureReason);
|
||||
|
@ -1529,7 +1517,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
agent.IsInTransit = true;
|
||||
|
||||
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);
|
||||
|
||||
|
@ -1627,7 +1615,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
/// </summary>
|
||||
public ScenePresence CrossAgentToNewRegionAsync(
|
||||
ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
|
||||
bool isFlying, string version)
|
||||
bool isFlying, EntityTransferContext ctx)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1646,7 +1634,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
||||
}
|
||||
|
||||
CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, version);
|
||||
CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -1703,7 +1691,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
}
|
||||
|
||||
public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
|
||||
bool isFlying, string version)
|
||||
bool isFlying, EntityTransferContext ctx)
|
||||
{
|
||||
agent.ControllingClient.RequestClientInfo();
|
||||
|
||||
|
@ -1755,14 +1743,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
agent.SendOtherAgentsAvatarDataToClient();
|
||||
agent.SendOtherAgentsAppearanceToClient();
|
||||
|
||||
// TODO: Check since what version this wasn't needed anymore. May be as old as 0.6
|
||||
/*
|
||||
// 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...");
|
||||
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
|
||||
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
||||
}
|
||||
|
||||
*/
|
||||
// Next, let's close the child agent connections that are too far away.
|
||||
uint neighbourx;
|
||||
uint neighboury;
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
||||
[assembly: Addin("OpenSim.Region.CoreModules", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -45,11 +45,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Version of this service.
|
||||
/// </summary>
|
||||
public string ServiceVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Map region ID to scene.
|
||||
/// </summary>
|
||||
|
@ -81,8 +76,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
|
||||
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()
|
||||
|
@ -251,10 +244,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
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";
|
||||
version = ServiceVersion;
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
|
@ -263,19 +255,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
// m_log.DebugFormat(
|
||||
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||
uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
|
||||
|
||||
float theirVersionNumber = 0f;
|
||||
string[] versionComponents = theirversion.Split(new char[] { '/' });
|
||||
if (versionComponents.Length >= 2)
|
||||
float.TryParse(versionComponents[1], out theirVersionNumber);
|
||||
uint sizeX = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
|
||||
uint sizeY = m_scenes[destination.RegionID].RegionInfo.RegionSizeY;
|
||||
|
||||
// Var regions here, and the requesting simulator is in an older version.
|
||||
// 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.";
|
||||
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;
|
||||
|
||||
}
|
||||
|
|
|
@ -205,21 +205,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
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";
|
||||
version = "Unknown";
|
||||
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
// 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;
|
||||
|
||||
// else do the remote thing
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
|||
|
||||
m_console.Commands.AddCommand(
|
||||
"Regions", false, "region set",
|
||||
"region get",
|
||||
"region set",
|
||||
"Set control information for the currently selected region.",
|
||||
"Currently, the following parameters can be set:\n"
|
||||
+ "agent-limit <int> - Current root agent limit. This is persisted over restart.\n"
|
||||
|
|
|
@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes;
|
|||
|
||||
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
|
||||
{
|
||||
|
@ -92,12 +92,12 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
[assembly: AddinRoot("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ using OpenSim.Region.Framework.Interfaces;
|
|||
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
using PermissionMask = OpenSim.Framework.PermissionMask;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
|
@ -447,12 +448,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <returns></returns>
|
||||
public bool IsAttachmentCheckFull()
|
||||
{
|
||||
if(IsAttachment)
|
||||
return true;
|
||||
|
||||
IsAttachment = (m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0);
|
||||
|
||||
return IsAttachment;
|
||||
return (IsAttachment ||
|
||||
(m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0));
|
||||
}
|
||||
|
||||
private struct avtocrossInfo
|
||||
|
@ -480,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
)
|
||||
{
|
||||
IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
||||
string version = String.Empty;
|
||||
EntityTransferContext ctx = new EntityTransferContext();
|
||||
Vector3 newpos = Vector3.Zero;
|
||||
string failureReason = String.Empty;
|
||||
OpenSim.Services.Interfaces.GridRegion destination = null;
|
||||
|
@ -500,7 +497,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
// We set the avatar position as being the object
|
||||
// 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;
|
||||
break;
|
||||
|
@ -561,14 +558,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// threads rather than any replace threadpool that we might be using.
|
||||
if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest)
|
||||
{
|
||||
entityTransfer.CrossAgentToNewRegionAsync(av, val, destination, av.Flying, version);
|
||||
entityTransfer.CrossAgentToNewRegionAsync(av, val, destination, av.Flying, ctx);
|
||||
CrossAgentToNewRegionCompleted(av);
|
||||
}
|
||||
else
|
||||
{
|
||||
CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
|
||||
d.BeginInvoke(
|
||||
av, val, destination, av.Flying, version,
|
||||
av, val, destination, av.Flying, ctx,
|
||||
ar => CrossAgentToNewRegionCompleted(d.EndInvoke(ar)), null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1753,8 +1753,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment
|
||||
&& !(Shape.PathCurve == (byte)Extrusion.Flexible))
|
||||
if ((!isPhantom || isPhysical || _VolumeDetectActive)
|
||||
&& !ParentGroup.IsAttachmentCheckFull()
|
||||
&& !(Shape.PathCurve == (byte)Extrusion.Flexible))
|
||||
{
|
||||
AddToPhysics(isPhysical, isPhantom, isPhysical);
|
||||
}
|
||||
|
@ -4241,7 +4242,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
if (SetPhantom
|
||||
|| ParentGroup.IsAttachment
|
||||
|| ParentGroup.IsAttachmentCheckFull()
|
||||
|| PhysicsShapeType == (byte)PhysShapeType.none
|
||||
|| (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
|
||||
{
|
||||
|
|
|
@ -105,6 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
|
||||
}
|
||||
|
||||
/*
|
||||
[Test]
|
||||
public void TestSameSimulatorIsolatedRegionsV1()
|
||||
{
|
||||
|
@ -136,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
|
||||
|
||||
// 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 teleportLookAt = new Vector3(20, 21, 22);
|
||||
|
@ -178,6 +179,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
// position instead).
|
||||
// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
|
||||
}
|
||||
*/
|
||||
|
||||
[Test]
|
||||
public void TestSameSimulatorIsolatedRegionsV2()
|
||||
|
@ -488,6 +490,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
// TestHelpers.DisableLogging();
|
||||
}
|
||||
|
||||
/*
|
||||
[Test]
|
||||
public void TestSameSimulatorNeighbouringRegionsV1()
|
||||
{
|
||||
|
@ -519,7 +522,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB);
|
||||
|
||||
// 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 teleportLookAt = new Vector3(20, 21, 22);
|
||||
|
@ -573,6 +576,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
|
||||
// TestHelpers.DisableLogging();
|
||||
}
|
||||
*/
|
||||
|
||||
[Test]
|
||||
public void TestSameSimulatorNeighbouringRegionsV2()
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
||||
[assembly: Addin("OpenSim.Region.OptionalModules", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Region.PhysicsModule.BulletS", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Region.PhysicsModules.Meshing", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Region.ScriptEngine.XEngine", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -145,9 +145,90 @@ namespace OpenSim.Server.Handlers.Simulation
|
|||
if (args.ContainsKey("agent_home_uri"))
|
||||
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"))
|
||||
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>();
|
||||
|
||||
|
@ -163,16 +244,24 @@ namespace OpenSim.Server.Handlers.Simulation
|
|||
destination.RegionID = regionID;
|
||||
|
||||
string reason;
|
||||
string version;
|
||||
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, features, out version, out reason);
|
||||
// We're sending the version numbers down to the local connector to do the varregion check.
|
||||
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;
|
||||
|
||||
OSDMap resp = new OSDMap(3);
|
||||
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason);
|
||||
|
||||
resp["success"] = OSD.FromBoolean(result);
|
||||
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);
|
||||
|
||||
OSDArray featuresWanted = new OSDArray();
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -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";
|
||||
version = "Unknown";
|
||||
|
||||
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position);
|
||||
|
||||
|
@ -298,7 +297,14 @@ namespace OpenSim.Services.Connectors.Simulation
|
|||
OSDMap request = new OSDMap();
|
||||
request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
|
||||
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();
|
||||
foreach (UUID feature in featuresAvailable)
|
||||
|
@ -322,15 +328,32 @@ namespace OpenSim.Services.Connectors.Simulation
|
|||
success = data["success"];
|
||||
|
||||
reason = data["reason"].AsString();
|
||||
if (data["version"] != null && data["version"].AsString() != string.Empty)
|
||||
version = data["version"].AsString();
|
||||
// We will need to plumb this and start sing the outbound version as well
|
||||
// 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(
|
||||
"[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})",
|
||||
uri, success, reason, version, data["version"].AsString());
|
||||
"[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}",
|
||||
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
|
||||
// actual failure message
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -452,12 +452,11 @@ namespace OpenSim.Services.HypergridService
|
|||
|
||||
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(
|
||||
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 m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -162,10 +162,15 @@ namespace OpenSim.Services.Interfaces
|
|||
}
|
||||
|
||||
// Visual Params
|
||||
string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
|
||||
byte[] binary = appearance.VisualParams;
|
||||
//string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
|
||||
//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();
|
||||
}
|
||||
|
@ -202,7 +207,13 @@ namespace OpenSim.Services.Interfaces
|
|||
appearance.Serial = Int32.Parse(Data["Serial"]);
|
||||
|
||||
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
|
||||
if (Data.ContainsKey("BodyItem"))
|
||||
|
@ -273,9 +284,13 @@ namespace OpenSim.Services.Interfaces
|
|||
if (Data.ContainsKey("VisualParams"))
|
||||
{
|
||||
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]);
|
||||
|
||||
appearance.VisualParams = binary;
|
||||
|
|
|
@ -34,6 +34,20 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
|||
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -92,7 +106,7 @@ namespace OpenSim.Services.Interfaces
|
|||
/// <param name="version">Version that the target simulator is running</param>
|
||||
/// <param name="reason">[out] Optional error message</param>
|
||||
/// <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>
|
||||
/// Message from receiving region to departing region, telling it got contacted by the client.
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -983,11 +983,10 @@ namespace OpenSim.Services.LLLoginService
|
|||
|
||||
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
|
||||
{
|
||||
string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
|
||||
string version;
|
||||
EntityTransferContext ctx = new EntityTransferContext();
|
||||
|
||||
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 simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.2.*")]
|
||||
[assembly: AssemblyVersion("0.8.3.*")]
|
||||
|
||||
|
|
Loading…
Reference in New Issue