dont mess throotles values sent to child presences. Some cleanup

avinationmerge
UbitUmarov 2014-08-27 15:57:12 +01:00
parent 012d0b07bc
commit 73cdafd6c9
1 changed files with 37 additions and 52 deletions

View File

@ -3811,6 +3811,11 @@ namespace OpenSim.Region.Framework.Scenes
// Throttles // Throttles
float multiplier = 1; float multiplier = 1;
/* dont messup throttles
* child agent is a full presence that can be just a few meters away across border
* sending this is possible wrong since viewers may send own needs to each region
*
int childRegions = KnownRegionCount; int childRegions = KnownRegionCount;
if (childRegions != 0) if (childRegions != 0)
multiplier = 1f / childRegions; multiplier = 1f / childRegions;
@ -3818,7 +3823,7 @@ namespace OpenSim.Region.Framework.Scenes
// Minimum throttle for a child region is 1/4 of the root region throttle // Minimum throttle for a child region is 1/4 of the root region throttle
if (multiplier <= 0.25f) if (multiplier <= 0.25f)
multiplier = 0.25f; multiplier = 0.25f;
*/
cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
cadu.Velocity = Velocity; cadu.Velocity = Velocity;
@ -4814,11 +4819,15 @@ namespace OpenSim.Region.Framework.Scenes
int j = 0; int j = 0;
bool allterse = true; bool allterse = true;
for (int i = 0; i < origparts.Length; i++) for (int i = 0; i < origparts.Length; i++)
{
if (origparts[i] != rootpart)
{ {
switch (origparts[i].UpdateFlag) switch (origparts[i].UpdateFlag)
{ {
case UpdateRequired.NONE:
break;
case UpdateRequired.TERSE: case UpdateRequired.TERSE:
flags[j] = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity flags[j] = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity;
@ -4828,29 +4837,25 @@ namespace OpenSim.Region.Framework.Scenes
case UpdateRequired.FULL: case UpdateRequired.FULL:
flags[j] = PrimUpdateFlags.FullUpdate; flags[j] = PrimUpdateFlags.FullUpdate;
allterse = false;
parts[j] = origparts[i]; parts[j] = origparts[i];
j++; j++;
allterse = false;
break; break;
} }
}
origparts[i].UpdateFlag = 0; origparts[i].UpdateFlag = 0;
} }
if (j == 0) if (j == 0 && rootreq == UpdateRequired.NONE)
return; return;
if (rootreq == UpdateRequired.NONE)
{
if (allterse)
rootreq = UpdateRequired.TERSE;
else
rootreq = UpdateRequired.FULL;
}
PrimUpdateFlags rootflag = PrimUpdateFlags.FullUpdate; PrimUpdateFlags rootflag = PrimUpdateFlags.FullUpdate;
if (rootreq == UpdateRequired.TERSE)
if (rootreq != UpdateRequired.FULL && allterse)
{
rootflag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity rootflag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity;
}
int nparts = j; int nparts = j;
@ -4870,10 +4875,7 @@ namespace OpenSim.Region.Framework.Scenes
for (int i = 0; i < nparts; i++) for (int i = 0; i < nparts; i++)
{ {
SceneObjectPart part = parts[i]; p.ControllingClient.SendEntityUpdate(parts[i], flags[i]);
if (part == rootpart)
continue;
p.ControllingClient.SendEntityUpdate(part, flags[i]);
} }
} }
} }
@ -4902,6 +4904,8 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = sog.Parts; SceneObjectPart[] parts = sog.Parts;
SceneObjectPart rootpart = sog.RootPart; SceneObjectPart rootpart = sog.RootPart;
rootpart.UpdateFlag = 0;
bool priv = sog.HasPrivateAttachmentPoint; bool priv = sog.HasPrivateAttachmentPoint;
List<ScenePresence> allPresences = m_scene.GetScenePresences(); List<ScenePresence> allPresences = m_scene.GetScenePresences();
@ -4915,7 +4919,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
p.ControllingClient.SendEntityUpdate(rootpart, flag); p.ControllingClient.SendEntityUpdate(rootpart, flag);
rootpart.UpdateFlag = 0;
for (int i = 0; i < parts.Length; i++) for (int i = 0; i < parts.Length; i++)
{ {
@ -4950,6 +4953,8 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
part.UpdateFlag = 0;
bool priv = part.ParentGroup.HasPrivateAttachmentPoint; bool priv = part.ParentGroup.HasPrivateAttachmentPoint;
List<ScenePresence> allPresences = m_scene.GetScenePresences(); List<ScenePresence> allPresences = m_scene.GetScenePresences();
@ -4964,7 +4969,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
p.ControllingClient.SendEntityUpdate(part, flag); p.ControllingClient.SendEntityUpdate(part, flag);
part.UpdateFlag = 0;
} }
} }
@ -4989,6 +4993,8 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
part.UpdateFlag = 0;
bool priv = part.ParentGroup.HasPrivateAttachmentPoint; bool priv = part.ParentGroup.HasPrivateAttachmentPoint;
List<ScenePresence> allPresences = m_scene.GetScenePresences(); List<ScenePresence> allPresences = m_scene.GetScenePresences();
@ -5002,7 +5008,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
p.ControllingClient.SendEntityUpdate(part, flag); p.ControllingClient.SendEntityUpdate(part, flag);
part.UpdateFlag = 0;
} }
} }
@ -5768,26 +5773,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void parcelRegionCross()
{
if (!ParcelHideThisAvatar || GodLevel >= 200)
return;
List<ScenePresence> allpresences = null;
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);
}
}
}
private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID,
bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)
{ {