aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs72
1 files changed, 40 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 8c5afab..60cf061 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -99,6 +99,8 @@ namespace OpenSim.Region.Environment.Scenes
99 private Vector3 lastPhysGroupPos; 99 private Vector3 lastPhysGroupPos;
100 private Quaternion lastPhysGroupRot; 100 private Quaternion lastPhysGroupRot;
101 101
102 private bool m_isBackedUp = false;
103
102 /// <summary> 104 /// <summary>
103 /// The constituent parts of this group 105 /// The constituent parts of this group
104 /// </summary> 106 /// </summary>
@@ -120,7 +122,11 @@ namespace OpenSim.Region.Environment.Scenes
120 /// </summary> 122 /// </summary>
121 public override string Name 123 public override string Name
122 { 124 {
123 get { return RootPart.Name; } 125 get {
126 if (RootPart == null)
127 return "";
128 return RootPart.Name;
129 }
124 set { RootPart.Name = value; } 130 set { RootPart.Name = value; }
125 } 131 }
126 132
@@ -544,7 +550,9 @@ namespace OpenSim.Region.Environment.Scenes
544 //m_log.DebugFormat( 550 //m_log.DebugFormat(
545 // "[SCENE OBJECT GROUP]: Attaching object {0} {1} to scene presistence sweep", Name, UUID); 551 // "[SCENE OBJECT GROUP]: Attaching object {0} {1} to scene presistence sweep", Name, UUID);
546 552
547 m_scene.EventManager.OnBackup += ProcessBackup; 553 if (!m_isBackedUp)
554 m_scene.EventManager.OnBackup += ProcessBackup;
555 m_isBackedUp = true;
548 } 556 }
549 } 557 }
550 558
@@ -786,6 +794,7 @@ namespace OpenSim.Region.Environment.Scenes
786 SetAttachmentPoint((byte)0); 794 SetAttachmentPoint((byte)0);
787 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); 795 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
788 HasGroupChanged = true; 796 HasGroupChanged = true;
797 RootPart.Rezzed = DateTime.Now;
789 AttachToBackup(); 798 AttachToBackup();
790 m_scene.EventManager.TriggerParcelPrimCountTainted(); 799 m_scene.EventManager.TriggerParcelPrimCountTainted();
791 m_rootPart.ScheduleFullUpdate(); 800 m_rootPart.ScheduleFullUpdate();
@@ -1000,6 +1009,8 @@ namespace OpenSim.Region.Environment.Scenes
1000 // that they don't happen, otherwise the deleted objects will reappear 1009 // that they don't happen, otherwise the deleted objects will reappear
1001 m_isDeleted = true; 1010 m_isDeleted = true;
1002 1011
1012 DetachFromBackup();
1013
1003 foreach (SceneObjectPart part in m_parts.Values) 1014 foreach (SceneObjectPart part in m_parts.Values)
1004 { 1015 {
1005 List<ScenePresence> avatars = Scene.GetScenePresences(); 1016 List<ScenePresence> avatars = Scene.GetScenePresences();
@@ -1149,6 +1160,28 @@ namespace OpenSim.Region.Environment.Scenes
1149 // any exception propogate upwards. 1160 // any exception propogate upwards.
1150 try 1161 try
1151 { 1162 {
1163 ILandObject parcel = m_scene.LandChannel.GetLandObject(
1164 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
1165
1166 if (parcel.landData.OtherCleanTime != 0)
1167 {
1168 if (parcel.landData.OwnerID != OwnerID &&
1169 (parcel.landData.GroupID != GroupID ||
1170 parcel.landData.GroupID == UUID.Zero))
1171 {
1172 if ((DateTime.Now - RootPart.Rezzed).TotalMinutes >
1173 parcel.landData.OtherCleanTime)
1174 {
1175 m_log.InfoFormat("[SCENE] Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
1176 m_scene.AddReturn(OwnerID, Name, AbsolutePosition);
1177 m_scene.DeRezObject(null, RootPart.LocalId,
1178 RootPart.GroupID, 9, UUID.Zero);
1179
1180 return;
1181 }
1182 }
1183 }
1184
1152 if (HasGroupChanged) 1185 if (HasGroupChanged)
1153 { 1186 {
1154 // don't backup while it's selected or you're asking for changes mid stream. 1187 // don't backup while it's selected or you're asking for changes mid stream.
@@ -1226,35 +1259,6 @@ namespace OpenSim.Region.Environment.Scenes
1226 } 1259 }
1227 } 1260 }
1228 1261
1229 /// <summary>
1230 /// Send a terse update to the client for the given part
1231 /// </summary>
1232 /// <param name="remoteClient"></param>
1233 /// <param name="part"></param>
1234 internal void SendPartTerseUpdate(IClientAPI remoteClient, SceneObjectPart part)
1235 {
1236 SceneObjectPart rootPart = m_rootPart;
1237
1238 // TODO: that could by caused by some race condition with attachments on sim-crossing
1239 if (rootPart == null) return;
1240
1241 if (rootPart.UUID == part.UUID)
1242 {
1243 if (rootPart.IsAttachment)
1244 {
1245 part.SendTerseUpdateToClient(remoteClient, rootPart.AttachedPos);
1246 }
1247 else
1248 {
1249 part.SendTerseUpdateToClient(remoteClient, AbsolutePosition);
1250 }
1251 }
1252 else
1253 {
1254 part.SendTerseUpdateToClient(remoteClient);
1255 }
1256 }
1257
1258 #endregion 1262 #endregion
1259 1263
1260 #region Copying 1264 #region Copying
@@ -1920,6 +1924,8 @@ namespace OpenSim.Region.Environment.Scenes
1920 if (sendEvents) 1924 if (sendEvents)
1921 linkPart.TriggerScriptChangedEvent(Changed.LINK); 1925 linkPart.TriggerScriptChangedEvent(Changed.LINK);
1922 1926
1927 linkPart.Rezzed = RootPart.Rezzed;
1928
1923 HasGroupChanged = true; 1929 HasGroupChanged = true;
1924 ScheduleGroupForFullUpdate(); 1930 ScheduleGroupForFullUpdate();
1925 } 1931 }
@@ -1937,7 +1943,9 @@ namespace OpenSim.Region.Environment.Scenes
1937 /// <param name="objectGroup"></param> 1943 /// <param name="objectGroup"></param>
1938 public void DetachFromBackup() 1944 public void DetachFromBackup()
1939 { 1945 {
1940 m_scene.EventManager.OnBackup -= ProcessBackup; 1946 if (m_isBackedUp)
1947 m_scene.EventManager.OnBackup -= ProcessBackup;
1948 m_isBackedUp = false;
1941 } 1949 }
1942 1950
1943 private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation) 1951 private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation)