start sending terrain in scenePresence after well defined avatar. Minor
change on significante AgentUpdate check.avinationmerge
parent
8cf945544c
commit
05a2feba5d
|
@ -577,7 +577,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
// Fire the callback for this connection closing
|
// Fire the callback for this connection closing
|
||||||
if (OnConnectionClosed != null)
|
if (OnConnectionClosed != null)
|
||||||
|
{
|
||||||
OnConnectionClosed(this);
|
OnConnectionClosed(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Flush all of the packets out of the UDP server for this client
|
// Flush all of the packets out of the UDP server for this client
|
||||||
if (m_udpServer != null)
|
if (m_udpServer != null)
|
||||||
|
@ -5518,8 +5521,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
|
AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
|
||||||
AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
|
AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
|
||||||
|
|
||||||
// AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false);
|
AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, false);
|
||||||
AddLocalPacketHandler(PacketType.RegionHandshakeReply, HandlerRegionHandshakeReply, true);
|
|
||||||
|
|
||||||
AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
|
AddLocalPacketHandler(PacketType.AgentWearablesRequest, HandlerAgentWearablesRequest);
|
||||||
AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
|
AddLocalPacketHandler(PacketType.AgentSetAppearance, HandlerAgentSetAppearance);
|
||||||
|
@ -5732,7 +5734,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
#region Scene/Avatar
|
#region Scene/Avatar
|
||||||
|
|
||||||
// Threshold for body rotation to be a significant agent update
|
// Threshold for body rotation to be a significant agent update
|
||||||
private const float QDELTA = 0.000001f;
|
// private const float QDELTA = 0.000001f;
|
||||||
|
// QDELTA is now relative to abs of cos of angle between orientations
|
||||||
|
|
||||||
|
private const float QDELTABODY = 1 - 0.0001f;
|
||||||
|
private const float QDELTAHEAD = 1 - 0.0001f;
|
||||||
|
|
||||||
// Threshold for camera rotation to be a significant agent update
|
// Threshold for camera rotation to be a significant agent update
|
||||||
private const float VDELTA = 0.01f;
|
private const float VDELTA = 0.01f;
|
||||||
|
|
||||||
|
@ -5755,13 +5762,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// <param name='x'></param>
|
/// <param name='x'></param>
|
||||||
private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
|
private bool CheckAgentMovementUpdateSignificance(AgentUpdatePacket.AgentDataBlock x)
|
||||||
{
|
{
|
||||||
float qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2);
|
// float qdelta1 = 1 - (float)Math.Pow(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation), 2);
|
||||||
//qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2);
|
//qdelta2 = 1 - (float)Math.Pow(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation), 2);
|
||||||
|
// now using abs of cos
|
||||||
|
float qdelta1 = (float)Math.Abs(Quaternion.Dot(x.BodyRotation, m_thisAgentUpdateArgs.BodyRotation));
|
||||||
|
float qdelta2 = (float)Math.Abs(Quaternion.Dot(x.HeadRotation, m_thisAgentUpdateArgs.HeadRotation));
|
||||||
|
|
||||||
bool movementSignificant =
|
bool movementSignificant =
|
||||||
(qdelta1 > QDELTA) // significant if body rotation above threshold
|
// (qdelta1 > QDELTA) // significant if body rotation above threshold
|
||||||
// Ignoring head rotation altogether, because it's not being used for anything interesting up the stack
|
(qdelta1 < QDELTABODY) // higher angle lower cos
|
||||||
|
// Ignoring head rotation altogether, because it's not being used for anything interesting up the stack
|
||||||
// || (qdelta2 > QDELTA * 10) // significant if head rotation above threshold
|
// || (qdelta2 > QDELTA * 10) // significant if head rotation above threshold
|
||||||
|
|| (qdelta2 < QDELTAHEAD) // using cos above
|
||||||
|| (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed
|
|| (x.ControlFlags != m_thisAgentUpdateArgs.ControlFlags) // significant if control flags changed
|
||||||
|| (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands
|
|| (x.ControlFlags != (byte)AgentManager.ControlFlags.NONE) // significant if user supplying any movement update commands
|
||||||
|| (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed
|
|| (x.Far != m_thisAgentUpdateArgs.Far) // significant if far distance changed
|
||||||
|
@ -6476,7 +6488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
|
Action<IClientAPI> handlerRegionHandShakeReply = OnRegionHandShakeReply;
|
||||||
if (handlerRegionHandShakeReply != null)
|
if (handlerRegionHandShakeReply != null)
|
||||||
{
|
{
|
||||||
Thread.Sleep(500);
|
// Thread.Sleep(500);
|
||||||
handlerRegionHandShakeReply(this);
|
handlerRegionHandShakeReply(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1750,25 +1750,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
endPoint,
|
endPoint,
|
||||||
sessionInfo);
|
sessionInfo);
|
||||||
|
|
||||||
// Send ack straight away to let the viewer know that the connection is active.
|
|
||||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
|
||||||
// circuit code to the existing child agent. This is not particularly obvious.
|
|
||||||
SendAckImmediate(endPoint, uccp.Header.Sequence);
|
|
||||||
|
|
||||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
|
||||||
if (client != null)
|
|
||||||
{
|
|
||||||
AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(uccp.CircuitCode.Code);
|
|
||||||
bool tp = (aCircuit.teleportFlags > 0);
|
|
||||||
// Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from
|
|
||||||
if (!tp)
|
|
||||||
client.SceneAgent.SendInitialDataToMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now we know we can handle more data
|
// Now we know we can handle more data
|
||||||
Thread.Sleep(200);
|
// Thread.Sleep(200);
|
||||||
|
|
||||||
// Obtain the queue and remove it from the cache
|
// Obtain the pending queue and remove it from the cache
|
||||||
Queue<UDPPacketBuffer> queue = null;
|
Queue<UDPPacketBuffer> queue = null;
|
||||||
|
|
||||||
lock (m_pendingCache)
|
lock (m_pendingCache)
|
||||||
|
@ -1790,6 +1775,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
PacketReceived(buf);
|
PacketReceived(buf);
|
||||||
}
|
}
|
||||||
queue = null;
|
queue = null;
|
||||||
|
|
||||||
|
// Send ack straight away to let the viewer know that the connection is active.
|
||||||
|
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||||
|
// circuit code to the existing child agent. This is not particularly obvious.
|
||||||
|
SendAckImmediate(endPoint, uccp.Header.Sequence);
|
||||||
|
|
||||||
|
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||||
|
if (client != null)
|
||||||
|
{
|
||||||
|
AgentCircuitData aCircuit = m_scene.AuthenticateHandler.GetAgentCircuitData(uccp.CircuitCode.Code);
|
||||||
|
bool tp = (aCircuit.teleportFlags > 0);
|
||||||
|
// Let's delay this for TP agents, otherwise the viewer doesn't know where to get resources from
|
||||||
|
if (!tp)
|
||||||
|
client.SceneAgent.SendInitialDataToMe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -3179,7 +3179,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public virtual void SubscribeToClientTerrainEvents(IClientAPI client)
|
public virtual void SubscribeToClientTerrainEvents(IClientAPI client)
|
||||||
{
|
{
|
||||||
client.OnRegionHandShakeReply += SendLayerData;
|
// client.OnRegionHandShakeReply += SendLayerData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void SubscribeToClientPrimEvents(IClientAPI client)
|
public virtual void SubscribeToClientPrimEvents(IClientAPI client)
|
||||||
|
@ -3307,7 +3307,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client)
|
public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client)
|
||||||
{
|
{
|
||||||
client.OnRegionHandShakeReply -= SendLayerData;
|
// client.OnRegionHandShakeReply -= SendLayerData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UnSubscribeToClientPrimEvents(IClientAPI client)
|
public virtual void UnSubscribeToClientPrimEvents(IClientAPI client)
|
||||||
|
|
|
@ -3473,6 +3473,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
landch.sendClientInitialLandInfo(ControllingClient);
|
landch.sendClientInitialLandInfo(ControllingClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_scene.SendLayerData(ControllingClient);
|
||||||
SendOtherAgentsAvatarDataToMe();
|
SendOtherAgentsAvatarDataToMe();
|
||||||
SendOtherAgentsAppearanceToMe();
|
SendOtherAgentsAppearanceToMe();
|
||||||
|
|
||||||
|
@ -5426,7 +5427,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (p.IsChildAgent)
|
if (p.IsChildAgent)
|
||||||
continue;
|
continue;
|
||||||
m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
|
||||||
ControllingClient.SendAvatarDataImmediate(p);
|
ControllingClient.SendAvatarDataImmediate(p);
|
||||||
p.SendAppearanceToAgent(this);
|
p.SendAppearanceToAgent(this);
|
||||||
p.SendAttachmentsToClient(ControllingClient);
|
p.SendAttachmentsToClient(ControllingClient);
|
||||||
|
@ -5454,7 +5455,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in killsToSendme)
|
foreach (ScenePresence p in killsToSendme)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
||||||
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
||||||
catch (NullReferenceException) { }
|
catch (NullReferenceException) { }
|
||||||
}
|
}
|
||||||
|
@ -5499,7 +5500,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in killsToSendto)
|
foreach (ScenePresence p in killsToSendto)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
|
||||||
try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
|
try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
|
||||||
catch (NullReferenceException) { }
|
catch (NullReferenceException) { }
|
||||||
}
|
}
|
||||||
|
@ -5509,7 +5510,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in killsToSendme)
|
foreach (ScenePresence p in killsToSendme)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
||||||
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
||||||
catch (NullReferenceException) { }
|
catch (NullReferenceException) { }
|
||||||
}
|
}
|
||||||
|
@ -5519,7 +5520,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in viewsToSendto)
|
foreach (ScenePresence p in viewsToSendto)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
|
||||||
p.ControllingClient.SendAvatarDataImmediate(this);
|
p.ControllingClient.SendAvatarDataImmediate(this);
|
||||||
SendAppearanceToAgent(p);
|
SendAppearanceToAgent(p);
|
||||||
SendAttachmentsToClient(p.ControllingClient);
|
SendAttachmentsToClient(p.ControllingClient);
|
||||||
|
@ -5532,9 +5533,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in viewsToSendme)
|
foreach (ScenePresence p in viewsToSendme)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
|
|
||||||
if (p.IsChildAgent)
|
if (p.IsChildAgent)
|
||||||
continue;
|
continue;
|
||||||
|
// m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
|
||||||
ControllingClient.SendAvatarDataImmediate(p);
|
ControllingClient.SendAvatarDataImmediate(p);
|
||||||
p.SendAppearanceToAgent(this);
|
p.SendAppearanceToAgent(this);
|
||||||
p.SendAttachmentsToClient(ControllingClient);
|
p.SendAttachmentsToClient(ControllingClient);
|
||||||
|
@ -5603,7 +5604,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in killsToSendme)
|
foreach (ScenePresence p in killsToSendme)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
||||||
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
||||||
catch (NullReferenceException) { }
|
catch (NullReferenceException) { }
|
||||||
}
|
}
|
||||||
|
@ -5752,7 +5753,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in killsToSendto)
|
foreach (ScenePresence p in killsToSendto)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
|
||||||
try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
|
try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
|
||||||
catch (NullReferenceException) { }
|
catch (NullReferenceException) { }
|
||||||
}
|
}
|
||||||
|
@ -5762,7 +5763,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in killsToSendme)
|
foreach (ScenePresence p in killsToSendme)
|
||||||
{
|
{
|
||||||
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
// m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
|
||||||
try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
|
||||||
catch (NullReferenceException) { }
|
catch (NullReferenceException) { }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue