a few more changes on initial data sending

0.9.1.0-post-fixes
UbitUmarov 2019-03-31 19:28:06 +01:00
parent 89ac80189c
commit 3a6d87da95
1 changed files with 43 additions and 101 deletions

View File

@ -2130,11 +2130,12 @@ namespace OpenSim.Region.Framework.Scenes
{ {
return; // how? return; // how?
} }
//m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); //m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
if (!IsNPC) if (!IsNPC)
{ {
if (!haveGroupInformation && !IsNPC) if (!haveGroupInformation)
{ {
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null) if (gm != null)
@ -2150,54 +2151,46 @@ namespace OpenSim.Region.Framework.Scenes
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);
} }
} }
// Tell the client that we're totally ready
ControllingClient.SendRegionHandshake();
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
//m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts));
// recheck to reduce timing issues if (m_teleportFlags > 0)
ControllingClient.GetViewerCaps(); gotCrossUpdate = false; // sanity check
if (!gotCrossUpdate)
RotateToLookAt(look);
m_previusParcelHide = false;
m_previusParcelUUID = UUID.Zero;
m_currentParcelHide = false;
m_currentParcelUUID = UUID.Zero;
ParcelDwellTickMS = Util.GetTimeStampMS();
m_inTransit = false;
// Tell the client that we're ready to send rest
ControllingClient.SendRegionHandshake();
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0;
int delayctnr = Util.EnvironmentTickCount(); if(!IsNPC)
if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
{ {
ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); if( ParentPart != null && (crossingFlags & 0x08) != 0)
}
// 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) ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient);
}
// verify baked textures and cache
if (m_scene.AvatarFactory != null && !isHGTP)
{
if (!m_scene.AvatarFactory.ValidateBakedTextureCache(this))
m_scene.AvatarFactory.QueueAppearanceSave(UUID); m_scene.AvatarFactory.QueueAppearanceSave(UUID);
} }
} }
//m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); //m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts));
if(m_teleportFlags > 0)
{
gotCrossUpdate = false; // sanity check
if(Util.EnvironmentTickCountSubtract(delayctnr)< 500)
Thread.Sleep(500); // let viewers catch us
}
if(!gotCrossUpdate)
RotateToLookAt(look);
// HG // HG
if(isHGTP) if(isHGTP)
{ {
@ -2205,16 +2198,10 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[CompleteMovement] HG"); m_log.DebugFormat("[CompleteMovement] HG");
} }
m_previusParcelHide = false; if (!IsNPC)
m_previusParcelUUID = UUID.Zero;
m_currentParcelHide = false;
m_currentParcelUUID = UUID.Zero;
ParcelDwellTickMS = Util.GetTimeStampMS();
if(!IsNPC)
{ {
GodController.SyncViewerState(); GodController.SyncViewerState();
// start sending terrain patchs // start sending terrain patchs
if (!gotCrossUpdate) if (!gotCrossUpdate)
Scene.SendLayerData(ControllingClient); Scene.SendLayerData(ControllingClient);
@ -2229,11 +2216,11 @@ namespace OpenSim.Region.Framework.Scenes
// send avatar object to all presences including us, so they cross it into region // send avatar object to all presences including us, so they cross it into region
// then hide if necessary // then hide if necessary
SendInitialAvatarDataToAllAgents(allpresences); SendInitialAvatarDataToAllAgents(allpresences);
// send this look // send this look
SendAppearanceToAgent(this); if (!IsNPC)
SendAppearanceToAgent(this);
// send this animations // send this animations
@ -2246,13 +2233,9 @@ namespace OpenSim.Region.Framework.Scenes
bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null); bool haveAnims = (animIDs != null && animseqs != null && animsobjs != null);
if (haveAnims) if (!IsNPC && haveAnims)
SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); 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 // send look and animations to others
// if not cached we send greys // if not cached we send greys
// uncomented if will wait till avatar does baking // uncomented if will wait till avatar does baking
@ -2272,33 +2255,16 @@ namespace OpenSim.Region.Framework.Scenes
} }
} // greys if } // greys if
//m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
// attachments // attachments
if (IsNPC || IsRealLogin(m_teleportFlags)) if (IsNPC || IsRealLogin(m_teleportFlags))
{ {
if (Scene.AttachmentsModule != null) if (Scene.AttachmentsModule != null)
// Util.FireAndForget( Scene.AttachmentsModule.RezAttachments(this);
// o =>
// {
if (!IsNPC)
Scene.AttachmentsModule.RezAttachments(this);
else
Util.FireAndForget(x =>
{
Scene.AttachmentsModule.RezAttachments(this);
});
// });
} }
else else
{ {
if (m_attachments.Count > 0) 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) foreach (SceneObjectGroup sog in m_attachments)
{ {
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
@ -2320,7 +2286,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
//m_log.DebugFormat("[CompleteMovement] attachments: {0}ms", Util.EnvironmentTickCountSubtract(ts));
if (!IsNPC) if (!IsNPC)
{ {
if (!string.IsNullOrEmpty(m_callbackURI)) if (!string.IsNullOrEmpty(m_callbackURI))
@ -2371,8 +2337,6 @@ namespace OpenSim.Region.Framework.Scenes
m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel;
m_childUpdatesBusy = false; // allow them m_childUpdatesBusy = false; // allow them
//m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
// send the rest of the world // send the rest of the world
if (m_teleportFlags > 0 || m_currentParcelHide) if (m_teleportFlags > 0 || m_currentParcelHide)
//SendInitialDataToMe(); //SendInitialDataToMe();
@ -2384,9 +2348,6 @@ namespace OpenSim.Region.Framework.Scenes
// m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it // m_reprioritizationLastTime = Util.EnvironmentTickCount() + 15000; // delay it
// m_reprioritizationBusy = false; // m_reprioritizationBusy = false;
//m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts));
if (openChildAgents) if (openChildAgents)
{ {
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
@ -3718,10 +3679,7 @@ namespace OpenSim.Region.Framework.Scenes
if (IsChildAgent) if (IsChildAgent)
return; return;
// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick..
sitAnimation = "SIT_GROUND_CONSTRAINED"; sitAnimation = "SIT_GROUND_CONSTRAINED";
// Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
// TriggerScenePresenceUpdated();
SitGround = true; SitGround = true;
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
@ -3822,14 +3780,6 @@ namespace OpenSim.Region.Framework.Scenes
direc.Z = 0; direc.Z = 0;
} }
// m_log.DebugFormat("[SCENE PRESENCE]: Setting force to apply to {0} for {1}", direc, Name);
/*
lock(m_forceToApplyLock)
{
m_forceToApply = direc;
m_forceToApplyValid = true;
}
*/
TargetVelocity = direc; TargetVelocity = direc;
Animator.UpdateMovementAnimations(); Animator.UpdateMovementAnimations();
} }
@ -4054,7 +4004,12 @@ namespace OpenSim.Region.Framework.Scenes
if((flags & 0x1000) == 0) // wait for seeds sending if((flags & 0x1000) == 0) // wait for seeds sending
return; return;
NeedInitialData = false; lock (m_completeMovementLock)
{
if(!NeedInitialData)
return;
NeedInitialData = false;
}
bool selfappearance = (flags & 4) != 0; bool selfappearance = (flags & 4) != 0;
@ -4327,19 +4282,6 @@ namespace OpenSim.Region.Framework.Scenes
if(IsDeleted || !ControllingClient.IsActive) if(IsDeleted || !ControllingClient.IsActive)
return; return;
/*
bool needsendinitial = false;
lock(m_completeMovementLock)
{
needsendinitial = SentInitialData;
}
if(needsendinitial)
{
SendInitialDataToMe();
return;
}
*/
if(m_reprioritizationBusy) if(m_reprioritizationBusy)
return; return;