mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
add more test code to make usage od compressed updates etc. Should be disable, but well many things can go wrong.
This commit is contained in:
@@ -153,10 +153,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="remoteClient"></param>
|
||||
public void RequestPrim(uint primLocalID, IClientAPI remoteClient)
|
||||
{
|
||||
SceneObjectGroup sog = GetGroupByPrim(primLocalID);
|
||||
SceneObjectPart part = GetSceneObjectPart(primLocalID);
|
||||
if (part != null)
|
||||
{
|
||||
SceneObjectGroup sog = part.ParentGroup;
|
||||
if(!sog.IsDeleted)
|
||||
{
|
||||
PrimUpdateFlags update = PrimUpdateFlags.FullUpdate;
|
||||
if (sog.RootPart.Shape.MeshFlagEntry)
|
||||
update = PrimUpdateFlags.FullUpdatewithAnim;
|
||||
part.SendUpdate(remoteClient, update);
|
||||
}
|
||||
}
|
||||
|
||||
if (sog != null)
|
||||
sog.SendFullAnimUpdateToClient(remoteClient);
|
||||
//SceneObjectGroup sog = GetGroupByPrim(primLocalID);
|
||||
|
||||
//if (sog != null)
|
||||
//sog.SendFullAnimUpdateToClient(remoteClient);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -170,8 +170,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
private bool m_scripts_enabled;
|
||||
|
||||
public SynchronizeSceneHandler SynchronizeScene;
|
||||
|
||||
public bool ClampNegativeZ
|
||||
{
|
||||
get { return m_clampNegativeZ; }
|
||||
@@ -1006,11 +1004,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete);
|
||||
m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
|
||||
m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
|
||||
m_dontPersistBefore =
|
||||
startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
|
||||
m_dontPersistBefore = startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
|
||||
m_dontPersistBefore *= 10000000;
|
||||
m_persistAfter =
|
||||
startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
|
||||
m_persistAfter = startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
|
||||
m_persistAfter *= 10000000;
|
||||
|
||||
m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
|
||||
@@ -1695,9 +1691,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (PhysicsEnabled)
|
||||
physicsFPS = m_sceneGraph.UpdatePhysics(FrameTime);
|
||||
|
||||
if (SynchronizeScene != null)
|
||||
SynchronizeScene(this);
|
||||
}
|
||||
|
||||
tmpMS2 = Util.GetTimeStampMS();
|
||||
@@ -1775,30 +1768,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Region ready should always be set
|
||||
Ready = true;
|
||||
|
||||
|
||||
IConfig restartConfig = m_config.Configs["RestartModule"];
|
||||
if (restartConfig != null)
|
||||
{
|
||||
string markerPath = restartConfig.GetString("MarkerPath", String.Empty);
|
||||
|
||||
if (markerPath != String.Empty)
|
||||
{
|
||||
string path = Path.Combine(markerPath, RegionInfo.RegionID.ToString() + ".ready");
|
||||
try
|
||||
{
|
||||
string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString();
|
||||
FileStream fs = File.Create(path);
|
||||
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
|
||||
Byte[] buf = enc.GetBytes(pidstring);
|
||||
fs.Write(buf, 0, buf.Length);
|
||||
fs.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -119,6 +119,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// private PrimCountTaintedDelegate handlerPrimCountTainted = null;
|
||||
|
||||
public bool IsViewerCachable
|
||||
{
|
||||
get
|
||||
{
|
||||
// needs more exclusion ?
|
||||
return(Backup && !IsTemporary && !inTransit && !IsSelected && !UsesPhysics && !IsAttachmentCheckFull() &&
|
||||
!RootPart.Shape.MeshFlagEntry && // animations are not sent correctly for now
|
||||
RootPart.KeyframeMotion == null &&
|
||||
(DateTime.UtcNow.Ticks - timeLastChanged > 36000000000) && //36000000000 is one hour
|
||||
RootPart.Velocity.LengthSquared() < 1e8f && // should not be needed
|
||||
RootPart.Acceleration.LengthSquared() < 1e4f // should not be needed
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Signal whether the non-inventory attributes of any prims in the group have changed
|
||||
/// since the group's last persistent backup
|
||||
@@ -128,7 +143,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private long timeLastChanged = 0;
|
||||
private long m_maxPersistTime = 0;
|
||||
private long m_minPersistTime = 0;
|
||||
// private Random m_rand;
|
||||
|
||||
public int PseudoCRC;
|
||||
|
||||
/// <summary>
|
||||
/// This indicates whether the object has changed such that it needs to be repersisted to permenant storage
|
||||
@@ -145,40 +161,26 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
|
||||
if (Backup)
|
||||
{
|
||||
m_scene.SceneGraph.FireChangeBackup(this);
|
||||
}
|
||||
|
||||
PseudoCRC = (int)(DateTime.UtcNow.Ticks); ;
|
||||
timeLastChanged = DateTime.UtcNow.Ticks;
|
||||
if (!m_hasGroupChanged)
|
||||
timeFirstChanged = DateTime.UtcNow.Ticks;
|
||||
timeFirstChanged = timeLastChanged;
|
||||
if (m_rootPart != null && m_scene != null)
|
||||
{
|
||||
/*
|
||||
if (m_rand == null)
|
||||
{
|
||||
byte[] val = new byte[16];
|
||||
m_rootPart.UUID.ToBytes(val, 0);
|
||||
m_rand = new Random(BitConverter.ToInt32(val, 0));
|
||||
}
|
||||
*/
|
||||
if (m_scene.GetRootAgentCount() == 0)
|
||||
{
|
||||
//If the region is empty, this change has been made by an automated process
|
||||
//and thus we delay the persist time by a random amount between 1.5 and 2.5.
|
||||
|
||||
// float factor = 1.5f + (float)(m_rand.NextDouble());
|
||||
float factor = 2.0f;
|
||||
m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor);
|
||||
m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor);
|
||||
m_maxPersistTime = (long)(m_scene.m_persistAfter * factor);
|
||||
m_minPersistTime = (long)(m_scene.m_dontPersistBefore * factor);
|
||||
}
|
||||
else
|
||||
{
|
||||
//If the region is not empty, we want to obey the minimum and maximum persist times
|
||||
//but add a random factor so we stagger the object persistance a little
|
||||
// m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
|
||||
// m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
|
||||
m_maxPersistTime = m_scene.m_persistAfter;
|
||||
m_minPersistTime = m_scene.m_dontPersistBefore;
|
||||
}
|
||||
@@ -1330,6 +1332,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public SceneObjectGroup()
|
||||
{
|
||||
m_lastCollisionSoundMS = Util.GetTimeStampMS() + 1000.0;
|
||||
PseudoCRC = (int)(DateTime.UtcNow.Ticks);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2441,6 +2444,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void SendUpdateProbes(IClientAPI remoteClient)
|
||||
{
|
||||
PrimUpdateFlags update = PrimUpdateFlags.UpdateProbe;
|
||||
|
||||
RootPart.SendUpdate(remoteClient, update);
|
||||
|
||||
SceneObjectPart[] parts = m_parts.GetArray();
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
{
|
||||
SceneObjectPart part = parts[i];
|
||||
if (part != RootPart)
|
||||
part.SendUpdate(remoteClient, update);
|
||||
}
|
||||
}
|
||||
|
||||
#region Copying
|
||||
|
||||
/// <summary>
|
||||
@@ -2516,6 +2534,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
dupe.InvalidatePartsLinkMaps();
|
||||
dupe.PseudoCRC = (int)(DateTime.UtcNow.Ticks);
|
||||
m_dupeInProgress = false;
|
||||
return dupe;
|
||||
}
|
||||
@@ -2769,6 +2788,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
PseudoCRC = (int)(DateTime.UtcNow.Ticks);
|
||||
rpart.ScheduleFullUpdate();
|
||||
}
|
||||
|
||||
@@ -2808,6 +2828,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
part.ResetIDs(part.LinkNum); // Don't change link nums
|
||||
m_parts.Add(part.UUID, part);
|
||||
}
|
||||
PseudoCRC = (int)(DateTime.UtcNow.Ticks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3117,7 +3138,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 'linkPart' == the root of the group being linked into this group
|
||||
SceneObjectPart linkPart = objectGroup.m_rootPart;
|
||||
|
||||
@@ -3160,7 +3180,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
axPos *= Quaternion.Conjugate(parentRot);
|
||||
linkPart.OffsetPosition = axPos;
|
||||
|
||||
|
||||
// If there is only one SOP in a SOG, the LinkNum is zero. I.e., not a linkset.
|
||||
// Now that we know this SOG has at least two SOPs in it, the new root
|
||||
// SOP becomes the first in the linkset.
|
||||
@@ -3193,8 +3212,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
linkPart.CreateSelected = true;
|
||||
|
||||
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
|
||||
linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive, true);
|
||||
linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive || RootPart.VolumeDetectActive, true);
|
||||
|
||||
// If the added SOP is physical, also tell the physics engine about the link relationship.
|
||||
if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
|
||||
|
||||
@@ -1179,9 +1179,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
set
|
||||
{
|
||||
string old = m_mediaUrl;
|
||||
m_mediaUrl = value;
|
||||
|
||||
if (ParentGroup != null)
|
||||
if (ParentGroup != null && old != m_mediaUrl)
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
}
|
||||
@@ -1385,13 +1386,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsOccupied // KF If an av is sittingon this prim
|
||||
{
|
||||
get { return m_occupied; }
|
||||
set { m_occupied = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ID of the avatar that is sat on us if we have a sit target. If there is no such avatar then is UUID.Zero
|
||||
/// </summary>
|
||||
@@ -2472,12 +2466,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public uint GetEffectiveObjectFlags()
|
||||
{
|
||||
// Commenting this section of code out since it doesn't actually do anything, as enums are handled by
|
||||
// value rather than reference
|
||||
// PrimFlags f = _flags;
|
||||
// if (m_parentGroup == null || m_parentGroup.RootPart == this)
|
||||
// f &= ~(PrimFlags.Touch | PrimFlags.Money);
|
||||
|
||||
uint eff = (uint)Flags | (uint)LocalFlags;
|
||||
if(m_inventory == null || m_inventory.Count == 0)
|
||||
eff |= (uint)PrimFlags.InventoryEmpty;
|
||||
|
||||
@@ -1212,7 +1212,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ControllingClient.OnForceReleaseControls += HandleForceReleaseControls;
|
||||
ControllingClient.OnAutoPilotGo += MoveToTargetHandle;
|
||||
ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles;
|
||||
// ControllingClient.OnAgentFOV += HandleAgentFOV;
|
||||
ControllingClient.OnRegionHandShakeReply += RegionHandShakeReply;
|
||||
|
||||
// ControllingClient.OnAgentFOV += HandleAgentFOV;
|
||||
|
||||
// ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
|
||||
// ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
|
||||
@@ -1232,7 +1234,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ControllingClient.OnForceReleaseControls -= HandleForceReleaseControls;
|
||||
ControllingClient.OnAutoPilotGo -= MoveToTargetHandle;
|
||||
ControllingClient.OnUpdateThrottles -= RaiseUpdateThrottles;
|
||||
// ControllingClient.OnAgentFOV += HandleAgentFOV;
|
||||
ControllingClient.OnRegionHandShakeReply -= RegionHandShakeReply;
|
||||
|
||||
// ControllingClient.OnAgentFOV += HandleAgentFOV;
|
||||
}
|
||||
|
||||
private void SetDirectionVectors()
|
||||
@@ -2126,56 +2130,54 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(IsChildAgent)
|
||||
{
|
||||
return; // how?
|
||||
}
|
||||
//m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
if(!haveGroupInformation && !IsChildAgent && !IsNPC)
|
||||
if (!IsNPC)
|
||||
{
|
||||
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
if (gm != null)
|
||||
Grouptitle = gm.GetGroupTitle(m_uuid);
|
||||
if (!haveGroupInformation && !IsNPC)
|
||||
{
|
||||
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
if (gm != null)
|
||||
Grouptitle = gm.GetGroupTitle(m_uuid);
|
||||
|
||||
//m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
//m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46);
|
||||
if (cof == null)
|
||||
COF = UUID.Zero;
|
||||
else
|
||||
COF = cof.ID;
|
||||
InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46);
|
||||
if (cof == null)
|
||||
COF = UUID.Zero;
|
||||
else
|
||||
COF = cof.ID;
|
||||
|
||||
m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF);
|
||||
m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(m_callbackURI))
|
||||
{
|
||||
// We cannot sleep here since this would hold up the inbound packet processing thread, as
|
||||
// CompleteMovement() is executed synchronously. However, it might be better to delay the release
|
||||
// here until we know for sure that the agent is active in this region. Sending AgentMovementComplete
|
||||
// is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this
|
||||
// region as the current region, meaning that a close sent before then will fail the teleport.
|
||||
// System.Threading.Thread.Sleep(2000);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
|
||||
client.Name, client.AgentId, m_callbackURI);
|
||||
|
||||
UUID originID;
|
||||
|
||||
lock (m_originRegionIDAccessLock)
|
||||
originID = m_originRegionID;
|
||||
|
||||
Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI);
|
||||
m_callbackURI = null;
|
||||
//m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(m_callbackURI))
|
||||
{
|
||||
// We cannot sleep here since this would hold up the inbound packet processing thread, as
|
||||
// CompleteMovement() is executed synchronously. However, it might be better to delay the release
|
||||
// here until we know for sure that the agent is active in this region. Sending AgentMovementComplete
|
||||
// is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this
|
||||
// region as the current region, meaning that a close sent before then will fail the teleport.
|
||||
// System.Threading.Thread.Sleep(2000);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
|
||||
client.Name, client.AgentId, m_callbackURI);
|
||||
|
||||
UUID originID;
|
||||
|
||||
lock (m_originRegionIDAccessLock)
|
||||
originID = m_originRegionID;
|
||||
|
||||
Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI);
|
||||
m_callbackURI = null;
|
||||
//m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: No callback provided on CompleteMovement of {0} {1} to {2}",
|
||||
// client.Name, client.AgentId, m_scene.RegionInfo.RegionName);
|
||||
// }
|
||||
|
||||
|
||||
// Tell the client that we're totally ready
|
||||
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
|
||||
//m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
@@ -2187,33 +2189,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
int delayctnr = Util.EnvironmentTickCount();
|
||||
|
||||
if (!IsChildAgent)
|
||||
if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
|
||||
{
|
||||
if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
|
||||
{
|
||||
ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient);
|
||||
}
|
||||
|
||||
// verify baked textures and cache
|
||||
bool cachedbaked = false;
|
||||
|
||||
if (IsNPC)
|
||||
cachedbaked = true;
|
||||
else
|
||||
{
|
||||
if (m_scene.AvatarFactory != null && !isHGTP)
|
||||
cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
|
||||
|
||||
// not sure we need this
|
||||
if (!cachedbaked)
|
||||
{
|
||||
if (m_scene.AvatarFactory != null)
|
||||
m_scene.AvatarFactory.QueueAppearanceSave(UUID);
|
||||
}
|
||||
}
|
||||
//m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient);
|
||||
}
|
||||
|
||||
// verify baked textures and cache
|
||||
bool cachedbaked = false;
|
||||
|
||||
if (IsNPC)
|
||||
cachedbaked = true;
|
||||
else
|
||||
{
|
||||
if (m_scene.AvatarFactory != null && !isHGTP)
|
||||
cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
|
||||
|
||||
// not sure we need this
|
||||
if (!cachedbaked)
|
||||
{
|
||||
if (m_scene.AvatarFactory != null)
|
||||
m_scene.AvatarFactory.QueueAppearanceSave(UUID);
|
||||
}
|
||||
}
|
||||
//m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
if(m_teleportFlags > 0)
|
||||
{
|
||||
gotCrossUpdate = false; // sanity check
|
||||
@@ -2251,104 +2250,103 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
landch.sendClientInitialLandInfo(client, !gotCrossUpdate);
|
||||
}
|
||||
|
||||
if (!IsChildAgent)
|
||||
List<ScenePresence> allpresences = m_scene.GetScenePresences();
|
||||
|
||||
// send avatar object to all presences including us, so they cross it into region
|
||||
// then hide if necessary
|
||||
|
||||
SendInitialAvatarDataToAllAgents(allpresences);
|
||||
|
||||
// send this look
|
||||
SendAppearanceToAgent(this);
|
||||
|
||||
// send this animations
|
||||
|
||||
UUID[] animIDs = null;
|
||||
int[] animseqs = null;
|
||||
UUID[] animsobjs = null;
|
||||
|
||||
if (Animator != null)
|
||||
Animator.GetArrays(out animIDs, out animseqs, out animsobjs);
|
||||
|
||||
bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null);
|
||||
|
||||
if (haveAnims)
|
||||
SendAnimPackToAgent(this, animIDs, animseqs, animsobjs);
|
||||
|
||||
// we should be able to receive updates, etc
|
||||
// so release them
|
||||
m_inTransit = false;
|
||||
|
||||
// send look and animations to others
|
||||
// if not cached we send greys
|
||||
// uncomented if will wait till avatar does baking
|
||||
//if (cachedbaked)
|
||||
{
|
||||
List<ScenePresence> allpresences = m_scene.GetScenePresences();
|
||||
|
||||
// send avatar object to all presences including us, so they cross it into region
|
||||
// then hide if necessary
|
||||
|
||||
SendInitialAvatarDataToAllAgents(allpresences);
|
||||
|
||||
// send this look
|
||||
SendAppearanceToAgent(this);
|
||||
|
||||
// send this animations
|
||||
|
||||
UUID[] animIDs = null;
|
||||
int[] animseqs = null;
|
||||
UUID[] animsobjs = null;
|
||||
|
||||
if (Animator != null)
|
||||
Animator.GetArrays(out animIDs, out animseqs, out animsobjs);
|
||||
|
||||
bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null);
|
||||
|
||||
if (haveAnims)
|
||||
SendAnimPackToAgent(this, animIDs, animseqs, animsobjs);
|
||||
|
||||
// we should be able to receive updates, etc
|
||||
// so release them
|
||||
m_inTransit = false;
|
||||
|
||||
// send look and animations to others
|
||||
// if not cached we send greys
|
||||
// uncomented if will wait till avatar does baking
|
||||
//if (cachedbaked)
|
||||
foreach (ScenePresence p in allpresences)
|
||||
{
|
||||
if (p == this)
|
||||
continue;
|
||||
|
||||
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
||||
continue;
|
||||
|
||||
SendAppearanceToAgentNF(p);
|
||||
if (haveAnims)
|
||||
SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs);
|
||||
}
|
||||
} // greys if
|
||||
|
||||
//m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
// attachments
|
||||
if (IsNPC || IsRealLogin(m_teleportFlags))
|
||||
{
|
||||
if (Scene.AttachmentsModule != null)
|
||||
// Util.FireAndForget(
|
||||
// o =>
|
||||
// {
|
||||
|
||||
if (!IsNPC)
|
||||
Scene.AttachmentsModule.RezAttachments(this);
|
||||
else
|
||||
Util.FireAndForget(x =>
|
||||
{
|
||||
Scene.AttachmentsModule.RezAttachments(this);
|
||||
});
|
||||
|
||||
// });
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_attachments.Count > 0)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
||||
|
||||
foreach (SceneObjectGroup sog in m_attachments)
|
||||
{
|
||||
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
|
||||
foreach (ScenePresence p in allpresences)
|
||||
{
|
||||
if (p == this)
|
||||
{
|
||||
SendAttachmentsToAgentNF(this);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
||||
continue;
|
||||
|
||||
SendAppearanceToAgentNF(p);
|
||||
if (haveAnims)
|
||||
SendAnimPackToAgentNF(p, animIDs, animseqs, animsobjs);
|
||||
}
|
||||
} // greys if
|
||||
|
||||
//m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
// attachments
|
||||
if (IsNPC || IsRealLogin(m_teleportFlags))
|
||||
{
|
||||
if (Scene.AttachmentsModule != null)
|
||||
// Util.FireAndForget(
|
||||
// o =>
|
||||
// {
|
||||
|
||||
if (!IsNPC)
|
||||
Scene.AttachmentsModule.RezAttachments(this);
|
||||
else
|
||||
Util.FireAndForget(x =>
|
||||
{
|
||||
Scene.AttachmentsModule.RezAttachments(this);
|
||||
});
|
||||
|
||||
// });
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_attachments.Count > 0)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
||||
|
||||
foreach (SceneObjectGroup sog in m_attachments)
|
||||
{
|
||||
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
|
||||
foreach (ScenePresence p in allpresences)
|
||||
{
|
||||
if (p == this)
|
||||
{
|
||||
SendAttachmentsToAgentNF(this);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
||||
continue;
|
||||
|
||||
SendAttachmentsToAgentNF(p);
|
||||
}
|
||||
SendAttachmentsToAgentNF(p);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(!IsNPC)
|
||||
{
|
||||
//m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
if (openChildAgents)
|
||||
{
|
||||
@@ -2366,34 +2364,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel;
|
||||
m_childUpdatesBusy = false; // allow them
|
||||
}
|
||||
|
||||
//m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
//m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
// send the rest of the world
|
||||
if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide)
|
||||
SendInitialDataToMe();
|
||||
// send the rest of the world
|
||||
if (m_teleportFlags > 0 | m_currentParcelHide)
|
||||
SendInitialDataToMe();
|
||||
|
||||
// priority uses avatar position only
|
||||
// m_reprioritizationLastPosition = AbsolutePosition;
|
||||
// m_reprioritizationLastDrawDistance = DrawDistance;
|
||||
// m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
|
||||
// m_reprioritizationBusy = false;
|
||||
// priority uses avatar position only
|
||||
// m_reprioritizationLastPosition = AbsolutePosition;
|
||||
// m_reprioritizationLastDrawDistance = DrawDistance;
|
||||
// m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
|
||||
// m_reprioritizationBusy = false;
|
||||
|
||||
//m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
//m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
if (!IsChildAgent && openChildAgents)
|
||||
{
|
||||
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||
if (friendsModule != null)
|
||||
if (openChildAgents)
|
||||
{
|
||||
if(gotCrossUpdate)
|
||||
friendsModule.IsNowRoot(this);
|
||||
else
|
||||
friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
|
||||
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||
if (friendsModule != null)
|
||||
{
|
||||
if(gotCrossUpdate)
|
||||
friendsModule.IsNowRoot(this);
|
||||
else
|
||||
friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
|
||||
}
|
||||
//m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
}
|
||||
//m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -4024,10 +4021,100 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ControllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations);
|
||||
}
|
||||
|
||||
|
||||
public void RegionHandShakeReply (IClientAPI client, uint flags)
|
||||
{
|
||||
if(IsNPC)
|
||||
return;
|
||||
|
||||
bool selfappearance = (flags & 4) != 0;
|
||||
bool cacheCulling = (flags & 1) != 0;
|
||||
bool cacheEmpty;
|
||||
if(cacheCulling)
|
||||
cacheEmpty = (flags & 2) != 0;
|
||||
else
|
||||
cacheEmpty = true;
|
||||
|
||||
if (m_teleportFlags > 0) // only doing for child for now
|
||||
return;
|
||||
|
||||
lock (m_completeMovementLock)
|
||||
{
|
||||
if (SentInitialData)
|
||||
return;
|
||||
SentInitialData = true;
|
||||
}
|
||||
|
||||
Util.FireAndForget(delegate
|
||||
{
|
||||
Scene.SendLayerData(ControllingClient);
|
||||
|
||||
ILandChannel landch = m_scene.LandChannel;
|
||||
if (landch != null)
|
||||
landch.sendClientInitialLandInfo(ControllingClient, true);
|
||||
|
||||
// recheck to reduce timing issues
|
||||
ControllingClient.CheckViewerCaps();
|
||||
|
||||
SendOtherAgentsAvatarFullToMe();
|
||||
/*
|
||||
if (m_scene.ObjectsCullingByDistance && cacheCulling)
|
||||
{
|
||||
m_reprioritizationBusy = true;
|
||||
m_reprioritizationLastPosition = AbsolutePosition;
|
||||
m_reprioritizationLastDrawDistance = DrawDistance;
|
||||
|
||||
ControllingClient.ReprioritizeUpdates();
|
||||
m_reprioritizationLastTime = Util.EnvironmentTickCount();
|
||||
m_reprioritizationBusy = false;
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
EntityBase[] entities = Scene.Entities.GetEntities();
|
||||
if(cacheEmpty)
|
||||
{
|
||||
foreach (EntityBase e in entities)
|
||||
{
|
||||
if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment)
|
||||
((SceneObjectGroup)e).SendFullAnimUpdateToClient(ControllingClient);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (EntityBase e in entities)
|
||||
{
|
||||
if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment)
|
||||
{
|
||||
SceneObjectGroup grp = e as SceneObjectGroup;
|
||||
if(grp.IsViewerCachable)
|
||||
grp.SendUpdateProbes(ControllingClient);
|
||||
else
|
||||
grp.SendFullAnimUpdateToClient(ControllingClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_reprioritizationLastPosition = AbsolutePosition;
|
||||
m_reprioritizationLastDrawDistance = DrawDistance;
|
||||
m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
|
||||
|
||||
m_reprioritizationBusy = false;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void SendInitialDataToMe()
|
||||
{
|
||||
// Send all scene object to the new client
|
||||
SentInitialData = true;
|
||||
lock (m_completeMovementLock)
|
||||
{
|
||||
if (SentInitialData)
|
||||
return;
|
||||
SentInitialData = true;
|
||||
}
|
||||
|
||||
Util.FireAndForget(delegate
|
||||
{
|
||||
// we created a new ScenePresence (a new child agent) in a fresh region.
|
||||
@@ -4280,7 +4367,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if(IsDeleted || !ControllingClient.IsActive)
|
||||
return;
|
||||
|
||||
if(!SentInitialData)
|
||||
bool needsendinitial = false;
|
||||
lock(m_completeMovementLock)
|
||||
{
|
||||
needsendinitial = SentInitialData;
|
||||
}
|
||||
|
||||
if(!needsendinitial)
|
||||
{
|
||||
SendInitialDataToMe();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user