aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs125
1 files changed, 61 insertions, 64 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 39b109b..7a6449d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -39,6 +39,7 @@ using OpenMetaverse.Packets;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
41using OpenSim.Region.Framework.Scenes.Scripting; 41using OpenSim.Region.Framework.Scenes.Scripting;
42using OpenSim.Region.Framework.Scenes.Serialization;
42using OpenSim.Region.Physics.Manager; 43using OpenSim.Region.Physics.Manager;
43 44
44namespace OpenSim.Region.Framework.Scenes 45namespace OpenSim.Region.Framework.Scenes
@@ -118,40 +119,36 @@ namespace OpenSim.Region.Framework.Scenes
118 /// <value> 119 /// <value>
119 /// Is this sop a root part? 120 /// Is this sop a root part?
120 /// </value> 121 /// </value>
121 [XmlIgnore] 122
122 public bool IsRoot 123 public bool IsRoot
123 { 124 {
124 get { return ParentGroup.RootPart == this; } 125 get { return ParentGroup.RootPart == this; }
125 } 126 }
126 127
127 // use only one serializer to give the runtime a chance to optimize it (it won't do that if you
128 // use a new instance every time)
129 private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart));
130
131 #region Fields 128 #region Fields
132 129
133 public bool AllowedDrop; 130 public bool AllowedDrop;
134 131
135 [XmlIgnore] 132
136 public bool DIE_AT_EDGE; 133 public bool DIE_AT_EDGE;
137 134
138 [XmlIgnore] 135
139 public bool RETURN_AT_EDGE; 136 public bool RETURN_AT_EDGE;
140 137
141 [XmlIgnore] 138
142 public bool BlockGrab; 139 public bool BlockGrab;
143 140
144 [XmlIgnore] 141
145 public bool StatusSandbox; 142 public bool StatusSandbox;
146 143
147 [XmlIgnore] 144
148 public Vector3 StatusSandboxPos; 145 public Vector3 StatusSandboxPos;
149 146
150 // TODO: This needs to be persisted in next XML version update! 147 // TODO: This needs to be persisted in next XML version update!
151 [XmlIgnore] 148
152 public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; 149 public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
153 150
154 [XmlIgnore] 151
155 public PhysicsActor PhysActor 152 public PhysicsActor PhysActor
156 { 153 {
157 get { return m_physActor; } 154 get { return m_physActor; }
@@ -166,43 +163,43 @@ namespace OpenSim.Region.Framework.Scenes
166 // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet. 163 // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet.
167 // Not a big problem as long as the script that sets it remains in the prim on startup. 164 // Not a big problem as long as the script that sets it remains in the prim on startup.
168 // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script) 165 // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script)
169 [XmlIgnore] 166
170 public UUID Sound; 167 public UUID Sound;
171 168
172 [XmlIgnore] 169
173 public byte SoundFlags; 170 public byte SoundFlags;
174 171
175 [XmlIgnore] 172
176 public double SoundGain; 173 public double SoundGain;
177 174
178 [XmlIgnore] 175
179 public double SoundRadius; 176 public double SoundRadius;
180 177
181 [XmlIgnore] 178
182 public uint TimeStampFull; 179 public uint TimeStampFull;
183 180
184 [XmlIgnore] 181
185 public uint TimeStampLastActivity; // Will be used for AutoReturn 182 public uint TimeStampLastActivity; // Will be used for AutoReturn
186 183
187 [XmlIgnore] 184
188 public uint TimeStampTerse; 185 public uint TimeStampTerse;
189 186
190 [XmlIgnore] 187
191 public UUID FromItemID; 188 public UUID FromItemID;
192 189
193 [XmlIgnore] 190
194 public UUID FromFolderID; 191 public UUID FromFolderID;
195 192
196 [XmlIgnore] 193
197 public int STATUS_ROTATE_X; 194 public int STATUS_ROTATE_X;
198 195
199 [XmlIgnore] 196
200 public int STATUS_ROTATE_Y; 197 public int STATUS_ROTATE_Y;
201 198
202 [XmlIgnore] 199
203 public int STATUS_ROTATE_Z; 200 public int STATUS_ROTATE_Z;
204 201
205 [XmlIgnore] 202
206 private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); 203 private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>();
207 204
208 /// <value> 205 /// <value>
@@ -211,68 +208,68 @@ namespace OpenSim.Region.Framework.Scenes
211 /// </value> 208 /// </value>
212 private UUID m_fromUserInventoryItemID; 209 private UUID m_fromUserInventoryItemID;
213 210
214 [XmlIgnore] 211
215 public UUID FromUserInventoryItemID 212 public UUID FromUserInventoryItemID
216 { 213 {
217 get { return m_fromUserInventoryItemID; } 214 get { return m_fromUserInventoryItemID; }
218 } 215 }
219 216
220 [XmlIgnore] 217
221 public bool IsAttachment; 218 public bool IsAttachment;
222 219
223 [XmlIgnore] 220
224 public scriptEvents AggregateScriptEvents; 221 public scriptEvents AggregateScriptEvents;
225 222
226 [XmlIgnore] 223
227 public UUID AttachedAvatar; 224 public UUID AttachedAvatar;
228 225
229 [XmlIgnore] 226
230 public Vector3 AttachedPos; 227 public Vector3 AttachedPos;
231 228
232 [XmlIgnore] 229
233 public uint AttachmentPoint; 230 public uint AttachmentPoint;
234 231
235 [XmlIgnore] 232
236 public Vector3 RotationAxis = Vector3.One; 233 public Vector3 RotationAxis = Vector3.One;
237 234
238 [XmlIgnore] 235
239 public bool VolumeDetectActive; // XmlIgnore set to avoid problems with persistance until I come to care for this 236 public bool VolumeDetectActive; // XmlIgnore set to avoid problems with persistance until I come to care for this
240 // Certainly this must be a persistant setting finally 237 // Certainly this must be a persistant setting finally
241 238
242 [XmlIgnore] 239
243 public bool IsWaitingForFirstSpinUpdatePacket; 240 public bool IsWaitingForFirstSpinUpdatePacket;
244 241
245 [XmlIgnore] 242
246 public Quaternion SpinOldOrientation = Quaternion.Identity; 243 public Quaternion SpinOldOrientation = Quaternion.Identity;
247 244
248 [XmlIgnore] 245
249 public Quaternion m_APIDTarget = Quaternion.Identity; 246 public Quaternion m_APIDTarget = Quaternion.Identity;
250 247
251 [XmlIgnore] 248
252 public float m_APIDDamp = 0; 249 public float m_APIDDamp = 0;
253 250
254 [XmlIgnore] 251
255 public float m_APIDStrength = 0; 252 public float m_APIDStrength = 0;
256 253
257 /// <summary> 254 /// <summary>
258 /// This part's inventory 255 /// This part's inventory
259 /// </summary> 256 /// </summary>
260 [XmlIgnore] 257
261 public IEntityInventory Inventory 258 public IEntityInventory Inventory
262 { 259 {
263 get { return m_inventory; } 260 get { return m_inventory; }
264 } 261 }
265 protected SceneObjectPartInventory m_inventory; 262 protected SceneObjectPartInventory m_inventory;
266 263
267 [XmlIgnore] 264
268 public bool Undoing; 265 public bool Undoing;
269 266
270 [XmlIgnore] 267
271 public bool IgnoreUndoUpdate = false; 268 public bool IgnoreUndoUpdate = false;
272 269
273 [XmlIgnore] 270
274 private PrimFlags LocalFlags; 271 private PrimFlags LocalFlags;
275 [XmlIgnore] 272
276 private float m_damage = -1.0f; 273 private float m_damage = -1.0f;
277 private byte[] m_TextureAnimation; 274 private byte[] m_TextureAnimation;
278 private byte m_clickAction; 275 private byte m_clickAction;
@@ -280,9 +277,9 @@ namespace OpenSim.Region.Framework.Scenes
280 private string m_description = String.Empty; 277 private string m_description = String.Empty;
281 private readonly List<uint> m_lastColliders = new List<uint>(); 278 private readonly List<uint> m_lastColliders = new List<uint>();
282 private int m_linkNum; 279 private int m_linkNum;
283 [XmlIgnore] 280
284 private int m_scriptAccessPin; 281 private int m_scriptAccessPin;
285 [XmlIgnore] 282
286 private readonly Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); 283 private readonly Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>();
287 private string m_sitName = String.Empty; 284 private string m_sitName = String.Empty;
288 private Quaternion m_sitTargetOrientation = Quaternion.Identity; 285 private Quaternion m_sitTargetOrientation = Quaternion.Identity;
@@ -548,7 +545,7 @@ namespace OpenSim.Region.Framework.Scenes
548 } 545 }
549 546
550 547
551 [XmlIgnore] 548
552 public Dictionary<int, string> CollisionFilter 549 public Dictionary<int, string> CollisionFilter
553 { 550 {
554 get { return m_CollisionFilter; } 551 get { return m_CollisionFilter; }
@@ -558,21 +555,21 @@ namespace OpenSim.Region.Framework.Scenes
558 } 555 }
559 } 556 }
560 557
561 [XmlIgnore] 558
562 public Quaternion APIDTarget 559 public Quaternion APIDTarget
563 { 560 {
564 get { return m_APIDTarget; } 561 get { return m_APIDTarget; }
565 set { m_APIDTarget = value; } 562 set { m_APIDTarget = value; }
566 } 563 }
567 564
568 [XmlIgnore] 565
569 public float APIDDamp 566 public float APIDDamp
570 { 567 {
571 get { return m_APIDDamp; } 568 get { return m_APIDDamp; }
572 set { m_APIDDamp = value; } 569 set { m_APIDDamp = value; }
573 } 570 }
574 571
575 [XmlIgnore] 572
576 public float APIDStrength 573 public float APIDStrength
577 { 574 {
578 get { return m_APIDStrength; } 575 get { return m_APIDStrength; }
@@ -618,35 +615,35 @@ namespace OpenSim.Region.Framework.Scenes
618 set { m_LoopSoundSlavePrims = value; } 615 set { m_LoopSoundSlavePrims = value; }
619 } 616 }
620 617
621 [XmlIgnore] 618
622 public Byte[] TextureAnimation 619 public Byte[] TextureAnimation
623 { 620 {
624 get { return m_TextureAnimation; } 621 get { return m_TextureAnimation; }
625 set { m_TextureAnimation = value; } 622 set { m_TextureAnimation = value; }
626 } 623 }
627 624
628 [XmlIgnore] 625
629 public Byte[] ParticleSystem 626 public Byte[] ParticleSystem
630 { 627 {
631 get { return m_particleSystem; } 628 get { return m_particleSystem; }
632 set { m_particleSystem = value; } 629 set { m_particleSystem = value; }
633 } 630 }
634 631
635 [XmlIgnore] 632
636 public DateTime Expires 633 public DateTime Expires
637 { 634 {
638 get { return m_expires; } 635 get { return m_expires; }
639 set { m_expires = value; } 636 set { m_expires = value; }
640 } 637 }
641 638
642 [XmlIgnore] 639
643 public DateTime Rezzed 640 public DateTime Rezzed
644 { 641 {
645 get { return m_rezzed; } 642 get { return m_rezzed; }
646 set { m_rezzed = value; } 643 set { m_rezzed = value; }
647 } 644 }
648 645
649 [XmlIgnore] 646
650 public float Damage 647 public float Damage
651 { 648 {
652 get { return m_damage; } 649 get { return m_damage; }
@@ -1019,7 +1016,7 @@ namespace OpenSim.Region.Framework.Scenes
1019 } 1016 }
1020 } 1017 }
1021 1018
1022 [XmlIgnore] 1019
1023 public bool CreateSelected 1020 public bool CreateSelected
1024 { 1021 {
1025 get { return m_createSelected; } 1022 get { return m_createSelected; }
@@ -1201,14 +1198,14 @@ namespace OpenSim.Region.Framework.Scenes
1201 } 1198 }
1202 } 1199 }
1203 1200
1204 [XmlIgnore] 1201
1205 public UUID SitTargetAvatar 1202 public UUID SitTargetAvatar
1206 { 1203 {
1207 get { return m_sitTargetAvatar; } 1204 get { return m_sitTargetAvatar; }
1208 set { m_sitTargetAvatar = value; } 1205 set { m_sitTargetAvatar = value; }
1209 } 1206 }
1210 1207
1211 [XmlIgnore] 1208
1212 public virtual UUID RegionID 1209 public virtual UUID RegionID
1213 { 1210 {
1214 get 1211 get
@@ -1222,7 +1219,7 @@ namespace OpenSim.Region.Framework.Scenes
1222 } 1219 }
1223 1220
1224 private UUID _parentUUID = UUID.Zero; 1221 private UUID _parentUUID = UUID.Zero;
1225 [XmlIgnore] 1222
1226 public UUID ParentUUID 1223 public UUID ParentUUID
1227 { 1224 {
1228 get 1225 get
@@ -1236,7 +1233,7 @@ namespace OpenSim.Region.Framework.Scenes
1236 set { _parentUUID = value; } 1233 set { _parentUUID = value; }
1237 } 1234 }
1238 1235
1239 [XmlIgnore] 1236
1240 public string SitAnimation 1237 public string SitAnimation
1241 { 1238 {
1242 get { return m_sitAnimation; } 1239 get { return m_sitAnimation; }
@@ -1850,7 +1847,7 @@ namespace OpenSim.Region.Framework.Scenes
1850 /// </summary> 1847 /// </summary>
1851 /// <param name="xmlReader"></param> 1848 /// <param name="xmlReader"></param>
1852 /// <returns></returns> 1849 /// <returns></returns>
1853 public static SceneObjectPart FromXml(XmlReader xmlReader) 1850 public static SceneObjectPart FromXml(XmlTextReader xmlReader)
1854 { 1851 {
1855 return FromXml(UUID.Zero, xmlReader); 1852 return FromXml(UUID.Zero, xmlReader);
1856 } 1853 }
@@ -1861,9 +1858,9 @@ namespace OpenSim.Region.Framework.Scenes
1861 /// <param name="fromUserInventoryItemId">The inventory id from which this part came, if applicable</param> 1858 /// <param name="fromUserInventoryItemId">The inventory id from which this part came, if applicable</param>
1862 /// <param name="xmlReader"></param> 1859 /// <param name="xmlReader"></param>
1863 /// <returns></returns> 1860 /// <returns></returns>
1864 public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlReader xmlReader) 1861 public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlTextReader xmlReader)
1865 { 1862 {
1866 SceneObjectPart part = (SceneObjectPart)serializer.Deserialize(xmlReader); 1863 SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader);
1867 part.m_fromUserInventoryItemID = fromUserInventoryItemId; 1864 part.m_fromUserInventoryItemID = fromUserInventoryItemId;
1868 1865
1869 // for tempOnRez objects, we have to fix the Expire date. 1866 // for tempOnRez objects, we have to fix the Expire date.
@@ -4058,9 +4055,9 @@ namespace OpenSim.Region.Framework.Scenes
4058 /// Serialize this part to xml. 4055 /// Serialize this part to xml.
4059 /// </summary> 4056 /// </summary>
4060 /// <param name="xmlWriter"></param> 4057 /// <param name="xmlWriter"></param>
4061 public void ToXml(XmlWriter xmlWriter) 4058 public void ToXml(XmlTextWriter xmlWriter)
4062 { 4059 {
4063 serializer.Serialize(xmlWriter, this); 4060 SceneObjectSerializer.SOPToXml2(xmlWriter, this, new Dictionary<string, object>());
4064 } 4061 }
4065 4062
4066 public void TriggerScriptChangedEvent(Changed val) 4063 public void TriggerScriptChangedEvent(Changed val)