variations..

avinationmerge
UbitUmarov 2014-08-21 09:32:36 +01:00
parent 5f1cb6542d
commit 114144407b
1 changed files with 48 additions and 195 deletions

View File

@ -1920,7 +1920,6 @@ namespace OpenSim.Region.Framework.Scenes
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
}); });
} }
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
sog.ResumeScripts(); sog.ResumeScripts();
} }
@ -3542,14 +3541,12 @@ namespace OpenSim.Region.Framework.Scenes
} }
SendOtherAgentsAvatarFullToMe(); SendOtherAgentsAvatarFullToMe();
EntityBase[] entities = Scene.Entities.GetEntities(); EntityBase[] entities = Scene.Entities.GetEntities();
foreach (EntityBase e in entities) foreach (EntityBase e in entities)
{ {
if (e != null && e is SceneObjectGroup) if (e != null && e is SceneObjectGroup)
((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
} }
}); });
} }
@ -4754,32 +4751,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
// send attachments to a client without filters except for huds
// for now they are checked in several places down the line...
// kills all parts before sending
public void SendAttachmentsToAgentNFPK(ScenePresence p)
{
lock (m_attachments)
{
List<uint> pk = new List<uint>();
foreach (SceneObjectGroup sog in m_attachments)
{
foreach (SceneObjectPart part in sog.Parts)
pk.Add(part.LocalId);
}
p.ControllingClient.SendKillObject(pk);
foreach (SceneObjectGroup sog in m_attachments)
{
if (p == this || !sog.HasPrivateAttachmentPoint)
sog.SendFullUpdateToClient(p.ControllingClient);
}
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
}
}
public void SendAttachmentScheduleUpdate(SceneObjectGroup sog) public void SendAttachmentScheduleUpdate(SceneObjectGroup sog)
{ {
if (IsChildAgent) if (IsChildAgent)
@ -4796,9 +4767,27 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = sog.Parts; SceneObjectPart[] parts = sog.Parts;
SendFullUpdateToClient(p.ControllingClient);
SceneObjectPart rootpart = sog.RootPart;
if (rootpart.UpdateFlag == UpdateRequired.TERSE)
{
p.ControllingClient.SendEntityUpdate(rootpart,
PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
rootpart.UpdateFlag = 0;
}
else if (rootpart.UpdateFlag == UpdateRequired.FULL)
{
p.ControllingClient.SendEntityUpdate(rootpart, PrimUpdateFlags.FullUpdate);
rootpart.UpdateFlag = 0;
}
for (int i = 0; i < parts.Length; i++) for (int i = 0; i < parts.Length; i++)
{ {
SceneObjectPart part = parts[i]; SceneObjectPart part = parts[i];
if (part == rootpart)
continue;
if (part.UpdateFlag == UpdateRequired.TERSE) if (part.UpdateFlag == UpdateRequired.TERSE)
{ {
p.ControllingClient.SendEntityUpdate(part, p.ControllingClient.SendEntityUpdate(part,
@ -5655,183 +5644,56 @@ namespace OpenSim.Region.Framework.Scenes
private void parcelGodCheck(UUID currentParcelID, bool isGod) private void parcelGodCheck(UUID currentParcelID, bool isGod)
{ {
List<ScenePresence> allpresences = null; List<ScenePresence> allpresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p.IsChildAgent || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
allpresences = m_scene.GetScenePresences(); if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
{
if (isGod) if (isGod)
{ p.SendViewTo(this);
List<ScenePresence> viewsToSendme = new List<ScenePresence>();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
{
viewsToSendme.Add(p); // i see them
}
}
if (viewsToSendme.Count > 0)
{
foreach (ScenePresence p in viewsToSendme)
{
if (p.IsChildAgent)
continue;
p.SendAvatarDataToAgentNF(this);
p.SendAppearanceToAgent(this);
if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient);
p.SendAttachmentsToAgentNF(this);
}
}
}
else else
{ p.SendKillTo(this);
List<ScenePresence> killsToSendme = new List<ScenePresence>();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID)
{
killsToSendme.Add(p);
} }
} }
if (killsToSendme.Count > 0)
{
foreach (ScenePresence p in killsToSendme)
{
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
catch (NullReferenceException) { }
}
}
}
} }
private void ParcelLoginCheck(UUID currentParcelID) private void ParcelLoginCheck(UUID currentParcelID)
{ {
List<ScenePresence> killsToSendto = new List<ScenePresence>(); List<ScenePresence> allpresences = m_scene.GetScenePresences();
List<ScenePresence> killsToSendme = new List<ScenePresence>();
List<ScenePresence> viewsToSendto = new List<ScenePresence>();
List<ScenePresence> viewsToSendme = new List<ScenePresence>();
List<ScenePresence> allpresences = null;
allpresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allpresences) foreach (ScenePresence p in allpresences)
{ {
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue; continue;
if (currentParcelID != p.currentParcelUUID) if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200)
{ {
if (p.GodLevel < 200)
killsToSendto.Add(p);
// if (GodLevel < 200 && p.ParcelHideThisAvatar)
// killsToSendme.Add(p.LocalId);
}
else
{
viewsToSendto.Add(p);
viewsToSendme.Add(p);
}
}
allpresences.Clear();
// send the things
// kill main avatar object
if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
{
foreach (ScenePresence p in killsToSendto)
{
m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
SendKillTo(p); SendKillTo(p);
// try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
// catch (NullReferenceException) { }
} }
} }
if (killsToSendme.Count > 0)
{
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + killsToSendme.Count.ToString());
foreach (ScenePresence p in killsToSendme)
{
SendKillTo(this);
} }
}
/*
if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
{
foreach (ScenePresence p in viewsToSendto)
{
m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
p.ControllingClient.SendAvatarDataImmediate(this);
SendAppearanceToAgent(p);
SendAttachmentsToClient(p.ControllingClient);
if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient);
}
}
if (viewsToSendme.Count > 0)
{
foreach (ScenePresence p in viewsToSendme)
{
m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
if (p.IsChildAgent)
continue;
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient);
}
}
*/
}
public void parcelRegionCross() public void parcelRegionCross()
{ {
if (!ParcelHideThisAvatar || GodLevel >= 200) if (!ParcelHideThisAvatar || IsChildAgent || GodLevel >= 200)
return; return;
List<ScenePresence> allpresences = null; List<ScenePresence> allpresences = null;
allpresences = m_scene.GetScenePresences(); allpresences = m_scene.GetScenePresences();
List<ScenePresence> killsToSendme = new List<ScenePresence>();
foreach (ScenePresence p in allpresences) foreach (ScenePresence p in allpresences)
{ {
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) if (p.IsDeleted || p == this || p.IsChildAgent || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue; continue;
if (p.currentParcelUUID == m_currentParcelUUID) if (p.currentParcelUUID == m_currentParcelUUID)
{ {
killsToSendme.Add(p);
}
}
if (killsToSendme.Count > 0)
{
foreach (ScenePresence p in killsToSendme)
p.SendKillTo(this); p.SendKillTo(this);
// try }
// {
// ControllingClient.SendKillObject(killsToSendme);
// }
// catch (NullReferenceException) { }
} }
} }
@ -5844,10 +5706,7 @@ namespace OpenSim.Region.Framework.Scenes
List<ScenePresence> viewsToSendme = new List<ScenePresence>(); List<ScenePresence> viewsToSendme = new List<ScenePresence>();
List<ScenePresence> allpresences = null; List<ScenePresence> allpresences = null;
if (IsInTransit) if (IsInTransit || IsChildAgent)
return;
if (IsChildAgent)
return; return;
if (check) if (check)
@ -5973,17 +5832,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
// send the things // send the things
// kill main avatar object
if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc) if (killsToSendto.Count > 0)
{ {
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);
SendKillTo(p); SendKillTo(p);
// try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
// catch (NullReferenceException) { }
} }
} }
@ -5992,23 +5847,17 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString()); m_log.Debug("[AVATAR]: killtoMe: " + Lastname + " " + killsToSendme.Count.ToString());
foreach (ScenePresence p in killsToSendme) foreach (ScenePresence p in killsToSendme)
try
{ {
m_log.Debug("[AVATAR]: killToMe: " + Lastname + " " + p.Lastname);
p.SendKillTo(this); p.SendKillTo(this);
} }
catch (NullReferenceException) { }
} }
if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc) if (viewsToSendto.Count > 0)
{ {
foreach (ScenePresence p in viewsToSendto) foreach (ScenePresence p in viewsToSendto)
{ {
SendAvatarDataToAgentNF(p); SendViewTo(p);
SendAppearanceToAgent(p);
if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient);
SendAttachmentsToAgentNF(p);
} }
} }
@ -6019,12 +5868,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);
p.SendViewTo(this);
p.SendAvatarDataToAgentNF(this);
p.SendAppearanceToAgent(this);
if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient);
p.SendAttachmentsToAgentNF(this);
} }
} }
} }
@ -6035,5 +5879,14 @@ namespace OpenSim.Region.Framework.Scenes
p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1);
p.ControllingClient.SendKillObject(new List<uint> { LocalId }); p.ControllingClient.SendKillObject(new List<uint> { LocalId });
} }
public void SendViewTo(ScenePresence p)
{
SendAvatarDataToAgentNF(p);
SendAppearanceToAgent(p);
if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient);
SendAttachmentsToAgentNF(p);
}
} }
} }