diff options
author | Melanie Thielker | 2008-10-03 15:32:44 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-03 15:32:44 +0000 |
commit | 3902149e1b3954ea92e0a2dce1e6a9da3c42b6e8 (patch) | |
tree | 3b797b849b22830d69f83e24500c9b57e4182539 /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | * For shits and giggles, print out the time taken for a server to start up (w... (diff) | |
download | opensim-SC_OLD-3902149e1b3954ea92e0a2dce1e6a9da3c42b6e8.zip opensim-SC_OLD-3902149e1b3954ea92e0a2dce1e6a9da3c42b6e8.tar.gz opensim-SC_OLD-3902149e1b3954ea92e0a2dce1e6a9da3c42b6e8.tar.bz2 opensim-SC_OLD-3902149e1b3954ea92e0a2dce1e6a9da3c42b6e8.tar.xz |
Implement temp-on-rez objecte really being temporary
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 09ebbee..2e28cca 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -760,6 +760,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
760 | if (m_frame % m_update_presences == 0) | 760 | if (m_frame % m_update_presences == 0) |
761 | m_innerScene.UpdatePresences(); | 761 | m_innerScene.UpdatePresences(); |
762 | 762 | ||
763 | // Delete temp-on-rez stuff | ||
764 | if (m_frame % m_update_backup == 0) | ||
765 | CleanTempObjects(); | ||
766 | |||
763 | if (Region_Status != RegionStatus.SlaveScene) | 767 | if (Region_Status != RegionStatus.SlaveScene) |
764 | { | 768 | { |
765 | if (m_frame % m_update_events == 0) | 769 | if (m_frame % m_update_events == 0) |
@@ -2069,6 +2073,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2069 | } | 2073 | } |
2070 | else | 2074 | else |
2071 | { | 2075 | { |
2076 | // Remove, then add, to ensure the expire | ||
2077 | // time is refreshed. Wouldn't do to | ||
2078 | // have it poof before the avatar gets | ||
2079 | // there. | ||
2080 | // | ||
2081 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2072 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2082 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2073 | } | 2083 | } |
2074 | } | 2084 | } |
@@ -4183,5 +4193,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
4183 | break; | 4193 | break; |
4184 | } | 4194 | } |
4185 | } | 4195 | } |
4196 | |||
4197 | public void CleanTempObjects() | ||
4198 | { | ||
4199 | List<EntityBase> objs = GetEntities(); | ||
4200 | |||
4201 | foreach (EntityBase obj in objs) | ||
4202 | { | ||
4203 | if (obj is SceneObjectGroup) | ||
4204 | { | ||
4205 | SceneObjectGroup grp = (SceneObjectGroup)obj; | ||
4206 | |||
4207 | if (grp.RootPart != null) | ||
4208 | { | ||
4209 | if ((grp.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) | ||
4210 | { | ||
4211 | if (grp.RootPart.Expires <= DateTime.Now) | ||
4212 | DeleteSceneObject(grp); | ||
4213 | } | ||
4214 | } | ||
4215 | } | ||
4216 | } | ||
4217 | } | ||
4186 | } | 4218 | } |
4187 | } | 4219 | } |