try to suport physics wearable type, sending it only if outgoing protocol version >= 0.5

0.8.2-post-fixes
UbitUmarov 2015-12-01 19:12:16 +00:00
parent 46cd2da82c
commit 0a122c9b40
4 changed files with 42 additions and 13 deletions

View File

@ -69,6 +69,8 @@ namespace OpenSim.Framework
protected WearableCacheItem[] m_cacheitems; protected WearableCacheItem[] m_cacheitems;
protected bool m_cacheItemsDirty = true; protected bool m_cacheItemsDirty = true;
public bool PackLegacyWearables {get; set; }
public virtual int Serial public virtual int Serial
{ {
get { return m_serial; } get { return m_serial; }
@ -133,7 +135,7 @@ namespace OpenSim.Framework
public AvatarAppearance() public AvatarAppearance()
{ {
// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance"); // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
PackLegacyWearables = false;
m_serial = 0; m_serial = 0;
SetDefaultWearables(); SetDefaultWearables();
SetDefaultTexture(); SetDefaultTexture();
@ -712,8 +714,15 @@ namespace OpenSim.Framework
data["height"] = OSD.FromReal(m_avatarHeight); data["height"] = OSD.FromReal(m_avatarHeight);
// Wearables // Wearables
OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES);
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) int wearsCount;
if(PackLegacyWearables)
wearsCount = AvatarWearable.LEGACY_VERSION_MAX_WEARABLES;
else
wearsCount = AvatarWearable.MAX_WEARABLES;
OSDArray wears = new OSDArray(wearsCount);
for (int i = 0; i < wearsCount; i++)
wears.Add(m_wearables[i].Pack()); wears.Add(m_wearables[i].Pack());
data["wearables"] = wears; data["wearables"] = wears;

View File

@ -65,7 +65,9 @@ namespace OpenSim.Framework
public static readonly int ALPHA = 13; public static readonly int ALPHA = 13;
public static readonly int TATTOO = 14; public static readonly int TATTOO = 14;
public static readonly int MAX_WEARABLES = 15; public static readonly int LEGACY_VERSION_MAX_WEARABLES = 15;
public static readonly int PHYSICS = 15;
public static readonly int MAX_WEARABLES = 16;
public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");

View File

@ -443,9 +443,18 @@ namespace OpenSim.Framework
// We might not pass this in all cases... // We might not pass this in all cases...
if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
{ {
OSDArray wears = new OSDArray(Appearance.Wearables.Length); int wearsCount;
foreach (AvatarWearable awear in Appearance.Wearables) if(Appearance.PackLegacyWearables)
wears.Add(awear.Pack()); wearsCount = AvatarWearable.LEGACY_VERSION_MAX_WEARABLES;
else
wearsCount = AvatarWearable.MAX_WEARABLES;
if(wearsCount > Appearance.Wearables.Length)
wearsCount = Appearance.Wearables.Length;
OSDArray wears = new OSDArray(wearsCount);
for(int i = 0; i < wearsCount ; i++)
wears.Add(Appearance.Wearables[i].Pack());
args["wearables"] = wears; args["wearables"] = wears;
} }

View File

@ -768,7 +768,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo();
agentCircuit.startpos = position; agentCircuit.startpos = position;
agentCircuit.child = true; agentCircuit.child = true;
agentCircuit.Appearance = sp.Appearance; agentCircuit.Appearance = new AvatarAppearance();
agentCircuit.Appearance.PackLegacyWearables = true;
if (currentAgentCircuit != null) if (currentAgentCircuit != null)
{ {
agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs; agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs;
@ -805,7 +806,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}",
sp.Name, Scene.Name, finalDestination.RegionName); sp.Name, Scene.Name, finalDestination.RegionName);
// Let's create an agent there if one doesn't exist yet. // Let's create an agent there if one doesn't exist yet.
// NOTE: logout will always be false for a non-HG teleport. // NOTE: logout will always be false for a non-HG teleport.
bool logout = false; bool logout = false;
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
@ -906,6 +907,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Let's send a full update of the agent. This is a synchronous call. // Let's send a full update of the agent. This is a synchronous call.
AgentData agent = new AgentData(); AgentData agent = new AgentData();
sp.CopyTo(agent); sp.CopyTo(agent);
if (ctx.OutboundVersion < 0.5f)
agent.Appearance.PackLegacyWearables = true;
agent.Position = agentCircuit.startpos; agent.Position = agentCircuit.startpos;
SetCallbackURL(agent, sp.Scene.RegionInfo); SetCallbackURL(agent, sp.Scene.RegionInfo);
@ -1145,6 +1148,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Let's send a full update of the agent. // Let's send a full update of the agent.
AgentData agent = new AgentData(); AgentData agent = new AgentData();
sp.CopyTo(agent); sp.CopyTo(agent);
if (ctx.OutboundVersion < 0.5f)
agent.Appearance.PackLegacyWearables = true;
agent.Position = agentCircuit.startpos; agent.Position = agentCircuit.startpos;
agent.SenderWantsToWaitForRoot = true; agent.SenderWantsToWaitForRoot = true;
//SetCallbackURL(agent, sp.Scene.RegionInfo); //SetCallbackURL(agent, sp.Scene.RegionInfo);
@ -1628,7 +1633,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.ResetFromTransit(agent.UUID); m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
} }
if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying)) if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying, ctx))
{ {
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader); m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader);
m_entityTransferStateMachine.ResetFromTransit(agent.UUID); m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
@ -1644,12 +1649,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return agent; return agent;
} }
public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying) public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx)
{ {
try try
{ {
AgentData cAgent = new AgentData(); AgentData cAgent = new AgentData();
agent.CopyTo(cAgent); agent.CopyTo(cAgent);
if (ctx.OutboundVersion < 0.5f)
cAgent.Appearance.PackLegacyWearables = true;
cAgent.Position = pos; cAgent.Position = pos;
if (isFlying) if (isFlying)
@ -1815,7 +1822,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.InventoryFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero;
agent.startpos = new Vector3(128, 128, 70); agent.startpos = new Vector3(128, 128, 70);
agent.child = true; agent.child = true;
agent.Appearance = sp.Appearance; agent.Appearance = new AvatarAppearance();
agent.Appearance.PackLegacyWearables = true;
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
@ -1938,7 +1946,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.InventoryFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero;
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour); agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
agent.child = true; agent.child = true;
agent.Appearance = sp.Appearance; agent.Appearance = new AvatarAppearance();
agent.Appearance.PackLegacyWearables = true;
if (currentAgentCircuit != null) if (currentAgentCircuit != null)
{ {
agent.ServiceURLs = currentAgentCircuit.ServiceURLs; agent.ServiceURLs = currentAgentCircuit.ServiceURLs;