replace datetime.now on just timming by faster utcnow
parent
7524c7729f
commit
4e64445c39
|
@ -5454,6 +5454,7 @@ Label_GroupsDone:
|
|||
|
||||
public void CleanTempObjects()
|
||||
{
|
||||
DateTime now = DateTime.UtcNow;
|
||||
EntityBase[] entities = GetEntities();
|
||||
foreach (EntityBase obj in entities)
|
||||
{
|
||||
|
@ -5465,7 +5466,7 @@ Label_GroupsDone:
|
|||
{
|
||||
if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
|
||||
{
|
||||
if (grp.GetSittingAvatarsCount() == 0 && grp.RootPart.Expires <= DateTime.Now)
|
||||
if (grp.GetSittingAvatarsCount() == 0 && grp.RootPart.Expires <= now)
|
||||
DeleteSceneObject(grp, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,9 +153,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
m_scene.SceneGraph.FireChangeBackup(this);
|
||||
}
|
||||
timeLastChanged = DateTime.Now.Ticks;
|
||||
timeLastChanged = DateTime.UtcNow.Ticks;
|
||||
if (!m_hasGroupChanged)
|
||||
timeFirstChanged = DateTime.Now.Ticks;
|
||||
timeFirstChanged = DateTime.UtcNow.Ticks;
|
||||
if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
|
||||
{
|
||||
/*
|
||||
|
@ -233,7 +233,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_minPersistTime = m_scene.m_dontPersistBefore;
|
||||
}
|
||||
|
||||
long currentTime = DateTime.Now.Ticks;
|
||||
long currentTime = DateTime.UtcNow.Ticks;
|
||||
|
||||
if (timeLastChanged == 0) timeLastChanged = currentTime;
|
||||
if (timeFirstChanged == 0) timeFirstChanged = currentTime;
|
||||
|
|
|
@ -185,8 +185,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
return
|
||||
!(SitTargetPosition == Vector3.Zero
|
||||
&& (SitTargetOrientation == Quaternion.Identity // Valid Zero Rotation quaternion
|
||||
|| SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 1f && SitTargetOrientation.W == 0f // W-Z Mapping was invalid at one point
|
||||
|| SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f && SitTargetOrientation.W == 0f)); // Invalid Quaternion
|
||||
|| (SitTargetOrientation.W == 0f && SitTargetOrientation.X == 0f && SitTargetOrientation.Y == 0f && SitTargetOrientation.Z == 0f ))); // Invalid Quaternion
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1909,7 +1908,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public void ResetExpire()
|
||||
{
|
||||
Expires = DateTime.Now + new TimeSpan(600000000);
|
||||
Expires = DateTime.UtcNow + new TimeSpan(600000000);
|
||||
}
|
||||
|
||||
public void AddFlag(PrimFlags flag)
|
||||
|
|
|
@ -880,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
|||
try
|
||||
{
|
||||
m_CurrentEvent = data.EventName;
|
||||
m_EventStart = DateTime.Now;
|
||||
m_EventStart = DateTime.UtcNow;
|
||||
m_InEvent = true;
|
||||
|
||||
try
|
||||
|
@ -1033,7 +1033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
|||
if (!m_InEvent)
|
||||
return 0;
|
||||
|
||||
return (DateTime.Now - m_EventStart).Seconds;
|
||||
return (DateTime.UtcNow - m_EventStart).Seconds;
|
||||
}
|
||||
|
||||
public void ResetScript(int timeout)
|
||||
|
|
Loading…
Reference in New Issue