diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-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 | } |