Merge branch 'ubitworkmaster'
commit
012d0b07bc
|
@ -5393,6 +5393,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
//update.JointType = 0;
|
||||
update.Material = data.Material;
|
||||
update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim
|
||||
/*
|
||||
if (data.ParentGroup.IsAttachment)
|
||||
{
|
||||
update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID);
|
||||
|
@ -5406,6 +5407,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// case for attachments may contain conflicting values that can end up crashing the viewer.
|
||||
update.State = data.ParentGroup.RootPart.Shape.State;
|
||||
}
|
||||
*/
|
||||
|
||||
if (data.ParentGroup.IsAttachment)
|
||||
{
|
||||
if (data.IsRoot)
|
||||
{
|
||||
update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.ParentGroup.FromItemID);
|
||||
}
|
||||
else
|
||||
update.NameValue = Utils.EmptyBytes;
|
||||
|
||||
int st = (int)data.ParentGroup.AttachmentPoint;
|
||||
update.State = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ;
|
||||
}
|
||||
else
|
||||
{
|
||||
update.NameValue = Utils.EmptyBytes;
|
||||
update.State = data.Shape.State; // not sure about this
|
||||
}
|
||||
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLCLIENTVIEW]: Sending state {0} for {1} {2} to {3}",
|
||||
|
|
|
@ -364,6 +364,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
|
||||
|
||||
int total = resend + land + wind + cloud + task + texture + asset;
|
||||
total /= 128;
|
||||
|
||||
// Make sure none of the throttles are set below our packet MTU,
|
||||
// otherwise a throttle could become permanently clogged
|
||||
resend = Math.Max(resend, LLUDPServer.MTU);
|
||||
|
@ -380,7 +383,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
task = task + (int)(m_cannibalrate * texture);
|
||||
texture = (int)((1 - m_cannibalrate) * texture);
|
||||
|
||||
//int total = resend + land + wind + cloud + task + texture + asset;
|
||||
total = resend + land + wind + cloud + task + texture + asset;
|
||||
total /= 128;
|
||||
//m_log.DebugFormat("[LLUDPCLIENT]: {0} is setting throttles. Resend={1}, Land={2}, Wind={3}, Cloud={4}, Task={5}, Texture={6}, Asset={7}, Total={8}",
|
||||
// AgentID, resend, land, wind, cloud, task, texture, asset, total);
|
||||
|
||||
|
@ -484,7 +488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// Don't send this packet if there is already a packet waiting in the queue
|
||||
// even if we have the tokens to send it, tokens should go to the already
|
||||
// queued packets
|
||||
if (queue.Count > 0)
|
||||
if (queue.Count > 0 || m_nextPackets[category] != null)
|
||||
{
|
||||
queue.Enqueue(packet, highPriority);
|
||||
return true;
|
||||
|
@ -528,7 +532,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
/// <returns>True if any packets were sent, otherwise false</returns>
|
||||
public bool DequeueOutgoing()
|
||||
{
|
||||
if (m_deliverPackets == false) return false;
|
||||
// if (m_deliverPackets == false) return false;
|
||||
|
||||
OutgoingPacket packet = null;
|
||||
DoubleLocklessQueue<OutgoingPacket> queue;
|
||||
|
|
|
@ -1245,7 +1245,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
int dataLength = buffer.DataLength;
|
||||
|
||||
// NOTE: I'm seeing problems with some viewers when ACKs are appended to zerocoded packets so I've disabled that here
|
||||
if (!isZerocoded)
|
||||
if (!isZerocoded && !isResend)
|
||||
{
|
||||
// Keep appending ACKs until there is no room left in the buffer or there are
|
||||
// no more ACKs to append
|
||||
|
|
|
@ -986,7 +986,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// Well, this is it. The agent is over there.
|
||||
// KillEntity(sp.Scene, sp.LocalId);
|
||||
|
||||
sp.HasMovedAway();
|
||||
bool nearRegion = sp.KnownRegions.ContainsKey(destinationHandle);
|
||||
sp.HasMovedAway(nearRegion);
|
||||
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
@ -1141,7 +1142,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
|
||||
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||
|
||||
sp.HasMovedAway();
|
||||
bool nearRegion = sp.KnownRegions.ContainsKey(destinationHandle);
|
||||
sp.HasMovedAway(nearRegion);
|
||||
|
||||
// Need to signal neighbours whether child agents may need closing irrespective of whether this
|
||||
// one needed closing. We also need to close child agents as quickly as possible to avoid complicated
|
||||
|
@ -1784,9 +1786,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
|
||||
|
||||
// this may need the attachments
|
||||
agent.parcelRegionCross();
|
||||
|
||||
AgentHasMovedAway(agent, true);
|
||||
agent.HasMovedAway(true);
|
||||
// agent.parcelRegionCross();
|
||||
|
||||
// AgentHasMovedAway(agent, true);
|
||||
|
||||
agent.MakeChildAgent();
|
||||
|
||||
|
|
|
@ -1887,29 +1887,26 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
||||
|
||||
// Resume scripts this possible should also be moved down after sending the avatar to viewer ?
|
||||
foreach(SceneObjectGroup sog in m_attachments)
|
||||
{
|
||||
SendFullUpdateToClient(ControllingClient);
|
||||
SendAttachmentFullUpdateToAgentNF(sog, this);
|
||||
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
|
||||
if (!sog.HasPrivateAttachmentPoint)
|
||||
{
|
||||
// sog.ScheduleGroupForFullUpdate();
|
||||
foreach (ScenePresence p in allpresences)
|
||||
{
|
||||
if (p == this)
|
||||
{
|
||||
SendTerseUpdateToAgentNF(this);
|
||||
SendAttachmentsToAgentNF(this);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
|
||||
continue;
|
||||
|
||||
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
|
||||
SendAttachmentFullUpdateToAgentNF(sog, p);
|
||||
};
|
||||
}
|
||||
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
||||
sog.ResumeScripts();
|
||||
SendTerseUpdateToAgentNF(p);
|
||||
SendAttachmentsToAgentNF(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3428,7 +3425,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (remoteClient.IsActive)
|
||||
{
|
||||
//m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity);
|
||||
remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate);
|
||||
remoteClient.SendEntityUpdate(this,
|
||||
PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
|
||||
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
|
||||
m_scene.StatsReporter.AddAgentUpdates(1);
|
||||
}
|
||||
}
|
||||
|
@ -4761,8 +4760,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
|
||||
return;
|
||||
|
||||
SendTerseUpdateToAgentNF(p);
|
||||
SendAttachmentFullUpdateToAgentNF(sog, p);
|
||||
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -4772,13 +4771,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// for now they are checked in several places down the line...
|
||||
public void SendAttachmentsToAgentNF(ScenePresence p)
|
||||
{
|
||||
SendTerseUpdateToAgentNF(p);
|
||||
lock (m_attachments)
|
||||
{
|
||||
foreach (SceneObjectGroup sog in m_attachments)
|
||||
{
|
||||
SendAttachmentFullUpdateToAgentNF(sog, p);
|
||||
}
|
||||
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5963,7 +5962,30 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
public void HasMovedAway()
|
||||
public void HasMovedAway(bool nearRegion)
|
||||
{
|
||||
|
||||
if (nearRegion)
|
||||
{
|
||||
if (Scene.AttachmentsModule != null)
|
||||
Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
|
||||
|
||||
if (!ParcelHideThisAvatar || GodLevel >= 200)
|
||||
return;
|
||||
|
||||
List<ScenePresence> allpresences = m_scene.GetScenePresences();
|
||||
foreach (ScenePresence p in allpresences)
|
||||
{
|
||||
if (p.IsDeleted || p == this || p.IsChildAgent || p.ControllingClient == null || !p.ControllingClient.IsActive)
|
||||
continue;
|
||||
|
||||
if (p.currentParcelUUID == m_currentParcelUUID)
|
||||
{
|
||||
p.SendKillTo(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
List<ScenePresence> allpresences = m_scene.GetScenePresences();
|
||||
foreach (ScenePresence p in allpresences)
|
||||
|
@ -5974,9 +5996,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (!p.IsChildAgent)
|
||||
p.SendKillTo(this);
|
||||
}
|
||||
|
||||
if (Scene.AttachmentsModule != null)
|
||||
Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// kill with attachs root kills
|
||||
public void SendKillTo(ScenePresence p)
|
||||
|
|
Loading…
Reference in New Issue