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 | |
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 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 32 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 16 |
3 files changed, 49 insertions, 6 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 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index ebd79e2..9a418b8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1809,7 +1809,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1809 | linkPart.LinkNum = m_parts.Count; | 1809 | linkPart.LinkNum = m_parts.Count; |
1810 | 1810 | ||
1811 | linkPart.SetParent(this); | 1811 | linkPart.SetParent(this); |
1812 | linkPart.AddFlag(PrimFlags.CreateSelected); | 1812 | linkPart.AddFlag(PrimFlags.CreateSelected); |
1813 | 1813 | ||
1814 | //if (linkPart.PhysActor != null) | 1814 | //if (linkPart.PhysActor != null) |
1815 | //{ | 1815 | //{ |
@@ -2081,6 +2081,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
2081 | { | 2081 | { |
2082 | SceneObjectPart selectionPart = GetChildPart(localID); | 2082 | SceneObjectPart selectionPart = GetChildPart(localID); |
2083 | 2083 | ||
2084 | if (data[47] != 0) // Temporary | ||
2085 | DetachFromBackup(); | ||
2086 | |||
2084 | if (selectionPart != null) | 2087 | if (selectionPart != null) |
2085 | { | 2088 | { |
2086 | lock (m_parts) | 2089 | lock (m_parts) |
@@ -2089,7 +2092,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2089 | { | 2092 | { |
2090 | if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) | 2093 | if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) |
2091 | { | 2094 | { |
2092 | data[47] = 0; // Reset physics | 2095 | data[46] = 0; // Reset physics |
2093 | break; | 2096 | break; |
2094 | } | 2097 | } |
2095 | } | 2098 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 9458908..a214884 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -361,6 +361,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
361 | private uint _everyoneMask = (uint)PermissionMask.None; | 361 | private uint _everyoneMask = (uint)PermissionMask.None; |
362 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 362 | private uint _nextOwnerMask = (uint)PermissionMask.All; |
363 | private PrimFlags _flags = 0; | 363 | private PrimFlags _flags = 0; |
364 | private DateTime m_expires; | ||
364 | 365 | ||
365 | public UUID CreatorID { | 366 | public UUID CreatorID { |
366 | get | 367 | get |
@@ -451,6 +452,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
451 | set { m_particleSystem = value; } | 452 | set { m_particleSystem = value; } |
452 | } | 453 | } |
453 | 454 | ||
455 | [XmlIgnore] | ||
456 | public DateTime Expires | ||
457 | { | ||
458 | get { return m_expires; } | ||
459 | set { m_expires = value; } | ||
460 | } | ||
461 | |||
454 | /// <summary> | 462 | /// <summary> |
455 | /// The position of the entire group that this prim belongs to. | 463 | /// The position of the entire group that this prim belongs to. |
456 | /// </summary> | 464 | /// </summary> |
@@ -1050,15 +1058,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1050 | public void AddFlag(PrimFlags flag) | 1058 | public void AddFlag(PrimFlags flag) |
1051 | { | 1059 | { |
1052 | // PrimFlags prevflag = Flags; | 1060 | // PrimFlags prevflag = Flags; |
1053 | //uint objflags = Flags; | ||
1054 | if ((ObjectFlags & (uint) flag) == 0) | 1061 | if ((ObjectFlags & (uint) flag) == 0) |
1055 | { | 1062 | { |
1056 | //Console.WriteLine("Adding flag: " + ((PrimFlags) flag).ToString()); | 1063 | //Console.WriteLine("Adding flag: " + ((PrimFlags) flag).ToString()); |
1057 | _flags |= flag; | 1064 | _flags |= flag; |
1065 | |||
1066 | if (flag == PrimFlags.TemporaryOnRez) | ||
1067 | Expires = DateTime.Now + new TimeSpan(600000000); | ||
1058 | } | 1068 | } |
1059 | //uint currflag = (uint)Flags; | 1069 | // System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString()); |
1060 | //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString()); | ||
1061 | //ScheduleFullUpdate(); | ||
1062 | } | 1070 | } |
1063 | 1071 | ||
1064 | /// <summary> | 1072 | /// <summary> |