aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Animation.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/AnimationSet.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/AvatarAnimations.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs61
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityList.cs21
-rw-r--r--OpenSim/Region/Environment/Scenes/EventManager.cs88
-rw-r--r--OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs117
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs202
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs38
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs303
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs70
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs160
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs319
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs48
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs698
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs398
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs19
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/UndoState.cs10
24 files changed, 1254 insertions, 1385 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Animation.cs b/OpenSim/Region/Environment/Scenes/Animation.cs
index b2fca90..2854e06 100644
--- a/OpenSim/Region/Environment/Scenes/Animation.cs
+++ b/OpenSim/Region/Environment/Scenes/Animation.cs
@@ -26,14 +26,14 @@
26 */ 26 */
27 27
28using System; 28using System;
29using libsecondlife; 29using OpenMetaverse;
30 30
31namespace OpenSim.Region.Environment.Scenes 31namespace OpenSim.Region.Environment.Scenes
32{ 32{
33 public class Animation 33 public class Animation
34 { 34 {
35 private LLUUID animID; 35 private UUID animID;
36 public LLUUID AnimID 36 public UUID AnimID
37 { 37 {
38 get { return animID; } 38 get { return animID; }
39 set { animID = value; } 39 set { animID = value; }
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes
50 { 50 {
51 } 51 }
52 52
53 public Animation(LLUUID animID, int sequenceNum) 53 public Animation(UUID animID, int sequenceNum)
54 { 54 {
55 this.animID = animID; 55 this.animID = animID;
56 this.sequenceNum = sequenceNum; 56 this.sequenceNum = sequenceNum;
diff --git a/OpenSim/Region/Environment/Scenes/AnimationSet.cs b/OpenSim/Region/Environment/Scenes/AnimationSet.cs
index c485d30..0b7188a 100644
--- a/OpenSim/Region/Environment/Scenes/AnimationSet.cs
+++ b/OpenSim/Region/Environment/Scenes/AnimationSet.cs
@@ -27,7 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using OpenMetaverse;
31 31
32namespace OpenSim.Region.Environment.Scenes 32namespace OpenSim.Region.Environment.Scenes
33{ 33{
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes
43 ResetDefaultAnimation(); 43 ResetDefaultAnimation();
44 } 44 }
45 45
46 public bool HasAnimation(LLUUID animID) 46 public bool HasAnimation(UUID animID)
47 { 47 {
48 if (m_defaultAnimation.AnimID == animID) 48 if (m_defaultAnimation.AnimID == animID)
49 return true; 49 return true;
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Environment.Scenes
57 return false; 57 return false;
58 } 58 }
59 59
60 public bool Add(LLUUID animID, int sequenceNum) 60 public bool Add(UUID animID, int sequenceNum)
61 { 61 {
62 lock (m_animations) 62 lock (m_animations)
63 { 63 {
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes
70 return false; 70 return false;
71 } 71 }
72 72
73 public bool Remove(LLUUID animID) 73 public bool Remove(UUID animID)
74 { 74 {
75 lock (m_animations) 75 lock (m_animations)
76 { 76 {
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Scenes
103 /// The default animation is reserved for "main" animations 103 /// The default animation is reserved for "main" animations
104 /// that are mutually exclusive, e.g. flying and sitting. 104 /// that are mutually exclusive, e.g. flying and sitting.
105 /// </summary> 105 /// </summary>
106 public bool SetDefaultAnimation(LLUUID animID, int sequenceNum) 106 public bool SetDefaultAnimation(UUID animID, int sequenceNum)
107 { 107 {
108 if (m_defaultAnimation.AnimID != animID) 108 if (m_defaultAnimation.AnimID != animID)
109 { 109 {
@@ -123,18 +123,18 @@ namespace OpenSim.Region.Environment.Scenes
123 /// </summary> 123 /// </summary>
124 public bool TrySetDefaultAnimation(string anim, int sequenceNum) 124 public bool TrySetDefaultAnimation(string anim, int sequenceNum)
125 { 125 {
126 if (Animations.AnimsLLUUID.ContainsKey(anim)) 126 if (Animations.AnimsUUID.ContainsKey(anim))
127 { 127 {
128 return SetDefaultAnimation(Animations.AnimsLLUUID[anim], sequenceNum); 128 return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum);
129 } 129 }
130 return false; 130 return false;
131 } 131 }
132 132
133 public void GetArrays(out LLUUID[] animIDs, out int[] sequenceNums) 133 public void GetArrays(out UUID[] animIDs, out int[] sequenceNums)
134 { 134 {
135 lock (m_animations) 135 lock (m_animations)
136 { 136 {
137 animIDs = new LLUUID[m_animations.Count + 1]; 137 animIDs = new UUID[m_animations.Count + 1];
138 sequenceNums = new int[m_animations.Count + 1]; 138 sequenceNums = new int[m_animations.Count + 1];
139 139
140 animIDs[0] = m_defaultAnimation.AnimID; 140 animIDs[0] = m_defaultAnimation.AnimID;
diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
index fe9c8e7..6bb5525 100644
--- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
+++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
@@ -27,18 +27,18 @@
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Xml; 29using System.Xml;
30using libsecondlife; 30using OpenMetaverse;
31 31
32namespace OpenSim.Region.Environment.Scenes 32namespace OpenSim.Region.Environment.Scenes
33{ 33{
34 public class AvatarAnimations 34 public class AvatarAnimations
35 { 35 {
36 public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>(); 36 public Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>();
37 public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>(); 37 public Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>();
38 38
39 public AvatarAnimations() 39 public AvatarAnimations()
40 { 40 {
41 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) 41 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.Xml"))
42 { 42 {
43 XmlDocument doc = new XmlDocument(); 43 XmlDocument doc = new XmlDocument();
44 doc.Load(reader); 44 doc.Load(reader);
@@ -47,9 +47,9 @@ namespace OpenSim.Region.Environment.Scenes
47 if (nod.Attributes["name"] != null) 47 if (nod.Attributes["name"] != null)
48 { 48 {
49 string name = (string)nod.Attributes["name"].Value; 49 string name = (string)nod.Attributes["name"].Value;
50 LLUUID id = (LLUUID)nod.InnerText; 50 UUID id = (UUID)nod.InnerText;
51 51
52 AnimsLLUUID.Add(name, id); 52 AnimsUUID.Add(name, id);
53 AnimsNames.Add(id, name); 53 AnimsNames.Add(id, name);
54 } 54 }
55 } 55 }
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 40caabc..884ff32 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -28,8 +28,7 @@
28using System; 28using System;
29using System.Runtime.Serialization; 29using System.Runtime.Serialization;
30using System.Security.Permissions; 30using System.Security.Permissions;
31using Axiom.Math; 31using OpenMetaverse;
32using libsecondlife;
33 32
34namespace OpenSim.Region.Environment.Scenes 33namespace OpenSim.Region.Environment.Scenes
35{ 34{
@@ -45,9 +44,9 @@ namespace OpenSim.Region.Environment.Scenes
45 } 44 }
46 protected Scene m_scene; 45 protected Scene m_scene;
47 46
48 protected LLUUID m_uuid; 47 protected UUID m_uuid;
49 48
50 public virtual LLUUID UUID 49 public virtual UUID UUID
51 { 50 {
52 get { return m_uuid; } 51 get { return m_uuid; }
53 set { m_uuid = value; } 52 set { m_uuid = value; }
@@ -73,30 +72,30 @@ namespace OpenSim.Region.Environment.Scenes
73 } 72 }
74 protected bool m_isDeleted; 73 protected bool m_isDeleted;
75 74
76 protected LLVector3 m_pos; 75 protected Vector3 m_pos;
77 76
78 /// <summary> 77 /// <summary>
79 /// 78 ///
80 /// </summary> 79 /// </summary>
81 public virtual LLVector3 AbsolutePosition 80 public virtual Vector3 AbsolutePosition
82 { 81 {
83 get { return m_pos; } 82 get { return m_pos; }
84 set { m_pos = value; } 83 set { m_pos = value; }
85 } 84 }
86 85
87 protected LLVector3 m_velocity; 86 protected Vector3 m_velocity;
88 protected LLVector3 m_rotationalvelocity; 87 protected Vector3 m_rotationalvelocity;
89 88
90 /// <summary> 89 /// <summary>
91 /// 90 ///
92 /// </summary> 91 /// </summary>
93 public virtual LLVector3 Velocity 92 public virtual Vector3 Velocity
94 { 93 {
95 get { return m_velocity; } 94 get { return m_velocity; }
96 set { m_velocity = value; } 95 set { m_velocity = value; }
97 } 96 }
98 97
99 protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0); 98 protected Quaternion m_rotation = new Quaternion(0f, 0f, 1f, 0f);
100 99
101 public virtual Quaternion Rotation 100 public virtual Quaternion Rotation
102 { 101 {
@@ -117,13 +116,13 @@ namespace OpenSim.Region.Environment.Scenes
117 /// </summary> 116 /// </summary>
118 public EntityBase() 117 public EntityBase()
119 { 118 {
120 m_uuid = LLUUID.Zero; 119 m_uuid = UUID.Zero;
121 120
122 m_pos = new LLVector3(); 121 m_pos = Vector3.Zero;
123 m_velocity = new LLVector3(); 122 m_velocity = Vector3.Zero;
124 Rotation = new Quaternion(); 123 Rotation = Quaternion.Identity;
125 m_name = "(basic entity)"; 124 m_name = "(basic entity)";
126 m_rotationalvelocity = new LLVector3(0, 0, 0); 125 m_rotationalvelocity = Vector3.Zero;
127 } 126 }
128 127
129 /// <summary> 128 /// <summary>
@@ -157,33 +156,33 @@ namespace OpenSim.Region.Environment.Scenes
157 throw new ArgumentNullException("info"); 156 throw new ArgumentNullException("info");
158 } 157 }
159 158
160 m_uuid = new LLUUID((Guid)info.GetValue("m_uuid", typeof(Guid))); 159 m_uuid = new UUID((Guid)info.GetValue("m_uuid", typeof(Guid)));
161 m_name = (string)info.GetValue("m_name", typeof(string)); 160 m_name = (string)info.GetValue("m_name", typeof(string));
162 161
163 m_pos 162 m_pos
164 = new LLVector3( 163 = new Vector3(
165 (float)info.GetValue("m_pos.X", typeof(float)), 164 (float)info.GetValue("m_pos.X", typeof(float)),
166 (float)info.GetValue("m_pos.Y", typeof(float)), 165 (float)info.GetValue("m_pos.Y", typeof(float)),
167 (float)info.GetValue("m_pos.Z", typeof(float))); 166 (float)info.GetValue("m_pos.Z", typeof(float)));
168 167
169 m_velocity 168 m_velocity
170 = new LLVector3( 169 = new Vector3(
171 (float)info.GetValue("m_velocity.X", typeof(float)), 170 (float)info.GetValue("m_velocity.X", typeof(float)),
172 (float)info.GetValue("m_velocity.Y", typeof(float)), 171 (float)info.GetValue("m_velocity.Y", typeof(float)),
173 (float)info.GetValue("m_velocity.Z", typeof(float))); 172 (float)info.GetValue("m_velocity.Z", typeof(float)));
174 173
175 m_rotationalvelocity 174 m_rotationalvelocity
176 = new LLVector3( 175 = new Vector3(
177 (float)info.GetValue("m_rotationalvelocity.X", typeof(float)), 176 (float)info.GetValue("m_rotationalvelocity.X", typeof(float)),
178 (float)info.GetValue("m_rotationalvelocity.Y", typeof(float)), 177 (float)info.GetValue("m_rotationalvelocity.Y", typeof(float)),
179 (float)info.GetValue("m_rotationalvelocity.Z", typeof(float))); 178 (float)info.GetValue("m_rotationalvelocity.Z", typeof(float)));
180 179
181 m_rotation 180 m_rotation
182 = new Quaternion( 181 = new Quaternion(
183 (float)info.GetValue("m_rotation.w", typeof(float)), 182 (float)info.GetValue("m_rotation.X", typeof(float)),
184 (float)info.GetValue("m_rotation.x", typeof(float)), 183 (float)info.GetValue("m_rotation.Y", typeof(float)),
185 (float)info.GetValue("m_rotation.y", typeof(float)), 184 (float)info.GetValue("m_rotation.Z", typeof(float)),
186 (float)info.GetValue("m_rotation.z", typeof(float))); 185 (float)info.GetValue("m_rotation.W", typeof(float)));
187 186
188 m_localId = (uint)info.GetValue("m_localId", typeof(uint)); 187 m_localId = (uint)info.GetValue("m_localId", typeof(uint));
189 188
@@ -200,29 +199,29 @@ namespace OpenSim.Region.Environment.Scenes
200 throw new ArgumentNullException("info"); 199 throw new ArgumentNullException("info");
201 } 200 }
202 201
203 info.AddValue("m_uuid", m_uuid.UUID); 202 info.AddValue("m_uuid", m_uuid.Guid);
204 info.AddValue("m_name", m_name); 203 info.AddValue("m_name", m_name);
205 204
206 // LLVector3 205 // Vector3
207 info.AddValue("m_pos.X", m_pos.X); 206 info.AddValue("m_pos.X", m_pos.X);
208 info.AddValue("m_pos.Y", m_pos.Y); 207 info.AddValue("m_pos.Y", m_pos.Y);
209 info.AddValue("m_pos.Z", m_pos.Z); 208 info.AddValue("m_pos.Z", m_pos.Z);
210 209
211 // LLVector3 210 // Vector3
212 info.AddValue("m_velocity.X", m_velocity.X); 211 info.AddValue("m_velocity.X", m_velocity.X);
213 info.AddValue("m_velocity.Y", m_velocity.Y); 212 info.AddValue("m_velocity.Y", m_velocity.Y);
214 info.AddValue("m_velocity.Z", m_velocity.Z); 213 info.AddValue("m_velocity.Z", m_velocity.Z);
215 214
216 // LLVector3 215 // Vector3
217 info.AddValue("m_rotationalvelocity.X", m_rotationalvelocity.X); 216 info.AddValue("m_rotationalvelocity.X", m_rotationalvelocity.X);
218 info.AddValue("m_rotationalvelocity.Y", m_rotationalvelocity.Y); 217 info.AddValue("m_rotationalvelocity.Y", m_rotationalvelocity.Y);
219 info.AddValue("m_rotationalvelocity.Z", m_rotationalvelocity.Z); 218 info.AddValue("m_rotationalvelocity.Z", m_rotationalvelocity.Z);
220 219
221 // Quaternion 220 // Quaternion
222 info.AddValue("m_rotation.w", m_rotation.w); 221 info.AddValue("m_rotation.X", m_rotation.X);
223 info.AddValue("m_rotation.x", m_rotation.x); 222 info.AddValue("m_rotation.Y", m_rotation.Y);
224 info.AddValue("m_rotation.y", m_rotation.y); 223 info.AddValue("m_rotation.Z", m_rotation.Z);
225 info.AddValue("m_rotation.z", m_rotation.z); 224 info.AddValue("m_rotation.W", m_rotation.W);
226 225
227 info.AddValue("m_localId", m_localId); 226 info.AddValue("m_localId", m_localId);
228 } 227 }
diff --git a/OpenSim/Region/Environment/Scenes/EntityList.cs b/OpenSim/Region/Environment/Scenes/EntityList.cs
index ff8def2..09eb84f 100644
--- a/OpenSim/Region/Environment/Scenes/EntityList.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityList.cs
@@ -29,9 +29,8 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using Axiom.Math; 32using OpenMetaverse;
33using libsecondlife; 33using OpenMetaverse.Packets;
34using libsecondlife.Packets;
35using log4net; 34using log4net;
36using OpenSim.Framework; 35using OpenSim.Framework;
37using OpenSim.Region.Environment.Types; 36using OpenSim.Region.Environment.Types;
@@ -69,9 +68,9 @@ namespace OpenSim.Region.Environment.Scenes
69 // ListObjects() 68 // ListObjects()
70 // ListPresenes() 69 // ListPresenes()
71 // RemoveAll() 70 // RemoveAll()
72 // FindObject(LLUUID) 71 // FindObject(UUID)
73 // FindObject(int) 72 // FindObject(int)
74 // FindPresence(LLUUID) 73 // FindPresence(UUID)
75 74
76 public void Add(SceneObjectGroup obj) 75 public void Add(SceneObjectGroup obj)
77 { 76 {
@@ -84,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes
84 m_pres_by_uuid[pres.UUID] = pres; 83 m_pres_by_uuid[pres.UUID] = pres;
85 } 84 }
86 85
87 public SceneObjectGroup RemoveObject(LLUUID uuid) 86 public SceneObjectGroup RemoveObject(UUID uuid)
88 { 87 {
89 SceneObjectGroup sog = null; 88 SceneObjectGroup sog = null;
90 try 89 try
@@ -101,7 +100,7 @@ namespace OpenSim.Region.Environment.Scenes
101 return sog; 100 return sog;
102 } 101 }
103 102
104 public ScenePresence RemovePresence(LLUUID uuid) 103 public ScenePresence RemovePresence(UUID uuid)
105 { 104 {
106 ScenePresence sp = null; 105 ScenePresence sp = null;
107 try 106 try
@@ -117,7 +116,7 @@ namespace OpenSim.Region.Environment.Scenes
117 return sp; 116 return sp;
118 } 117 }
119 118
120 public SceneObjectGroup FindObject(LLUUID uuid) 119 public SceneObjectGroup FindObject(UUID uuid)
121 { 120 {
122 try 121 try
123 { 122 {
@@ -135,7 +134,7 @@ namespace OpenSim.Region.Environment.Scenes
135 { 134 {
136 try 135 try
137 { 136 {
138 LLUUID uuid = (LLUUID)m_obj_by_local[local]; 137 UUID uuid = (UUID)m_obj_by_local[local];
139 SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid]; 138 SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid];
140 return sog; 139 return sog;
141 } 140 }
@@ -146,7 +145,7 @@ namespace OpenSim.Region.Environment.Scenes
146 } 145 }
147 } 146 }
148 147
149 public ScenePresence FindPresense(LLUUID uuid) 148 public ScenePresence FindPresense(UUID uuid)
150 { 149 {
151 try 150 try
152 { 151 {
@@ -159,4 +158,4 @@ namespace OpenSim.Region.Environment.Scenes
159 } 158 }
160 } 159 }
161 } 160 }
162} \ No newline at end of file 161}
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs
index d48ef0c..58f5efe 100644
--- a/OpenSim/Region/Environment/Scenes/EventManager.cs
+++ b/OpenSim/Region/Environment/Scenes/EventManager.cs
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using libsecondlife; 29using OpenMetaverse;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Environment.Interfaces; 31using OpenSim.Region.Environment.Interfaces;
32using Caps=OpenSim.Framework.Communications.Capabilities.Caps; 32using Caps=OpenSim.Framework.Communications.Capabilities.Caps;
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes
63 63
64 public event OnNewPresenceDelegate OnNewPresence; 64 public event OnNewPresenceDelegate OnNewPresence;
65 65
66 public delegate void OnRemovePresenceDelegate(LLUUID agentId); 66 public delegate void OnRemovePresenceDelegate(UUID agentId);
67 67
68 public event OnRemovePresenceDelegate OnRemovePresence; 68 public event OnRemovePresenceDelegate OnRemovePresence;
69 69
@@ -83,11 +83,11 @@ namespace OpenSim.Region.Environment.Scenes
83 83
84 public event OnShutdownDelegate OnShutdown; 84 public event OnShutdownDelegate OnShutdown;
85 85
86 public delegate void ObjectGrabDelegate(uint localID, uint originalID, LLVector3 offsetPos, IClientAPI remoteClient); 86 public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient);
87 public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient); 87 public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient);
88 public delegate void ScriptResetDelegate(uint localID, LLUUID itemID); 88 public delegate void ScriptResetDelegate(uint localID, UUID itemID);
89 89
90 public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); 90 public delegate void OnPermissionErrorDelegate(UUID user, string reason);
91 91
92 public event ObjectGrabDelegate OnObjectGrab; 92 public event ObjectGrabDelegate OnObjectGrab;
93 public event ObjectDeGrabDelegate OnObjectDeGrab; 93 public event ObjectDeGrabDelegate OnObjectDeGrab;
@@ -95,27 +95,27 @@ namespace OpenSim.Region.Environment.Scenes
95 95
96 public event OnPermissionErrorDelegate OnPermissionError; 96 public event OnPermissionErrorDelegate OnPermissionError;
97 97
98 public delegate void NewRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez); 98 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez);
99 99
100 public event NewRezScript OnRezScript; 100 public event NewRezScript OnRezScript;
101 101
102 public delegate void RemoveScript(uint localID, LLUUID itemID); 102 public delegate void RemoveScript(uint localID, UUID itemID);
103 103
104 public event RemoveScript OnRemoveScript; 104 public event RemoveScript OnRemoveScript;
105 105
106 public delegate void StartScript(uint localID, LLUUID itemID); 106 public delegate void StartScript(uint localID, UUID itemID);
107 107
108 public event StartScript OnStartScript; 108 public event StartScript OnStartScript;
109 109
110 public delegate void StopScript(uint localID, LLUUID itemID); 110 public delegate void StopScript(uint localID, UUID itemID);
111 111
112 public event StopScript OnStopScript; 112 public event StopScript OnStopScript;
113 113
114 public delegate bool SceneGroupMoved(LLUUID groupID, LLVector3 delta); 114 public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta);
115 115
116 public event SceneGroupMoved OnSceneGroupMove; 116 public event SceneGroupMoved OnSceneGroupMove;
117 117
118 public delegate void SceneGroupGrabed(LLUUID groupID, LLVector3 offset, LLUUID userID); 118 public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID);
119 119
120 public event SceneGroupGrabed OnSceneGroupGrab; 120 public event SceneGroupGrabed OnSceneGroupGrab;
121 121
@@ -123,11 +123,11 @@ namespace OpenSim.Region.Environment.Scenes
123 123
124 public event LandObjectAdded OnLandObjectAdded; 124 public event LandObjectAdded OnLandObjectAdded;
125 125
126 public delegate void LandObjectRemoved(LLUUID globalID); 126 public delegate void LandObjectRemoved(UUID globalID);
127 127
128 public event LandObjectRemoved OnLandObjectRemoved; 128 public event LandObjectRemoved OnLandObjectRemoved;
129 129
130 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID); 130 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
131 131
132 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; 132 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
133 133
@@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes
143 143
144 public event NewGridInstantMessage OnGridInstantMessageToGroupsModule; 144 public event NewGridInstantMessage OnGridInstantMessageToGroupsModule;
145 145
146 public delegate void ClientClosed(LLUUID clientID); 146 public delegate void ClientClosed(UUID clientID);
147 147
148 public event ClientClosed OnClientClosed; 148 public event ClientClosed OnClientClosed;
149 149
@@ -151,11 +151,11 @@ namespace OpenSim.Region.Environment.Scenes
151 151
152 public event ScriptChangedEvent OnScriptChangedEvent; 152 public event ScriptChangedEvent OnScriptChangedEvent;
153 153
154 public delegate void ScriptControlEvent(uint localID, LLUUID item, LLUUID avatarID, uint held, uint changed); 154 public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed);
155 155
156 public event ScriptControlEvent OnScriptControlEvent; 156 public event ScriptControlEvent OnScriptControlEvent;
157 157
158 public delegate void ScriptAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); 158 public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
159 159
160 public event ScriptAtTargetEvent OnScriptAtTargetEvent; 160 public event ScriptAtTargetEvent OnScriptAtTargetEvent;
161 161
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes
175 public delegate void OnMakeRootAgentDelegate(ScenePresence presence); 175 public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
176 public event OnMakeRootAgentDelegate OnMakeRootAgent; 176 public event OnMakeRootAgentDelegate OnMakeRootAgent;
177 177
178 public delegate void NewInventoryItemUploadComplete(LLUUID avatarID, LLUUID assetID, string name, int userlevel); 178 public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel);
179 179
180 public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete; 180 public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
181 181
@@ -217,13 +217,13 @@ namespace OpenSim.Region.Environment.Scenes
217 /// has been instantiated and before it is return to the 217 /// has been instantiated and before it is return to the
218 /// client and provides region modules to add their caps. 218 /// client and provides region modules to add their caps.
219 /// </summary> 219 /// </summary>
220 public delegate void RegisterCapsEvent(LLUUID agentID, Caps caps); 220 public delegate void RegisterCapsEvent(UUID agentID, Caps caps);
221 public event RegisterCapsEvent OnRegisterCaps; 221 public event RegisterCapsEvent OnRegisterCaps;
222 /// <summary> 222 /// <summary>
223 /// DeregisterCapsEvent is called by Scene when the caps 223 /// DeregisterCapsEvent is called by Scene when the caps
224 /// handler for an agent are removed. 224 /// handler for an agent are removed.
225 /// </summary> 225 /// </summary>
226 public delegate void DeregisterCapsEvent(LLUUID agentID, Caps caps); 226 public delegate void DeregisterCapsEvent(UUID agentID, Caps caps);
227 public event DeregisterCapsEvent OnDeregisterCaps; 227 public event DeregisterCapsEvent OnDeregisterCaps;
228 /// <summary> 228 /// <summary>
229 /// ChatFromWorldEvent is called via Scene when a chat message 229 /// ChatFromWorldEvent is called via Scene when a chat message
@@ -244,8 +244,8 @@ namespace OpenSim.Region.Environment.Scenes
244 244
245 public class MoneyTransferArgs : EventArgs 245 public class MoneyTransferArgs : EventArgs
246 { 246 {
247 public LLUUID sender; 247 public UUID sender;
248 public LLUUID receiver; 248 public UUID receiver;
249 249
250 // Always false. The SL protocol sucks. 250 // Always false. The SL protocol sucks.
251 public bool authenticated = false; 251 public bool authenticated = false;
@@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes
254 public int transactiontype; 254 public int transactiontype;
255 public string description; 255 public string description;
256 256
257 public MoneyTransferArgs(LLUUID asender, LLUUID areceiver, int aamount, int atransactiontype, string adescription) 257 public MoneyTransferArgs(UUID asender, UUID areceiver, int aamount, int atransactiontype, string adescription)
258 { 258 {
259 sender = asender; 259 sender = asender;
260 receiver = areceiver; 260 receiver = areceiver;
@@ -266,11 +266,11 @@ namespace OpenSim.Region.Environment.Scenes
266 266
267 public class LandBuyArgs : EventArgs 267 public class LandBuyArgs : EventArgs
268 { 268 {
269 public LLUUID agentId = LLUUID.Zero; 269 public UUID agentId = UUID.Zero;
270 270
271 public LLUUID groupId = LLUUID.Zero; 271 public UUID groupId = UUID.Zero;
272 272
273 public LLUUID parcelOwnerID = LLUUID.Zero; 273 public UUID parcelOwnerID = UUID.Zero;
274 274
275 public bool final = false; 275 public bool final = false;
276 public bool groupOwned = false; 276 public bool groupOwned = false;
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes
284 public int transactionID = 0; 284 public int transactionID = 0;
285 public int amountDebited = 0; 285 public int amountDebited = 0;
286 286
287 public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, 287 public LandBuyArgs(UUID pagentId, UUID pgroupId, bool pfinal, bool pgroupOwned,
288 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, 288 bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice,
289 bool pauthenticated) 289 bool pauthenticated)
290 { 290 {
@@ -385,7 +385,7 @@ namespace OpenSim.Region.Environment.Scenes
385 handlerClientMovement(avatar); 385 handlerClientMovement(avatar);
386 } 386 }
387 387
388 public void TriggerPermissionError(LLUUID user, string reason) 388 public void TriggerPermissionError(UUID user, string reason)
389 { 389 {
390 handlerPermissionError = OnPermissionError; 390 handlerPermissionError = OnPermissionError;
391 if (handlerPermissionError != null) 391 if (handlerPermissionError != null)
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Scenes
422 handlerNewPresence(presence); 422 handlerNewPresence(presence);
423 } 423 }
424 424
425 public void TriggerOnRemovePresence(LLUUID agentId) 425 public void TriggerOnRemovePresence(UUID agentId)
426 { 426 {
427 handlerRemovePresence = OnRemovePresence; 427 handlerRemovePresence = OnRemovePresence;
428 if (handlerRemovePresence != null) 428 if (handlerRemovePresence != null)
@@ -492,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes
492 handlerShutdown(); 492 handlerShutdown();
493 } 493 }
494 494
495 public void TriggerObjectGrab(uint localID, uint originalID, LLVector3 offsetPos, IClientAPI remoteClient) 495 public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient)
496 { 496 {
497 handlerObjectGrab = OnObjectGrab; 497 handlerObjectGrab = OnObjectGrab;
498 if (handlerObjectGrab != null) 498 if (handlerObjectGrab != null)
@@ -510,7 +510,7 @@ namespace OpenSim.Region.Environment.Scenes
510 } 510 }
511 } 511 }
512 512
513 public void TriggerScriptReset(uint localID, LLUUID itemID) 513 public void TriggerScriptReset(uint localID, UUID itemID)
514 { 514 {
515 handlerScriptReset = OnScriptReset; 515 handlerScriptReset = OnScriptReset;
516 if (handlerScriptReset != null) 516 if (handlerScriptReset != null)
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes
519 } 519 }
520 } 520 }
521 521
522 public void TriggerRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez) 522 public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez)
523 { 523 {
524 handlerRezScript = OnRezScript; 524 handlerRezScript = OnRezScript;
525 if (handlerRezScript != null) 525 if (handlerRezScript != null)
@@ -528,7 +528,7 @@ namespace OpenSim.Region.Environment.Scenes
528 } 528 }
529 } 529 }
530 530
531 public void TriggerStartScript(uint localID, LLUUID itemID) 531 public void TriggerStartScript(uint localID, UUID itemID)
532 { 532 {
533 handlerStartScript = OnStartScript; 533 handlerStartScript = OnStartScript;
534 if (handlerStartScript != null) 534 if (handlerStartScript != null)
@@ -537,7 +537,7 @@ namespace OpenSim.Region.Environment.Scenes
537 } 537 }
538 } 538 }
539 539
540 public void TriggerStopScript(uint localID, LLUUID itemID) 540 public void TriggerStopScript(uint localID, UUID itemID)
541 { 541 {
542 handlerStopScript = OnStopScript; 542 handlerStopScript = OnStopScript;
543 if (handlerStopScript != null) 543 if (handlerStopScript != null)
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Scenes
546 } 546 }
547 } 547 }
548 548
549 public void TriggerRemoveScript(uint localID, LLUUID itemID) 549 public void TriggerRemoveScript(uint localID, UUID itemID)
550 { 550 {
551 handlerRemoveScript = OnRemoveScript; 551 handlerRemoveScript = OnRemoveScript;
552 if (handlerRemoveScript != null) 552 if (handlerRemoveScript != null)
@@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes
555 } 555 }
556 } 556 }
557 557
558 public bool TriggerGroupMove(LLUUID groupID, LLVector3 delta) 558 public bool TriggerGroupMove(UUID groupID, Vector3 delta)
559 { 559 {
560 handlerSceneGroupMove = OnSceneGroupMove; 560 handlerSceneGroupMove = OnSceneGroupMove;
561 561
@@ -566,7 +566,7 @@ namespace OpenSim.Region.Environment.Scenes
566 return true; 566 return true;
567 } 567 }
568 568
569 public void TriggerGroupGrab(LLUUID groupID, LLVector3 offset, LLUUID userID) 569 public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
570 { 570 {
571 handlerSceneGroupGrab = OnSceneGroupGrab; 571 handlerSceneGroupGrab = OnSceneGroupGrab;
572 if (handlerSceneGroupGrab != null) 572 if (handlerSceneGroupGrab != null)
@@ -585,7 +585,7 @@ namespace OpenSim.Region.Environment.Scenes
585 } 585 }
586 } 586 }
587 587
588 public void TriggerLandObjectRemoved(LLUUID globalID) 588 public void TriggerLandObjectRemoved(UUID globalID)
589 { 589 {
590 handlerLandObjectRemoved = OnLandObjectRemoved; 590 handlerLandObjectRemoved = OnLandObjectRemoved;
591 if (handlerLandObjectRemoved != null) 591 if (handlerLandObjectRemoved != null)
@@ -601,7 +601,7 @@ namespace OpenSim.Region.Environment.Scenes
601 TriggerLandObjectAdded(newParcel); 601 TriggerLandObjectAdded(newParcel);
602 } 602 }
603 603
604 public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID) 604 public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID)
605 { 605 {
606 handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; 606 handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel;
607 607
@@ -634,7 +634,7 @@ namespace OpenSim.Region.Environment.Scenes
634 } 634 }
635 } 635 }
636 636
637 public void TriggerClientClosed(LLUUID ClientID) 637 public void TriggerClientClosed(UUID ClientID)
638 { 638 {
639 handlerClientClosed = OnClientClosed; 639 handlerClientClosed = OnClientClosed;
640 if (handlerClientClosed != null) 640 if (handlerClientClosed != null)
@@ -661,7 +661,7 @@ namespace OpenSim.Region.Environment.Scenes
661 } 661 }
662 } 662 }
663 663
664 public void TriggerOnRegisterCaps(LLUUID agentID, Caps caps) 664 public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
665 { 665 {
666 handlerRegisterCaps = OnRegisterCaps; 666 handlerRegisterCaps = OnRegisterCaps;
667 if (handlerRegisterCaps != null) 667 if (handlerRegisterCaps != null)
@@ -670,7 +670,7 @@ namespace OpenSim.Region.Environment.Scenes
670 } 670 }
671 } 671 }
672 672
673 public void TriggerOnDeregisterCaps(LLUUID agentID, Caps caps) 673 public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
674 { 674 {
675 handlerDeregisterCaps = OnDeregisterCaps; 675 handlerDeregisterCaps = OnDeregisterCaps;
676 if (handlerDeregisterCaps != null) 676 if (handlerDeregisterCaps != null)
@@ -679,7 +679,7 @@ namespace OpenSim.Region.Environment.Scenes
679 } 679 }
680 } 680 }
681 681
682 public void TriggerOnNewInventoryItemUploadComplete(LLUUID agentID, LLUUID AssetID, String AssetName, int userlevel) 682 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel)
683 { 683 {
684 handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; 684 handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
685 if (handlerNewInventoryItemUpdateComplete != null) 685 if (handlerNewInventoryItemUpdateComplete != null)
@@ -706,7 +706,7 @@ namespace OpenSim.Region.Environment.Scenes
706 } 706 }
707 } 707 }
708 708
709 public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) 709 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
710 { 710 {
711 handlerScriptAtTargetEvent = OnScriptAtTargetEvent; 711 handlerScriptAtTargetEvent = OnScriptAtTargetEvent;
712 if (handlerScriptAtTargetEvent != null) 712 if (handlerScriptAtTargetEvent != null)
@@ -769,7 +769,7 @@ namespace OpenSim.Region.Environment.Scenes
769 } 769 }
770 } 770 }
771 771
772 internal void TriggerControlEvent(uint p, LLUUID scriptUUID, LLUUID avatarID, uint held, uint _changed) 772 internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed)
773 { 773 {
774 handlerScriptControlEvent = OnScriptControlEvent; 774 handlerScriptControlEvent = OnScriptControlEvent;
775 if (handlerScriptControlEvent != null) 775 if (handlerScriptControlEvent != null)
diff --git a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs
index 3a20190..9a4c72f 100644
--- a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs
+++ b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs
@@ -25,13 +25,13 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using libsecondlife; 28using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30 30
31namespace OpenSim.Region.Environment.Scenes 31namespace OpenSim.Region.Environment.Scenes
32{ 32{
33 public interface IScenePresenceBody 33 public interface IScenePresenceBody
34 { 34 {
35 void processMovement(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); 35 void processMovement(IClientAPI remoteClient, uint flags, Quaternion bodyRotation);
36 } 36 }
37} 37}
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 658478d..e61fb19 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -28,9 +28,8 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using Axiom.Math; 31using OpenMetaverse;
32using libsecondlife; 32using OpenMetaverse.Packets;
33using libsecondlife.Packets;
34using log4net; 33using log4net;
35using OpenSim.Framework; 34using OpenSim.Framework;
36using OpenSim.Region.Environment.Types; 35using OpenSim.Region.Environment.Types;
@@ -53,11 +52,11 @@ namespace OpenSim.Region.Environment.Scenes
53 52
54 #region Fields 53 #region Fields
55 54
56 protected internal Dictionary<LLUUID, ScenePresence> ScenePresences = new Dictionary<LLUUID, ScenePresence>(); 55 protected internal Dictionary<UUID, ScenePresence> ScenePresences = new Dictionary<UUID, ScenePresence>();
57 // SceneObjects is not currently populated or used. 56 // SceneObjects is not currently populated or used.
58 //public Dictionary<LLUUID, SceneObjectGroup> SceneObjects; 57 //public Dictionary<UUID, SceneObjectGroup> SceneObjects;
59 protected internal Dictionary<LLUUID, EntityBase> Entities = new Dictionary<LLUUID, EntityBase>(); 58 protected internal Dictionary<UUID, EntityBase> Entities = new Dictionary<UUID, EntityBase>();
60 protected internal Dictionary<LLUUID, ScenePresence> RestorePresences = new Dictionary<LLUUID, ScenePresence>(); 59 protected internal Dictionary<UUID, ScenePresence> RestorePresences = new Dictionary<UUID, ScenePresence>();
61 60
62 protected internal BasicQuadTreeNode QuadTree; 61 protected internal BasicQuadTreeNode QuadTree;
63 62
@@ -276,7 +275,7 @@ namespace OpenSim.Region.Environment.Scenes
276 /// </summary> 275 /// </summary>
277 /// <param name="sceneObject"></param> 276 /// <param name="sceneObject"></param>
278 /// <returns>true if the object was deleted, false if there was no object to delete</returns> 277 /// <returns>true if the object was deleted, false if there was no object to delete</returns>
279 protected internal bool DeleteSceneObject(LLUUID uuid, bool resultOfObjectLinked) 278 protected internal bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked)
280 { 279 {
281 lock (Entities) 280 lock (Entities)
282 { 281 {
@@ -378,9 +377,9 @@ namespace OpenSim.Region.Environment.Scenes
378 } 377 }
379 } 378 }
380 379
381 protected internal void HandleUndo(IClientAPI remoteClient, LLUUID primId) 380 protected internal void HandleUndo(IClientAPI remoteClient, UUID primId)
382 { 381 {
383 if (primId != LLUUID.Zero) 382 if (primId != UUID.Zero)
384 { 383 {
385 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); 384 SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId);
386 if (part != null) 385 if (part != null)
@@ -389,7 +388,7 @@ namespace OpenSim.Region.Environment.Scenes
389 } 388 }
390 389
391 protected internal void HandleObjectGroupUpdate( 390 protected internal void HandleObjectGroupUpdate(
392 IClientAPI remoteClient, LLUUID GroupID, uint objectLocalID, LLUUID Garbage) 391 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
393 { 392 {
394 List<EntityBase> EntityList = GetEntities(); 393 List<EntityBase> EntityList = GetEntities();
395 394
@@ -417,17 +416,17 @@ namespace OpenSim.Region.Environment.Scenes
417 /// <param name="objectLocalID"></param> 416 /// <param name="objectLocalID"></param>
418 /// <param name="AttachmentPt"></param> 417 /// <param name="AttachmentPt"></param>
419 /// <param name="rot"></param> 418 /// <param name="rot"></param>
420 protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) 419 protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot)
421 { 420 {
422 // Calls attach with a Zero position 421 // Calls attach with a Zero position
423 422
424 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); 423 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero);
425 } 424 }
426 425
427 public SceneObjectGroup RezSingleAttachment( 426 public SceneObjectGroup RezSingleAttachment(
428 IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) 427 IClientAPI remoteClient, UUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask)
429 { 428 {
430 SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, (byte)1, true, 429 SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
431 (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), 430 (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer),
432 (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), 431 (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer),
433 (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), 432 (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer),
@@ -435,17 +434,17 @@ namespace OpenSim.Region.Environment.Scenes
435 434
436 if (objatt != null) 435 if (objatt != null)
437 { 436 {
438 AttachObject(remoteClient,objatt.LocalId,AttachmentPt,new LLQuaternion(0,0,0,1),objatt.AbsolutePosition); 437 AttachObject(remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition);
439 objatt.ScheduleGroupForFullUpdate(); 438 objatt.ScheduleGroupForFullUpdate();
440 } 439 }
441 return objatt; 440 return objatt;
442 } 441 }
443 442
444 // What makes this method odd and unique is it tries to detach using an LLUUID.... Yay for standards. 443 // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards.
445 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? 444 // To LocalId or UUID, *THAT* is the question. How now Brown UUID??
446 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) 445 public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient)
447 { 446 {
448 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... 447 if (itemID == UUID.Zero) // If this happened, someone made a mistake....
449 return; 448 return;
450 449
451 List<EntityBase> EntityList = GetEntities(); 450 List<EntityBase> EntityList = GetEntities();
@@ -467,7 +466,7 @@ namespace OpenSim.Region.Environment.Scenes
467 } 466 }
468 467
469 protected internal void AttachObject( 468 protected internal void AttachObject(
470 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos) 469 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos)
471 { 470 {
472 List<EntityBase> EntityList = GetEntities(); 471 List<EntityBase> EntityList = GetEntities();
473 foreach (EntityBase obj in EntityList) 472 foreach (EntityBase obj in EntityList)
@@ -485,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes
485 if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) 484 if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint())
486 { 485 {
487 486
488 attachPos = LLVector3.Zero; 487 attachPos = Vector3.Zero;
489 } 488 }
490 489
491 // AttachmentPt 0 means the client chose to 'wear' the attachment. 490 // AttachmentPt 0 means the client chose to 'wear' the attachment.
@@ -503,16 +502,16 @@ namespace OpenSim.Region.Environment.Scenes
503 { 502 {
504 // Stick it on left hand with Zero Offset from the attachment point. 503 // Stick it on left hand with Zero Offset from the attachment point.
505 AttachmentPt = (uint)AttachmentPoint.LeftHand; 504 AttachmentPt = (uint)AttachmentPoint.LeftHand;
506 attachPos = LLVector3.Zero; 505 attachPos = Vector3.Zero;
507 } 506 }
508 m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString()); 507 m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString());
509 508
510 509
511 510
512 // Saves and gets assetID 511 // Saves and gets assetID
513 if (group.GetFromAssetID() == LLUUID.Zero) 512 if (group.GetFromAssetID() == UUID.Zero)
514 { 513 {
515 LLUUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); 514 UUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId);
516 515
517 // sets assetID so client can show asset as 'attached' in inventory 516 // sets assetID so client can show asset as 'attached' in inventory
518 group.SetFromAssetID(newAssetID); 517 group.SetFromAssetID(newAssetID);
@@ -573,7 +572,7 @@ namespace OpenSim.Region.Environment.Scenes
573 /// <summary> 572 /// <summary>
574 /// Remove a presence from the scene 573 /// Remove a presence from the scene
575 /// </summary> 574 /// </summary>
576 protected internal void RemoveScenePresence(LLUUID agentID) 575 protected internal void RemoveScenePresence(UUID agentID)
577 { 576 {
578 lock (Entities) 577 lock (Entities)
579 { 578 {
@@ -696,7 +695,7 @@ namespace OpenSim.Region.Environment.Scenes
696 /// </summary> 695 /// </summary>
697 /// <param name="agentId"></param> 696 /// <param name="agentId"></param>
698 /// <returns>null if either the avatar wasn't in the scene, or they do not have a controlling client</returns> 697 /// <returns>null if either the avatar wasn't in the scene, or they do not have a controlling client</returns>
699 protected internal IClientAPI GetControllingClient(LLUUID agentId) 698 protected internal IClientAPI GetControllingClient(UUID agentId)
700 { 699 {
701 ScenePresence presence = GetScenePresence(agentId); 700 ScenePresence presence = GetScenePresence(agentId);
702 701
@@ -735,7 +734,7 @@ namespace OpenSim.Region.Environment.Scenes
735 /// </summary> 734 /// </summary>
736 /// <param name="avatarID"></param> 735 /// <param name="avatarID"></param>
737 /// <returns>null if the agent was not found</returns> 736 /// <returns>null if the agent was not found</returns>
738 protected internal ScenePresence GetScenePresence(LLUUID agentID) 737 protected internal ScenePresence GetScenePresence(UUID agentID)
739 { 738 {
740 ScenePresence sp; 739 ScenePresence sp;
741 ScenePresences.TryGetValue(agentID, out sp); 740 ScenePresences.TryGetValue(agentID, out sp);
@@ -768,7 +767,7 @@ namespace OpenSim.Region.Environment.Scenes
768 /// </summary> 767 /// </summary>
769 /// <param name="fullID"></param> 768 /// <param name="fullID"></param>
770 /// <returns>null if no scene object group containing that prim is found</returns> 769 /// <returns>null if no scene object group containing that prim is found</returns>
771 private SceneObjectGroup GetGroupByPrim(LLUUID fullID) 770 private SceneObjectGroup GetGroupByPrim(UUID fullID)
772 { 771 {
773 List<EntityBase> EntityList = GetEntities(); 772 List<EntityBase> EntityList = GetEntities();
774 773
@@ -828,7 +827,7 @@ namespace OpenSim.Region.Environment.Scenes
828 /// </summary> 827 /// </summary>
829 /// <param name="fullID"></param> 828 /// <param name="fullID"></param>
830 /// <returns>null if the part was not found</returns> 829 /// <returns>null if the part was not found</returns>
831 protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) 830 protected internal SceneObjectPart GetSceneObjectPart(UUID fullID)
832 { 831 {
833 SceneObjectGroup group = GetGroupByPrim(fullID); 832 SceneObjectGroup group = GetGroupByPrim(fullID);
834 if (group != null) 833 if (group != null)
@@ -837,7 +836,7 @@ namespace OpenSim.Region.Environment.Scenes
837 return null; 836 return null;
838 } 837 }
839 838
840 protected internal bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) 839 protected internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
841 { 840 {
842 ScenePresence presence; 841 ScenePresence presence;
843 if (ScenePresences.TryGetValue(avatarId, out presence)) 842 if (ScenePresences.TryGetValue(avatarId, out presence))
@@ -906,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes
906 if (ent is SceneObjectGroup) 905 if (ent is SceneObjectGroup)
907 { 906 {
908 SceneObjectGroup grp = (SceneObjectGroup)ent; 907 SceneObjectGroup grp = (SceneObjectGroup)ent;
909 if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0) 908 if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
910 { 909 {
911 if (grp.scriptScore >= 0.01) 910 if (grp.scriptScore >= 0.01)
912 { 911 {
@@ -938,13 +937,13 @@ namespace OpenSim.Region.Environment.Scenes
938 } 937 }
939 } 938 }
940 939
941 protected internal LLUUID ConvertLocalIDToFullID(uint localID) 940 protected internal UUID ConvertLocalIDToFullID(uint localID)
942 { 941 {
943 SceneObjectGroup group = GetGroupByPrim(localID); 942 SceneObjectGroup group = GetGroupByPrim(localID);
944 if (group != null) 943 if (group != null)
945 return group.GetPartsFullID(localID); 944 return group.GetPartsFullID(localID);
946 else 945 else
947 return LLUUID.Zero; 946 return UUID.Zero;
948 } 947 }
949 948
950 protected internal void ForEachClient(Action<IClientAPI> action) 949 protected internal void ForEachClient(Action<IClientAPI> action)
@@ -968,7 +967,7 @@ namespace OpenSim.Region.Environment.Scenes
968 /// <param name="localID"></param> 967 /// <param name="localID"></param>
969 /// <param name="scale"></param> 968 /// <param name="scale"></param>
970 /// <param name="remoteClient"></param> 969 /// <param name="remoteClient"></param>
971 protected internal void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) 970 protected internal void UpdatePrimScale(uint localID, Vector3 scale, IClientAPI remoteClient)
972 { 971 {
973 SceneObjectGroup group = GetGroupByPrim(localID); 972 SceneObjectGroup group = GetGroupByPrim(localID);
974 if (group != null) 973 if (group != null)
@@ -980,7 +979,7 @@ namespace OpenSim.Region.Environment.Scenes
980 } 979 }
981 } 980 }
982 981
983 protected internal void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient) 982 protected internal void UpdatePrimGroupScale(uint localID, Vector3 scale, IClientAPI remoteClient)
984 { 983 {
985 SceneObjectGroup group = GetGroupByPrim(localID); 984 SceneObjectGroup group = GetGroupByPrim(localID);
986 if (group != null) 985 if (group != null)
@@ -1001,7 +1000,7 @@ namespace OpenSim.Region.Environment.Scenes
1001 /// <param name="RequestFlags"></param> 1000 /// <param name="RequestFlags"></param>
1002 /// <param name="ObjectID"></param> 1001 /// <param name="ObjectID"></param>
1003 protected internal void RequestObjectPropertiesFamily( 1002 protected internal void RequestObjectPropertiesFamily(
1004 IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags, LLUUID ObjectID) 1003 IClientAPI remoteClient, UUID AgentID, uint RequestFlags, UUID ObjectID)
1005 { 1004 {
1006 SceneObjectGroup group = GetGroupByPrim(ObjectID); 1005 SceneObjectGroup group = GetGroupByPrim(ObjectID);
1007 if (group != null) 1006 if (group != null)
@@ -1016,7 +1015,7 @@ namespace OpenSim.Region.Environment.Scenes
1016 /// <param name="localID"></param> 1015 /// <param name="localID"></param>
1017 /// <param name="rot"></param> 1016 /// <param name="rot"></param>
1018 /// <param name="remoteClient"></param> 1017 /// <param name="remoteClient"></param>
1019 protected internal void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) 1018 protected internal void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
1020 { 1019 {
1021 SceneObjectGroup group = GetGroupByPrim(localID); 1020 SceneObjectGroup group = GetGroupByPrim(localID);
1022 if (group != null) 1021 if (group != null)
@@ -1034,7 +1033,7 @@ namespace OpenSim.Region.Environment.Scenes
1034 /// <param name="localID"></param> 1033 /// <param name="localID"></param>
1035 /// <param name="rot"></param> 1034 /// <param name="rot"></param>
1036 /// <param name="remoteClient"></param> 1035 /// <param name="remoteClient"></param>
1037 protected internal void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) 1036 protected internal void UpdatePrimRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
1038 { 1037 {
1039 SceneObjectGroup group = GetGroupByPrim(localID); 1038 SceneObjectGroup group = GetGroupByPrim(localID);
1040 if (group != null) 1039 if (group != null)
@@ -1053,7 +1052,7 @@ namespace OpenSim.Region.Environment.Scenes
1053 /// <param name="pos"></param> 1052 /// <param name="pos"></param>
1054 /// <param name="rot"></param> 1053 /// <param name="rot"></param>
1055 /// <param name="remoteClient"></param> 1054 /// <param name="remoteClient"></param>
1056 protected internal void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient) 1055 protected internal void UpdatePrimRotation(uint localID, Vector3 pos, Quaternion rot, IClientAPI remoteClient)
1057 { 1056 {
1058 SceneObjectGroup group = GetGroupByPrim(localID); 1057 SceneObjectGroup group = GetGroupByPrim(localID);
1059 if (group != null) 1058 if (group != null)
@@ -1071,12 +1070,12 @@ namespace OpenSim.Region.Environment.Scenes
1071 /// <param name="localID"></param> 1070 /// <param name="localID"></param>
1072 /// <param name="pos"></param> 1071 /// <param name="pos"></param>
1073 /// <param name="remoteClient"></param> 1072 /// <param name="remoteClient"></param>
1074 protected internal void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient) 1073 protected internal void UpdatePrimSinglePosition(uint localID, Vector3 pos, IClientAPI remoteClient)
1075 { 1074 {
1076 SceneObjectGroup group = GetGroupByPrim(localID); 1075 SceneObjectGroup group = GetGroupByPrim(localID);
1077 if (group != null) 1076 if (group != null)
1078 { 1077 {
1079 // LLVector3 oldPos = group.AbsolutePosition; 1078 // Vector3 oldPos = group.AbsolutePosition;
1080 if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) 1079 if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment)
1081 { 1080 {
1082 group.SendGroupTerseUpdate(); 1081 group.SendGroupTerseUpdate();
@@ -1096,13 +1095,13 @@ namespace OpenSim.Region.Environment.Scenes
1096 /// <param name="localID"></param> 1095 /// <param name="localID"></param>
1097 /// <param name="pos"></param> 1096 /// <param name="pos"></param>
1098 /// <param name="remoteClient"></param> 1097 /// <param name="remoteClient"></param>
1099 protected internal void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) 1098 protected internal void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient)
1100 { 1099 {
1101 SceneObjectGroup group = GetGroupByPrim(localID); 1100 SceneObjectGroup group = GetGroupByPrim(localID);
1102 if (group != null) 1101 if (group != null)
1103 { 1102 {
1104 1103
1105 // LLVector3 oldPos = group.AbsolutePosition; 1104 // Vector3 oldPos = group.AbsolutePosition;
1106 if (group.RootPart.IsAttachment) 1105 if (group.RootPart.IsAttachment)
1107 { 1106 {
1108 group.UpdateGroupPosition(pos); 1107 group.UpdateGroupPosition(pos);
@@ -1166,7 +1165,7 @@ namespace OpenSim.Region.Environment.Scenes
1166 /// <param name="offset"></param> 1165 /// <param name="offset"></param>
1167 /// <param name="pos"></param> 1166 /// <param name="pos"></param>
1168 /// <param name="remoteClient"></param> 1167 /// <param name="remoteClient"></param>
1169 protected internal void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 1168 protected internal void MoveObject(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient)
1170 { 1169 {
1171 SceneObjectGroup group = GetGroupByPrim(objectID); 1170 SceneObjectGroup group = GetGroupByPrim(objectID);
1172 if (group != null) 1171 if (group != null)
@@ -1219,7 +1218,7 @@ namespace OpenSim.Region.Environment.Scenes
1219 } 1218 }
1220 } 1219 }
1221 1220
1222 protected internal void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) 1221 protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
1223 { 1222 {
1224 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1223 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1225 1224
@@ -1237,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes
1237 /// </summary> 1236 /// </summary>
1238 /// <param name="primLocalID"></param> 1237 /// <param name="primLocalID"></param>
1239 /// <param name="shapeBlock"></param> 1238 /// <param name="shapeBlock"></param>
1240 protected internal void UpdatePrimShape(LLUUID agentID, uint primLocalID, UpdateShapeArgs shapeBlock) 1239 protected internal void UpdatePrimShape(UUID agentID, uint primLocalID, UpdateShapeArgs shapeBlock)
1241 { 1240 {
1242 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1241 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1243 if (group != null) 1242 if (group != null)
@@ -1323,7 +1322,7 @@ namespace OpenSim.Region.Environment.Scenes
1323 1322
1324 // We need to explicitly resend the newly link prim's object properties since no other actions 1323 // We need to explicitly resend the newly link prim's object properties since no other actions
1325 // occur on link to invoke this elsewhere (such as object selection) 1324 // occur on link to invoke this elsewhere (such as object selection)
1326 parenPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); 1325 parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected);
1327 parenPrim.TriggerScriptChangedEvent(Changed.LINK); 1326 parenPrim.TriggerScriptChangedEvent(Changed.LINK);
1328 if (client != null) 1327 if (client != null)
1329 parenPrim.GetProperties(client); 1328 parenPrim.GetProperties(client);
@@ -1478,8 +1477,8 @@ namespace OpenSim.Region.Environment.Scenes
1478 1477
1479 protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) 1478 protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID)
1480 { 1479 {
1481 LLUUID user = remoteClient.AgentId; 1480 UUID user = remoteClient.AgentId;
1482 LLUUID objid = null; 1481 UUID objid = null;
1483 SceneObjectPart obj = null; 1482 SceneObjectPart obj = null;
1484 1483
1485 List<EntityBase> EntityList = GetEntities(); 1484 List<EntityBase> EntityList = GetEntities();
@@ -1487,7 +1486,7 @@ namespace OpenSim.Region.Environment.Scenes
1487 { 1486 {
1488 if (ent is SceneObjectGroup) 1487 if (ent is SceneObjectGroup)
1489 { 1488 {
1490 foreach (KeyValuePair<LLUUID, SceneObjectPart> subent in ((SceneObjectGroup)ent).Children) 1489 foreach (KeyValuePair<UUID, SceneObjectPart> subent in ((SceneObjectGroup)ent).Children)
1491 { 1490 {
1492 if (subent.Value.LocalId == localID) 1491 if (subent.Value.LocalId == localID)
1493 { 1492 {
@@ -1512,11 +1511,11 @@ namespace OpenSim.Region.Environment.Scenes
1512 1511
1513 if (IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanEditObject(objid, user)) 1512 if (IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanEditObject(objid, user))
1514 { 1513 {
1515 obj.ParentGroup.RootPart.AddFlag(LLObject.ObjectFlags.JointWheel); 1514 obj.ParentGroup.RootPart.AddFlag(PrimFlags.JointWheel);
1516 } 1515 }
1517 else if (!IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(objid,user)) 1516 else if (!IncludeInSearch && m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(objid,user))
1518 { 1517 {
1519 obj.ParentGroup.RootPart.RemFlag(LLObject.ObjectFlags.JointWheel); 1518 obj.ParentGroup.RootPart.RemFlag(PrimFlags.JointWheel);
1520 } 1519 }
1521 } 1520 }
1522 1521
@@ -1526,12 +1525,12 @@ namespace OpenSim.Region.Environment.Scenes
1526 /// <param name="originalPrim"></param> 1525 /// <param name="originalPrim"></param>
1527 /// <param name="offset"></param> 1526 /// <param name="offset"></param>
1528 /// <param name="flags"></param> 1527 /// <param name="flags"></param>
1529 protected internal void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) 1528 protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID)
1530 { 1529 {
1531 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1530 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
1532 1531
1533 // SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero); 1532 // SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero);
1534 DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero); 1533 DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
1535 } 1534 }
1536 /// <summary> 1535 /// <summary>
1537 /// Duplicate the given object. 1536 /// Duplicate the given object.
@@ -1539,7 +1538,7 @@ namespace OpenSim.Region.Environment.Scenes
1539 /// <param name="originalPrim"></param> 1538 /// <param name="originalPrim"></param>
1540 /// <param name="offset"></param> 1539 /// <param name="offset"></param>
1541 /// <param name="flags"></param> 1540 /// <param name="flags"></param>
1542 protected internal SceneObjectGroup DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID, Quaternion rot) 1541 protected internal SceneObjectGroup DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
1543 { 1542 {
1544 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1543 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
1545 1544
@@ -1580,9 +1579,9 @@ namespace OpenSim.Region.Environment.Scenes
1580 1579
1581 m_numPrim += copy.Children.Count; 1580 m_numPrim += copy.Children.Count;
1582 1581
1583 if (rot != Quaternion.Zero) 1582 if (rot != Quaternion.Identity)
1584 { 1583 {
1585 copy.UpdateGroupRotation(new LLQuaternion(rot.x, rot.y, rot.z, rot.w)); 1584 copy.UpdateGroupRotation(rot);
1586 } 1585 }
1587 1586
1588 copy.CreateScriptInstances(0, false); 1587 copy.CreateScriptInstances(0, false);
@@ -1610,7 +1609,7 @@ namespace OpenSim.Region.Environment.Scenes
1610 1609
1611 return 1610 return
1612 (float) 1611 (float)
1613 Math.Sqrt((v1.x - v2.x) * (v1.x - v2.x) + (v1.y - v2.y) * (v1.y - v2.y) + (v1.z - v2.z) * (v1.z - v2.z)); 1612 Math.Sqrt((v1.X - v2.X) * (v1.X - v2.X) + (v1.Y - v2.Y) * (v1.Y - v2.Y) + (v1.Z - v2.Z) * (v1.Z - v2.Z));
1614 } 1613 }
1615 1614
1616 #endregion 1615 #endregion
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index ab580ae..cdd6943 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -30,8 +30,8 @@ using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Text; 31using System.Text;
32using System.Timers; 32using System.Timers;
33using libsecondlife; 33using OpenMetaverse;
34using libsecondlife.Packets; 34using OpenMetaverse.Packets;
35using log4net; 35using log4net;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Communications.Cache; 37using OpenSim.Framework.Communications.Cache;
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Scenes
46 public EntityBase selectedEnt; 46 public EntityBase selectedEnt;
47 public IClientAPI remoteClient; 47 public IClientAPI remoteClient;
48 public SceneObjectGroup objectGroup; 48 public SceneObjectGroup objectGroup;
49 public LLUUID folderID; 49 public UUID folderID;
50 public bool permissionToDelete; 50 public bool permissionToDelete;
51 } 51 }
52 52
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes
74 } 74 }
75 } 75 }
76 76
77 public void AddUploadedInventoryItem(LLUUID agentID, InventoryItemBase item) 77 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
78 { 78 {
79 IMoneyModule money=RequestModuleInterface<IMoneyModule>(); 79 IMoneyModule money=RequestModuleInterface<IMoneyModule>();
80 if (money != null) 80 if (money != null)
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Scenes
85 AddInventoryItem(agentID, item); 85 AddInventoryItem(agentID, item);
86 } 86 }
87 87
88 public bool AddInventoryItemReturned(LLUUID AgentId, InventoryItemBase item) 88 public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item)
89 { 89 {
90 CachedUserInfo userInfo 90 CachedUserInfo userInfo
91 = CommsManager.UserProfileCacheService.GetUserDetails(AgentId); 91 = CommsManager.UserProfileCacheService.GetUserDetails(AgentId);
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Scenes
103 } 103 }
104 } 104 }
105 105
106 public void AddInventoryItem(LLUUID AgentID, InventoryItemBase item) 106 public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
107 { 107 {
108 CachedUserInfo userInfo 108 CachedUserInfo userInfo
109 = CommsManager.UserProfileCacheService.GetUserDetails(AgentID); 109 = CommsManager.UserProfileCacheService.GetUserDetails(AgentID);
@@ -160,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes
160 /// <param name="itemID"></param> 160 /// <param name="itemID"></param>
161 /// <param name="data"></param> 161 /// <param name="data"></param>
162 /// <returns></returns> 162 /// <returns></returns>
163 public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) 163 public UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
164 { 164 {
165 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 165 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
166 if (userInfo != null) 166 if (userInfo != null)
@@ -192,13 +192,13 @@ namespace OpenSim.Region.Environment.Scenes
192 } 192 }
193 } 193 }
194 } 194 }
195 return LLUUID.Zero; 195 return UUID.Zero;
196 } 196 }
197 197
198 /// <summary> 198 /// <summary>
199 /// <see>CapsUpdatedInventoryItemAsset(IClientAPI, LLUUID, byte[])</see> 199 /// <see>CapsUpdatedInventoryItemAsset(IClientAPI, UUID, byte[])</see>
200 /// </summary> 200 /// </summary>
201 private LLUUID CapsUpdateInventoryItemAsset(LLUUID avatarId, LLUUID itemID, byte[] data) 201 private UUID CapsUpdateInventoryItemAsset(UUID avatarId, UUID itemID, byte[] data)
202 { 202 {
203 ScenePresence avatar; 203 ScenePresence avatar;
204 204
@@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Scenes
214 avatarId); 214 avatarId);
215 } 215 }
216 216
217 return LLUUID.Zero; 217 return UUID.Zero;
218 } 218 }
219 219
220 /// <summary> 220 /// <summary>
@@ -225,8 +225,8 @@ namespace OpenSim.Region.Environment.Scenes
225 /// <param name="primID">The prim which contains the item to update</param> 225 /// <param name="primID">The prim which contains the item to update</param>
226 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> 226 /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
227 /// <param name="data"></param> 227 /// <param name="data"></param>
228 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId, 228 public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId,
229 LLUUID primId, bool isScriptRunning, byte[] data) 229 UUID primId, bool isScriptRunning, byte[] data)
230 { 230 {
231 // Retrieve group 231 // Retrieve group
232 SceneObjectPart part = GetSceneObjectPart(primId); 232 SceneObjectPart part = GetSceneObjectPart(primId);
@@ -274,10 +274,10 @@ namespace OpenSim.Region.Environment.Scenes
274 } 274 }
275 275
276 /// <summary> 276 /// <summary>
277 /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see> 277 /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, UUID, UUID, bool, byte[])</see>
278 /// </summary> 278 /// </summary>
279 private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId, 279 private void CapsUpdateTaskInventoryScriptAsset(UUID avatarId, UUID itemId,
280 LLUUID primId, bool isScriptRunning, byte[] data) 280 UUID primId, bool isScriptRunning, byte[] data)
281 { 281 {
282 ScenePresence avatar; 282 ScenePresence avatar;
283 283
@@ -300,17 +300,17 @@ namespace OpenSim.Region.Environment.Scenes
300 /// a transaction 300 /// a transaction
301 /// </summary> 301 /// </summary>
302 /// <param name="remoteClient"></param> 302 /// <param name="remoteClient"></param>
303 /// <param name="transactionID">The transaction ID. If this is LLUUID.Zero we will 303 /// <param name="transactionID">The transaction ID. If this is UUID.Zero we will
304 /// assume that we are not in a transaction</param> 304 /// assume that we are not in a transaction</param>
305 /// <param name="itemID">The ID of the updated item</param> 305 /// <param name="itemID">The ID of the updated item</param>
306 /// <param name="name">The name of the updated item</param> 306 /// <param name="name">The name of the updated item</param>
307 /// <param name="description">The description of the updated item</param> 307 /// <param name="description">The description of the updated item</param>
308 /// <param name="nextOwnerMask">The permissions of the updated item</param> 308 /// <param name="nextOwnerMask">The permissions of the updated item</param>
309/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, 309/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
310 LLUUID itemID, string name, string description, 310 UUID itemID, string name, string description,
311 uint nextOwnerMask)*/ 311 uint nextOwnerMask)*/
312 public void UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, 312 public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
313 LLUUID itemID, InventoryItemBase itemUpd) 313 UUID itemID, InventoryItemBase itemUpd)
314 { 314 {
315 CachedUserInfo userInfo 315 CachedUserInfo userInfo
316 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 316 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Environment.Scenes
321 321
322 if (item != null) 322 if (item != null)
323 { 323 {
324 if (LLUUID.Zero == transactionID) 324 if (UUID.Zero == transactionID)
325 { 325 {
326 item.Name = itemUpd.Name; 326 item.Name = itemUpd.Name;
327 item.Description = itemUpd.Description; 327 item.Description = itemUpd.Description;
@@ -378,7 +378,7 @@ namespace OpenSim.Region.Environment.Scenes
378 /// <param name="recipientClient"></param> 378 /// <param name="recipientClient"></param>
379 /// <param name="senderId">ID of the sender of the item</param> 379 /// <param name="senderId">ID of the sender of the item</param>
380 /// <param name="itemId"></param> 380 /// <param name="itemId"></param>
381 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId) 381 public void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId)
382 { 382 {
383 // Retrieve the item from the sender 383 // Retrieve the item from the sender
384 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); 384 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId);
@@ -413,13 +413,13 @@ namespace OpenSim.Region.Environment.Scenes
413 InventoryItemBase itemCopy = new InventoryItemBase(); 413 InventoryItemBase itemCopy = new InventoryItemBase();
414 itemCopy.Owner = recipientClient.AgentId; 414 itemCopy.Owner = recipientClient.AgentId;
415 itemCopy.Creator = senderId; 415 itemCopy.Creator = senderId;
416 itemCopy.ID = LLUUID.Random(); 416 itemCopy.ID = UUID.Random();
417 itemCopy.AssetID = item.AssetID; 417 itemCopy.AssetID = item.AssetID;
418 itemCopy.Description = item.Description; 418 itemCopy.Description = item.Description;
419 itemCopy.Name = item.Name; 419 itemCopy.Name = item.Name;
420 itemCopy.AssetType = item.AssetType; 420 itemCopy.AssetType = item.AssetType;
421 itemCopy.InvType = item.InvType; 421 itemCopy.InvType = item.InvType;
422 itemCopy.Folder = LLUUID.Zero; 422 itemCopy.Folder = UUID.Zero;
423 if (ExternalChecks.ExternalChecksPropagatePermissions()) 423 if (ExternalChecks.ExternalChecksPropagatePermissions())
424 { 424 {
425 if (item.InvType == 6) 425 if (item.InvType == 6)
@@ -493,8 +493,8 @@ namespace OpenSim.Region.Environment.Scenes
493 } 493 }
494 } 494 }
495 495
496 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, 496 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, UUID oldAgentID, UUID oldItemID,
497 LLUUID newFolderID, string newName) 497 UUID newFolderID, string newName)
498 { 498 {
499 m_log.DebugFormat( 499 m_log.DebugFormat(
500 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}", 500 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
@@ -579,7 +579,7 @@ namespace OpenSim.Region.Environment.Scenes
579 asset.Name = name; 579 asset.Name = name;
580 asset.Description = description; 580 asset.Description = description;
581 asset.Type = assetType; 581 asset.Type = assetType;
582 asset.FullID = LLUUID.Random(); 582 asset.FullID = UUID.Random();
583 asset.Data = (data == null) ? new byte[1] : data; 583 asset.Data = (data == null) ? new byte[1] : data;
584 584
585 return asset; 585 return asset;
@@ -593,7 +593,7 @@ namespace OpenSim.Region.Environment.Scenes
593 /// <param name="itemID"></param> 593 /// <param name="itemID"></param>
594 /// <param name="length"></param> 594 /// <param name="length"></param>
595 /// <param name="newName"></param> 595 /// <param name="newName"></param>
596 public void MoveInventoryItem(IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, 596 public void MoveInventoryItem(IClientAPI remoteClient, UUID folderID, UUID itemID, int length,
597 string newName) 597 string newName)
598 { 598 {
599 m_log.DebugFormat( 599 m_log.DebugFormat(
@@ -648,7 +648,7 @@ namespace OpenSim.Region.Environment.Scenes
648 /// <param name="asset"></param> 648 /// <param name="asset"></param>
649 /// <param name="invType"></param> 649 /// <param name="invType"></param>
650 /// <param name="nextOwnerMask"></param> 650 /// <param name="nextOwnerMask"></param>
651 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, 651 private void CreateNewInventoryItem(IClientAPI remoteClient, UUID folderID, string name, uint flags, uint callbackID,
652 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) 652 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
653 { 653 {
654 CreateNewInventoryItem( 654 CreateNewInventoryItem(
@@ -667,7 +667,7 @@ namespace OpenSim.Region.Environment.Scenes
667 /// <param name="nextOwnerMask"></param> 667 /// <param name="nextOwnerMask"></param>
668 /// <param name="creationDate"></param> 668 /// <param name="creationDate"></param>
669 private void CreateNewInventoryItem( 669 private void CreateNewInventoryItem(
670 IClientAPI remoteClient, LLUUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, 670 IClientAPI remoteClient, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType,
671 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, int creationDate) 671 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, int creationDate)
672 { 672 {
673 CachedUserInfo userInfo 673 CachedUserInfo userInfo
@@ -678,7 +678,7 @@ namespace OpenSim.Region.Environment.Scenes
678 InventoryItemBase item = new InventoryItemBase(); 678 InventoryItemBase item = new InventoryItemBase();
679 item.Owner = remoteClient.AgentId; 679 item.Owner = remoteClient.AgentId;
680 item.Creator = remoteClient.AgentId; 680 item.Creator = remoteClient.AgentId;
681 item.ID = LLUUID.Random(); 681 item.ID = UUID.Random();
682 item.AssetID = asset.FullID; 682 item.AssetID = asset.FullID;
683 item.Description = asset.Description; 683 item.Description = asset.Description;
684 item.Name = name; 684 item.Name = name;
@@ -717,14 +717,14 @@ namespace OpenSim.Region.Environment.Scenes
717 /// <param name="type"></param> 717 /// <param name="type"></param>
718 /// <param name="wearableType"></param> 718 /// <param name="wearableType"></param>
719 /// <param name="nextOwnerMask"></param> 719 /// <param name="nextOwnerMask"></param>
720 public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, 720 public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
721 uint callbackID, string description, string name, sbyte invType, 721 uint callbackID, string description, string name, sbyte invType,
722 sbyte assetType, 722 sbyte assetType,
723 byte wearableType, uint nextOwnerMask, int creationDate) 723 byte wearableType, uint nextOwnerMask, int creationDate)
724 { 724 {
725// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); 725// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
726 726
727 if (transactionID == LLUUID.Zero) 727 if (transactionID == UUID.Zero)
728 { 728 {
729 CachedUserInfo userInfo 729 CachedUserInfo userInfo
730 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 730 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -734,9 +734,9 @@ namespace OpenSim.Region.Environment.Scenes
734 ScenePresence presence; 734 ScenePresence presence;
735 TryGetAvatar(remoteClient.AgentId, out presence); 735 TryGetAvatar(remoteClient.AgentId, out presence);
736 byte[] data = null; 736 byte[] data = null;
737 if (invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum 737 if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum
738 { 738 {
739 LLVector3 pos=presence.AbsolutePosition; 739 Vector3 pos=presence.AbsolutePosition;
740 string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n", 740 string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
741 presence.Scene.RegionInfo.RegionID, 741 presence.Scene.RegionInfo.RegionID,
742 pos.X, pos.Y, pos.Z, 742 pos.X, pos.Y, pos.Z,
@@ -775,7 +775,7 @@ namespace OpenSim.Region.Environment.Scenes
775 /// </summary> 775 /// </summary>
776 /// <param name="remoteClient"></param> 776 /// <param name="remoteClient"></param>
777 /// <param name="itemID"></param> 777 /// <param name="itemID"></param>
778 private void RemoveInventoryItem(IClientAPI remoteClient, LLUUID itemID) 778 private void RemoveInventoryItem(IClientAPI remoteClient, UUID itemID)
779 { 779 {
780 CachedUserInfo userInfo 780 CachedUserInfo userInfo
781 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 781 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -798,7 +798,7 @@ namespace OpenSim.Region.Environment.Scenes
798 /// </summary> 798 /// </summary>
799 /// <param name="remoteClient"></param> 799 /// <param name="remoteClient"></param>
800 /// <param name="folderID"></param> 800 /// <param name="folderID"></param>
801 private void RemoveInventoryFolder(IClientAPI remoteClient, LLUUID folderID) 801 private void RemoveInventoryFolder(IClientAPI remoteClient, UUID folderID)
802 { 802 {
803 CachedUserInfo userInfo 803 CachedUserInfo userInfo
804 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 804 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -873,7 +873,7 @@ namespace OpenSim.Region.Environment.Scenes
873 /// be necessary for a permissions check at some stage.</param> 873 /// be necessary for a permissions check at some stage.</param>
874 /// <param name="itemID"></param> 874 /// <param name="itemID"></param>
875 /// <param name="localID"></param> 875 /// <param name="localID"></param>
876 public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID) 876 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
877 { 877 {
878 SceneObjectPart part = GetSceneObjectPart(localID); 878 SceneObjectPart part = GetSceneObjectPart(localID);
879 SceneObjectGroup group = part.ParentGroup; 879 SceneObjectGroup group = part.ParentGroup;
@@ -896,7 +896,7 @@ namespace OpenSim.Region.Environment.Scenes
896 } 896 }
897 } 897 }
898 898
899 private InventoryItemBase CreateAgentInventoryItemFromTask(LLUUID destAgent, SceneObjectPart part, LLUUID itemId) 899 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
900 { 900 {
901 TaskInventoryItem taskItem = part.GetInventoryItem(itemId); 901 TaskInventoryItem taskItem = part.GetInventoryItem(itemId);
902 902
@@ -913,7 +913,7 @@ namespace OpenSim.Region.Environment.Scenes
913 913
914 InventoryItemBase agentItem = new InventoryItemBase(); 914 InventoryItemBase agentItem = new InventoryItemBase();
915 915
916 agentItem.ID = LLUUID.Random(); 916 agentItem.ID = UUID.Random();
917 agentItem.Creator = taskItem.CreatorID; 917 agentItem.Creator = taskItem.CreatorID;
918 agentItem.Owner = destAgent; 918 agentItem.Owner = destAgent;
919 agentItem.AssetID = taskItem.AssetID; 919 agentItem.AssetID = taskItem.AssetID;
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
954 /// <param name="folderID"></param> 954 /// <param name="folderID"></param>
955 /// <param name="part"></param> 955 /// <param name="part"></param>
956 /// <param name="itemID"></param> 956 /// <param name="itemID"></param>
957 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, SceneObjectPart part, LLUUID itemId) 957 public void MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId)
958 { 958 {
959 959
960 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId); 960 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId);
@@ -970,7 +970,7 @@ namespace OpenSim.Region.Environment.Scenes
970 /// <param name="folderID"></param> 970 /// <param name="folderID"></param>
971 /// <param name="primLocalID"></param> 971 /// <param name="primLocalID"></param>
972 /// <param name="itemID"></param> 972 /// <param name="itemID"></param>
973 public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 973 public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, uint primLocalId, UUID itemId)
974 { 974 {
975 SceneObjectPart part = GetSceneObjectPart(primLocalId); 975 SceneObjectPart part = GetSceneObjectPart(primLocalId);
976 976
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Environment.Scenes
1009 /// <param name="folderID"></param> 1009 /// <param name="folderID"></param>
1010 /// <param name="part"></param> 1010 /// <param name="part"></param>
1011 /// <param name="itemID"></param> 1011 /// <param name="itemID"></param>
1012 public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId) 1012 public void MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId)
1013 { 1013 {
1014 ScenePresence avatar; 1014 ScenePresence avatar;
1015 1015
@@ -1040,7 +1040,7 @@ namespace OpenSim.Region.Environment.Scenes
1040 /// <param name="destId"></param> 1040 /// <param name="destId"></param>
1041 /// <param name="part"></param> 1041 /// <param name="part"></param>
1042 /// <param name="itemId"></param> 1042 /// <param name="itemId"></param>
1043 public void MoveTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId) 1043 public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId)
1044 { 1044 {
1045 TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId); 1045 TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId);
1046 1046
@@ -1065,7 +1065,7 @@ namespace OpenSim.Region.Environment.Scenes
1065 return; 1065 return;
1066 } 1066 }
1067 1067
1068 if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) 1068 if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
1069 { 1069 {
1070 // object cannot copy items to an object owned by a different owner 1070 // object cannot copy items to an object owned by a different owner
1071 // unless llAllowInventoryDrop has been called 1071 // unless llAllowInventoryDrop has been called
@@ -1081,7 +1081,7 @@ namespace OpenSim.Region.Environment.Scenes
1081 1081
1082 TaskInventoryItem destTaskItem = new TaskInventoryItem(); 1082 TaskInventoryItem destTaskItem = new TaskInventoryItem();
1083 1083
1084 destTaskItem.ItemID = LLUUID.Random(); 1084 destTaskItem.ItemID = UUID.Random();
1085 destTaskItem.CreatorID = srcTaskItem.CreatorID; 1085 destTaskItem.CreatorID = srcTaskItem.CreatorID;
1086 destTaskItem.AssetID = srcTaskItem.AssetID; 1086 destTaskItem.AssetID = srcTaskItem.AssetID;
1087 destTaskItem.GroupID = destPart.GroupID; 1087 destTaskItem.GroupID = destPart.GroupID;
@@ -1130,7 +1130,7 @@ namespace OpenSim.Region.Environment.Scenes
1130 } 1130 }
1131 } 1131 }
1132 1132
1133 public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) 1133 public void MoveTaskInventoryItems(UUID destID, string category, SceneObjectPart host, List<UUID> items)
1134 { 1134 {
1135 CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); 1135 CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID);
1136 if (profile == null || profile.RootFolder == null) 1136 if (profile == null || profile.RootFolder == null)
@@ -1142,11 +1142,11 @@ namespace OpenSim.Region.Environment.Scenes
1142 return; 1142 return;
1143 } 1143 }
1144 1144
1145 LLUUID newFolderID = LLUUID.Random(); 1145 UUID newFolderID = UUID.Random();
1146 1146
1147 profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); 1147 profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID);
1148 1148
1149 foreach (LLUUID itemID in items) 1149 foreach (UUID itemID in items)
1150 { 1150 {
1151 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID); 1151 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(destID, host, itemID);
1152 agentItem.Folder = newFolderID; 1152 agentItem.Folder = newFolderID;
@@ -1167,16 +1167,16 @@ namespace OpenSim.Region.Environment.Scenes
1167 1167
1168 /// <summary> 1168 /// <summary>
1169 /// Update an item in a prim (task) inventory. 1169 /// Update an item in a prim (task) inventory.
1170 /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> 1170 /// This method does not handle scripts, <see>RezScript(IClientAPI, UUID, unit)</see>
1171 /// </summary> 1171 /// </summary>
1172 /// <param name="remoteClient"></param> 1172 /// <param name="remoteClient"></param>
1173 /// <param name="transactionID"></param> 1173 /// <param name="transactionID"></param>
1174 /// <param name="itemInfo"></param> 1174 /// <param name="itemInfo"></param>
1175 /// <param name="primLocalID"></param> 1175 /// <param name="primLocalID"></param>
1176 public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID transactionID, TaskInventoryItem itemInfo, 1176 public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, TaskInventoryItem itemInfo,
1177 uint primLocalID) 1177 uint primLocalID)
1178 { 1178 {
1179 LLUUID itemID = itemInfo.ItemID; 1179 UUID itemID = itemInfo.ItemID;
1180 1180
1181 // Find the prim we're dealing with 1181 // Find the prim we're dealing with
1182 SceneObjectPart part = GetSceneObjectPart(primLocalID); 1182 SceneObjectPart part = GetSceneObjectPart(primLocalID);
@@ -1193,8 +1193,8 @@ namespace OpenSim.Region.Environment.Scenes
1193 1193
1194 if (currentItem == null) 1194 if (currentItem == null)
1195 { 1195 {
1196 LLUUID copyID = LLUUID.Random(); 1196 UUID copyID = UUID.Random();
1197 if (itemID != LLUUID.Zero) 1197 if (itemID != UUID.Zero)
1198 { 1198 {
1199 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 1199 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
1200 1200
@@ -1254,12 +1254,12 @@ namespace OpenSim.Region.Environment.Scenes
1254 /// <param name="remoteClient"></param> 1254 /// <param name="remoteClient"></param>
1255 /// <param name="itemID"> </param> 1255 /// <param name="itemID"> </param>
1256 /// <param name="localID"></param> 1256 /// <param name="localID"></param>
1257 public void RezScript(IClientAPI remoteClient, InventoryItemBase itemBase, LLUUID transactionID, uint localID) 1257 public void RezScript(IClientAPI remoteClient, InventoryItemBase itemBase, UUID transactionID, uint localID)
1258 { 1258 {
1259 LLUUID itemID=itemBase.ID; 1259 UUID itemID=itemBase.ID;
1260 LLUUID copyID = LLUUID.Random(); 1260 UUID copyID = UUID.Random();
1261 1261
1262 if (itemID != LLUUID.Zero) 1262 if (itemID != UUID.Zero)
1263 { 1263 {
1264 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 1264 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
1265 1265
@@ -1344,7 +1344,7 @@ namespace OpenSim.Region.Environment.Scenes
1344 taskItem.GroupID = itemBase.GroupID; 1344 taskItem.GroupID = itemBase.GroupID;
1345 taskItem.GroupPermissions = 0; 1345 taskItem.GroupPermissions = 0;
1346 taskItem.Flags = itemBase.Flags; 1346 taskItem.Flags = itemBase.Flags;
1347 taskItem.PermsGranter = LLUUID.Zero; 1347 taskItem.PermsGranter = UUID.Zero;
1348 taskItem.PermsMask = 0; 1348 taskItem.PermsMask = 0;
1349 taskItem.AssetID = asset.ID; 1349 taskItem.AssetID = asset.ID;
1350 1350
@@ -1361,7 +1361,7 @@ namespace OpenSim.Region.Environment.Scenes
1361 /// <param name="remoteClient"></param> 1361 /// <param name="remoteClient"></param>
1362 /// <param name="itemID"> </param> 1362 /// <param name="itemID"> </param>
1363 /// <param name="localID"></param> 1363 /// <param name="localID"></param>
1364 public void RezScript(LLUUID srcId, SceneObjectPart srcPart, LLUUID destId, int pin, int running, int start_param) 1364 public void RezScript(UUID srcId, SceneObjectPart srcPart, UUID destId, int pin, int running, int start_param)
1365 { 1365 {
1366 TaskInventoryItem srcTaskItem = srcPart.GetInventoryItem(srcId); 1366 TaskInventoryItem srcTaskItem = srcPart.GetInventoryItem(srcId);
1367 1367
@@ -1407,7 +1407,7 @@ namespace OpenSim.Region.Environment.Scenes
1407 1407
1408 TaskInventoryItem destTaskItem = new TaskInventoryItem(); 1408 TaskInventoryItem destTaskItem = new TaskInventoryItem();
1409 1409
1410 destTaskItem.ItemID = LLUUID.Random(); 1410 destTaskItem.ItemID = UUID.Random();
1411 destTaskItem.CreatorID = srcTaskItem.CreatorID; 1411 destTaskItem.CreatorID = srcTaskItem.CreatorID;
1412 destTaskItem.AssetID = srcTaskItem.AssetID; 1412 destTaskItem.AssetID = srcTaskItem.AssetID;
1413 destTaskItem.GroupID = destPart.GroupID; 1413 destTaskItem.GroupID = destPart.GroupID;
@@ -1467,7 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes
1467 { 1467 {
1468 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; 1468 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet;
1469 1469
1470 LLUUID folderID = LLUUID.Zero; 1470 UUID folderID = UUID.Zero;
1471 1471
1472 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) 1472 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
1473 { 1473 {
@@ -1598,7 +1598,7 @@ namespace OpenSim.Region.Environment.Scenes
1598 return false; 1598 return false;
1599 } 1599 }
1600 1600
1601 private void DeleteToInventory(DeRezObjectPacket DeRezPacket, EntityBase selectedEnt, IClientAPI remoteClient, SceneObjectGroup objectGroup, LLUUID folderID, bool permissionToDelete) 1601 private void DeleteToInventory(DeRezObjectPacket DeRezPacket, EntityBase selectedEnt, IClientAPI remoteClient, SceneObjectGroup objectGroup, UUID folderID, bool permissionToDelete)
1602 { 1602 {
1603 string sceneObjectXml = objectGroup.ToXmlString(); 1603 string sceneObjectXml = objectGroup.ToXmlString();
1604 1604
@@ -1616,7 +1616,7 @@ namespace OpenSim.Region.Environment.Scenes
1616 // If we're deleting someone else's item, it goes back to their deleted items folder 1616 // If we're deleting someone else's item, it goes back to their deleted items folder
1617 // If we're returning someone's item, it goes back to the owner's Lost And Found folder. 1617 // If we're returning someone's item, it goes back to the owner's Lost And Found folder.
1618 1618
1619 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero || (DeRezPacket.AgentBlock.Destination == 6 && objectGroup.OwnerID != remoteClient.AgentId)) 1619 if (DeRezPacket.AgentBlock.DestinationID == UUID.Zero || (DeRezPacket.AgentBlock.Destination == 6 && objectGroup.OwnerID != remoteClient.AgentId))
1620 { 1620 {
1621 List<InventoryFolderBase> subrootfolders = userInfo.RootFolder.RequestListOfFolders(); 1621 List<InventoryFolderBase> subrootfolders = userInfo.RootFolder.RequestListOfFolders();
1622 foreach (InventoryFolderBase flder in subrootfolders) 1622 foreach (InventoryFolderBase flder in subrootfolders)
@@ -1628,7 +1628,7 @@ namespace OpenSim.Region.Environment.Scenes
1628 } 1628 }
1629 } 1629 }
1630 1630
1631 if (folderID == LLUUID.Zero) 1631 if (folderID == UUID.Zero)
1632 { 1632 {
1633 folderID = userInfo.RootFolder.ID; 1633 folderID = userInfo.RootFolder.ID;
1634 } 1634 }
@@ -1643,7 +1643,7 @@ namespace OpenSim.Region.Environment.Scenes
1643 ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId), 1643 ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId),
1644 ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId), 1644 ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId),
1645 (sbyte)AssetType.Object, 1645 (sbyte)AssetType.Object,
1646 Helpers.StringToField(sceneObjectXml)); 1646 Utils.StringToBytes(sceneObjectXml));
1647 AssetCache.AddAsset(asset); 1647 AssetCache.AddAsset(asset);
1648 1648
1649 InventoryItemBase item = new InventoryItemBase(); 1649 InventoryItemBase item = new InventoryItemBase();
@@ -1654,7 +1654,7 @@ namespace OpenSim.Region.Environment.Scenes
1654 else // Delete / Return 1654 else // Delete / Return
1655 item.Owner = objectGroup.OwnerID; 1655 item.Owner = objectGroup.OwnerID;
1656 1656
1657 item.ID = LLUUID.Random(); 1657 item.ID = UUID.Random();
1658 item.AssetID = asset.FullID; 1658 item.AssetID = asset.FullID;
1659 item.Description = asset.Description; 1659 item.Description = asset.Description;
1660 item.Name = asset.Name; 1660 item.Name = asset.Name;
@@ -1709,7 +1709,7 @@ namespace OpenSim.Region.Environment.Scenes
1709 DeleteSceneObject(objectGroup); 1709 DeleteSceneObject(objectGroup);
1710 } 1710 }
1711 1711
1712 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID) 1712 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, UUID assetID, UUID agentID)
1713 { 1713 {
1714 SceneObjectGroup objectGroup = grp; 1714 SceneObjectGroup objectGroup = grp;
1715 if (objectGroup != null) 1715 if (objectGroup != null)
@@ -1723,7 +1723,7 @@ namespace OpenSim.Region.Environment.Scenes
1723 Queue<InventoryFolderImpl> searchfolders = new Queue<InventoryFolderImpl>(); 1723 Queue<InventoryFolderImpl> searchfolders = new Queue<InventoryFolderImpl>();
1724 searchfolders.Enqueue(userInfo.RootFolder); 1724 searchfolders.Enqueue(userInfo.RootFolder);
1725 1725
1726 LLUUID foundFolder = userInfo.RootFolder.ID; 1726 UUID foundFolder = userInfo.RootFolder.ID;
1727 1727
1728 // search through folders to find the asset. 1728 // search through folders to find the asset.
1729 while (searchfolders.Count > 0) 1729 while (searchfolders.Count > 0)
@@ -1754,7 +1754,7 @@ namespace OpenSim.Region.Environment.Scenes
1754 objectGroup.GetPartName(objectGroup.LocalId), 1754 objectGroup.GetPartName(objectGroup.LocalId),
1755 objectGroup.GetPartDescription(objectGroup.LocalId), 1755 objectGroup.GetPartDescription(objectGroup.LocalId),
1756 (sbyte)AssetType.Object, 1756 (sbyte)AssetType.Object,
1757 Helpers.StringToField(sceneObjectXml)); 1757 Utils.StringToBytes(sceneObjectXml));
1758 AssetCache.AddAsset(asset); 1758 AssetCache.AddAsset(asset);
1759 1759
1760 InventoryItemBase item = new InventoryItemBase(); 1760 InventoryItemBase item = new InventoryItemBase();
@@ -1797,7 +1797,7 @@ namespace OpenSim.Region.Environment.Scenes
1797 } 1797 }
1798 } 1798 }
1799 1799
1800 public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) 1800 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId)
1801 { 1801 {
1802 SceneObjectGroup objectGroup = grp; 1802 SceneObjectGroup objectGroup = grp;
1803 if (objectGroup != null) 1803 if (objectGroup != null)
@@ -1812,13 +1812,13 @@ namespace OpenSim.Region.Environment.Scenes
1812 objectGroup.GetPartName(objectGroup.LocalId), 1812 objectGroup.GetPartName(objectGroup.LocalId),
1813 objectGroup.GetPartDescription(objectGroup.LocalId), 1813 objectGroup.GetPartDescription(objectGroup.LocalId),
1814 (sbyte)AssetType.Object, 1814 (sbyte)AssetType.Object,
1815 Helpers.StringToField(sceneObjectXml)); 1815 Utils.StringToBytes(sceneObjectXml));
1816 AssetCache.AddAsset(asset); 1816 AssetCache.AddAsset(asset);
1817 1817
1818 InventoryItemBase item = new InventoryItemBase(); 1818 InventoryItemBase item = new InventoryItemBase();
1819 item.Creator = objectGroup.RootPart.CreatorID; 1819 item.Creator = objectGroup.RootPart.CreatorID;
1820 item.Owner = remoteClient.AgentId; 1820 item.Owner = remoteClient.AgentId;
1821 item.ID = LLUUID.Random(); 1821 item.ID = UUID.Random();
1822 item.AssetID = asset.FullID; 1822 item.AssetID = asset.FullID;
1823 item.Description = asset.Description; 1823 item.Description = asset.Description;
1824 item.Name = asset.Name; 1824 item.Name = asset.Name;
@@ -1848,9 +1848,9 @@ namespace OpenSim.Region.Environment.Scenes
1848 remoteClient.SendInventoryItemCreateUpdate(item); 1848 remoteClient.SendInventoryItemCreateUpdate(item);
1849 return item.AssetID; 1849 return item.AssetID;
1850 } 1850 }
1851 return LLUUID.Zero; 1851 return UUID.Zero;
1852 } 1852 }
1853 return LLUUID.Zero; 1853 return UUID.Zero;
1854 1854
1855 } 1855 }
1856 1856
@@ -1872,10 +1872,10 @@ namespace OpenSim.Region.Environment.Scenes
1872 /// <param name="RezSelected"></param> 1872 /// <param name="RezSelected"></param>
1873 /// <param name="RemoveItem"></param> 1873 /// <param name="RemoveItem"></param>
1874 /// <param name="fromTaskID"></param> 1874 /// <param name="fromTaskID"></param>
1875 public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, 1875 public virtual void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
1876 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 1876 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
1877 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, 1877 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
1878 bool RezSelected, bool RemoveItem, LLUUID fromTaskID) 1878 bool RezSelected, bool RemoveItem, UUID fromTaskID)
1879 { 1879 {
1880 RezObject( 1880 RezObject(
1881 remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, 1881 remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
@@ -1901,10 +1901,10 @@ namespace OpenSim.Region.Environment.Scenes
1901 /// <param name="fromTaskID"></param> 1901 /// <param name="fromTaskID"></param>
1902 /// <param name="difference"></param> 1902 /// <param name="difference"></param>
1903 /// <returns></returns> 1903 /// <returns></returns>
1904 public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, 1904 public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
1905 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 1905 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
1906 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, 1906 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
1907 bool RezSelected, bool RemoveItem, LLUUID fromTaskID, bool attachment) 1907 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
1908 { 1908 {
1909 // Work out position details 1909 // Work out position details
1910 byte bRayEndIsIntersection = (byte)0; 1910 byte bRayEndIsIntersection = (byte)0;
@@ -1918,11 +1918,11 @@ namespace OpenSim.Region.Environment.Scenes
1918 bRayEndIsIntersection = (byte)0; 1918 bRayEndIsIntersection = (byte)0;
1919 } 1919 }
1920 1920
1921 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f); 1921 Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
1922 1922
1923 1923
1924 LLVector3 pos = GetNewRezLocation( 1924 Vector3 pos = GetNewRezLocation(
1925 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), 1925 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
1926 BypassRayCast, bRayEndIsIntersection,true,scale, false); 1926 BypassRayCast, bRayEndIsIntersection,true,scale, false);
1927 1927
1928 // Rez object 1928 // Rez object
@@ -1939,7 +1939,7 @@ namespace OpenSim.Region.Environment.Scenes
1939 1939
1940 if (rezAsset != null) 1940 if (rezAsset != null)
1941 { 1941 {
1942 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 1942 string xmlData = Utils.BytesToString(rezAsset.Data);
1943 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 1943 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
1944 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, remoteClient.AgentId, pos) && !attachment) 1944 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, remoteClient.AgentId, pos) && !attachment)
1945 { 1945 {
@@ -1955,7 +1955,7 @@ namespace OpenSim.Region.Environment.Scenes
1955 if (!attachment) 1955 if (!attachment)
1956 { 1956 {
1957 pos = GetNewRezLocation( 1957 pos = GetNewRezLocation(
1958 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), 1958 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
1959 BypassRayCast, bRayEndIsIntersection, true, group.GroupScale(), false); 1959 BypassRayCast, bRayEndIsIntersection, true, group.GroupScale(), false);
1960 group.AbsolutePosition = pos; 1960 group.AbsolutePosition = pos;
1961 } 1961 }
@@ -2066,18 +2066,18 @@ namespace OpenSim.Region.Environment.Scenes
2066 /// <returns></returns> 2066 /// <returns></returns>
2067 public virtual SceneObjectGroup RezObject( 2067 public virtual SceneObjectGroup RezObject(
2068 SceneObjectPart sourcePart, TaskInventoryItem item, 2068 SceneObjectPart sourcePart, TaskInventoryItem item,
2069 LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) 2069 Vector3 pos, Quaternion rot, Vector3 vel, int param)
2070 { 2070 {
2071 // Rez object 2071 // Rez object
2072 if (item != null) 2072 if (item != null)
2073 { 2073 {
2074 LLUUID ownerID = item.OwnerID; 2074 UUID ownerID = item.OwnerID;
2075 2075
2076 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false); 2076 AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false);
2077 2077
2078 if (rezAsset != null) 2078 if (rezAsset != null)
2079 { 2079 {
2080 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 2080 string xmlData = Utils.BytesToString(rezAsset.Data);
2081 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 2081 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
2082 2082
2083 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos)) 2083 if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos))
@@ -2154,7 +2154,7 @@ namespace OpenSim.Region.Environment.Scenes
2154 return null; 2154 return null;
2155 } 2155 }
2156 2156
2157 public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) 2157 public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId)
2158 { 2158 {
2159 string message = ""; 2159 string message = "";
2160 if (returnobjects.Length <= 0) 2160 if (returnobjects.Length <= 0)
@@ -2186,7 +2186,7 @@ namespace OpenSim.Region.Environment.Scenes
2186 { 2186 {
2187 if (userInfo.HasReceivedInventory) 2187 if (userInfo.HasReceivedInventory)
2188 { 2188 {
2189 LLUUID folderID = LLUUID.Zero; 2189 UUID folderID = UUID.Zero;
2190 2190
2191 List<InventoryFolderBase> subrootfolders = userInfo.RootFolder.RequestListOfFolders(); 2191 List<InventoryFolderBase> subrootfolders = userInfo.RootFolder.RequestListOfFolders();
2192 foreach (InventoryFolderBase flder in subrootfolders) 2192 foreach (InventoryFolderBase flder in subrootfolders)
@@ -2198,7 +2198,7 @@ namespace OpenSim.Region.Environment.Scenes
2198 } 2198 }
2199 } 2199 }
2200 2200
2201 if (folderID == LLUUID.Zero) 2201 if (folderID == UUID.Zero)
2202 { 2202 {
2203 folderID = userInfo.RootFolder.ID; 2203 folderID = userInfo.RootFolder.ID;
2204 } 2204 }
@@ -2213,13 +2213,13 @@ namespace OpenSim.Region.Environment.Scenes
2213 returnobjects[i].GetPartName(returnobjects[i].LocalId), 2213 returnobjects[i].GetPartName(returnobjects[i].LocalId),
2214 returnobjects[i].GetPartDescription(returnobjects[i].LocalId), 2214 returnobjects[i].GetPartDescription(returnobjects[i].LocalId),
2215 (sbyte)AssetType.Object, 2215 (sbyte)AssetType.Object,
2216 Helpers.StringToField(sceneObjectXml)); 2216 Utils.StringToBytes(sceneObjectXml));
2217 AssetCache.AddAsset(asset); 2217 AssetCache.AddAsset(asset);
2218 2218
2219 InventoryItemBase item = new InventoryItemBase(); 2219 InventoryItemBase item = new InventoryItemBase();
2220 item.Creator = returnobjects[i].RootPart.CreatorID; 2220 item.Creator = returnobjects[i].RootPart.CreatorID;
2221 item.Owner = returnobjects[i].OwnerID; 2221 item.Owner = returnobjects[i].OwnerID;
2222 item.ID = LLUUID.Random(); 2222 item.ID = UUID.Random();
2223 item.AssetID = asset.FullID; 2223 item.AssetID = asset.FullID;
2224 item.Description = asset.Description; 2224 item.Description = asset.Description;
2225 item.Name = asset.Name; 2225 item.Name = asset.Name;
@@ -2295,7 +2295,7 @@ namespace OpenSim.Region.Environment.Scenes
2295 2295
2296 } 2296 }
2297 2297
2298 public void GetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID) 2298 public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
2299 { 2299 {
2300 IScriptModule scriptModule = RequestModuleInterface<IScriptModule>(); 2300 IScriptModule scriptModule = RequestModuleInterface<IScriptModule>();
2301 if (scriptModule == null) 2301 if (scriptModule == null)
@@ -2305,7 +2305,7 @@ namespace OpenSim.Region.Environment.Scenes
2305 scriptModule.GetScriptRunning(objectID, itemID)); 2305 scriptModule.GetScriptRunning(objectID, itemID));
2306 } 2306 }
2307 2307
2308 public void SetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID, bool running) 2308 public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running)
2309 { 2309 {
2310 SceneObjectPart part = GetSceneObjectPart(objectID); 2310 SceneObjectPart part = GetSceneObjectPart(objectID);
2311 if (part == null) 2311 if (part == null)
@@ -2317,7 +2317,7 @@ namespace OpenSim.Region.Environment.Scenes
2317 EventManager.TriggerStopScript(part.LocalId, itemID); 2317 EventManager.TriggerStopScript(part.LocalId, itemID);
2318 } 2318 }
2319 2319
2320 public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, 2320 public void RezSingleAttachment(IClientAPI remoteClient, UUID itemID,
2321 uint AttachmentPt, uint ItemFlags, uint NextOwnerMask) 2321 uint AttachmentPt, uint ItemFlags, uint NextOwnerMask)
2322 { 2322 {
2323 SceneObjectGroup att = m_innerScene.RezSingleAttachment(remoteClient, itemID, AttachmentPt, ItemFlags, NextOwnerMask); 2323 SceneObjectGroup att = m_innerScene.RezSingleAttachment(remoteClient, itemID, AttachmentPt, ItemFlags, NextOwnerMask);
@@ -2333,7 +2333,7 @@ namespace OpenSim.Region.Environment.Scenes
2333 } 2333 }
2334 2334
2335 public void RezSingleAttachment(SceneObjectGroup att, 2335 public void RezSingleAttachment(SceneObjectGroup att,
2336 IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt, 2336 IClientAPI remoteClient, UUID itemID, uint AttachmentPt,
2337 uint ItemFlags, uint NextOwnerMask) 2337 uint ItemFlags, uint NextOwnerMask)
2338 { 2338 {
2339 if (att.RootPart != null) 2339 if (att.RootPart != null)
@@ -2352,12 +2352,12 @@ namespace OpenSim.Region.Environment.Scenes
2352 } 2352 }
2353 } 2353 }
2354 2354
2355 public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, LLQuaternion rot, LLVector3 pos) 2355 public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos)
2356 { 2356 {
2357 m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos); 2357 m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos);
2358 } 2358 }
2359 2359
2360 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) 2360 public void DetachSingleAttachmentToInv(UUID itemID, IClientAPI remoteClient)
2361 { 2361 {
2362 ScenePresence presence; 2362 ScenePresence presence;
2363 if (TryGetAvatar(remoteClient.AgentId, out presence)) 2363 if (TryGetAvatar(remoteClient.AgentId, out presence))
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 14d6826..38f4029 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -26,20 +26,20 @@
26 */ 26 */
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using libsecondlife; 29using OpenMetaverse;
30using libsecondlife.Packets; 30using OpenMetaverse.Packets;
31using OpenSim.Framework; 31using OpenSim.Framework;
32 32
33namespace OpenSim.Region.Environment.Scenes 33namespace OpenSim.Region.Environment.Scenes
34{ 34{
35 public partial class Scene 35 public partial class Scene
36 { 36 {
37 protected void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, 37 protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
38 LLUUID fromID, bool fromAgent, bool broadcast) 38 UUID fromID, bool fromAgent, bool broadcast)
39 { 39 {
40 OSChatMessage args = new OSChatMessage(); 40 OSChatMessage args = new OSChatMessage();
41 41
42 args.Message = Helpers.FieldToUTF8String(message); 42 args.Message = Utils.BytesToString(message);
43 args.Channel = channel; 43 args.Channel = channel;
44 args.Type = type; 44 args.Type = type;
45 args.Position = fromPos; 45 args.Position = fromPos;
@@ -75,8 +75,8 @@ namespace OpenSim.Region.Environment.Scenes
75 /// <param name="fromPos"></param> 75 /// <param name="fromPos"></param>
76 /// <param name="fromName"></param> 76 /// <param name="fromName"></param>
77 /// <param name="fromAgentID"></param> 77 /// <param name="fromAgentID"></param>
78 public void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, 78 public void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
79 LLUUID fromID, bool fromAgent) 79 UUID fromID, bool fromAgent)
80 { 80 {
81 SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, false); 81 SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, false);
82 } 82 }
@@ -89,8 +89,8 @@ namespace OpenSim.Region.Environment.Scenes
89 /// <param name="fromPos"></param> 89 /// <param name="fromPos"></param>
90 /// <param name="fromName"></param> 90 /// <param name="fromName"></param>
91 /// <param name="fromAgentID"></param> 91 /// <param name="fromAgentID"></param>
92 public void SimChatBroadcast(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName, 92 public void SimChatBroadcast(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
93 LLUUID fromID, bool fromAgent) 93 UUID fromID, bool fromAgent)
94 { 94 {
95 SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true); 95 SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true);
96 } 96 }
@@ -125,7 +125,7 @@ namespace OpenSim.Region.Environment.Scenes
125 // We also need to check the children of this prim as they 125 // We also need to check the children of this prim as they
126 // can be selected as well and send property information 126 // can be selected as well and send property information
127 bool foundPrim = false; 127 bool foundPrim = false;
128 foreach (KeyValuePair<LLUUID, SceneObjectPart> child in ((SceneObjectGroup) ent).Children) 128 foreach (KeyValuePair<UUID, SceneObjectPart> child in ((SceneObjectGroup) ent).Children)
129 { 129 {
130 if (child.Value.LocalId == primLocalID) 130 if (child.Value.LocalId == primLocalID)
131 { 131 {
@@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes
196 } 196 }
197 } 197 }
198 198
199 public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount, 199 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount,
200 int transactiontype, string description) 200 int transactiontype, string description)
201 { 201 {
202 EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(source, destination, amount, 202 EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(source, destination, amount,
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes
205 EventManager.TriggerMoneyTransfer(this, args); 205 EventManager.TriggerMoneyTransfer(this, args);
206 } 206 }
207 207
208 public virtual void ProcessParcelBuy(LLUUID agentId, LLUUID groupId, bool final, bool groupOwned, 208 public virtual void ProcessParcelBuy(UUID agentId, UUID groupId, bool final, bool groupOwned,
209 bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated) 209 bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated)
210 { 210 {
211 EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(agentId, groupId, final, groupOwned, 211 EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(agentId, groupId, final, groupOwned,
@@ -219,7 +219,7 @@ namespace OpenSim.Region.Environment.Scenes
219 m_eventManager.TriggerLandBuy(this, args); 219 m_eventManager.TriggerLandBuy(this, args);
220 } 220 }
221 221
222 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 222 public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient)
223 { 223 {
224 224
225 List<EntityBase> EntityList = GetEntities(); 225 List<EntityBase> EntityList = GetEntities();
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes
286 } 286 }
287 } 287 }
288 288
289 public void ProcessAvatarPickerRequest(IClientAPI client, LLUUID avatarID, LLUUID RequestID, string query) 289 public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query)
290 { 290 {
291 //EventManager.TriggerAvatarPickerRequest(); 291 //EventManager.TriggerAvatarPickerRequest();
292 292
@@ -308,11 +308,11 @@ namespace OpenSim.Region.Environment.Scenes
308 int i = 0; 308 int i = 0;
309 foreach (AvatarPickerAvatar item in AvatarResponses) 309 foreach (AvatarPickerAvatar item in AvatarResponses)
310 { 310 {
311 LLUUID translatedIDtem = item.AvatarID; 311 UUID translatedIDtem = item.AvatarID;
312 searchData[i] = new AvatarPickerReplyPacket.DataBlock(); 312 searchData[i] = new AvatarPickerReplyPacket.DataBlock();
313 searchData[i].AvatarID = translatedIDtem; 313 searchData[i].AvatarID = translatedIDtem;
314 searchData[i].FirstName = Helpers.StringToField((string) item.firstName); 314 searchData[i].FirstName = Utils.StringToBytes((string) item.firstName);
315 searchData[i].LastName = Helpers.StringToField((string) item.lastName); 315 searchData[i].LastName = Utils.StringToBytes((string) item.lastName);
316 i++; 316 i++;
317 } 317 }
318 if (AvatarResponses.Count == 0) 318 if (AvatarResponses.Count == 0)
@@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Scenes
337 client.SendAvatarPickerReply(agent_data, data_args); 337 client.SendAvatarPickerReply(agent_data, data_args);
338 } 338 }
339 339
340 public void ProcessScriptReset(IClientAPI remoteClient, LLUUID objectID, 340 public void ProcessScriptReset(IClientAPI remoteClient, UUID objectID,
341 LLUUID itemID) 341 UUID itemID)
342 { 342 {
343 SceneObjectPart part=GetSceneObjectPart(objectID); 343 SceneObjectPart part=GetSceneObjectPart(objectID);
344 if (part == null) 344 if (part == null)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index becd7dc..9e784d6 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -32,10 +32,9 @@ using System.Drawing.Imaging;
32using System.IO; 32using System.IO;
33using System.Threading; 33using System.Threading;
34using System.Timers; 34using System.Timers;
35using Axiom.Math; 35using OpenMetaverse;
36using libsecondlife; 36using OpenMetaverse.Imaging;
37using libsecondlife.Packets; 37using OpenMetaverse.Packets;
38using OpenJPEGNet;
39using OpenSim.Framework; 38using OpenSim.Framework;
40using OpenSim.Framework.Communications; 39using OpenSim.Framework.Communications;
41using OpenSim.Framework.Communications.Cache; 40using OpenSim.Framework.Communications.Cache;
@@ -116,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes
116 /// <summary> 115 /// <summary>
117 /// Each agent has its own capabilities handler. 116 /// Each agent has its own capabilities handler.
118 /// </summary> 117 /// </summary>
119 protected Dictionary<LLUUID, Caps> m_capsHandlers = new Dictionary<LLUUID, Caps>(); 118 protected Dictionary<UUID, Caps> m_capsHandlers = new Dictionary<UUID, Caps>();
120 119
121 protected BaseHttpServer m_httpListener; 120 protected BaseHttpServer m_httpListener;
122 121
@@ -201,19 +200,19 @@ namespace OpenSim.Region.Environment.Scenes
201 } 200 }
202 201
203 // Local reference to the objects in the scene (which are held in innerScene) 202 // Local reference to the objects in the scene (which are held in innerScene)
204 // public Dictionary<LLUUID, SceneObjectGroup> Objects 203 // public Dictionary<UUID, SceneObjectGroup> Objects
205 // { 204 // {
206 // get { return m_innerScene.SceneObjects; } 205 // get { return m_innerScene.SceneObjects; }
207 // } 206 // }
208 207
209 // Reference to all of the agents in the scene (root and child) 208 // Reference to all of the agents in the scene (root and child)
210 protected Dictionary<LLUUID, ScenePresence> m_scenePresences 209 protected Dictionary<UUID, ScenePresence> m_scenePresences
211 { 210 {
212 get { return m_innerScene.ScenePresences; } 211 get { return m_innerScene.ScenePresences; }
213 set { m_innerScene.ScenePresences = value; } 212 set { m_innerScene.ScenePresences = value; }
214 } 213 }
215 214
216 // protected Dictionary<LLUUID, SceneObjectGroup> m_sceneObjects 215 // protected Dictionary<UUID, SceneObjectGroup> m_sceneObjects
217 // { 216 // {
218 // get { return m_innerScene.SceneObjects; } 217 // get { return m_innerScene.SceneObjects; }
219 // set { m_innerScene.SceneObjects = value; } 218 // set { m_innerScene.SceneObjects = value; }
@@ -227,13 +226,13 @@ namespace OpenSim.Region.Environment.Scenes
227 /// If you want a list of entities where the list itself is guaranteed not to change, please use 226 /// If you want a list of entities where the list itself is guaranteed not to change, please use
228 /// GetEntities() 227 /// GetEntities()
229 /// </summary> 228 /// </summary>
230 public Dictionary<LLUUID, EntityBase> Entities 229 public Dictionary<UUID, EntityBase> Entities
231 { 230 {
232 get { return m_innerScene.Entities; } 231 get { return m_innerScene.Entities; }
233 set { m_innerScene.Entities = value; } 232 set { m_innerScene.Entities = value; }
234 } 233 }
235 234
236 public Dictionary<LLUUID, ScenePresence> m_restorePresences 235 public Dictionary<UUID, ScenePresence> m_restorePresences
237 { 236 {
238 get { return m_innerScene.RestorePresences; } 237 get { return m_innerScene.RestorePresences; }
239 set { m_innerScene.RestorePresences = value; } 238 set { m_innerScene.RestorePresences = value; }
@@ -466,7 +465,7 @@ namespace OpenSim.Region.Environment.Scenes
466 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); 465 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
467 m_log.Error("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); 466 m_log.Error("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
468 m_restartTimer.Start(); 467 m_restartTimer.Start();
469 SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); 468 SendRegionMessageFromEstateTools(UUID.Random(), UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes");
470 //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); 469 //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes");
471 } 470 }
472 } 471 }
@@ -481,7 +480,7 @@ namespace OpenSim.Region.Environment.Scenes
481 if (m_RestartTimerCounter <= m_incrementsof15seconds) 480 if (m_RestartTimerCounter <= m_incrementsof15seconds)
482 { 481 {
483 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) 482 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7)
484 SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + 483 SendRegionMessageFromEstateTools(UUID.Random(), UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " +
485 ((8 - m_RestartTimerCounter) * 15) + " seconds"); 484 ((8 - m_RestartTimerCounter) * 15) + " seconds");
486 485
487 // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + 486 // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) +
@@ -923,8 +922,11 @@ namespace OpenSim.Region.Environment.Scenes
923 922
924 foreach (AssetBase asset in textures) 923 foreach (AssetBase asset in textures)
925 { 924 {
926 Image image = OpenJPEG.DecodeToImage(asset.Data); 925 ManagedImage managedImage;
927 bitImages.Add(image); 926 Image image;
927
928 if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image))
929 bitImages.Add(image);
928 } 930 }
929 931
930 Bitmap mapTexture = new Bitmap(2560, 2560); 932 Bitmap mapTexture = new Bitmap(2560, 2560);
@@ -1025,9 +1027,9 @@ namespace OpenSim.Region.Environment.Scenes
1025 double[,] hm = Heightmap.GetDoubles(); 1027 double[,] hm = Heightmap.GetDoubles();
1026 bool ShadowDebugContinue = true; 1028 bool ShadowDebugContinue = true;
1027 //Color prim = Color.FromArgb(120, 120, 120); 1029 //Color prim = Color.FromArgb(120, 120, 120);
1028 //LLVector3 RayEnd = new LLVector3(0, 0, 0); 1030 //Vector3 RayEnd = new Vector3(0, 0, 0);
1029 //LLVector3 RayStart = new LLVector3(0, 0, 0); 1031 //Vector3 RayStart = new Vector3(0, 0, 0);
1030 //LLVector3 direction = new LLVector3(0, 0, -1); 1032 //Vector3 direction = new Vector3(0, 0, -1);
1031 //Vector3 AXOrigin = new Vector3(); 1033 //Vector3 AXOrigin = new Vector3();
1032 //Vector3 AXdirection = new Vector3(); 1034 //Vector3 AXdirection = new Vector3();
1033 //Ray testRay = new Ray(); 1035 //Ray testRay = new Ray();
@@ -1061,10 +1063,10 @@ namespace OpenSim.Region.Environment.Scenes
1061 //int tc = System.Environment.TickCount; 1063 //int tc = System.Environment.TickCount;
1062 for (int y = 0; y < 256; y++) 1064 for (int y = 0; y < 256; y++)
1063 { 1065 {
1064 //RayEnd = new LLVector3(x, y, 0); 1066 //RayEnd = new Vector3(x, y, 0);
1065 //RayStart = new LLVector3(x, y, 255); 1067 //RayStart = new Vector3(x, y, 255);
1066 1068
1067 //direction = LLVector3.Norm(RayEnd - RayStart); 1069 //direction = Vector3.Norm(RayEnd - RayStart);
1068 //AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1070 //AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1069 //AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1071 //AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
1070 1072
@@ -1272,7 +1274,7 @@ namespace OpenSim.Region.Environment.Scenes
1272 if (part.Shape.Textures.DefaultTexture == null) 1274 if (part.Shape.Textures.DefaultTexture == null)
1273 continue; 1275 continue;
1274 1276
1275 LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; 1277 Color4 texcolor = part.Shape.Textures.DefaultTexture.RGBA;
1276 1278
1277 // Not sure why some of these are null, oh well. 1279 // Not sure why some of these are null, oh well.
1278 1280
@@ -1285,7 +1287,7 @@ namespace OpenSim.Region.Environment.Scenes
1285 //Try to set the map spot color 1287 //Try to set the map spot color
1286 try 1288 try
1287 { 1289 {
1288 // If the color gets goofy somehow, skip it *shakes fist at LLColor 1290 // If the color gets goofy somehow, skip it *shakes fist at Color4
1289 mapdotspot = Color.FromArgb(colorr, colorg, colorb); 1291 mapdotspot = Color.FromArgb(colorr, colorg, colorb);
1290 } 1292 }
1291 catch (ArgumentException) 1293 catch (ArgumentException)
@@ -1302,7 +1304,7 @@ namespace OpenSim.Region.Environment.Scenes
1302 // Mono Array 1304 // Mono Array
1303 } 1305 }
1304 1306
1305 LLVector3 pos = part.GetWorldPosition(); 1307 Vector3 pos = part.GetWorldPosition();
1306 1308
1307 // skip prim outside of retion 1309 // skip prim outside of retion
1308 if (pos.X < 0f || pos.X > 256f || pos.Y < 0f || pos.Y > 256f) 1310 if (pos.X < 0f || pos.X > 256f || pos.Y < 0f || pos.Y > 256f)
@@ -1327,21 +1329,20 @@ namespace OpenSim.Region.Environment.Scenes
1327 if (isBelow256AboveTerrain) 1329 if (isBelow256AboveTerrain)
1328 { 1330 {
1329 // Translate scale by rotation so scale is represented properly when object is rotated 1331 // Translate scale by rotation so scale is represented properly when object is rotated
1330 Vector3 scale = new Vector3(part.Shape.Scale.X, part.Shape.Scale.Y, part.Shape.Scale.Z); 1332 Vector3 scale = part.Shape.Scale;
1331 LLQuaternion llrot = part.GetWorldRotation(); 1333 Quaternion rot = part.GetWorldRotation();
1332 Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z); 1334 scale *= rot;
1333 scale = rot * scale;
1334 1335
1335 // negative scales don't work in this situation 1336 // negative scales don't work in this situation
1336 scale.x = Math.Abs(scale.x); 1337 scale.X = Math.Abs(scale.X);
1337 scale.y = Math.Abs(scale.y); 1338 scale.Y = Math.Abs(scale.Y);
1338 scale.z = Math.Abs(scale.z); 1339 scale.Z = Math.Abs(scale.Z);
1339 1340
1340 // This scaling isn't very accurate and doesn't take into account the face rotation :P 1341 // This scaling isn't very accurate and doesn't take into account the face rotation :P
1341 int mapdrawstartX = (int)(pos.X - scale.x); 1342 int mapdrawstartX = (int)(pos.X - scale.X);
1342 int mapdrawstartY = (int)(pos.Y - scale.y); 1343 int mapdrawstartY = (int)(pos.Y - scale.Y);
1343 int mapdrawendX = (int)(pos.X + scale.x); 1344 int mapdrawendX = (int)(pos.X + scale.X);
1344 int mapdrawendY = (int)(pos.Y + scale.y); 1345 int mapdrawendY = (int)(pos.Y + scale.Y);
1345 1346
1346 // If object is beyond the edge of the map, don't draw it to avoid errors 1347 // If object is beyond the edge of the map, don't draw it to avoid errors
1347 if (mapdrawstartX < 0 || mapdrawstartX > 255 || mapdrawendX < 0 || mapdrawendX > 255 1348 if (mapdrawstartX < 0 || mapdrawstartX > 255 || mapdrawendX < 0 || mapdrawendX > 255
@@ -1420,7 +1421,7 @@ namespace OpenSim.Region.Environment.Scenes
1420 // map tile while protecting the (grid) asset database from bloat caused by a new asset each 1421 // map tile while protecting the (grid) asset database from bloat caused by a new asset each
1421 // time a mapimage is generated! 1422 // time a mapimage is generated!
1422 1423
1423 LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; 1424 UUID lastMapRegionUUID = m_regInfo.lastMapUUID;
1424 1425
1425 int lastMapRefresh = 0; 1426 int lastMapRefresh = 0;
1426 int twoDays = 172800; 1427 int twoDays = 172800;
@@ -1440,21 +1441,21 @@ namespace OpenSim.Region.Environment.Scenes
1440 { 1441 {
1441 } 1442 }
1442 1443
1443 LLUUID TerrainImageLLUUID = LLUUID.Random(); 1444 UUID TerrainImageUUID = UUID.Random();
1444 1445
1445 if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) 1446 if (lastMapRegionUUID == UUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch())
1446 { 1447 {
1447 m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); 1448 m_regInfo.SaveLastMapUUID(TerrainImageUUID);
1448 1449
1449 m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE"); 1450 m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE");
1450 } 1451 }
1451 else 1452 else
1452 { 1453 {
1453 TerrainImageLLUUID = lastMapRegionUUID; 1454 TerrainImageUUID = lastMapRegionUUID;
1454 m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID"); 1455 m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID");
1455 } 1456 }
1456 1457
1457 m_regInfo.RegionSettings.TerrainImageID = TerrainImageLLUUID; 1458 m_regInfo.RegionSettings.TerrainImageID = TerrainImageUUID;
1458 1459
1459 AssetBase asset = new AssetBase(); 1460 AssetBase asset = new AssetBase();
1460 asset.FullID = m_regInfo.RegionSettings.TerrainImageID; 1461 asset.FullID = m_regInfo.RegionSettings.TerrainImageID;
@@ -1471,7 +1472,7 @@ namespace OpenSim.Region.Environment.Scenes
1471 1472
1472 #region Load Land 1473 #region Load Land
1473 1474
1474 public void loadAllLandObjectsFromStorage(LLUUID regionID) 1475 public void loadAllLandObjectsFromStorage(UUID regionID)
1475 { 1476 {
1476 m_log.Info("[SCENE]: Loading land objects from storage"); 1477 m_log.Info("[SCENE]: Loading land objects from storage");
1477 List<LandData> landData = m_storageManager.DataStore.LoadLandObjects(regionID); 1478 List<LandData> landData = m_storageManager.DataStore.LoadLandObjects(regionID);
@@ -1500,7 +1501,7 @@ namespace OpenSim.Region.Environment.Scenes
1500 /// <summary> 1501 /// <summary>
1501 /// Loads the World's objects 1502 /// Loads the World's objects
1502 /// </summary> 1503 /// </summary>
1503 public virtual void LoadPrimsFromStorage(LLUUID regionID) 1504 public virtual void LoadPrimsFromStorage(UUID regionID)
1504 { 1505 {
1505 m_log.Info("[SCENE]: Loading objects from datastore"); 1506 m_log.Info("[SCENE]: Loading objects from datastore");
1506 1507
@@ -1509,7 +1510,7 @@ namespace OpenSim.Region.Environment.Scenes
1509 { 1510 {
1510 AddRestoredSceneObject(group, true, true); 1511 AddRestoredSceneObject(group, true, true);
1511 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1512 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1512 rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; 1513 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
1513 rootPart.TrimPermissions(); 1514 rootPart.TrimPermissions();
1514 group.CheckSculptAndLoad(); 1515 group.CheckSculptAndLoad();
1515 //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 1516 //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
@@ -1533,20 +1534,20 @@ namespace OpenSim.Region.Environment.Scenes
1533 return myID; 1534 return myID;
1534 } 1535 }
1535 1536
1536 public LLVector3 GetNewRezLocation(LLVector3 RayStart, LLVector3 RayEnd, LLUUID RayTargetID, LLQuaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, LLVector3 scale, bool FaceCenter) 1537 public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter)
1537 { 1538 {
1538 LLVector3 pos = LLVector3.Zero; 1539 Vector3 pos = Vector3.Zero;
1539 if (RayEndIsIntersection == (byte)1) 1540 if (RayEndIsIntersection == (byte)1)
1540 { 1541 {
1541 pos = RayEnd; 1542 pos = RayEnd;
1542 return pos; 1543 return pos;
1543 } 1544 }
1544 1545
1545 if (RayTargetID != LLUUID.Zero) 1546 if (RayTargetID != UUID.Zero)
1546 { 1547 {
1547 SceneObjectPart target = GetSceneObjectPart(RayTargetID); 1548 SceneObjectPart target = GetSceneObjectPart(RayTargetID);
1548 1549
1549 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 1550 Vector3 direction = Vector3.Normalize(RayEnd - RayStart);
1550 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 1551 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
1551 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 1552 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
1552 1553
@@ -1561,7 +1562,7 @@ namespace OpenSim.Region.Environment.Scenes
1561 Ray NewRay = new Ray(AXOrigin, AXdirection); 1562 Ray NewRay = new Ray(AXOrigin, AXdirection);
1562 1563
1563 // Ray Trace against target here 1564 // Ray Trace against target here
1564 EntityIntersection ei = target.TestIntersectionOBB(NewRay, new Quaternion(1,0,0,0), frontFacesOnly, FaceCenter); 1565 EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter);
1565 1566
1566 // Un-comment out the following line to Get Raytrace results printed to the console. 1567 // Un-comment out the following line to Get Raytrace results printed to the console.
1567 // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); 1568 // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
@@ -1570,15 +1571,15 @@ namespace OpenSim.Region.Environment.Scenes
1570 // If we hit something 1571 // If we hit something
1571 if (ei.HitTF) 1572 if (ei.HitTF)
1572 { 1573 {
1573 LLVector3 scaleComponent = new LLVector3(ei.AAfaceNormal.x, ei.AAfaceNormal.y, ei.AAfaceNormal.z); 1574 Vector3 scaleComponent = new Vector3(ei.AAfaceNormal.X, ei.AAfaceNormal.Y, ei.AAfaceNormal.Z);
1574 if (scaleComponent.X != 0) ScaleOffset = scale.X; 1575 if (scaleComponent.X != 0) ScaleOffset = scale.X;
1575 if (scaleComponent.Y != 0) ScaleOffset = scale.Y; 1576 if (scaleComponent.Y != 0) ScaleOffset = scale.Y;
1576 if (scaleComponent.Z != 0) ScaleOffset = scale.Z; 1577 if (scaleComponent.Z != 0) ScaleOffset = scale.Z;
1577 ScaleOffset = Math.Abs(ScaleOffset); 1578 ScaleOffset = Math.Abs(ScaleOffset);
1578 LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); 1579 Vector3 intersectionpoint = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
1579 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); 1580 Vector3 normal = new Vector3(ei.normal.X, ei.normal.Y, ei.normal.Z);
1580 // Set the position to the intersection point 1581 // Set the position to the intersection point
1581 LLVector3 offset = (normal * (ScaleOffset / 2f)); 1582 Vector3 offset = (normal * (ScaleOffset / 2f));
1582 pos = (intersectionpoint + offset); 1583 pos = (intersectionpoint + offset);
1583 1584
1584 // Un-offset the prim (it gets offset later by the consumer method) 1585 // Un-offset the prim (it gets offset later by the consumer method)
@@ -1598,7 +1599,7 @@ namespace OpenSim.Region.Environment.Scenes
1598 1599
1599 if (ei.HitTF) 1600 if (ei.HitTF)
1600 { 1601 {
1601 pos = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); 1602 pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
1602 } 1603 }
1603 1604
1604 return pos; 1605 return pos;
@@ -1612,11 +1613,11 @@ namespace OpenSim.Region.Environment.Scenes
1612 } 1613 }
1613 } 1614 }
1614 1615
1615 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, 1616 public virtual void AddNewPrim(UUID ownerID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape,
1616 byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, 1617 byte bypassRaycast, Vector3 RayStart, UUID RayTargetID,
1617 byte RayEndIsIntersection) 1618 byte RayEndIsIntersection)
1618 { 1619 {
1619 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new LLVector3(0.5f, 0.5f, 0.5f), false); 1620 Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false);
1620 1621
1621 if (ExternalChecks.ExternalChecksCanRezObject(1, ownerID, pos)) 1622 if (ExternalChecks.ExternalChecksCanRezObject(1, ownerID, pos))
1622 { 1623 {
@@ -1627,7 +1628,7 @@ namespace OpenSim.Region.Environment.Scenes
1627 } 1628 }
1628 } 1629 }
1629 1630
1630 public virtual SceneObjectGroup AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) 1631 public virtual SceneObjectGroup AddNewPrim(UUID ownerID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
1631 { 1632 {
1632 //m_log.DebugFormat( 1633 //m_log.DebugFormat(
1633 // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); 1634 // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName);
@@ -1640,8 +1641,8 @@ namespace OpenSim.Region.Environment.Scenes
1640 //rootPart.TrimPermissions(); 1641 //rootPart.TrimPermissions();
1641 if ((rootPart.Shape.PCode == (byte)PCode.Grass) || (rootPart.Shape.PCode == (byte)PCode.Tree) || (rootPart.Shape.PCode == (byte)PCode.NewTree)) 1642 if ((rootPart.Shape.PCode == (byte)PCode.Grass) || (rootPart.Shape.PCode == (byte)PCode.Tree) || (rootPart.Shape.PCode == (byte)PCode.NewTree))
1642 { 1643 {
1643 rootPart.AddFlag(LLObject.ObjectFlags.Phantom); 1644 rootPart.AddFlag(PrimFlags.Phantom);
1644 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; 1645 //rootPart.ObjectFlags += (uint)PrimFlags.Phantom;
1645 if (rootPart.Shape.PCode != (byte)PCode.Grass) 1646 if (rootPart.Shape.PCode != (byte)PCode.Grass)
1646 AdaptTree(ref shape); 1647 AdaptTree(ref shape);
1647 } 1648 }
@@ -1658,20 +1659,20 @@ namespace OpenSim.Region.Environment.Scenes
1658 { 1659 {
1659 case Tree.Cypress1: 1660 case Tree.Cypress1:
1660 case Tree.Cypress2: 1661 case Tree.Cypress2:
1661 tree.Scale = new LLVector3(4, 4, 10); 1662 tree.Scale = new Vector3(4, 4, 10);
1662 break; 1663 break;
1663 1664
1664 // case... other tree types 1665 // case... other tree types
1665 // tree.Scale = new LLVector3(?, ?, ?); 1666 // tree.Scale = new Vector3(?, ?, ?);
1666 // break; 1667 // break;
1667 1668
1668 default: 1669 default:
1669 tree.Scale = new LLVector3(4, 4, 4); 1670 tree.Scale = new Vector3(4, 4, 4);
1670 break; 1671 break;
1671 } 1672 }
1672 } 1673 }
1673 1674
1674 public SceneObjectGroup AddTree(LLUUID uuid, LLVector3 scale, LLQuaternion rotation, LLVector3 position, 1675 public SceneObjectGroup AddTree(UUID uuid, Vector3 scale, Quaternion rotation, Vector3 position,
1675 Tree treeType, bool newTree) 1676 Tree treeType, bool newTree)
1676 { 1677 {
1677 PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); 1678 PrimitiveBaseShape treeShape = new PrimitiveBaseShape();
@@ -1771,7 +1772,7 @@ namespace OpenSim.Region.Environment.Scenes
1771 /// </summary> 1772 /// </summary>
1772 /// <param name="uuid"></param> 1773 /// <param name="uuid"></param>
1773 /// <returns>true if the object was in the scene, false if it was not</returns> 1774 /// <returns>true if the object was in the scene, false if it was not</returns>
1774 public bool UnlinkSceneObject(LLUUID uuid, bool resultOfLinkingObjects) 1775 public bool UnlinkSceneObject(UUID uuid, bool resultOfLinkingObjects)
1775 { 1776 {
1776 if (m_innerScene.DeleteSceneObject(uuid,resultOfLinkingObjects)) 1777 if (m_innerScene.DeleteSceneObject(uuid,resultOfLinkingObjects))
1777 { 1778 {
@@ -1783,7 +1784,7 @@ namespace OpenSim.Region.Environment.Scenes
1783 return false; 1784 return false;
1784 } 1785 }
1785 1786
1786 public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) 1787 public void LoadPrimsFromXml(string fileName, bool newIdsFlag, Vector3 loadOffset)
1787 { 1788 {
1788 m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); 1789 m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName);
1789 1790
@@ -1818,7 +1819,7 @@ namespace OpenSim.Region.Environment.Scenes
1818 m_serialiser.SavePrimsToXml2(this, fileName); 1819 m_serialiser.SavePrimsToXml2(this, fileName);
1819 } 1820 }
1820 1821
1821 public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) 1822 public void SavePrimsToXml2(TextWriter stream, Vector3 min, Vector3 max)
1822 { 1823 {
1823 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); 1824 m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName);
1824 1825
@@ -1876,7 +1877,7 @@ namespace OpenSim.Region.Environment.Scenes
1876 /// <param name="position">current position of Group</param> 1877 /// <param name="position">current position of Group</param>
1877 /// <param name="grp">Scene Object Group that we're crossing</param> 1878 /// <param name="grp">Scene Object Group that we're crossing</param>
1878 1879
1879 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp) 1880 public void CrossPrimGroupIntoNewRegion(Vector3 position, SceneObjectGroup grp)
1880 { 1881 {
1881 if (grp == null) 1882 if (grp == null)
1882 return; 1883 return;
@@ -1897,12 +1898,12 @@ namespace OpenSim.Region.Environment.Scenes
1897 return; 1898 return;
1898 } 1899 }
1899 1900
1900 m_log.Warn("Prim crossing: " + grp.UUID.ToString()); 1901 m_log.Warn("Prim crossing: " + grp.ToString());
1901 int thisx = (int)RegionInfo.RegionLocX; 1902 int thisx = (int)RegionInfo.RegionLocX;
1902 int thisy = (int)RegionInfo.RegionLocY; 1903 int thisy = (int)RegionInfo.RegionLocY;
1903 1904
1904 ulong newRegionHandle = 0; 1905 ulong newRegionHandle = 0;
1905 LLVector3 pos = position; 1906 Vector3 pos = position;
1906 1907
1907 if (position.X > Constants.RegionSize + 0.1f) 1908 if (position.X > Constants.RegionSize + 0.1f)
1908 { 1909 {
@@ -1973,7 +1974,7 @@ namespace OpenSim.Region.Environment.Scenes
1973 } 1974 }
1974 } 1975 }
1975 1976
1976 public bool IncomingInterRegionPrimGroup(ulong regionHandle, LLUUID primID, string objXMLData, int XMLMethod) 1977 public bool IncomingInterRegionPrimGroup(ulong regionHandle, UUID primID, string objXMLData, int XMLMethod)
1977 { 1978 {
1978 m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); 1979 m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor");
1979 if (XMLMethod == 0) 1980 if (XMLMethod == 0)
@@ -2160,7 +2161,7 @@ namespace OpenSim.Region.Environment.Scenes
2160 } 2161 }
2161 2162
2162 // Gesture 2163 // Gesture
2163 public virtual void ActivateGesture(IClientAPI client, LLUUID assetId, LLUUID gestureId) 2164 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
2164 { 2165 {
2165 // UserProfileCacheService User = CommsManager.SecureInventoryService.UpdateItem(gestureid, agentID); 2166 // UserProfileCacheService User = CommsManager.SecureInventoryService.UpdateItem(gestureid, agentID);
2166 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); 2167 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);
@@ -2180,7 +2181,7 @@ namespace OpenSim.Region.Environment.Scenes
2180 m_log.DebugFormat("Asset : {0} gesture :{1}", gestureId.ToString(), assetId.ToString()); 2181 m_log.DebugFormat("Asset : {0} gesture :{1}", gestureId.ToString(), assetId.ToString());
2181 } 2182 }
2182 2183
2183 public virtual void DeactivateGesture(IClientAPI client, LLUUID gestureId) 2184 public virtual void DeactivateGesture(IClientAPI client, UUID gestureId)
2184 { 2185 {
2185 // UserProfileCacheService User = CommsManager.SecureInventoryService.UpdateItem(gestureid, agentID); 2186 // UserProfileCacheService User = CommsManager.SecureInventoryService.UpdateItem(gestureid, agentID);
2186 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); 2187 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);
@@ -2200,14 +2201,14 @@ namespace OpenSim.Region.Environment.Scenes
2200 m_log.DebugFormat("gesture : {0} ", gestureId.ToString()); 2201 m_log.DebugFormat("gesture : {0} ", gestureId.ToString());
2201 } 2202 }
2202 2203
2203 public virtual void TeleportClientHome(LLUUID agentId, IClientAPI client) 2204 public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
2204 { 2205 {
2205 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); 2206 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId);
2206 if (UserProfile != null) 2207 if (UserProfile != null)
2207 { 2208 {
2208 LLUUID homeRegionID = UserProfile.HomeRegionID; 2209 UUID homeRegionID = UserProfile.HomeRegionID;
2209 ulong homeRegionHandle = UserProfile.HomeRegion; 2210 ulong homeRegionHandle = UserProfile.HomeRegion;
2210 if (homeRegionID == LLUUID.Zero) 2211 if (homeRegionID == UUID.Zero)
2211 { 2212 {
2212 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); 2213 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion);
2213 if (info == null) 2214 if (info == null)
@@ -2234,11 +2235,11 @@ namespace OpenSim.Region.Environment.Scenes
2234 } 2235 }
2235 } 2236 }
2236 2237
2237 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, 2238 public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID,
2238 LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, 2239 UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart,
2239 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) 2240 bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
2240 { 2241 {
2241 LLVector3 pos; 2242 Vector3 pos;
2242 const bool frontFacesOnly = true; 2243 const bool frontFacesOnly = true;
2243 //m_log.Info("HITTARGET: " + RayTargetObj.ToString() + ", COPYTARGET: " + localID.ToString()); 2244 //m_log.Info("HITTARGET: " + RayTargetObj.ToString() + ", COPYTARGET: " + localID.ToString());
2244 SceneObjectPart target = GetSceneObjectPart(localID); 2245 SceneObjectPart target = GetSceneObjectPart(localID);
@@ -2246,7 +2247,7 @@ namespace OpenSim.Region.Environment.Scenes
2246 2247
2247 if (target != null && target2 != null) 2248 if (target != null && target2 != null)
2248 { 2249 {
2249 LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); 2250 Vector3 direction = Vector3.Normalize(RayEnd - RayStart);
2250 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 2251 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
2251 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 2252 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
2252 2253
@@ -2261,7 +2262,7 @@ namespace OpenSim.Region.Environment.Scenes
2261 Ray NewRay = new Ray(AXOrigin, AXdirection); 2262 Ray NewRay = new Ray(AXOrigin, AXdirection);
2262 2263
2263 // Ray Trace against target here 2264 // Ray Trace against target here
2264 EntityIntersection ei = target2.TestIntersectionOBB(NewRay, new Quaternion(1, 0, 0, 0), frontFacesOnly, CopyCenters); 2265 EntityIntersection ei = target2.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, CopyCenters);
2265 2266
2266 // Un-comment out the following line to Get Raytrace results printed to the console. 2267 // Un-comment out the following line to Get Raytrace results printed to the console.
2267 //m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); 2268 //m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
@@ -2270,26 +2271,26 @@ namespace OpenSim.Region.Environment.Scenes
2270 // If we hit something 2271 // If we hit something
2271 if (ei.HitTF) 2272 if (ei.HitTF)
2272 { 2273 {
2273 LLVector3 scale = target.Scale; 2274 Vector3 scale = target.Scale;
2274 LLVector3 scaleComponent = new LLVector3(ei.AAfaceNormal.x, ei.AAfaceNormal.y, ei.AAfaceNormal.z); 2275 Vector3 scaleComponent = new Vector3(ei.AAfaceNormal.X, ei.AAfaceNormal.Y, ei.AAfaceNormal.Z);
2275 if (scaleComponent.X != 0) ScaleOffset = scale.X; 2276 if (scaleComponent.X != 0) ScaleOffset = scale.X;
2276 if (scaleComponent.Y != 0) ScaleOffset = scale.Y; 2277 if (scaleComponent.Y != 0) ScaleOffset = scale.Y;
2277 if (scaleComponent.Z != 0) ScaleOffset = scale.Z; 2278 if (scaleComponent.Z != 0) ScaleOffset = scale.Z;
2278 ScaleOffset = Math.Abs(ScaleOffset); 2279 ScaleOffset = Math.Abs(ScaleOffset);
2279 LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); 2280 Vector3 intersectionpoint = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
2280 LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); 2281 Vector3 normal = new Vector3(ei.normal.X, ei.normal.Y, ei.normal.Z);
2281 LLVector3 offset = normal * (ScaleOffset / 2f); 2282 Vector3 offset = normal * (ScaleOffset / 2f);
2282 pos = intersectionpoint + offset; 2283 pos = intersectionpoint + offset;
2283 2284
2284 // stick in offset format from the original prim 2285 // stick in offset format from the original prim
2285 pos = pos - target.ParentGroup.AbsolutePosition; 2286 pos = pos - target.ParentGroup.AbsolutePosition;
2286 if (CopyRotates) 2287 if (CopyRotates)
2287 { 2288 {
2288 LLQuaternion worldRot = target2.GetWorldRotation(); 2289 Quaternion worldRot = target2.GetWorldRotation();
2289 2290
2290 // SceneObjectGroup obj = m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, new Quaternion(worldRot.W,worldRot.X,worldRot.Y,worldRot.Z)); 2291 // SceneObjectGroup obj = m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
2291 m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, new Quaternion(worldRot.W,worldRot.X,worldRot.Y,worldRot.Z)); 2292 m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
2292 //obj.Rotation = new Quaternion(worldRot.W, worldRot.X, worldRot.Y, worldRot.Z); 2293 //obj.Rotation = worldRot;
2293 //obj.UpdateGroupRotation(worldRot); 2294 //obj.UpdateGroupRotation(worldRot);
2294 } 2295 }
2295 else 2296 else
@@ -2305,7 +2306,7 @@ namespace OpenSim.Region.Environment.Scenes
2305 } 2306 }
2306 } 2307 }
2307 2308
2308 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags) 2309 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
2309 { 2310 {
2310 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); 2311 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId);
2311 if (UserProfile != null) 2312 if (UserProfile != null)
@@ -2369,7 +2370,7 @@ namespace OpenSim.Region.Environment.Scenes
2369 /// Remove the given client from the scene. 2370 /// Remove the given client from the scene.
2370 /// </summary> 2371 /// </summary>
2371 /// <param name="agentID"></param> 2372 /// <param name="agentID"></param>
2372 public override void RemoveClient(LLUUID agentID) 2373 public override void RemoveClient(UUID agentID)
2373 { 2374 {
2374 bool childagentYN = false; 2375 bool childagentYN = false;
2375 ScenePresence avatar = GetScenePresence(agentID); 2376 ScenePresence avatar = GetScenePresence(agentID);
@@ -2420,7 +2421,7 @@ namespace OpenSim.Region.Environment.Scenes
2420 { 2421 {
2421 try 2422 try
2422 { 2423 {
2423 client.SendKillObject(avatar.RegionHandle, avatar.LocalId); 2424 client.SendKiPrimitive(avatar.RegionHandle, avatar.LocalId);
2424 } 2425 }
2425 catch (NullReferenceException) 2426 catch (NullReferenceException)
2426 { 2427 {
@@ -2462,7 +2463,7 @@ namespace OpenSim.Region.Environment.Scenes
2462 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 2463 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
2463 } 2464 }
2464 2465
2465 public void HandleRemoveKnownRegionsFromAvatar(LLUUID avatarID, List<ulong> regionslst) 2466 public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst)
2466 { 2467 {
2467 ScenePresence av = GetScenePresence(avatarID); 2468 ScenePresence av = GetScenePresence(avatarID);
2468 if (av != null) 2469 if (av != null)
@@ -2493,7 +2494,7 @@ namespace OpenSim.Region.Environment.Scenes
2493 2494
2494 #region Entities 2495 #region Entities
2495 2496
2496 public void SendKillObject(uint localID) 2497 public void SendKiPrimitive(uint localID)
2497 { 2498 {
2498 SceneObjectPart part = GetSceneObjectPart(localID); 2499 SceneObjectPart part = GetSceneObjectPart(localID);
2499 if (part != null) // It is a prim 2500 if (part != null) // It is a prim
@@ -2504,7 +2505,7 @@ namespace OpenSim.Region.Environment.Scenes
2504 return; 2505 return;
2505 } 2506 }
2506 } 2507 }
2507 Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); 2508 Broadcast(delegate(IClientAPI client) { client.SendKiPrimitive(m_regionHandle, localID); });
2508 } 2509 }
2509 2510
2510 #endregion 2511 #endregion
@@ -2524,7 +2525,7 @@ namespace OpenSim.Region.Environment.Scenes
2524 m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; 2525 m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup;
2525 m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; 2526 m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
2526 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; 2527 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
2527 m_sceneGridService.KillObject += SendKillObject; 2528 m_sceneGridService.KiPrimitive += SendKiPrimitive;
2528 m_sceneGridService.OnGetLandData += GetLandData; 2529 m_sceneGridService.OnGetLandData += GetLandData;
2529 } 2530 }
2530 2531
@@ -2533,7 +2534,7 @@ namespace OpenSim.Region.Environment.Scenes
2533 /// </summary> 2534 /// </summary>
2534 public void UnRegisterReginWithComms() 2535 public void UnRegisterReginWithComms()
2535 { 2536 {
2536 m_sceneGridService.KillObject -= SendKillObject; 2537 m_sceneGridService.KiPrimitive -= SendKiPrimitive;
2537 m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; 2538 m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
2538 m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; 2539 m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
2539 m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; 2540 m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup;
@@ -2574,7 +2575,7 @@ namespace OpenSim.Region.Environment.Scenes
2574 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 2575 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
2575 if (land != null) 2576 if (land != null)
2576 { 2577 {
2577 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != LLVector3.Zero) 2578 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero)
2578 { 2579 {
2579 agent.startpos = land.landData.UserLocation; 2580 agent.startpos = land.landData.UserLocation;
2580 } 2581 }
@@ -2608,7 +2609,7 @@ namespace OpenSim.Region.Environment.Scenes
2608 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); 2609 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
2609 } 2610 }
2610 2611
2611 protected void HandleLogOffUserFromGrid(ulong regionHandle, LLUUID AvatarID, LLUUID RegionSecret, string message) 2612 protected void HandleLogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message)
2612 { 2613 {
2613 if (RegionInfo.RegionHandle == regionHandle) 2614 if (RegionInfo.RegionHandle == regionHandle)
2614 { 2615 {
@@ -2645,7 +2646,7 @@ namespace OpenSim.Region.Environment.Scenes
2645 /// </summary> 2646 /// </summary>
2646 /// <param name="agentId"></param> 2647 /// <param name="agentId"></param>
2647 /// <param name="capsObjectPath"></param> 2648 /// <param name="capsObjectPath"></param>
2648 public void AddCapsHandler(LLUUID agentId) 2649 public void AddCapsHandler(UUID agentId)
2649 { 2650 {
2650 if (RegionInfo.EstateSettings.IsBanned(agentId)) 2651 if (RegionInfo.EstateSettings.IsBanned(agentId))
2651 return; 2652 return;
@@ -2670,7 +2671,7 @@ namespace OpenSim.Region.Environment.Scenes
2670 m_capsHandlers[agentId] = cap; 2671 m_capsHandlers[agentId] = cap;
2671 } 2672 }
2672 2673
2673 public Caps GetCapsHandlerForUser(LLUUID agentId) 2674 public Caps GetCapsHandlerForUser(UUID agentId)
2674 { 2675 {
2675 lock (m_capsHandlers) 2676 lock (m_capsHandlers)
2676 { 2677 {
@@ -2686,7 +2687,7 @@ namespace OpenSim.Region.Environment.Scenes
2686 /// Remove the caps handler for a given agent. 2687 /// Remove the caps handler for a given agent.
2687 /// </summary> 2688 /// </summary>
2688 /// <param name="agentId"></param> 2689 /// <param name="agentId"></param>
2689 public void RemoveCapsHandler(LLUUID agentId) 2690 public void RemoveCapsHandler(UUID agentId)
2690 { 2691 {
2691 lock (m_capsHandlers) 2692 lock (m_capsHandlers)
2692 { 2693 {
@@ -2717,7 +2718,7 @@ namespace OpenSim.Region.Environment.Scenes
2717 /// <param name="agentID"></param> 2718 /// <param name="agentID"></param>
2718 /// <param name="position"></param> 2719 /// <param name="position"></param>
2719 /// <param name="isFlying"></param> 2720 /// <param name="isFlying"></param>
2720 public virtual void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 2721 public virtual void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying)
2721 { 2722 {
2722 if (regionHandle == m_regInfo.RegionHandle) 2723 if (regionHandle == m_regInfo.RegionHandle)
2723 { 2724 {
@@ -2742,7 +2743,7 @@ namespace OpenSim.Region.Environment.Scenes
2742 2743
2743 public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 2744 public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
2744 { 2745 {
2745 ScenePresence childAgentUpdate = GetScenePresence(new LLUUID(cAgentData.AgentID)); 2746 ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID));
2746 if (childAgentUpdate != null) 2747 if (childAgentUpdate != null)
2747 { 2748 {
2748 // I can't imagine *yet* why we would get an update if the agent is a root agent.. 2749 // I can't imagine *yet* why we would get an update if the agent is a root agent..
@@ -2768,7 +2769,7 @@ namespace OpenSim.Region.Environment.Scenes
2768 /// </summary> 2769 /// </summary>
2769 /// <param name="regionHandle"></param> 2770 /// <param name="regionHandle"></param>
2770 /// <param name="agentID"></param> 2771 /// <param name="agentID"></param>
2771 public bool CloseConnection(ulong regionHandle, LLUUID agentID) 2772 public bool CloseConnection(ulong regionHandle, UUID agentID)
2772 { 2773 {
2773 if (regionHandle == m_regionHandle) 2774 if (regionHandle == m_regionHandle)
2774 { 2775 {
@@ -2850,8 +2851,8 @@ namespace OpenSim.Region.Environment.Scenes
2850 /// <param name="position"></param> 2851 /// <param name="position"></param>
2851 /// <param name="lookAt"></param> 2852 /// <param name="lookAt"></param>
2852 /// <param name="flags"></param> 2853 /// <param name="flags"></param>
2853 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, LLVector3 position, 2854 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
2854 LLVector3 lookat, uint flags) 2855 Vector3 lookat, uint flags)
2855 { 2856 {
2856 RegionInfo regionInfo = m_sceneGridService.RequestClosestRegion(regionName); 2857 RegionInfo regionInfo = m_sceneGridService.RequestClosestRegion(regionName);
2857 if (regionInfo == null) 2858 if (regionInfo == null)
@@ -2871,8 +2872,8 @@ namespace OpenSim.Region.Environment.Scenes
2871 /// <param name="position"></param> 2872 /// <param name="position"></param>
2872 /// <param name="lookAt"></param> 2873 /// <param name="lookAt"></param>
2873 /// <param name="flags"></param> 2874 /// <param name="flags"></param>
2874 public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, 2875 public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position,
2875 LLVector3 lookAt, uint flags) 2876 Vector3 lookAt, uint flags)
2876 { 2877 {
2877 lock (m_scenePresences) 2878 lock (m_scenePresences)
2878 { 2879 {
@@ -2890,7 +2891,7 @@ namespace OpenSim.Region.Environment.Scenes
2890 /// <param name="remoteClient"></param> 2891 /// <param name="remoteClient"></param>
2891 /// <param name="regionHandle"></param> 2892 /// <param name="regionHandle"></param>
2892 /// <param name="position"></param> 2893 /// <param name="position"></param>
2893 public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position) 2894 public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position)
2894 { 2895 {
2895 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID); 2896 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID);
2896 2897
@@ -2906,7 +2907,7 @@ namespace OpenSim.Region.Environment.Scenes
2906 if (m_scenePresences.ContainsKey(remoteClient.AgentId)) 2907 if (m_scenePresences.ContainsKey(remoteClient.AgentId))
2907 { 2908 {
2908 m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], info.RegionHandle, 2909 m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], info.RegionHandle,
2909 position, LLVector3.Zero, 0); 2910 position, Vector3.Zero, 0);
2910 } 2911 }
2911 } 2912 }
2912 } 2913 }
@@ -2919,7 +2920,7 @@ namespace OpenSim.Region.Environment.Scenes
2919 /// <param name="position"></param> 2920 /// <param name="position"></param>
2920 /// <param name="isFlying"></param> 2921 /// <param name="isFlying"></param>
2921 /// <returns></returns> 2922 /// <returns></returns>
2922 public bool InformNeighbourOfCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 2923 public bool InformNeighbourOfCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying)
2923 { 2924 {
2924 return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); 2925 return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying);
2925 } 2926 }
@@ -3006,7 +3007,7 @@ namespace OpenSim.Region.Environment.Scenes
3006 objectCapacity = objects; 3007 objectCapacity = objects;
3007 } 3008 }
3008 3009
3009 public List<FriendListItem> GetFriendList(LLUUID avatarID) 3010 public List<FriendListItem> GetFriendList(UUID avatarID)
3010 { 3011 {
3011 return CommsManager.GetUserFriendList(avatarID); 3012 return CommsManager.GetUserFriendList(avatarID);
3012 } 3013 }
@@ -3035,7 +3036,7 @@ namespace OpenSim.Region.Environment.Scenes
3035 /// <param name="groupOwned"></param> 3036 /// <param name="groupOwned"></param>
3036 /// <param name="message"></param> 3037 /// <param name="message"></param>
3037 /// <param name="url"></param> 3038 /// <param name="url"></param>
3038 public void SendUrlToUser(LLUUID avatarID, string objectName, LLUUID objectID, LLUUID ownerID, bool groupOwned, 3039 public void SendUrlToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned,
3039 string message, string url) 3040 string message, string url)
3040 { 3041 {
3041 lock (m_scenePresences) 3042 lock (m_scenePresences)
@@ -3048,7 +3049,7 @@ namespace OpenSim.Region.Environment.Scenes
3048 } 3049 }
3049 } 3050 }
3050 3051
3051 public void SendDialogToUser(LLUUID avatarID, string objectName, LLUUID objectID, LLUUID ownerID, string message, LLUUID TextureID, int ch, string[] buttonlabels) 3052 public void SendDialogToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, string message, UUID TextureID, int ch, string[] buttonlabels)
3052 { 3053 {
3053 lock (m_scenePresences) 3054 lock (m_scenePresences)
3054 { 3055 {
@@ -3067,13 +3068,13 @@ namespace OpenSim.Region.Environment.Scenes
3067 /// <param name="type"></param> 3068 /// <param name="type"></param>
3068 /// <param name="body"></param> 3069 /// <param name="body"></param>
3069 /// <returns></returns> 3070 /// <returns></returns>
3070 public LLUUID MakeHttpRequest(string url, string type, string body) 3071 public UUID MakeHttpRequest(string url, string type, string body)
3071 { 3072 {
3072 if (m_httpRequestModule != null) 3073 if (m_httpRequestModule != null)
3073 { 3074 {
3074 return m_httpRequestModule.MakeHttpRequest(url, type, body); 3075 return m_httpRequestModule.MakeHttpRequest(url, type, body);
3075 } 3076 }
3076 return LLUUID.Zero; 3077 return UUID.Zero;
3077 } 3078 }
3078 3079
3079 /// <summary> 3080 /// <summary>
@@ -3091,25 +3092,25 @@ namespace OpenSim.Region.Environment.Scenes
3091 m_eventManager.TriggerGridInstantMessage(message, options); 3092 m_eventManager.TriggerGridInstantMessage(message, options);
3092 } 3093 }
3093 3094
3094 public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms) 3095 public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms)
3095 { 3096 {
3096 // TODO: m_sceneGridService.DoStuff; 3097 // TODO: m_sceneGridService.DoStuff;
3097 m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms); 3098 m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms);
3098 } 3099 }
3099 3100
3100 public virtual void StoreUpdateFriendship(LLUUID ownerID, LLUUID friendID, uint perms) 3101 public virtual void StoreUpdateFriendship(UUID ownerID, UUID friendID, uint perms)
3101 { 3102 {
3102 // TODO: m_sceneGridService.DoStuff; 3103 // TODO: m_sceneGridService.DoStuff;
3103 m_sceneGridService.UpdateUserFriendPerms(ownerID, friendID, perms); 3104 m_sceneGridService.UpdateUserFriendPerms(ownerID, friendID, perms);
3104 } 3105 }
3105 3106
3106 public virtual void StoreRemoveFriendship(LLUUID ownerID, LLUUID ExfriendID) 3107 public virtual void StoreRemoveFriendship(UUID ownerID, UUID ExfriendID)
3107 { 3108 {
3108 // TODO: m_sceneGridService.DoStuff; 3109 // TODO: m_sceneGridService.DoStuff;
3109 m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID); 3110 m_sceneGridService.RemoveUserFriend(ownerID, ExfriendID);
3110 } 3111 }
3111 3112
3112 public virtual List<FriendListItem> StoreGetFriendsForUser(LLUUID ownerID) 3113 public virtual List<FriendListItem> StoreGetFriendsForUser(UUID ownerID)
3113 { 3114 {
3114 // TODO: m_sceneGridService.DoStuff; 3115 // TODO: m_sceneGridService.DoStuff;
3115 return m_sceneGridService.GetUserFriendList(ownerID); 3116 return m_sceneGridService.GetUserFriendList(ownerID);
@@ -3144,7 +3145,7 @@ namespace OpenSim.Region.Environment.Scenes
3144 3145
3145 #region Alert Methods 3146 #region Alert Methods
3146 3147
3147 private void SendPermissionAlert(LLUUID user, string reason) 3148 private void SendPermissionAlert(UUID user, string reason)
3148 { 3149 {
3149 SendAlertToUser(user, reason, false); 3150 SendAlertToUser(user, reason, false);
3150 } 3151 }
@@ -3170,7 +3171,7 @@ namespace OpenSim.Region.Environment.Scenes
3170 /// <param name="agentID"></param> 3171 /// <param name="agentID"></param>
3171 /// <param name="message"></param> 3172 /// <param name="message"></param>
3172 /// <param name="modal"></param> 3173 /// <param name="modal"></param>
3173 public void SendAlertToUser(LLUUID agentID, string message, bool modal) 3174 public void SendAlertToUser(UUID agentID, string message, bool modal)
3174 { 3175 {
3175 lock (m_scenePresences) 3176 lock (m_scenePresences)
3176 { 3177 {
@@ -3188,7 +3189,7 @@ namespace OpenSim.Region.Environment.Scenes
3188 /// <param name="sessionID"></param> 3189 /// <param name="sessionID"></param>
3189 /// <param name="token"></param> 3190 /// <param name="token"></param>
3190 /// <param name="controllingClient"></param> 3191 /// <param name="controllingClient"></param>
3191 public void handleRequestGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, bool godLike, 3192 public void handleRequestGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godLike,
3192 IClientAPI controllingClient) 3193 IClientAPI controllingClient)
3193 { 3194 {
3194 lock (m_scenePresences) 3195 lock (m_scenePresences)
@@ -3200,7 +3201,7 @@ namespace OpenSim.Region.Environment.Scenes
3200 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID)) 3201 if (ExternalChecks.ExternalChecksCanBeGodLike(agentID))
3201 { 3202 {
3202 // Next we check for spoofing..... 3203 // Next we check for spoofing.....
3203 LLUUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId; 3204 UUID testSessionID = m_scenePresences[agentID].ControllingClient.SessionId;
3204 if (sessionID == testSessionID) 3205 if (sessionID == testSessionID)
3205 { 3206 {
3206 if (sessionID == controllingClient.SessionId) 3207 if (sessionID == controllingClient.SessionId)
@@ -3226,7 +3227,7 @@ namespace OpenSim.Region.Environment.Scenes
3226 /// <param name="fromSessionID">The session of the person sending the message</param> 3227 /// <param name="fromSessionID">The session of the person sending the message</param>
3227 /// <param name="FromAvatarName">The name of the person doing the sending</param> 3228 /// <param name="FromAvatarName">The name of the person doing the sending</param>
3228 /// <param name="Message">The Message being sent to the user</param> 3229 /// <param name="Message">The Message being sent to the user</param>
3229 public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) 3230 public void SendRegionMessageFromEstateTools(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message)
3230 { 3231 {
3231 List<ScenePresence> presenceList = GetScenePresences(); 3232 List<ScenePresence> presenceList = GetScenePresences();
3232 3233
@@ -3245,7 +3246,7 @@ namespace OpenSim.Region.Environment.Scenes
3245 /// <param name="fromSessionID">The session of the person sending the message</param> 3246 /// <param name="fromSessionID">The session of the person sending the message</param>
3246 /// <param name="FromAvatarName">The name of the person doing the sending</param> 3247 /// <param name="FromAvatarName">The name of the person doing the sending</param>
3247 /// <param name="Message">The Message being sent to the user</param> 3248 /// <param name="Message">The Message being sent to the user</param>
3248 public void SendEstateMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) 3249 public void SendEstateMessageFromEstateTools(UUID FromAvatarID, UUID fromSessionID, String FromAvatarName, String Message)
3249 { 3250 {
3250 3251
3251 ClientManager.ForEachClient(delegate(IClientAPI controller) 3252 ClientManager.ForEachClient(delegate(IClientAPI controller)
@@ -3266,10 +3267,10 @@ namespace OpenSim.Region.Environment.Scenes
3266 /// <param name="agentID">the person that is being kicked</param> 3267 /// <param name="agentID">the person that is being kicked</param>
3267 /// <param name="kickflags">This isn't used apparently</param> 3268 /// <param name="kickflags">This isn't used apparently</param>
3268 /// <param name="reason">The message to send to the user after it's been turned into a field</param> 3269 /// <param name="reason">The message to send to the user after it's been turned into a field</param>
3269 public void HandleGodlikeKickUser(LLUUID godID, LLUUID sessionID, LLUUID agentID, uint kickflags, byte[] reason) 3270 public void HandleGodlikeKickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason)
3270 { 3271 {
3271 // For some reason the client sends this seemingly hard coded UUID for kicking everyone. Dun-know. 3272 // For some reason the client sends this seemingly hard coded UUID for kicking everyone. Dun-know.
3272 LLUUID kickUserID = new LLUUID("44e87126e7944ded05b37c42da3d5cdb"); 3273 UUID kickUserID = new UUID("44e87126e7944ded05b37c42da3d5cdb");
3273 lock (m_scenePresences) 3274 lock (m_scenePresences)
3274 { 3275 {
3275 if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID) 3276 if (m_scenePresences.ContainsKey(agentID) || agentID == kickUserID)
@@ -3281,7 +3282,7 @@ namespace OpenSim.Region.Environment.Scenes
3281 ClientManager.ForEachClient(delegate(IClientAPI controller) 3282 ClientManager.ForEachClient(delegate(IClientAPI controller)
3282 { 3283 {
3283 if (controller.AgentId != godID) 3284 if (controller.AgentId != godID)
3284 controller.Kick(Helpers.FieldToUTF8String(reason)); 3285 controller.Kick(Utils.BytesToString(reason));
3285 } 3286 }
3286 ); 3287 );
3287 3288
@@ -3304,7 +3305,7 @@ namespace OpenSim.Region.Environment.Scenes
3304 { 3305 {
3305 m_innerScene.removeUserCount(!m_scenePresences[agentID].IsChildAgent); 3306 m_innerScene.removeUserCount(!m_scenePresences[agentID].IsChildAgent);
3306 3307
3307 m_scenePresences[agentID].ControllingClient.Kick(Helpers.FieldToUTF8String(reason)); 3308 m_scenePresences[agentID].ControllingClient.Kick(Utils.BytesToString(reason));
3308 m_scenePresences[agentID].ControllingClient.Close(true); 3309 m_scenePresences[agentID].ControllingClient.Close(true);
3309 } 3310 }
3310 } 3311 }
@@ -3317,7 +3318,7 @@ namespace OpenSim.Region.Environment.Scenes
3317 } 3318 }
3318 } 3319 }
3319 3320
3320 public void HandleObjectPermissionsUpdate(IClientAPI controller, LLUUID agentID, LLUUID sessionID, byte field, uint localId, uint mask, byte set) 3321 public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set)
3321 { 3322 {
3322 // Check for spoofing.. since this is permissions we're talking about here! 3323 // Check for spoofing.. since this is permissions we're talking about here!
3323 if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) 3324 if ((controller.SessionId == sessionID) && (controller.AgentId == agentID))
@@ -3423,7 +3424,7 @@ namespace OpenSim.Region.Environment.Scenes
3423 if (part.Name == cmdparams[0]) 3424 if (part.Name == cmdparams[0])
3424 { 3425 {
3425 part.Resize( 3426 part.Resize(
3426 new LLVector3(Convert.ToSingle(cmdparams[1]), Convert.ToSingle(cmdparams[2]), 3427 new Vector3(Convert.ToSingle(cmdparams[1]), Convert.ToSingle(cmdparams[2]),
3427 Convert.ToSingle(cmdparams[3]))); 3428 Convert.ToSingle(cmdparams[3])));
3428 3429
3429 Console.WriteLine("Edited scale of Primitive: " + part.Name); 3430 Console.WriteLine("Edited scale of Primitive: " + part.Name);
@@ -3489,12 +3490,12 @@ namespace OpenSim.Region.Environment.Scenes
3489 return Heightmap[x, y]; 3490 return Heightmap[x, y];
3490 } 3491 }
3491 3492
3492 public LLUUID GetLandOwner(float x, float y) 3493 public UUID GetLandOwner(float x, float y)
3493 { 3494 {
3494 ILandObject land = LandChannel.GetLandObject(x, y); 3495 ILandObject land = LandChannel.GetLandObject(x, y);
3495 if (land == null) 3496 if (land == null)
3496 { 3497 {
3497 return LLUUID.Zero; 3498 return UUID.Zero;
3498 } 3499 }
3499 else 3500 else
3500 { 3501 {
@@ -3570,7 +3571,7 @@ namespace OpenSim.Region.Environment.Scenes
3570 m_eventManager.TriggerOnScriptChangedEvent(localID, change); 3571 m_eventManager.TriggerOnScriptChangedEvent(localID, change);
3571 } 3572 }
3572 3573
3573 public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) 3574 public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos)
3574 { 3575 {
3575 m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos); 3576 m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos);
3576 } 3577 }
@@ -3580,7 +3581,7 @@ namespace OpenSim.Region.Environment.Scenes
3580 m_eventManager.TriggerNotAtTargetEvent(localID); 3581 m_eventManager.TriggerNotAtTargetEvent(localID);
3581 } 3582 }
3582 3583
3583 private bool scriptDanger(SceneObjectPart part,LLVector3 pos) 3584 private bool scriptDanger(SceneObjectPart part,Vector3 pos)
3584 { 3585 {
3585 ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); 3586 ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);
3586 if (part != null) 3587 if (part != null)
@@ -3636,7 +3637,7 @@ namespace OpenSim.Region.Environment.Scenes
3636 } 3637 }
3637 } 3638 }
3638 3639
3639 public bool scriptDanger(uint localID, LLVector3 pos) 3640 public bool scriptDanger(uint localID, Vector3 pos)
3640 { 3641 {
3641 SceneObjectPart part = GetSceneObjectPart(localID); 3642 SceneObjectPart part = GetSceneObjectPart(localID);
3642 if (part != null) 3643 if (part != null)
@@ -3678,7 +3679,7 @@ namespace OpenSim.Region.Environment.Scenes
3678 /// </summary> 3679 /// </summary>
3679 /// <param name="localID"></param> 3680 /// <param name="localID"></param>
3680 /// <returns></returns> 3681 /// <returns></returns>
3681 public LLUUID ConvertLocalIDToFullID(uint localID) 3682 public UUID ConvertLocalIDToFullID(uint localID)
3682 { 3683 {
3683 return m_innerScene.ConvertLocalIDToFullID(localID); 3684 return m_innerScene.ConvertLocalIDToFullID(localID);
3684 } 3685 }
@@ -3737,7 +3738,7 @@ namespace OpenSim.Region.Environment.Scenes
3737 /// </summary> 3738 /// </summary>
3738 /// <param name="avatarID"></param> 3739 /// <param name="avatarID"></param>
3739 /// <returns></returns> 3740 /// <returns></returns>
3740 public ScenePresence GetScenePresence(LLUUID avatarID) 3741 public ScenePresence GetScenePresence(UUID avatarID)
3741 { 3742 {
3742 return m_innerScene.GetScenePresence(avatarID); 3743 return m_innerScene.GetScenePresence(avatarID);
3743 } 3744 }
@@ -3747,7 +3748,7 @@ namespace OpenSim.Region.Environment.Scenes
3747 /// </summary> 3748 /// </summary>
3748 /// <param name="avatarID">AvatarID to lookup</param> 3749 /// <param name="avatarID">AvatarID to lookup</param>
3749 /// <returns></returns> 3750 /// <returns></returns>
3750 public override bool PresenceChildStatus(LLUUID avatarID) 3751 public override bool PresenceChildStatus(UUID avatarID)
3751 { 3752 {
3752 ScenePresence cp = GetScenePresence(avatarID); 3753 ScenePresence cp = GetScenePresence(avatarID);
3753 return cp.IsChildAgent; 3754 return cp.IsChildAgent;
@@ -3811,12 +3812,12 @@ namespace OpenSim.Region.Environment.Scenes
3811 /// </summary> 3812 /// </summary>
3812 /// <param name="fullID"></param> 3813 /// <param name="fullID"></param>
3813 /// <returns></returns> 3814 /// <returns></returns>
3814 public SceneObjectPart GetSceneObjectPart(LLUUID fullID) 3815 public SceneObjectPart GetSceneObjectPart(UUID fullID)
3815 { 3816 {
3816 return m_innerScene.GetSceneObjectPart(fullID); 3817 return m_innerScene.GetSceneObjectPart(fullID);
3817 } 3818 }
3818 3819
3819 internal bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) 3820 internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
3820 { 3821 {
3821 return m_innerScene.TryGetAvatar(avatarId, out avatar); 3822 return m_innerScene.TryGetAvatar(avatarId, out avatar);
3822 } 3823 }
@@ -3921,7 +3922,7 @@ namespace OpenSim.Region.Environment.Scenes
3921// }); 3922// });
3922 } 3923 }
3923 3924
3924 public void RegionHandleRequest(IClientAPI client, LLUUID regionID) 3925 public void RegionHandleRequest(IClientAPI client, UUID regionID)
3925 { 3926 {
3926 RegionInfo info; 3927 RegionInfo info;
3927 if (regionID == RegionInfo.RegionID) 3928 if (regionID == RegionInfo.RegionID)
@@ -3939,7 +3940,7 @@ namespace OpenSim.Region.Environment.Scenes
3939 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); 3940 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
3940 } 3941 }
3941 3942
3942 public void SetRootAgentScene(LLUUID agentID) 3943 public void SetRootAgentScene(UUID agentID)
3943 { 3944 {
3944 IInventoryModule inv = RequestModuleInterface<IInventoryModule>(); 3945 IInventoryModule inv = RequestModuleInterface<IInventoryModule>();
3945 if (inv == null) 3946 if (inv == null)
@@ -3948,7 +3949,7 @@ namespace OpenSim.Region.Environment.Scenes
3948 inv.SetRootAgentScene(agentID, this); 3949 inv.SetRootAgentScene(agentID, this);
3949 } 3950 }
3950 3951
3951 public bool NeedSceneCacheClear(LLUUID agentID) 3952 public bool NeedSceneCacheClear(UUID agentID)
3952 { 3953 {
3953 IInventoryModule inv = RequestModuleInterface<IInventoryModule>(); 3954 IInventoryModule inv = RequestModuleInterface<IInventoryModule>();
3954 if (inv == null) 3955 if (inv == null)
@@ -3957,7 +3958,7 @@ namespace OpenSim.Region.Environment.Scenes
3957 return inv.NeedSceneCacheClear(agentID, this); 3958 return inv.NeedSceneCacheClear(agentID, this);
3958 } 3959 }
3959 3960
3960 public void ObjectSaleInfo(IClientAPI client, LLUUID agentID, LLUUID sessionID, uint localID, byte saleType, int salePrice) 3961 public void ObjectSaleInfo(IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice)
3961 { 3962 {
3962 SceneObjectPart part = GetSceneObjectPart(localID); 3963 SceneObjectPart part = GetSceneObjectPart(localID);
3963 if (part == null || part.ParentGroup == null) 3964 if (part == null || part.ParentGroup == null)
@@ -3976,7 +3977,7 @@ namespace OpenSim.Region.Environment.Scenes
3976 part.GetProperties(client); 3977 part.GetProperties(client);
3977 } 3978 }
3978 3979
3979 public void PerformObjectBuy(IClientAPI remoteClient, LLUUID categoryID, 3980 public void PerformObjectBuy(IClientAPI remoteClient, UUID categoryID,
3980 uint localID, byte saleType) 3981 uint localID, byte saleType)
3981 { 3982 {
3982 SceneObjectPart part = GetSceneObjectPart(localID); 3983 SceneObjectPart part = GetSceneObjectPart(localID);
@@ -4031,13 +4032,13 @@ namespace OpenSim.Region.Environment.Scenes
4031 group.GetPartName(localID), 4032 group.GetPartName(localID),
4032 group.GetPartDescription(localID), 4033 group.GetPartDescription(localID),
4033 (sbyte)AssetType.Object, 4034 (sbyte)AssetType.Object,
4034 Helpers.StringToField(sceneObjectXml)); 4035 Utils.StringToBytes(sceneObjectXml));
4035 AssetCache.AddAsset(asset); 4036 AssetCache.AddAsset(asset);
4036 4037
4037 InventoryItemBase item = new InventoryItemBase(); 4038 InventoryItemBase item = new InventoryItemBase();
4038 item.Creator = part.CreatorID; 4039 item.Creator = part.CreatorID;
4039 4040
4040 item.ID = LLUUID.Random(); 4041 item.ID = UUID.Random();
4041 item.Owner = remoteClient.AgentId; 4042 item.Owner = remoteClient.AgentId;
4042 item.AssetID = asset.FullID; 4043 item.AssetID = asset.FullID;
4043 item.Description = asset.Description; 4044 item.Description = asset.Description;
@@ -4069,7 +4070,7 @@ namespace OpenSim.Region.Environment.Scenes
4069 break; 4070 break;
4070 4071
4071 case 3: // Sell contents 4072 case 3: // Sell contents
4072 List<LLUUID> invList = part.GetInventoryList(); 4073 List<UUID> invList = part.GetInventoryList();
4073 4074
4074 if (invList.Count > 0) 4075 if (invList.Count > 0)
4075 MoveTaskInventoryItems(remoteClient.AgentId, part.Name, 4076 MoveTaskInventoryItems(remoteClient.AgentId, part.Name,
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index c624a41..51909ad 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using libsecondlife; 31using OpenMetaverse;
32using log4net; 32using log4net;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes
141 /// 141 ///
142 /// </summary> 142 /// </summary>
143 /// <param name="agentID"></param> 143 /// <param name="agentID"></param>
144 public abstract void RemoveClient(LLUUID agentID); 144 public abstract void RemoveClient(UUID agentID);
145 145
146 public abstract void CloseAllAgents(uint circuitcode); 146 public abstract void CloseAllAgents(uint circuitcode);
147 147
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes
175 handlerPhysicsCrash(RegionInfo); 175 handlerPhysicsCrash(RegionInfo);
176 } 176 }
177 177
178 public virtual bool PresenceChildStatus(LLUUID avatarID) 178 public virtual bool PresenceChildStatus(UUID avatarID)
179 { 179 {
180 return false; 180 return false;
181 } 181 }
@@ -210,8 +210,8 @@ namespace OpenSim.Region.Environment.Scenes
210 /// <summary> 210 /// <summary>
211 /// XXX These two methods are very temporary 211 /// XXX These two methods are very temporary
212 /// </summary> 212 /// </summary>
213 protected Dictionary<LLUUID, string> capsPaths = new Dictionary<LLUUID, string>(); 213 protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>();
214 public string GetCapsPath(LLUUID agentId) 214 public string GetCapsPath(UUID agentId)
215 { 215 {
216 if (capsPaths.ContainsKey(agentId)) 216 if (capsPaths.ContainsKey(agentId))
217 { 217 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index f8c5814..9ff35c0 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -30,16 +30,16 @@ using System.Collections.Generic;
30using System.Net; 30using System.Net;
31using System.Reflection; 31using System.Reflection;
32using System.Threading; 32using System.Threading;
33using libsecondlife; 33using OpenMetaverse;
34using log4net; 34using log4net;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Communications; 36using OpenSim.Framework.Communications;
37 37
38namespace OpenSim.Region.Environment.Scenes 38namespace OpenSim.Region.Environment.Scenes
39{ 39{
40 public delegate void KillObjectDelegate(uint localID); 40 public delegate void KiPrimitiveDelegate(uint localID);
41 41
42 public delegate void RemoveKnownRegionsFromAvatarList(LLUUID avatarID, List<ulong> regionlst); 42 public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst);
43 43
44 public class SceneCommunicationService //one instance per region 44 public class SceneCommunicationService //one instance per region
45 { 45 {
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
72 private LogOffUser handlerLogOffUser = null; 72 private LogOffUser handlerLogOffUser = null;
73 private GetLandData handlerGetLandData = null; // OnGetLandData 73 private GetLandData handlerGetLandData = null; // OnGetLandData
74 74
75 public KillObjectDelegate KillObject; 75 public KiPrimitiveDelegate KiPrimitive;
76 public string _debugRegionName = String.Empty; 76 public string _debugRegionName = String.Empty;
77 77
78 public string debugRegionName 78 public string debugRegionName
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes
158 } 158 }
159 } 159 }
160 160
161 protected void GridLogOffUser(ulong regionHandle, LLUUID AgentID, LLUUID RegionSecret, string message) 161 protected void GridLogOffUser(ulong regionHandle, UUID AgentID, UUID RegionSecret, string message)
162 { 162 {
163 handlerLogOffUser = OnLogOffUser; 163 handlerLogOffUser = OnLogOffUser;
164 if (handlerLogOffUser != null) 164 if (handlerLogOffUser != null)
@@ -188,7 +188,7 @@ namespace OpenSim.Region.Environment.Scenes
188 return true; 188 return true;
189 } 189 }
190 190
191 protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 191 protected void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying)
192 { 192 {
193 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; 193 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
194 if (handlerAvatarCrossingIntoRegion != null) 194 if (handlerAvatarCrossingIntoRegion != null)
@@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Scenes
197 } 197 }
198 } 198 }
199 199
200 protected bool IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData, int XMLMethod) 200 protected bool IncomingPrimCrossing(ulong regionHandle, UUID primID, String objXMLData, int XMLMethod)
201 { 201 {
202 handlerExpectPrim = OnExpectPrim; 202 handlerExpectPrim = OnExpectPrim;
203 if (handlerExpectPrim != null) 203 if (handlerExpectPrim != null)
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Scenes
211 211
212 } 212 }
213 213
214 protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) 214 protected void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical)
215 { 215 {
216 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; 216 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
217 if (handlerPrimCrossingIntoRegion != null) 217 if (handlerPrimCrossingIntoRegion != null)
@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
220 } 220 }
221 } 221 }
222 222
223 protected bool CloseConnection(ulong regionHandle, LLUUID agentID) 223 protected bool CloseConnection(ulong regionHandle, UUID agentID)
224 { 224 {
225 m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); 225 m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString());
226 handlerCloseAgentConnection = OnCloseAgentConnection; 226 handlerCloseAgentConnection = OnCloseAgentConnection;
@@ -315,9 +315,9 @@ namespace OpenSim.Region.Environment.Scenes
315 for (int i = 0; i < neighbours.Count; i++) 315 for (int i = 0; i < neighbours.Count; i++)
316 { 316 {
317 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); 317 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
318 agent.BaseFolder = LLUUID.Zero; 318 agent.BaseFolder = UUID.Zero;
319 agent.InventoryFolder = LLUUID.Zero; 319 agent.InventoryFolder = UUID.Zero;
320 agent.startpos = new LLVector3(128, 128, 70); 320 agent.startpos = new Vector3(128, 128, 70);
321 agent.child = true; 321 agent.child = true;
322 322
323 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; 323 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
@@ -356,9 +356,9 @@ namespace OpenSim.Region.Environment.Scenes
356 public void InformNeighborChildAgent(ScenePresence avatar, RegionInfo region, List<RegionInfo> neighbours) 356 public void InformNeighborChildAgent(ScenePresence avatar, RegionInfo region, List<RegionInfo> neighbours)
357 { 357 {
358 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); 358 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
359 agent.BaseFolder = LLUUID.Zero; 359 agent.BaseFolder = UUID.Zero;
360 agent.InventoryFolder = LLUUID.Zero; 360 agent.InventoryFolder = UUID.Zero;
361 agent.startpos = new LLVector3(128, 128, 70); 361 agent.startpos = new Vector3(128, 128, 70);
362 agent.child = true; 362 agent.child = true;
363 363
364 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; 364 InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
@@ -484,13 +484,13 @@ namespace OpenSim.Region.Environment.Scenes
484 d); 484 d);
485 } 485 }
486 486
487 public delegate void SendCloseChildAgentDelegate(LLUUID agentID, List<ulong> regionlst); 487 public delegate void SendCloseChildAgentDelegate(UUID agentID, List<ulong> regionlst);
488 488
489 /// <summary> 489 /// <summary>
490 /// This Closes child agents on neighboring regions 490 /// This Closes child agents on neighboring regions
491 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 491 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
492 /// </summary> 492 /// </summary>
493 private void SendCloseChildAgentAsync(LLUUID agentID, List<ulong> regionlst) 493 private void SendCloseChildAgentAsync(UUID agentID, List<ulong> regionlst)
494 { 494 {
495 495
496 foreach (ulong regionHandle in regionlst) 496 foreach (ulong regionHandle in regionlst)
@@ -525,7 +525,7 @@ namespace OpenSim.Region.Environment.Scenes
525 icon.EndInvoke(iar); 525 icon.EndInvoke(iar);
526 } 526 }
527 527
528 public void SendCloseChildAgentConnections(LLUUID agentID, List<ulong> regionslst) 528 public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst)
529 { 529 {
530 // This assumes that we know what our neighbors are. 530 // This assumes that we know what our neighbors are.
531 SendCloseChildAgentDelegate d = SendCloseChildAgentAsync; 531 SendCloseChildAgentDelegate d = SendCloseChildAgentAsync;
@@ -550,7 +550,7 @@ namespace OpenSim.Region.Environment.Scenes
550 /// </summary> 550 /// </summary>
551 /// <param name="regionID"></param> 551 /// <param name="regionID"></param>
552 /// <returns></returns> 552 /// <returns></returns>
553 public virtual RegionInfo RequestNeighbouringRegionInfo(LLUUID regionID) 553 public virtual RegionInfo RequestNeighbouringRegionInfo(UUID regionID)
554 { 554 {
555 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionID); 555 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionID);
556 return m_commsProvider.GridService.RequestNeighbourInfo(regionID); 556 return m_commsProvider.GridService.RequestNeighbourInfo(regionID);
@@ -578,8 +578,8 @@ namespace OpenSim.Region.Environment.Scenes
578 /// <param name="position"></param> 578 /// <param name="position"></param>
579 /// <param name="lookAt"></param> 579 /// <param name="lookAt"></param>
580 /// <param name="flags"></param> 580 /// <param name="flags"></param>
581 public virtual void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, LLVector3 position, 581 public virtual void RequestTeleportToLocation(ScenePresence avatar, ulong regionHandle, Vector3 position,
582 LLVector3 lookAt, uint flags) 582 Vector3 lookAt, uint flags)
583 { 583 {
584 bool destRegionUp = false; 584 bool destRegionUp = false;
585 585
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Environment.Scenes
588 // Teleport within the same region 588 // Teleport within the same region
589 if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) 589 if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0)
590 { 590 {
591 LLVector3 emergencyPos = new LLVector3(128, 128, 128); 591 Vector3 emergencyPos = new Vector3(128, 128, 128);
592 592
593 m_log.WarnFormat( 593 m_log.WarnFormat(
594 "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 594 "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
@@ -614,8 +614,8 @@ namespace OpenSim.Region.Environment.Scenes
614 { 614 {
615 avatar.ControllingClient.SendTeleportLocationStart(); 615 avatar.ControllingClient.SendTeleportLocationStart();
616 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); 616 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
617 agent.BaseFolder = LLUUID.Zero; 617 agent.BaseFolder = UUID.Zero;
618 agent.InventoryFolder = LLUUID.Zero; 618 agent.InventoryFolder = UUID.Zero;
619 agent.startpos = position; 619 agent.startpos = position;
620 agent.child = true; 620 agent.child = true;
621 621
@@ -667,9 +667,9 @@ namespace OpenSim.Region.Environment.Scenes
667 avatar.MakeChildAgent(); 667 avatar.MakeChildAgent();
668 Thread.Sleep(5000); 668 Thread.Sleep(5000);
669 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle); 669 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle);
670 if (KillObject != null) 670 if (KiPrimitive != null)
671 { 671 {
672 KillObject(avatar.LocalId); 672 KiPrimitive(avatar.LocalId);
673 } 673 }
674 uint newRegionX = (uint)(reg.RegionHandle >> 40); 674 uint newRegionX = (uint)(reg.RegionHandle >> 40);
675 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); 675 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
@@ -700,12 +700,12 @@ namespace OpenSim.Region.Environment.Scenes
700 /// <param name="regionhandle"></param> 700 /// <param name="regionhandle"></param>
701 /// <param name="agentID"></param> 701 /// <param name="agentID"></param>
702 /// <param name="position"></param> 702 /// <param name="position"></param>
703 public bool CrossToNeighbouringRegion(ulong regionhandle, LLUUID agentID, LLVector3 position, bool isFlying) 703 public bool CrossToNeighbouringRegion(ulong regionhandle, UUID agentID, Vector3 position, bool isFlying)
704 { 704 {
705 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); 705 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
706 } 706 }
707 707
708 public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, string objData, int XMLMethod) 708 public bool PrimCrossToNeighboringRegion(ulong regionhandle, UUID primID, string objData, int XMLMethod)
709 { 709 {
710 return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod); 710 return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod);
711 } 711 }
@@ -716,32 +716,32 @@ namespace OpenSim.Region.Environment.Scenes
716 return m_commsProvider.GridService.GetGridSettings(); 716 return m_commsProvider.GridService.GetGridSettings();
717 } 717 }
718 718
719 public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz) 719 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz)
720 { 720 {
721 m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz); 721 m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz);
722 } 722 }
723 723
724 public void ClearUserAgent(LLUUID avatarID) 724 public void ClearUserAgent(UUID avatarID)
725 { 725 {
726 m_commsProvider.UserService.ClearUserAgent(avatarID); 726 m_commsProvider.UserService.ClearUserAgent(avatarID);
727 } 727 }
728 728
729 public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) 729 public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
730 { 730 {
731 m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms); 731 m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms);
732 } 732 }
733 733
734 public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) 734 public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms)
735 { 735 {
736 m_commsProvider.UpdateUserFriendPerms(friendlistowner, friend, perms); 736 m_commsProvider.UpdateUserFriendPerms(friendlistowner, friend, perms);
737 } 737 }
738 738
739 public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) 739 public void RemoveUserFriend(UUID friendlistowner, UUID friend)
740 { 740 {
741 m_commsProvider.RemoveUserFriend(friendlistowner, friend); 741 m_commsProvider.RemoveUserFriend(friendlistowner, friend);
742 } 742 }
743 743
744 public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) 744 public List<FriendListItem> GetUserFriendList(UUID friendlistowner)
745 { 745 {
746 return m_commsProvider.GetUserFriendList(friendlistowner); 746 return m_commsProvider.GetUserFriendList(friendlistowner);
747 } 747 }
@@ -751,7 +751,7 @@ namespace OpenSim.Region.Environment.Scenes
751 return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY); 751 return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
752 } 752 }
753 753
754 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID queryID, string query) 754 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
755 { 755 {
756 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query); 756 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
757 } 757 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index a0e0a37..a2a4b2d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text; 30using System.Text;
31using libsecondlife; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Environment.Interfaces; 33using OpenSim.Region.Environment.Interfaces;
34 34
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Scenes
45 45
46 #region Object Permission Checks 46 #region Object Permission Checks
47 47
48 public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); 48 public delegate uint GenerateClientFlags(UUID userID, UUID objectIDID);
49 private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); 49 private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>();
50 50
51 public void addGenerateClientFlags(GenerateClientFlags delegateFunc) 51 public void addGenerateClientFlags(GenerateClientFlags delegateFunc)
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
60 GenerateClientFlagsCheckFunctions.Remove(delegateFunc); 60 GenerateClientFlagsCheckFunctions.Remove(delegateFunc);
61 } 61 }
62 62
63 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) 63 public uint ExternalChecksGenerateClientFlags(UUID userID, UUID objectID)
64 { 64 {
65 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); 65 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
66 66
@@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Scenes
68 return 0; 68 return 0;
69 69
70 uint perms=part.GetEffectiveObjectFlags() | 70 uint perms=part.GetEffectiveObjectFlags() |
71 (uint)LLObject.ObjectFlags.ObjectModify | 71 (uint)PrimFlags.ObjectModify |
72 (uint)LLObject.ObjectFlags.ObjectCopy | 72 (uint)PrimFlags.ObjectCopy |
73 (uint)LLObject.ObjectFlags.ObjectMove | 73 (uint)PrimFlags.ObjectMove |
74 (uint)LLObject.ObjectFlags.ObjectTransfer | 74 (uint)PrimFlags.ObjectTransfer |
75 (uint)LLObject.ObjectFlags.ObjectYouOwner | 75 (uint)PrimFlags.ObjectYouOwner |
76 (uint)LLObject.ObjectFlags.ObjectAnyOwner | 76 (uint)PrimFlags.ObjectAnyOwner |
77 (uint)LLObject.ObjectFlags.ObjectOwnerModify | 77 (uint)PrimFlags.ObjectOwnerModify |
78 (uint)LLObject.ObjectFlags.ObjectYouOfficer; 78 (uint)PrimFlags.ObjectYouOfficer;
79 79
80 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) 80 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
81 { 81 {
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Scenes
162 } 162 }
163 163
164 #region REZ OBJECT 164 #region REZ OBJECT
165 public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); 165 public delegate bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene);
166 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); 166 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>();
167 167
168 public void addCheckRezObject(CanRezObject delegateFunc) 168 public void addCheckRezObject(CanRezObject delegateFunc)
@@ -177,7 +177,7 @@ namespace OpenSim.Region.Environment.Scenes
177 CanRezObjectCheckFunctions.Remove(delegateFunc); 177 CanRezObjectCheckFunctions.Remove(delegateFunc);
178 } 178 }
179 179
180 public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) 180 public bool ExternalChecksCanRezObject(int objectCount, UUID owner, Vector3 objectPosition)
181 { 181 {
182 foreach (CanRezObject check in CanRezObjectCheckFunctions) 182 foreach (CanRezObject check in CanRezObjectCheckFunctions)
183 { 183 {
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Scenes
192 #endregion 192 #endregion
193 193
194 #region DELETE OBJECT 194 #region DELETE OBJECT
195 public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); 195 public delegate bool CanDeleteObject(UUID objectID, UUID deleter, Scene scene);
196 private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); 196 private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>();
197 197
198 public void addCheckDeleteObject(CanDeleteObject delegateFunc) 198 public void addCheckDeleteObject(CanDeleteObject delegateFunc)
@@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
207 CanDeleteObjectCheckFunctions.Remove(delegateFunc); 207 CanDeleteObjectCheckFunctions.Remove(delegateFunc);
208 } 208 }
209 209
210 public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) 210 public bool ExternalChecksCanDeleteObject(UUID objectID, UUID deleter)
211 { 211 {
212 foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) 212 foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions)
213 { 213 {
@@ -222,7 +222,7 @@ namespace OpenSim.Region.Environment.Scenes
222 #endregion 222 #endregion
223 223
224 #region TAKE OBJECT 224 #region TAKE OBJECT
225 public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); 225 public delegate bool CanTakeObject(UUID objectID, UUID stealer, Scene scene);
226 private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); 226 private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>();
227 227
228 public void addCheckTakeObject(CanTakeObject delegateFunc) 228 public void addCheckTakeObject(CanTakeObject delegateFunc)
@@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes
237 CanTakeObjectCheckFunctions.Remove(delegateFunc); 237 CanTakeObjectCheckFunctions.Remove(delegateFunc);
238 } 238 }
239 239
240 public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) 240 public bool ExternalChecksCanTakeObject(UUID objectID, UUID AvatarTakingUUID)
241 { 241 {
242 foreach (CanTakeObject check in CanTakeObjectCheckFunctions) 242 foreach (CanTakeObject check in CanTakeObjectCheckFunctions)
243 { 243 {
@@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes
252 #endregion 252 #endregion
253 253
254 #region TAKE COPY OBJECT 254 #region TAKE COPY OBJECT
255 public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); 255 public delegate bool CanTakeCopyObject(UUID objectID, UUID userID, Scene inScene);
256 private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); 256 private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>();
257 257
258 public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) 258 public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc)
@@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes
267 CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); 267 CanTakeCopyObjectCheckFunctions.Remove(delegateFunc);
268 } 268 }
269 269
270 public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) 270 public bool ExternalChecksCanTakeCopyObject(UUID objectID, UUID userID)
271 { 271 {
272 foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) 272 foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions)
273 { 273 {
@@ -282,7 +282,7 @@ namespace OpenSim.Region.Environment.Scenes
282 #endregion 282 #endregion
283 283
284 #region DUPLICATE OBJECT 284 #region DUPLICATE OBJECT
285 public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); 285 public delegate bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition);
286 private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); 286 private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>();
287 287
288 public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) 288 public void addCheckDuplicateObject(CanDuplicateObject delegateFunc)
@@ -297,7 +297,7 @@ namespace OpenSim.Region.Environment.Scenes
297 CanDuplicateObjectCheckFunctions.Remove(delegateFunc); 297 CanDuplicateObjectCheckFunctions.Remove(delegateFunc);
298 } 298 }
299 299
300 public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) 300 public bool ExternalChecksCanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition)
301 { 301 {
302 foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) 302 foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions)
303 { 303 {
@@ -312,7 +312,7 @@ namespace OpenSim.Region.Environment.Scenes
312 #endregion 312 #endregion
313 313
314 #region EDIT OBJECT 314 #region EDIT OBJECT
315 public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); 315 public delegate bool CanEditObject(UUID objectID, UUID editorID, Scene scene);
316 private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); 316 private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>();
317 317
318 public void addCheckEditObject(CanEditObject delegateFunc) 318 public void addCheckEditObject(CanEditObject delegateFunc)
@@ -327,7 +327,7 @@ namespace OpenSim.Region.Environment.Scenes
327 CanEditObjectCheckFunctions.Remove(delegateFunc); 327 CanEditObjectCheckFunctions.Remove(delegateFunc);
328 } 328 }
329 329
330 public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) 330 public bool ExternalChecksCanEditObject(UUID objectID, UUID editorID)
331 { 331 {
332 foreach (CanEditObject check in CanEditObjectCheckFunctions) 332 foreach (CanEditObject check in CanEditObjectCheckFunctions)
333 { 333 {
@@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes
342 #endregion 342 #endregion
343 343
344 #region MOVE OBJECT 344 #region MOVE OBJECT
345 public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); 345 public delegate bool CanMoveObject(UUID objectID, UUID moverID, Scene scene);
346 private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); 346 private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>();
347 347
348 public void addCheckMoveObject(CanMoveObject delegateFunc) 348 public void addCheckMoveObject(CanMoveObject delegateFunc)
@@ -357,7 +357,7 @@ namespace OpenSim.Region.Environment.Scenes
357 CanMoveObjectCheckFunctions.Remove(delegateFunc); 357 CanMoveObjectCheckFunctions.Remove(delegateFunc);
358 } 358 }
359 359
360 public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) 360 public bool ExternalChecksCanMoveObject(UUID objectID, UUID moverID)
361 { 361 {
362 foreach (CanMoveObject check in CanMoveObjectCheckFunctions) 362 foreach (CanMoveObject check in CanMoveObjectCheckFunctions)
363 { 363 {
@@ -372,7 +372,7 @@ namespace OpenSim.Region.Environment.Scenes
372 #endregion 372 #endregion
373 373
374 #region OBJECT ENTRY 374 #region OBJECT ENTRY
375 public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); 375 public delegate bool CanObjectEntry(UUID objectID, Vector3 newPoint, Scene scene);
376 private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); 376 private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>();
377 377
378 public void addCheckObjectEntry(CanObjectEntry delegateFunc) 378 public void addCheckObjectEntry(CanObjectEntry delegateFunc)
@@ -387,7 +387,7 @@ namespace OpenSim.Region.Environment.Scenes
387 CanObjectEntryCheckFunctions.Remove(delegateFunc); 387 CanObjectEntryCheckFunctions.Remove(delegateFunc);
388 } 388 }
389 389
390 public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) 390 public bool ExternalChecksCanObjectEntry(UUID objectID, Vector3 newPoint)
391 { 391 {
392 foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) 392 foreach (CanObjectEntry check in CanObjectEntryCheckFunctions)
393 { 393 {
@@ -402,7 +402,7 @@ namespace OpenSim.Region.Environment.Scenes
402 #endregion 402 #endregion
403 403
404 #region RETURN OBJECT 404 #region RETURN OBJECT
405 public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); 405 public delegate bool CanReturnObject(UUID objectID, UUID returnerID, Scene scene);
406 private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); 406 private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>();
407 407
408 public void addCheckReturnObject(CanReturnObject delegateFunc) 408 public void addCheckReturnObject(CanReturnObject delegateFunc)
@@ -417,7 +417,7 @@ namespace OpenSim.Region.Environment.Scenes
417 CanReturnObjectCheckFunctions.Remove(delegateFunc); 417 CanReturnObjectCheckFunctions.Remove(delegateFunc);
418 } 418 }
419 419
420 public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) 420 public bool ExternalChecksCanReturnObject(UUID objectID, UUID returnerID)
421 { 421 {
422 foreach (CanReturnObject check in CanReturnObjectCheckFunctions) 422 foreach (CanReturnObject check in CanReturnObjectCheckFunctions)
423 { 423 {
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
432 #endregion 432 #endregion
433 433
434 #region INSTANT MESSAGE 434 #region INSTANT MESSAGE
435 public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); 435 public delegate bool CanInstantMessage(UUID user, UUID target, Scene startScene);
436 private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); 436 private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>();
437 437
438 public void addCheckInstantMessage(CanInstantMessage delegateFunc) 438 public void addCheckInstantMessage(CanInstantMessage delegateFunc)
@@ -447,7 +447,7 @@ namespace OpenSim.Region.Environment.Scenes
447 CanInstantMessageCheckFunctions.Remove(delegateFunc); 447 CanInstantMessageCheckFunctions.Remove(delegateFunc);
448 } 448 }
449 449
450 public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) 450 public bool ExternalChecksCanInstantMessage(UUID user, UUID target)
451 { 451 {
452 foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) 452 foreach (CanInstantMessage check in CanInstantMessageCheckFunctions)
453 { 453 {
@@ -462,7 +462,7 @@ namespace OpenSim.Region.Environment.Scenes
462 #endregion 462 #endregion
463 463
464 #region INVENTORY TRANSFER 464 #region INVENTORY TRANSFER
465 public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); 465 public delegate bool CanInventoryTransfer(UUID user, UUID target, Scene startScene);
466 private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); 466 private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>();
467 467
468 public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) 468 public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc)
@@ -477,7 +477,7 @@ namespace OpenSim.Region.Environment.Scenes
477 CanInventoryTransferCheckFunctions.Remove(delegateFunc); 477 CanInventoryTransferCheckFunctions.Remove(delegateFunc);
478 } 478 }
479 479
480 public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) 480 public bool ExternalChecksCanInventoryTransfer(UUID user, UUID target)
481 { 481 {
482 foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) 482 foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions)
483 { 483 {
@@ -492,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes
492 #endregion 492 #endregion
493 493
494 #region VIEW SCRIPT 494 #region VIEW SCRIPT
495 public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 495 public delegate bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene);
496 private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); 496 private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>();
497 497
498 public void addCheckViewScript(CanViewScript delegateFunc) 498 public void addCheckViewScript(CanViewScript delegateFunc)
@@ -507,7 +507,7 @@ namespace OpenSim.Region.Environment.Scenes
507 CanViewScriptCheckFunctions.Remove(delegateFunc); 507 CanViewScriptCheckFunctions.Remove(delegateFunc);
508 } 508 }
509 509
510 public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) 510 public bool ExternalChecksCanViewScript(UUID script, UUID objectID, UUID user)
511 { 511 {
512 foreach (CanViewScript check in CanViewScriptCheckFunctions) 512 foreach (CanViewScript check in CanViewScriptCheckFunctions)
513 { 513 {
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes
519 return true; 519 return true;
520 } 520 }
521 521
522 public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 522 public delegate bool CanViewNotecard(UUID script, UUID objectID, UUID user, Scene scene);
523 private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); 523 private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>();
524 524
525 public void addCheckViewNotecard(CanViewNotecard delegateFunc) 525 public void addCheckViewNotecard(CanViewNotecard delegateFunc)
@@ -534,7 +534,7 @@ namespace OpenSim.Region.Environment.Scenes
534 CanViewNotecardCheckFunctions.Remove(delegateFunc); 534 CanViewNotecardCheckFunctions.Remove(delegateFunc);
535 } 535 }
536 536
537 public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) 537 public bool ExternalChecksCanViewNotecard(UUID script, UUID objectID, UUID user)
538 { 538 {
539 foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) 539 foreach (CanViewNotecard check in CanViewNotecardCheckFunctions)
540 { 540 {
@@ -549,7 +549,7 @@ namespace OpenSim.Region.Environment.Scenes
549 #endregion 549 #endregion
550 550
551 #region EDIT SCRIPT 551 #region EDIT SCRIPT
552 public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 552 public delegate bool CanEditScript(UUID script, UUID objectID, UUID user, Scene scene);
553 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); 553 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>();
554 554
555 public void addCheckEditScript(CanEditScript delegateFunc) 555 public void addCheckEditScript(CanEditScript delegateFunc)
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes
564 CanEditScriptCheckFunctions.Remove(delegateFunc); 564 CanEditScriptCheckFunctions.Remove(delegateFunc);
565 } 565 }
566 566
567 public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) 567 public bool ExternalChecksCanEditScript(UUID script, UUID objectID, UUID user)
568 { 568 {
569 foreach (CanEditScript check in CanEditScriptCheckFunctions) 569 foreach (CanEditScript check in CanEditScriptCheckFunctions)
570 { 570 {
@@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes
576 return true; 576 return true;
577 } 577 }
578 578
579 public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); 579 public delegate bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene);
580 private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); 580 private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>();
581 581
582 public void addCheckEditNotecard(CanEditNotecard delegateFunc) 582 public void addCheckEditNotecard(CanEditNotecard delegateFunc)
@@ -591,7 +591,7 @@ namespace OpenSim.Region.Environment.Scenes
591 CanEditNotecardCheckFunctions.Remove(delegateFunc); 591 CanEditNotecardCheckFunctions.Remove(delegateFunc);
592 } 592 }
593 593
594 public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) 594 public bool ExternalChecksCanEditNotecard(UUID script, UUID objectID, UUID user)
595 { 595 {
596 foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) 596 foreach (CanEditNotecard check in CanEditNotecardCheckFunctions)
597 { 597 {
@@ -606,7 +606,7 @@ namespace OpenSim.Region.Environment.Scenes
606 #endregion 606 #endregion
607 607
608 #region RUN SCRIPT (When Script Placed in Object) 608 #region RUN SCRIPT (When Script Placed in Object)
609 public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 609 public delegate bool CanRunScript(UUID script, UUID objectID, UUID user, Scene scene);
610 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); 610 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>();
611 611
612 public void addCheckRunScript(CanRunScript delegateFunc) 612 public void addCheckRunScript(CanRunScript delegateFunc)
@@ -621,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes
621 CanRunScriptCheckFunctions.Remove(delegateFunc); 621 CanRunScriptCheckFunctions.Remove(delegateFunc);
622 } 622 }
623 623
624 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) 624 public bool ExternalChecksCanRunScript(UUID script, UUID objectID, UUID user)
625 { 625 {
626 foreach (CanRunScript check in CanRunScriptCheckFunctions) 626 foreach (CanRunScript check in CanRunScriptCheckFunctions)
627 { 627 {
@@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Scenes
636 #endregion 636 #endregion
637 637
638 #region START SCRIPT (When Script run box is Checked after placed in object) 638 #region START SCRIPT (When Script run box is Checked after placed in object)
639 public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); 639 public delegate bool CanStartScript(UUID script, UUID user, Scene scene);
640 private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); 640 private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>();
641 641
642 public void addCheckStartScript(CanStartScript delegateFunc) 642 public void addCheckStartScript(CanStartScript delegateFunc)
@@ -651,7 +651,7 @@ namespace OpenSim.Region.Environment.Scenes
651 CanStartScriptCheckFunctions.Remove(delegateFunc); 651 CanStartScriptCheckFunctions.Remove(delegateFunc);
652 } 652 }
653 653
654 public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) 654 public bool ExternalChecksCanStartScript(UUID script, UUID user)
655 { 655 {
656 foreach (CanStartScript check in CanStartScriptCheckFunctions) 656 foreach (CanStartScript check in CanStartScriptCheckFunctions)
657 { 657 {
@@ -666,7 +666,7 @@ namespace OpenSim.Region.Environment.Scenes
666 #endregion 666 #endregion
667 667
668 #region STOP SCRIPT (When Script run box is unchecked after placed in object) 668 #region STOP SCRIPT (When Script run box is unchecked after placed in object)
669 public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); 669 public delegate bool CanStopScript(UUID script, UUID user, Scene scene);
670 private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); 670 private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>();
671 671
672 public void addCheckStopScript(CanStopScript delegateFunc) 672 public void addCheckStopScript(CanStopScript delegateFunc)
@@ -681,7 +681,7 @@ namespace OpenSim.Region.Environment.Scenes
681 CanStopScriptCheckFunctions.Remove(delegateFunc); 681 CanStopScriptCheckFunctions.Remove(delegateFunc);
682 } 682 }
683 683
684 public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) 684 public bool ExternalChecksCanStopScript(UUID script, UUID user)
685 { 685 {
686 foreach (CanStopScript check in CanStopScriptCheckFunctions) 686 foreach (CanStopScript check in CanStopScriptCheckFunctions)
687 { 687 {
@@ -696,7 +696,7 @@ namespace OpenSim.Region.Environment.Scenes
696 #endregion 696 #endregion
697 697
698 #region RESET SCRIPT 698 #region RESET SCRIPT
699 public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); 699 public delegate bool CanResetScript(UUID script, UUID user, Scene scene);
700 private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); 700 private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>();
701 701
702 public void addCheckResetScript(CanResetScript delegateFunc) 702 public void addCheckResetScript(CanResetScript delegateFunc)
@@ -711,7 +711,7 @@ namespace OpenSim.Region.Environment.Scenes
711 CanResetScriptCheckFunctions.Remove(delegateFunc); 711 CanResetScriptCheckFunctions.Remove(delegateFunc);
712 } 712 }
713 713
714 public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) 714 public bool ExternalChecksCanResetScript(UUID script, UUID user)
715 { 715 {
716 foreach (CanResetScript check in CanResetScriptCheckFunctions) 716 foreach (CanResetScript check in CanResetScriptCheckFunctions)
717 { 717 {
@@ -726,7 +726,7 @@ namespace OpenSim.Region.Environment.Scenes
726 #endregion 726 #endregion
727 727
728 #region TERRAFORM LAND 728 #region TERRAFORM LAND
729 public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); 729 public delegate bool CanTerraformLand(UUID user, Vector3 position, Scene requestFromScene);
730 private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); 730 private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>();
731 731
732 public void addCheckTerraformLand(CanTerraformLand delegateFunc) 732 public void addCheckTerraformLand(CanTerraformLand delegateFunc)
@@ -741,7 +741,7 @@ namespace OpenSim.Region.Environment.Scenes
741 CanTerraformLandCheckFunctions.Remove(delegateFunc); 741 CanTerraformLandCheckFunctions.Remove(delegateFunc);
742 } 742 }
743 743
744 public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) 744 public bool ExternalChecksCanTerraformLand(UUID user, Vector3 pos)
745 { 745 {
746 foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) 746 foreach (CanTerraformLand check in CanTerraformLandCheckFunctions)
747 { 747 {
@@ -756,7 +756,7 @@ namespace OpenSim.Region.Environment.Scenes
756 #endregion 756 #endregion
757 757
758 #region RUN CONSOLE COMMAND 758 #region RUN CONSOLE COMMAND
759 public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); 759 public delegate bool CanRunConsoleCommand(UUID user, Scene requestFromScene);
760 private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); 760 private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>();
761 761
762 public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) 762 public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc)
@@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes
771 CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); 771 CanRunConsoleCommandCheckFunctions.Remove(delegateFunc);
772 } 772 }
773 773
774 public bool ExternalChecksCanRunConsoleCommand(LLUUID user) 774 public bool ExternalChecksCanRunConsoleCommand(UUID user)
775 { 775 {
776 foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) 776 foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions)
777 { 777 {
@@ -786,7 +786,7 @@ namespace OpenSim.Region.Environment.Scenes
786 #endregion 786 #endregion
787 787
788 #region CAN ISSUE ESTATE COMMAND 788 #region CAN ISSUE ESTATE COMMAND
789 public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); 789 public delegate bool CanIssueEstateCommand(UUID user, Scene requestFromScene, bool ownerCommand);
790 private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); 790 private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>();
791 791
792 public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) 792 public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc)
@@ -801,7 +801,7 @@ namespace OpenSim.Region.Environment.Scenes
801 CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); 801 CanIssueEstateCommandCheckFunctions.Remove(delegateFunc);
802 } 802 }
803 803
804 public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) 804 public bool ExternalChecksCanIssueEstateCommand(UUID user, bool ownerCommand)
805 { 805 {
806 foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) 806 foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions)
807 { 807 {
@@ -815,7 +815,7 @@ namespace OpenSim.Region.Environment.Scenes
815 #endregion 815 #endregion
816 816
817 #region CAN BE GODLIKE 817 #region CAN BE GODLIKE
818 public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); 818 public delegate bool CanBeGodLike(UUID user, Scene requestFromScene);
819 private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); 819 private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>();
820 820
821 public void addCheckBeGodLike(CanBeGodLike delegateFunc) 821 public void addCheckBeGodLike(CanBeGodLike delegateFunc)
@@ -830,7 +830,7 @@ namespace OpenSim.Region.Environment.Scenes
830 CanBeGodLikeCheckFunctions.Remove(delegateFunc); 830 CanBeGodLikeCheckFunctions.Remove(delegateFunc);
831 } 831 }
832 832
833 public bool ExternalChecksCanBeGodLike(LLUUID user) 833 public bool ExternalChecksCanBeGodLike(UUID user)
834 { 834 {
835 foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) 835 foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions)
836 { 836 {
@@ -844,7 +844,7 @@ namespace OpenSim.Region.Environment.Scenes
844 #endregion 844 #endregion
845 845
846 #region EDIT PARCEL 846 #region EDIT PARCEL
847 public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); 847 public delegate bool CanEditParcel(UUID user, ILandObject parcel, Scene scene);
848 private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); 848 private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>();
849 849
850 public void addCheckEditParcel(CanEditParcel delegateFunc) 850 public void addCheckEditParcel(CanEditParcel delegateFunc)
@@ -859,7 +859,7 @@ namespace OpenSim.Region.Environment.Scenes
859 CanEditParcelCheckFunctions.Remove(delegateFunc); 859 CanEditParcelCheckFunctions.Remove(delegateFunc);
860 } 860 }
861 861
862 public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) 862 public bool ExternalChecksCanEditParcel(UUID user, ILandObject parcel)
863 { 863 {
864 foreach (CanEditParcel check in CanEditParcelCheckFunctions) 864 foreach (CanEditParcel check in CanEditParcelCheckFunctions)
865 { 865 {
@@ -873,7 +873,7 @@ namespace OpenSim.Region.Environment.Scenes
873 #endregion 873 #endregion
874 874
875 #region SELL PARCEL 875 #region SELL PARCEL
876 public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); 876 public delegate bool CanSellParcel(UUID user, ILandObject parcel, Scene scene);
877 private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); 877 private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>();
878 878
879 public void addCheckSellParcel(CanSellParcel delegateFunc) 879 public void addCheckSellParcel(CanSellParcel delegateFunc)
@@ -888,7 +888,7 @@ namespace OpenSim.Region.Environment.Scenes
888 CanSellParcelCheckFunctions.Remove(delegateFunc); 888 CanSellParcelCheckFunctions.Remove(delegateFunc);
889 } 889 }
890 890
891 public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) 891 public bool ExternalChecksCanSellParcel(UUID user, ILandObject parcel)
892 { 892 {
893 foreach (CanSellParcel check in CanSellParcelCheckFunctions) 893 foreach (CanSellParcel check in CanSellParcelCheckFunctions)
894 { 894 {
@@ -902,7 +902,7 @@ namespace OpenSim.Region.Environment.Scenes
902 #endregion 902 #endregion
903 903
904 #region ABANDON PARCEL 904 #region ABANDON PARCEL
905 public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); 905 public delegate bool CanAbandonParcel(UUID user, ILandObject parcel, Scene scene);
906 private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); 906 private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>();
907 907
908 public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) 908 public void addCheckAbandonParcel(CanAbandonParcel delegateFunc)
@@ -917,7 +917,7 @@ namespace OpenSim.Region.Environment.Scenes
917 CanAbandonParcelCheckFunctions.Remove(delegateFunc); 917 CanAbandonParcelCheckFunctions.Remove(delegateFunc);
918 } 918 }
919 919
920 public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) 920 public bool ExternalChecksCanAbandonParcel(UUID user, ILandObject parcel)
921 { 921 {
922 foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) 922 foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions)
923 { 923 {
@@ -930,7 +930,7 @@ namespace OpenSim.Region.Environment.Scenes
930 } 930 }
931 #endregion 931 #endregion
932 932
933 public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); 933 public delegate bool CanReclaimParcel(UUID user, ILandObject parcel, Scene scene);
934 private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); 934 private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>();
935 935
936 public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) 936 public void addCheckReclaimParcel(CanReclaimParcel delegateFunc)
@@ -945,7 +945,7 @@ namespace OpenSim.Region.Environment.Scenes
945 CanReclaimParcelCheckFunctions.Remove(delegateFunc); 945 CanReclaimParcelCheckFunctions.Remove(delegateFunc);
946 } 946 }
947 947
948 public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) 948 public bool ExternalChecksCanReclaimParcel(UUID user, ILandObject parcel)
949 { 949 {
950 foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) 950 foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions)
951 { 951 {
@@ -956,7 +956,7 @@ namespace OpenSim.Region.Environment.Scenes
956 } 956 }
957 return true; 957 return true;
958 } 958 }
959 public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); 959 public delegate bool CanBuyLand(UUID user, ILandObject parcel, Scene scene);
960 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); 960 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>();
961 961
962 public void addCheckCanBuyLand(CanBuyLand delegateFunc) 962 public void addCheckCanBuyLand(CanBuyLand delegateFunc)
@@ -971,7 +971,7 @@ namespace OpenSim.Region.Environment.Scenes
971 CanBuyLandCheckFunctions.Remove(delegateFunc); 971 CanBuyLandCheckFunctions.Remove(delegateFunc);
972 } 972 }
973 973
974 public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) 974 public bool ExternalChecksCanBuyLand(UUID user, ILandObject parcel)
975 { 975 {
976 foreach (CanBuyLand check in CanBuyLandCheckFunctions) 976 foreach (CanBuyLand check in CanBuyLandCheckFunctions)
977 { 977 {
@@ -983,7 +983,7 @@ namespace OpenSim.Region.Environment.Scenes
983 return true; 983 return true;
984 } 984 }
985 985
986 public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); 986 public delegate bool CanLinkObject(UUID user, UUID objectID);
987 private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); 987 private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>();
988 988
989 public void addCheckCanLinkObject(CanLinkObject delegateFunc) 989 public void addCheckCanLinkObject(CanLinkObject delegateFunc)
@@ -998,7 +998,7 @@ namespace OpenSim.Region.Environment.Scenes
998 CanLinkObjectCheckFunctions.Remove(delegateFunc); 998 CanLinkObjectCheckFunctions.Remove(delegateFunc);
999 } 999 }
1000 1000
1001 public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) 1001 public bool ExternalChecksCanLinkObject(UUID user, UUID objectID)
1002 { 1002 {
1003 foreach (CanLinkObject check in CanLinkObjectCheckFunctions) 1003 foreach (CanLinkObject check in CanLinkObjectCheckFunctions)
1004 { 1004 {
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.Environment.Scenes
1010 return true; 1010 return true;
1011 } 1011 }
1012 1012
1013 public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); 1013 public delegate bool CanDelinkObject(UUID user, UUID objectID);
1014 private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); 1014 private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>();
1015 1015
1016 public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) 1016 public void addCheckCanDelinkObject(CanDelinkObject delegateFunc)
@@ -1025,7 +1025,7 @@ namespace OpenSim.Region.Environment.Scenes
1025 CanDelinkObjectCheckFunctions.Remove(delegateFunc); 1025 CanDelinkObjectCheckFunctions.Remove(delegateFunc);
1026 } 1026 }
1027 1027
1028 public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) 1028 public bool ExternalChecksCanDelinkObject(UUID user, UUID objectID)
1029 { 1029 {
1030 foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) 1030 foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions)
1031 { 1031 {
@@ -1039,7 +1039,7 @@ namespace OpenSim.Region.Environment.Scenes
1039 1039
1040 #endregion 1040 #endregion
1041 1041
1042 public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); 1042 public delegate bool CanCreateInventory(uint invType, UUID objectID, UUID userID);
1043 private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); 1043 private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>();
1044 1044
1045 public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) 1045 public void addCheckCanCreateInventory(CanCreateInventory delegateFunc)
@@ -1054,7 +1054,7 @@ namespace OpenSim.Region.Environment.Scenes
1054 CanCreateInventoryCheckFunctions.Remove(delegateFunc); 1054 CanCreateInventoryCheckFunctions.Remove(delegateFunc);
1055 } 1055 }
1056 1056
1057 public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) 1057 public bool ExternalChecksCanCreateInventory(uint invType, UUID objectID, UUID userID)
1058 { 1058 {
1059 foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) 1059 foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions)
1060 { 1060 {
@@ -1066,7 +1066,7 @@ namespace OpenSim.Region.Environment.Scenes
1066 return true; 1066 return true;
1067 } 1067 }
1068 1068
1069 public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); 1069 public delegate bool CanCopyInventory(UUID itemID, UUID objectID, UUID userID);
1070 private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); 1070 private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>();
1071 1071
1072 public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) 1072 public void addCheckCanCopyInventory(CanCopyInventory delegateFunc)
@@ -1081,7 +1081,7 @@ namespace OpenSim.Region.Environment.Scenes
1081 CanCopyInventoryCheckFunctions.Remove(delegateFunc); 1081 CanCopyInventoryCheckFunctions.Remove(delegateFunc);
1082 } 1082 }
1083 1083
1084 public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 1084 public bool ExternalChecksCanCopyInventory(UUID itemID, UUID objectID, UUID userID)
1085 { 1085 {
1086 foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) 1086 foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions)
1087 { 1087 {
@@ -1093,7 +1093,7 @@ namespace OpenSim.Region.Environment.Scenes
1093 return true; 1093 return true;
1094 } 1094 }
1095 1095
1096 public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); 1096 public delegate bool CanDeleteInventory(UUID itemID, UUID objectID, UUID userID);
1097 private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); 1097 private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>();
1098 1098
1099 public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) 1099 public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
@@ -1108,7 +1108,7 @@ namespace OpenSim.Region.Environment.Scenes
1108 CanDeleteInventoryCheckFunctions.Remove(delegateFunc); 1108 CanDeleteInventoryCheckFunctions.Remove(delegateFunc);
1109 } 1109 }
1110 1110
1111 public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 1111 public bool ExternalChecksCanDeleteInventory(UUID itemID, UUID objectID, UUID userID)
1112 { 1112 {
1113 foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) 1113 foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions)
1114 { 1114 {
@@ -1120,7 +1120,7 @@ namespace OpenSim.Region.Environment.Scenes
1120 return true; 1120 return true;
1121 } 1121 }
1122 1122
1123 public delegate bool CanTeleport(LLUUID userID); 1123 public delegate bool CanTeleport(UUID userID);
1124 private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); 1124 private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>();
1125 1125
1126 public void addCheckCanTeleport(CanTeleport delegateFunc) 1126 public void addCheckCanTeleport(CanTeleport delegateFunc)
@@ -1135,7 +1135,7 @@ namespace OpenSim.Region.Environment.Scenes
1135 CanTeleportCheckFunctions.Remove(delegateFunc); 1135 CanTeleportCheckFunctions.Remove(delegateFunc);
1136 } 1136 }
1137 1137
1138 public bool ExternalChecksCanTeleport(LLUUID userID) 1138 public bool ExternalChecksCanTeleport(UUID userID)
1139 { 1139 {
1140 foreach (CanTeleport check in CanTeleportCheckFunctions) 1140 foreach (CanTeleport check in CanTeleportCheckFunctions)
1141 { 1141 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 5546618..472f446 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -29,7 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net; 30using System.Net;
31using System.Reflection; 31using System.Reflection;
32using libsecondlife; 32using OpenMetaverse;
33using log4net; 33using log4net;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
@@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Scenes
190 /// <param name="filename"></param> 190 /// <param name="filename"></param>
191 /// <param name="generateNewIDs"></param> 191 /// <param name="generateNewIDs"></param>
192 /// <param name="loadOffset"></param> 192 /// <param name="loadOffset"></param>
193 public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, LLVector3 loadOffset) 193 public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, Vector3 loadOffset)
194 { 194 {
195 CurrentOrFirstScene.LoadPrimsFromXml(filename, generateNewIDs, loadOffset); 195 CurrentOrFirstScene.LoadPrimsFromXml(filename, generateNewIDs, loadOffset);
196 } 196 }
@@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment.Scenes
320 } 320 }
321 } 321 }
322 322
323 public bool TrySetCurrentScene(LLUUID regionID) 323 public bool TrySetCurrentScene(UUID regionID)
324 { 324 {
325 Console.WriteLine("Searching for Region: '{0}'", regionID.ToString()); 325 Console.WriteLine("Searching for Region: '{0}'", regionID.ToString());
326 326
@@ -350,7 +350,7 @@ namespace OpenSim.Region.Environment.Scenes
350 return false; 350 return false;
351 } 351 }
352 352
353 public bool TryGetScene(LLUUID regionID, out Scene scene) 353 public bool TryGetScene(UUID regionID, out Scene scene)
354 { 354 {
355 foreach (Scene mscene in m_localScenes) 355 foreach (Scene mscene in m_localScenes)
356 { 356 {
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Scenes
481 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); 481 ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
482 } 482 }
483 483
484 public bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) 484 public bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
485 { 485 {
486 foreach (Scene scene in m_localScenes) 486 foreach (Scene scene in m_localScenes)
487 { 487 {
@@ -495,7 +495,7 @@ namespace OpenSim.Region.Environment.Scenes
495 return false; 495 return false;
496 } 496 }
497 497
498 public bool TryGetAvatarsScene(LLUUID avatarId, out Scene scene) 498 public bool TryGetAvatarsScene(UUID avatarId, out Scene scene)
499 { 499 {
500 ScenePresence avatar = null; 500 ScenePresence avatar = null;
501 foreach (Scene mScene in m_localScenes) 501 foreach (Scene mScene in m_localScenes)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 032d673..c6452f9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -27,7 +27,7 @@
27 27
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using libsecondlife; 30using OpenMetaverse;
31using log4net; 31using log4net;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Environment.Interfaces; 33using OpenSim.Region.Environment.Interfaces;
@@ -133,9 +133,9 @@ namespace OpenSim.Region.Environment.Scenes
133 /// <param name="copyItemID">The item UUID that should be used by the new item.</param> 133 /// <param name="copyItemID">The item UUID that should be used by the new item.</param>
134 /// <returns></returns> 134 /// <returns></returns>
135 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, 135 public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
136 InventoryItemBase item, LLUUID copyItemID) 136 InventoryItemBase item, UUID copyItemID)
137 { 137 {
138 LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID; 138 UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID;
139 139
140 SceneObjectPart part = GetChildPart(localID); 140 SceneObjectPart part = GetChildPart(localID);
141 if (part != null) 141 if (part != null)
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Scenes
183 /// <param name="primID"></param> 183 /// <param name="primID"></param>
184 /// <param name="itemID"></param> 184 /// <param name="itemID"></param>
185 /// <returns>null if the item does not exist</returns> 185 /// <returns>null if the item does not exist</returns>
186 public TaskInventoryItem GetInventoryItem(uint primID, LLUUID itemID) 186 public TaskInventoryItem GetInventoryItem(uint primID, UUID itemID)
187 { 187 {
188 SceneObjectPart part = GetChildPart(primID); 188 SceneObjectPart part = GetChildPart(primID);
189 if (part != null) 189 if (part != null)
@@ -227,7 +227,7 @@ namespace OpenSim.Region.Environment.Scenes
227 return false; 227 return false;
228 } 228 }
229 229
230 public int RemoveInventoryItem(uint localID, LLUUID itemID) 230 public int RemoveInventoryItem(uint localID, UUID itemID)
231 { 231 {
232 SceneObjectPart part = GetChildPart(localID); 232 SceneObjectPart part = GetChildPart(localID);
233 if (part != null) 233 if (part != null)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index b04e882..d465eaa 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -31,9 +31,8 @@ using System.Drawing;
31using System.IO; 31using System.IO;
32using System.Xml; 32using System.Xml;
33using System.Xml.Serialization; 33using System.Xml.Serialization;
34using Axiom.Math; 34using OpenMetaverse;
35using libsecondlife; 35using OpenMetaverse.Packets;
36using libsecondlife.Packets;
37using OpenSim.Framework; 36using OpenSim.Framework;
38using OpenSim.Region.Environment.Interfaces; 37using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Physics.Manager; 38using OpenSim.Region.Physics.Manager;
@@ -75,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes
75 74
76 struct scriptPosTarget 75 struct scriptPosTarget
77 { 76 {
78 public LLVector3 targetPos; 77 public Vector3 targetPos;
79 public float tolerance; 78 public float tolerance;
80 } 79 }
81 80
@@ -97,17 +96,17 @@ namespace OpenSim.Region.Environment.Scenes
97 96
98 public float scriptScore = 0f; 97 public float scriptScore = 0f;
99 98
100 private LLVector3 lastPhysGroupPos; 99 private Vector3 lastPhysGroupPos;
101 private LLQuaternion lastPhysGroupRot; 100 private Quaternion lastPhysGroupRot;
102 101
103 /// <summary> 102 /// <summary>
104 /// The constituent parts of this group 103 /// The constituent parts of this group
105 /// </summary> 104 /// </summary>
106 protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>(); 105 protected Dictionary<UUID, SceneObjectPart> m_parts = new Dictionary<UUID, SceneObjectPart>();
107 106
108 protected ulong m_regionHandle; 107 protected ulong m_regionHandle;
109 protected SceneObjectPart m_rootPart; 108 protected SceneObjectPart m_rootPart;
110 // private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); 109 // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>();
111 110
112 private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>(); 111 private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>();
113 112
@@ -142,18 +141,18 @@ namespace OpenSim.Region.Environment.Scenes
142 get { return m_parts.Count; } 141 get { return m_parts.Count; }
143 } 142 }
144 143
145 public LLQuaternion GroupRotation 144 public Quaternion GroupRotation
146 { 145 {
147 get { return m_rootPart.RotationOffset; } 146 get { return m_rootPart.RotationOffset; }
148 } 147 }
149 148
150 public LLUUID GroupID 149 public UUID GroupID
151 { 150 {
152 get { return m_rootPart.GroupID; } 151 get { return m_rootPart.GroupID; }
153 set { m_rootPart.GroupID = value; } 152 set { m_rootPart.GroupID = value; }
154 } 153 }
155 154
156 public Dictionary<LLUUID, SceneObjectPart> Children 155 public Dictionary<UUID, SceneObjectPart> Children
157 { 156 {
158 get { return m_parts; } 157 get { return m_parts; }
159 set { m_parts = value; } 158 set { m_parts = value; }
@@ -181,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes
181 } 180 }
182 } 181 }
183 182
184 public override LLVector3 AbsolutePosition 183 public override Vector3 AbsolutePosition
185 { 184 {
186 get 185 get
187 { 186 {
@@ -195,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes
195 } 194 }
196 set 195 set
197 { 196 {
198 LLVector3 val = value; 197 Vector3 val = value;
199 if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !m_rootPart.IsAttachment) 198 if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !m_rootPart.IsAttachment)
200 { 199 {
201 m_scene.CrossPrimGroupIntoNewRegion(val, this); 200 m_scene.CrossPrimGroupIntoNewRegion(val, this);
@@ -234,18 +233,18 @@ namespace OpenSim.Region.Environment.Scenes
234 set { m_rootPart.LocalId = value; } 233 set { m_rootPart.LocalId = value; }
235 } 234 }
236 235
237 public override LLUUID UUID 236 public override UUID UUID
238 { 237 {
239 get { return m_rootPart.UUID; } 238 get { return m_rootPart.UUID; }
240 set { m_rootPart.UUID = value; } 239 set { m_rootPart.UUID = value; }
241 } 240 }
242 241
243 public LLUUID OwnerID 242 public UUID OwnerID
244 { 243 {
245 get 244 get
246 { 245 {
247 if (m_rootPart == null) 246 if (m_rootPart == null)
248 return LLUUID.Zero; 247 return UUID.Zero;
249 248
250 return m_rootPart.OwnerID; 249 return m_rootPart.OwnerID;
251 } 250 }
@@ -299,7 +298,7 @@ namespace OpenSim.Region.Environment.Scenes
299 } 298 }
300 299
301 // The UUID for the Region this Object is in. 300 // The UUID for the Region this Object is in.
302 public LLUUID RegionUUID 301 public UUID RegionUUID
303 { 302 {
304 get 303 get
305 { 304 {
@@ -307,7 +306,7 @@ namespace OpenSim.Region.Environment.Scenes
307 { 306 {
308 return m_scene.RegionInfo.RegionID; 307 return m_scene.RegionInfo.RegionID;
309 } 308 }
310 return LLUUID.Zero; 309 return UUID.Zero;
311 } 310 }
312 } 311 }
313 312
@@ -455,14 +454,14 @@ namespace OpenSim.Region.Environment.Scenes
455 /// <summary> 454 /// <summary>
456 /// 455 ///
457 /// </summary> 456 /// </summary>
458 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 457 public SceneObjectGroup(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos,
459 LLQuaternion rot, PrimitiveBaseShape shape) 458 Quaternion rot, PrimitiveBaseShape shape)
460 { 459 {
461 m_regionHandle = regionHandle; 460 m_regionHandle = regionHandle;
462 m_scene = scene; 461 m_scene = scene;
463 462
464 // this.Pos = pos; 463 // this.Pos = pos;
465 LLVector3 rootOffset = new LLVector3(0, 0, 0); 464 Vector3 rootOffset = new Vector3(0, 0, 0);
466 SceneObjectPart newPart = 465 SceneObjectPart newPart =
467 new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rot, rootOffset); 466 new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rot, rootOffset);
468 newPart.LinkNum = 0; 467 newPart.LinkNum = 0;
@@ -479,13 +478,13 @@ namespace OpenSim.Region.Environment.Scenes
479 /// <summary> 478 /// <summary>
480 /// 479 ///
481 /// </summary> 480 /// </summary>
482 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 481 public SceneObjectGroup(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos,
483 PrimitiveBaseShape shape) 482 PrimitiveBaseShape shape)
484 : this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape) 483 : this(scene, regionHandle, ownerID, localID, pos, Quaternion.Identity, shape)
485 { 484 {
486 } 485 }
487 486
488 public void SetFromAssetID(LLUUID AssetId) 487 public void SetFromAssetID(UUID AssetId)
489 { 488 {
490 lock (m_parts) 489 lock (m_parts)
491 { 490 {
@@ -496,13 +495,13 @@ namespace OpenSim.Region.Environment.Scenes
496 } 495 }
497 } 496 }
498 497
499 public LLUUID GetFromAssetID() 498 public UUID GetFromAssetID()
500 { 499 {
501 if (m_rootPart != null) 500 if (m_rootPart != null)
502 { 501 {
503 return m_rootPart.FromAssetID; 502 return m_rootPart.FromAssetID;
504 } 503 }
505 return LLUUID.Zero; 504 return UUID.Zero;
506 } 505 }
507 506
508 /// <summary> 507 /// <summary>
@@ -519,18 +518,18 @@ namespace OpenSim.Region.Environment.Scenes
519 } 518 }
520 } 519 }
521 520
522 public LLVector3 GroupScale() 521 public Vector3 GroupScale()
523 { 522 {
524 LLVector3 minScale = new LLVector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize); 523 Vector3 minScale = new Vector3(Constants.RegionSize,Constants.RegionSize,Constants.RegionSize);
525 LLVector3 maxScale = new LLVector3(0f,0f,0f); 524 Vector3 maxScale = new Vector3(0f,0f,0f);
526 LLVector3 finalScale = new LLVector3(0.5f, 0.5f, 0.5f); 525 Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
527 526
528 lock (m_parts) 527 lock (m_parts)
529 { 528 {
530 foreach (SceneObjectPart part in m_parts.Values) 529 foreach (SceneObjectPart part in m_parts.Values)
531 { 530 {
532 LLVector3 partscale = part.Scale; 531 Vector3 partscale = part.Scale;
533 LLVector3 partoffset = part.OffsetPosition; 532 Vector3 partoffset = part.OffsetPosition;
534 533
535 minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X; 534 minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
536 minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.X + partoffset.Y : minScale.Y; 535 minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.X + partoffset.Y : minScale.Y;
@@ -563,8 +562,7 @@ namespace OpenSim.Region.Environment.Scenes
563 // Temporary commented to stop compiler warning 562 // Temporary commented to stop compiler warning
564 //Vector3 partPosition = 563 //Vector3 partPosition =
565 // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); 564 // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
566 Quaternion parentrotation = 565 Quaternion parentrotation = GroupRotation;
567 new Quaternion(GroupRotation.W, GroupRotation.X, GroupRotation.Y, GroupRotation.Z);
568 566
569 // Telling the prim to raytrace. 567 // Telling the prim to raytrace.
570 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); 568 //EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
@@ -684,7 +682,7 @@ namespace OpenSim.Region.Environment.Scenes
684 /// <param name="agentID"></param> 682 /// <param name="agentID"></param>
685 /// <param name="attachmentpoint"></param> 683 /// <param name="attachmentpoint"></param>
686 /// <param name="AttachOffset"></param> 684 /// <param name="AttachOffset"></param>
687 public void AttachToAgent(LLUUID agentID, uint attachmentpoint, LLVector3 AttachOffset) 685 public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset)
688 { 686 {
689 ScenePresence avatar = m_scene.GetScenePresence(agentID); 687 ScenePresence avatar = m_scene.GetScenePresence(agentID);
690 if (avatar != null) 688 if (avatar != null)
@@ -737,14 +735,14 @@ namespace OpenSim.Region.Environment.Scenes
737 public void DetachToGround() 735 public void DetachToGround()
738 { 736 {
739 ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); 737 ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
740 LLVector3 detachedpos = new LLVector3(127f,127f,127f); 738 Vector3 detachedpos = new Vector3(127f,127f,127f);
741 if (avatar != null) 739 if (avatar != null)
742 { 740 {
743 detachedpos = avatar.AbsolutePosition; 741 detachedpos = avatar.AbsolutePosition;
744 avatar.RemoveAttachment(this); 742 avatar.RemoveAttachment(this);
745 } 743 }
746 AbsolutePosition = detachedpos; 744 AbsolutePosition = detachedpos;
747 m_rootPart.AttachedAvatar = LLUUID.Zero; 745 m_rootPart.AttachedAvatar = UUID.Zero;
748 m_rootPart.SetParentLocalId(0); 746 m_rootPart.SetParentLocalId(0);
749 m_rootPart.SetAttachmentPoint((byte)0); 747 m_rootPart.SetAttachmentPoint((byte)0);
750 m_rootPart.IsAttachment = false; 748 m_rootPart.IsAttachment = false;
@@ -758,14 +756,14 @@ namespace OpenSim.Region.Environment.Scenes
758 public void DetachToInventoryPrep() 756 public void DetachToInventoryPrep()
759 { 757 {
760 ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); 758 ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
761 //LLVector3 detachedpos = new LLVector3(127f, 127f, 127f); 759 //Vector3 detachedpos = new Vector3(127f, 127f, 127f);
762 if (avatar != null) 760 if (avatar != null)
763 { 761 {
764 //detachedpos = avatar.AbsolutePosition; 762 //detachedpos = avatar.AbsolutePosition;
765 avatar.RemoveAttachment(this); 763 avatar.RemoveAttachment(this);
766 } 764 }
767 765
768 m_rootPart.AttachedAvatar = LLUUID.Zero; 766 m_rootPart.AttachedAvatar = UUID.Zero;
769 m_rootPart.SetParentLocalId(0); 767 m_rootPart.SetParentLocalId(0);
770 //m_rootPart.SetAttachmentPoint((byte)0); 768 //m_rootPart.SetAttachmentPoint((byte)0);
771 m_rootPart.IsAttachment = false; 769 m_rootPart.IsAttachment = false;
@@ -861,7 +859,7 @@ namespace OpenSim.Region.Environment.Scenes
861 { 859 {
862 foreach (SceneObjectPart part in m_parts.Values) 860 foreach (SceneObjectPart part in m_parts.Values)
863 { 861 {
864 part.UUID = LLUUID.Random(); 862 part.UUID = UUID.Random();
865 863
866 } 864 }
867 } 865 }
@@ -885,7 +883,7 @@ namespace OpenSim.Region.Environment.Scenes
885 //HasGroupChanged = false; 883 //HasGroupChanged = false;
886 } 884 }
887 885
888 public LLUUID GetPartsFullID(uint localID) 886 public UUID GetPartsFullID(uint localID)
889 { 887 {
890 SceneObjectPart part = GetChildPart(localID); 888 SceneObjectPart part = GetChildPart(localID);
891 if (part != null) 889 if (part != null)
@@ -895,7 +893,7 @@ namespace OpenSim.Region.Environment.Scenes
895 return null; 893 return null;
896 } 894 }
897 895
898 public void ObjectGrabHandler(uint localId, LLVector3 offsetPos, IClientAPI remoteClient) 896 public void ObjectGrabHandler(uint localId, Vector3 offsetPos, IClientAPI remoteClient)
899 { 897 {
900 if (m_rootPart.LocalId == localId) 898 if (m_rootPart.LocalId == localId)
901 { 899 {
@@ -909,14 +907,14 @@ namespace OpenSim.Region.Environment.Scenes
909 } 907 }
910 } 908 }
911 909
912 public virtual void OnGrabPart(SceneObjectPart part, LLVector3 offsetPos, IClientAPI remoteClient) 910 public virtual void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient)
913 { 911 {
914 part.StoreUndoState(); 912 part.StoreUndoState();
915 part.OnGrab(offsetPos, remoteClient); 913 part.OnGrab(offsetPos, remoteClient);
916 914
917 } 915 }
918 916
919 public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) 917 public virtual void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient)
920 { 918 {
921 m_scene.EventManager.TriggerGroupGrab(UUID, offsetPos, remoteClient.AgentId); 919 m_scene.EventManager.TriggerGroupGrab(UUID, offsetPos, remoteClient.AgentId);
922 } 920 }
@@ -949,7 +947,7 @@ namespace OpenSim.Region.Environment.Scenes
949 } 947 }
950 948
951 if (m_rootPart != null && part == m_rootPart) 949 if (m_rootPart != null && part == m_rootPart)
952 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); 950 avatars[i].ControllingClient.SendKiPrimitive(m_regionHandle, part.LocalId);
953 } 951 }
954 } 952 }
955 953
@@ -975,7 +973,7 @@ namespace OpenSim.Region.Environment.Scenes
975 } 973 }
976 974
977 if (m_rootPart != null && part == m_rootPart) 975 if (m_rootPart != null && part == m_rootPart)
978 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); 976 avatars[i].ControllingClient.SendKiPrimitive(m_regionHandle, part.LocalId);
979 } 977 }
980 } 978 }
981 } 979 }
@@ -1047,9 +1045,9 @@ namespace OpenSim.Region.Environment.Scenes
1047 public override void SetText(string text, Vector3 color, double alpha) 1045 public override void SetText(string text, Vector3 color, double alpha)
1048 { 1046 {
1049 Color = Color.FromArgb(0xff - (int) (alpha * 0xff), 1047 Color = Color.FromArgb(0xff - (int) (alpha * 0xff),
1050 (int) (color.x * 0xff), 1048 (int) (color.X * 0xff),
1051 (int) (color.y * 0xff), 1049 (int) (color.Y * 0xff),
1052 (int) (color.z * 0xff)); 1050 (int) (color.Z * 0xff));
1053 Text = text; 1051 Text = text;
1054 1052
1055 HasGroupChanged = true; 1053 HasGroupChanged = true;
@@ -1085,7 +1083,7 @@ namespace OpenSim.Region.Environment.Scenes
1085 } 1083 }
1086 } 1084 }
1087 1085
1088 public void SetOwnerId(LLUUID userId) 1086 public void SetOwnerId(UUID userId)
1089 { 1087 {
1090 ForEachPart(delegate(SceneObjectPart part) { part.OwnerID = userId; }); 1088 ForEachPart(delegate(SceneObjectPart part) { part.OwnerID = userId; });
1091 } 1089 }
@@ -1207,14 +1205,14 @@ namespace OpenSim.Region.Environment.Scenes
1207 /// Duplicates this object, including operations such as physics set up and attaching to the backup event. 1205 /// Duplicates this object, including operations such as physics set up and attaching to the backup event.
1208 /// </summary> 1206 /// </summary>
1209 /// <returns></returns> 1207 /// <returns></returns>
1210 public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID, bool userExposed) 1208 public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed)
1211 { 1209 {
1212 SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone(); 1210 SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone();
1213 dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>(); 1211 dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
1214 dupe.m_parts.Clear(); 1212 dupe.m_parts.Clear();
1215 //dupe.OwnerID = AgentID; 1213 //dupe.OwnerID = AgentID;
1216 //dupe.GroupID = GroupID; 1214 //dupe.GroupID = GroupID;
1217 dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 1215 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
1218 dupe.m_scene = m_scene; 1216 dupe.m_scene = m_scene;
1219 dupe.m_regionHandle = m_regionHandle; 1217 dupe.m_regionHandle = m_regionHandle;
1220 1218
@@ -1231,11 +1229,9 @@ namespace OpenSim.Region.Environment.Scenes
1231 dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( 1229 dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
1232 dupe.RootPart.Name, 1230 dupe.RootPart.Name,
1233 pbs, 1231 pbs,
1234 new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, 1232 new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z),
1235 dupe.RootPart.AbsolutePosition.Z),
1236 new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), 1233 new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
1237 new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, 1234 dupe.RootPart.RotationOffset,
1238 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
1239 dupe.RootPart.PhysActor.IsPhysical); 1235 dupe.RootPart.PhysActor.IsPhysical);
1240 1236
1241 dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId; 1237 dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
@@ -1286,7 +1282,7 @@ namespace OpenSim.Region.Environment.Scenes
1286 /// <param name="part"></param> 1282 /// <param name="part"></param>
1287 /// <param name="cAgentID"></param> 1283 /// <param name="cAgentID"></param>
1288 /// <param name="cGroupID"></param> 1284 /// <param name="cGroupID"></param>
1289 public void CopyRootPart(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID, bool userExposed) 1285 public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
1290 { 1286 {
1291 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed); 1287 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed);
1292 newPart.SetParent(this); 1288 newPart.SetParent(this);
@@ -1308,9 +1304,9 @@ namespace OpenSim.Region.Environment.Scenes
1308 foreach (SceneObjectPart part in m_parts.Values) 1304 foreach (SceneObjectPart part in m_parts.Values)
1309 { 1305 {
1310 if (UsePhysics) 1306 if (UsePhysics)
1311 part.AddFlag(LLObject.ObjectFlags.Physics); 1307 part.AddFlag(PrimFlags.Physics);
1312 else 1308 else
1313 part.RemFlag(LLObject.ObjectFlags.Physics); 1309 part.RemFlag(PrimFlags.Physics);
1314 1310
1315 part.DoPhysicsPropertyUpdate(UsePhysics, false); 1311 part.DoPhysicsPropertyUpdate(UsePhysics, false);
1316 IsSelected = false; 1312 IsSelected = false;
@@ -1327,7 +1323,7 @@ namespace OpenSim.Region.Environment.Scenes
1327 { 1323 {
1328 if (PhantomStatus) 1324 if (PhantomStatus)
1329 { 1325 {
1330 part.AddFlag(LLObject.ObjectFlags.Phantom); 1326 part.AddFlag(PrimFlags.Phantom);
1331 if (part.PhysActor != null) 1327 if (part.PhysActor != null)
1332 { 1328 {
1333 m_scene.PhysicsScene.RemovePrim(part.PhysActor); 1329 m_scene.PhysicsScene.RemovePrim(part.PhysActor);
@@ -1335,8 +1331,8 @@ namespace OpenSim.Region.Environment.Scenes
1335 } 1331 }
1336 else 1332 else
1337 { 1333 {
1338 part.RemFlag(LLObject.ObjectFlags.Phantom); 1334 part.RemFlag(PrimFlags.Phantom);
1339 if ((part.GetEffectiveObjectFlags() & (int) LLObject.ObjectFlags.Physics) != 0) 1335 if ((part.GetEffectiveObjectFlags() & (int) PrimFlags.Physics) != 0)
1340 { 1336 {
1341 part.DoPhysicsPropertyUpdate(true, false); 1337 part.DoPhysicsPropertyUpdate(true, false);
1342 } 1338 }
@@ -1372,7 +1368,7 @@ namespace OpenSim.Region.Environment.Scenes
1372 } 1368 }
1373 } 1369 }
1374 1370
1375 public void moveToTarget(LLVector3 target, float tau) 1371 public void moveToTarget(Vector3 target, float tau)
1376 { 1372 {
1377 SceneObjectPart rootpart = m_rootPart; 1373 SceneObjectPart rootpart = m_rootPart;
1378 if (rootpart != null) 1374 if (rootpart != null)
@@ -1395,7 +1391,7 @@ namespace OpenSim.Region.Environment.Scenes
1395 } 1391 }
1396 } 1392 }
1397 1393
1398 public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) 1394 public void SetRootPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID)
1399 { 1395 {
1400 part.LastOwnerID = part.OwnerID; 1396 part.LastOwnerID = part.OwnerID;
1401 part.OwnerID = cAgentID; 1397 part.OwnerID = cAgentID;
@@ -1417,7 +1413,7 @@ namespace OpenSim.Region.Environment.Scenes
1417 /// <param name="part"></param> 1413 /// <param name="part"></param>
1418 /// <param name="cAgentID"></param> 1414 /// <param name="cAgentID"></param>
1419 /// <param name="cGroupID"></param> 1415 /// <param name="cGroupID"></param>
1420 public void CopyPart(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID, bool userExposed) 1416 public void CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
1421 { 1417 {
1422 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed); 1418 SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed);
1423 newPart.SetParent(this); 1419 newPart.SetParent(this);
@@ -1432,7 +1428,7 @@ namespace OpenSim.Region.Environment.Scenes
1432 } 1428 }
1433 1429
1434 /// <summary> 1430 /// <summary>
1435 /// Reset the LLUUIDs for all the prims that make up this group. 1431 /// Reset the UUIDs for all the prims that make up this group.
1436 /// 1432 ///
1437 /// This is called by methods which want to add a new group to an existing scene, in order 1433 /// This is called by methods which want to add a new group to an existing scene, in order
1438 /// to ensure that there are no clashes with groups already present. 1434 /// to ensure that there are no clashes with groups already present.
@@ -1454,7 +1450,7 @@ namespace OpenSim.Region.Environment.Scenes
1454 /// 1450 ///
1455 /// </summary> 1451 /// </summary>
1456 /// <param name="part"></param> 1452 /// <param name="part"></param>
1457 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags) 1453 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags)
1458 { 1454 {
1459 1455
1460 remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.ObjectOwner, RootPart.GroupID, RootPart.BaseMask, 1456 remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.ObjectOwner, RootPart.GroupID, RootPart.BaseMask,
@@ -1463,7 +1459,7 @@ namespace OpenSim.Region.Environment.Scenes
1463 RootPart.CreatorID, RootPart.Name, RootPart.Description); 1459 RootPart.CreatorID, RootPart.Name, RootPart.Description);
1464 } 1460 }
1465 1461
1466 public void SetPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) 1462 public void SetPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID)
1467 { 1463 {
1468 part.OwnerID = cAgentID; 1464 part.OwnerID = cAgentID;
1469 part.GroupID = cGroupID; 1465 part.GroupID = cGroupID;
@@ -1640,7 +1636,7 @@ namespace OpenSim.Region.Environment.Scenes
1640 /// </summary> 1636 /// </summary>
1641 /// <param name="primID"></param> 1637 /// <param name="primID"></param>
1642 /// <returns>null if a child part with the primID was not found</returns> 1638 /// <returns>null if a child part with the primID was not found</returns>
1643 public SceneObjectPart GetChildPart(LLUUID primID) 1639 public SceneObjectPart GetChildPart(UUID primID)
1644 { 1640 {
1645 SceneObjectPart childPart = null; 1641 SceneObjectPart childPart = null;
1646 if (m_parts.ContainsKey(primID)) 1642 if (m_parts.ContainsKey(primID))
@@ -1677,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes
1677 /// </summary> 1673 /// </summary>
1678 /// <param name="primID"></param> 1674 /// <param name="primID"></param>
1679 /// <returns></returns> 1675 /// <returns></returns>
1680 public bool HasChildPrim(LLUUID primID) 1676 public bool HasChildPrim(UUID primID)
1681 { 1677 {
1682 if (m_parts.ContainsKey(primID)) 1678 if (m_parts.ContainsKey(primID))
1683 { 1679 {
@@ -1735,27 +1731,20 @@ namespace OpenSim.Region.Environment.Scenes
1735 1731
1736 SceneObjectPart linkPart = objectGroup.m_rootPart; 1732 SceneObjectPart linkPart = objectGroup.m_rootPart;
1737 1733
1738 Vector3 oldGroupPosition = 1734 Vector3 oldGroupPosition = linkPart.GroupPosition;
1739 new Vector3(linkPart.GroupPosition.X, linkPart.GroupPosition.Y, linkPart.GroupPosition.Z); 1735 Quaternion oldRootRotation = linkPart.RotationOffset;
1740 Quaternion oldRootRotation =
1741 new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y,
1742 linkPart.RotationOffset.Z);
1743 1736
1744 linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; 1737 linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
1745 linkPart.GroupPosition = AbsolutePosition; 1738 linkPart.GroupPosition = AbsolutePosition;
1746 Vector3 axPos = new Vector3(linkPart.OffsetPosition.X, linkPart.OffsetPosition.Y, linkPart.OffsetPosition.Z); 1739 Vector3 axPos = linkPart.OffsetPosition;
1747 1740
1748 Quaternion parentRot = 1741 Quaternion parentRot = m_rootPart.RotationOffset;
1749 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, 1742 axPos *= Quaternion.Inverse(parentRot);
1750 m_rootPart.RotationOffset.Z);
1751 axPos = parentRot.Inverse() * axPos;
1752 1743
1753 linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); 1744 linkPart.OffsetPosition = axPos;
1754 Quaternion oldRot = 1745 Quaternion oldRot = linkPart.RotationOffset;
1755 new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, 1746 Quaternion newRot = oldRot * Quaternion.Inverse(parentRot);
1756 linkPart.RotationOffset.Z); 1747 linkPart.RotationOffset = newRot;
1757 Quaternion newRot = parentRot.Inverse() * oldRot;
1758 linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
1759 1748
1760 linkPart.ParentID = m_rootPart.LocalId; 1749 linkPart.ParentID = m_rootPart.LocalId;
1761 if (m_rootPart.LinkNum == 0) 1750 if (m_rootPart.LinkNum == 0)
@@ -1769,7 +1758,7 @@ namespace OpenSim.Region.Environment.Scenes
1769 linkPart.LinkNum = m_parts.Count; 1758 linkPart.LinkNum = m_parts.Count;
1770 1759
1771 linkPart.SetParent(this); 1760 linkPart.SetParent(this);
1772 linkPart.AddFlag(LLObject.ObjectFlags.CreateSelected); 1761 linkPart.AddFlag(PrimFlags.CreateSelected);
1773 1762
1774 //if (linkPart.PhysActor != null) 1763 //if (linkPart.PhysActor != null)
1775 //{ 1764 //{
@@ -1821,7 +1810,7 @@ namespace OpenSim.Region.Environment.Scenes
1821// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}", 1810// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
1822// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID); 1811// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
1823 1812
1824 LLQuaternion worldRot = linkPart.GetWorldRotation(); 1813 Quaternion worldRot = linkPart.GetWorldRotation();
1825 1814
1826 // Remove the part from this object 1815 // Remove the part from this object
1827 lock (m_parts) 1816 lock (m_parts)
@@ -1850,23 +1839,14 @@ namespace OpenSim.Region.Environment.Scenes
1850 1839
1851 // We need to reset the child part's position 1840 // We need to reset the child part's position
1852 // ready for life as a separate object after being a part of another object 1841 // ready for life as a separate object after being a part of another object
1853 Quaternion parentRot 1842 Quaternion parentRot = m_rootPart.RotationOffset;
1854 = new Quaternion( 1843
1855 m_rootPart.RotationOffset.W, 1844 Vector3 axPos = linkPart.OffsetPosition;
1856 m_rootPart.RotationOffset.X, 1845
1857 m_rootPart.RotationOffset.Y, 1846 axPos *= parentRot;
1858 m_rootPart.RotationOffset.Z); 1847 linkPart.OffsetPosition = new Vector3(axPos.X, axPos.Y, axPos.Z);
1859
1860 Vector3 axPos
1861 = new Vector3(
1862 linkPart.OffsetPosition.X,
1863 linkPart.OffsetPosition.Y,
1864 linkPart.OffsetPosition.Z);
1865
1866 axPos = parentRot * axPos;
1867 linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
1868 linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition; 1848 linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
1869 linkPart.OffsetPosition = new LLVector3(0, 0, 0); 1849 linkPart.OffsetPosition = new Vector3(0, 0, 0);
1870 1850
1871 linkPart.RotationOffset = worldRot; 1851 linkPart.RotationOffset = worldRot;
1872 1852
@@ -1909,28 +1889,23 @@ namespace OpenSim.Region.Environment.Scenes
1909 1889
1910 part.LinkNum = m_parts.Count; 1890 part.LinkNum = m_parts.Count;
1911 1891
1912 Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z); 1892 Vector3 oldPos = part.OffsetPosition;
1913 axiomOldPos = oldGroupRotation * axiomOldPos; 1893 oldPos *= oldGroupRotation;
1914 axiomOldPos += oldGroupPosition; 1894 oldPos += oldGroupPosition;
1915 LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z); 1895 Vector3 oldAbsolutePosition = oldPos;
1916 part.OffsetPosition = oldAbsolutePosition - AbsolutePosition; 1896 part.OffsetPosition = oldAbsolutePosition - AbsolutePosition;
1917 1897
1918 Quaternion axiomRootRotation = 1898 Quaternion rootRotation = m_rootPart.RotationOffset;
1919 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
1920 m_rootPart.RotationOffset.Z);
1921 1899
1922 Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z); 1900 Vector3 pos = part.OffsetPosition;
1923 axiomPos = axiomRootRotation.Inverse() * axiomPos; 1901 pos *= Quaternion.Inverse(rootRotation);
1924 part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z); 1902 part.OffsetPosition = pos;
1925 1903
1926 Quaternion axiomPartRotation = 1904 Quaternion partRotation = part.RotationOffset;
1927 new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y,
1928 part.RotationOffset.Z);
1929 1905
1930 axiomPartRotation = oldGroupRotation * axiomPartRotation; 1906 partRotation *= oldGroupRotation;
1931 axiomPartRotation = axiomRootRotation.Inverse() * axiomPartRotation; 1907 partRotation *= Quaternion.Inverse(rootRotation);
1932 part.RotationOffset = 1908 part.RotationOffset = partRotation;
1933 new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
1934 } 1909 }
1935 1910
1936 /// <summary> 1911 /// <summary>
@@ -1940,7 +1915,7 @@ namespace OpenSim.Region.Environment.Scenes
1940 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param> 1915 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param>
1941 /// <param name="pos">New position. We do the math here to turn it into a force</param> 1916 /// <param name="pos">New position. We do the math here to turn it into a force</param>
1942 /// <param name="remoteClient"></param> 1917 /// <param name="remoteClient"></param>
1943 public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 1918 public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient)
1944 { 1919 {
1945 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 1920 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
1946 { 1921 {
@@ -1948,7 +1923,7 @@ namespace OpenSim.Region.Environment.Scenes
1948 { 1923 {
1949 if (m_rootPart.PhysActor.IsPhysical) 1924 if (m_rootPart.PhysActor.IsPhysical)
1950 { 1925 {
1951 LLVector3 llmoveforce = pos - AbsolutePosition; 1926 Vector3 llmoveforce = pos - AbsolutePosition;
1952 PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z); 1927 PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z);
1953 grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; 1928 grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass;
1954 m_rootPart.PhysActor.AddForce(grabforce,true); 1929 m_rootPart.PhysActor.AddForce(grabforce,true);
@@ -1966,7 +1941,7 @@ namespace OpenSim.Region.Environment.Scenes
1966 } 1941 }
1967 } 1942 }
1968 1943
1969 public void NonPhysicalGrabMovement(LLVector3 pos) 1944 public void NonPhysicalGrabMovement(Vector3 pos)
1970 { 1945 {
1971 AbsolutePosition = pos; 1946 AbsolutePosition = pos;
1972 m_rootPart.SendTerseUpdateToAllClients(); 1947 m_rootPart.SendTerseUpdateToAllClients();
@@ -2013,7 +1988,7 @@ namespace OpenSim.Region.Environment.Scenes
2013 } 1988 }
2014 } 1989 }
2015 1990
2016 public void SetPartText(string text, LLUUID partID) 1991 public void SetPartText(string text, UUID partID)
2017 { 1992 {
2018 SceneObjectPart part = GetChildPart(partID); 1993 SceneObjectPart part = GetChildPart(partID);
2019 if (part != null) 1994 if (part != null)
@@ -2109,7 +2084,7 @@ namespace OpenSim.Region.Environment.Scenes
2109 } 2084 }
2110 } 2085 }
2111 2086
2112 public void UpdatePermissions(LLUUID AgentID, byte field, uint localID, uint mask, byte addRemTF) 2087 public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF)
2113 { 2088 {
2114 SceneObjectPart updatePart = GetChildPart(localID); 2089 SceneObjectPart updatePart = GetChildPart(localID);
2115 updatePart.UpdatePermissions(AgentID, field, localID, mask, addRemTF); 2090 updatePart.UpdatePermissions(AgentID, field, localID, mask, addRemTF);
@@ -2145,7 +2120,7 @@ namespace OpenSim.Region.Environment.Scenes
2145 /// </summary> 2120 /// </summary>
2146 /// <param name="scale"></param> 2121 /// <param name="scale"></param>
2147 /// <param name="localID"></param> 2122 /// <param name="localID"></param>
2148 public void Resize(LLVector3 scale, uint localID) 2123 public void Resize(Vector3 scale, uint localID)
2149 { 2124 {
2150 if (scale.X > m_scene.m_maxNonphys) 2125 if (scale.X > m_scene.m_maxNonphys)
2151 scale.X = m_scene.m_maxNonphys; 2126 scale.X = m_scene.m_maxNonphys;
@@ -2190,7 +2165,7 @@ namespace OpenSim.Region.Environment.Scenes
2190 } 2165 }
2191 } 2166 }
2192 2167
2193 public void GroupResize(LLVector3 scale, uint localID) 2168 public void GroupResize(Vector3 scale, uint localID)
2194 { 2169 {
2195 SceneObjectPart part = GetChildPart(localID); 2170 SceneObjectPart part = GetChildPart(localID);
2196 if (part != null) 2171 if (part != null)
@@ -2222,7 +2197,7 @@ namespace OpenSim.Region.Environment.Scenes
2222 { 2197 {
2223 if (obPart.UUID != m_rootPart.UUID) 2198 if (obPart.UUID != m_rootPart.UUID)
2224 { 2199 {
2225 LLVector3 oldSize = new LLVector3(obPart.Scale); 2200 Vector3 oldSize = new Vector3(obPart.Scale);
2226 2201
2227 float f = 1.0f; 2202 float f = 1.0f;
2228 float a = 1.0f; 2203 float a = 1.0f;
@@ -2286,7 +2261,7 @@ namespace OpenSim.Region.Environment.Scenes
2286 } 2261 }
2287 } 2262 }
2288 2263
2289 LLVector3 prevScale = part.Scale; 2264 Vector3 prevScale = part.Scale;
2290 prevScale.X *= x; 2265 prevScale.X *= x;
2291 prevScale.Y *= y; 2266 prevScale.Y *= y;
2292 prevScale.Z *= z; 2267 prevScale.Z *= z;
@@ -2298,11 +2273,11 @@ namespace OpenSim.Region.Environment.Scenes
2298 { 2273 {
2299 if (obPart.UUID != m_rootPart.UUID) 2274 if (obPart.UUID != m_rootPart.UUID)
2300 { 2275 {
2301 LLVector3 currentpos = new LLVector3(obPart.OffsetPosition); 2276 Vector3 currentpos = new Vector3(obPart.OffsetPosition);
2302 currentpos.X *= x; 2277 currentpos.X *= x;
2303 currentpos.Y *= y; 2278 currentpos.Y *= y;
2304 currentpos.Z *= z; 2279 currentpos.Z *= z;
2305 LLVector3 newSize = new LLVector3(obPart.Scale); 2280 Vector3 newSize = new Vector3(obPart.Scale);
2306 newSize.X *= x; 2281 newSize.X *= x;
2307 newSize.Y *= y; 2282 newSize.Y *= y;
2308 newSize.Z *= z; 2283 newSize.Z *= z;
@@ -2332,7 +2307,7 @@ namespace OpenSim.Region.Environment.Scenes
2332 /// Move this scene object 2307 /// Move this scene object
2333 /// </summary> 2308 /// </summary>
2334 /// <param name="pos"></param> 2309 /// <param name="pos"></param>
2335 public void UpdateGroupPosition(LLVector3 pos) 2310 public void UpdateGroupPosition(Vector3 pos)
2336 { 2311 {
2337 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 2312 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
2338 { 2313 {
@@ -2356,7 +2331,7 @@ namespace OpenSim.Region.Environment.Scenes
2356 /// </summary> 2331 /// </summary>
2357 /// <param name="pos"></param> 2332 /// <param name="pos"></param>
2358 /// <param name="localID"></param> 2333 /// <param name="localID"></param>
2359 public void UpdateSinglePosition(LLVector3 pos, uint localID) 2334 public void UpdateSinglePosition(Vector3 pos, uint localID)
2360 { 2335 {
2361 SceneObjectPart part = GetChildPart(localID); 2336 SceneObjectPart part = GetChildPart(localID);
2362 2337
@@ -2379,22 +2354,18 @@ namespace OpenSim.Region.Environment.Scenes
2379 /// 2354 ///
2380 /// </summary> 2355 /// </summary>
2381 /// <param name="pos"></param> 2356 /// <param name="pos"></param>
2382 private void UpdateRootPosition(LLVector3 pos) 2357 private void UpdateRootPosition(Vector3 pos)
2383 { 2358 {
2384 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); 2359 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
2385 LLVector3 oldPos = 2360 Vector3 oldPos =
2386 new LLVector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, 2361 new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X,
2387 AbsolutePosition.Y + m_rootPart.OffsetPosition.Y, 2362 AbsolutePosition.Y + m_rootPart.OffsetPosition.Y,
2388 AbsolutePosition.Z + m_rootPart.OffsetPosition.Z); 2363 AbsolutePosition.Z + m_rootPart.OffsetPosition.Z);
2389 LLVector3 diff = oldPos - newPos; 2364 Vector3 diff = oldPos - newPos;
2390 Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); 2365 Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z);
2391 Quaternion partRotation = 2366 Quaternion partRotation = m_rootPart.RotationOffset;
2392 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, 2367 axDiff *= Quaternion.Inverse(partRotation);
2393 m_rootPart.RotationOffset.Z); 2368 diff = axDiff;
2394 axDiff = partRotation.Inverse() * axDiff;
2395 diff.X = axDiff.x;
2396 diff.Y = axDiff.y;
2397 diff.Z = axDiff.z;
2398 2369
2399 lock (m_parts) 2370 lock (m_parts)
2400 { 2371 {
@@ -2413,7 +2384,7 @@ namespace OpenSim.Region.Environment.Scenes
2413 ScheduleGroupForTerseUpdate(); 2384 ScheduleGroupForTerseUpdate();
2414 } 2385 }
2415 2386
2416 public void OffsetForNewRegion(LLVector3 offset) 2387 public void OffsetForNewRegion(Vector3 offset)
2417 { 2388 {
2418 m_rootPart.GroupPosition = offset; 2389 m_rootPart.GroupPosition = offset;
2419 } 2390 }
@@ -2426,14 +2397,12 @@ namespace OpenSim.Region.Environment.Scenes
2426 /// 2397 ///
2427 /// </summary> 2398 /// </summary>
2428 /// <param name="rot"></param> 2399 /// <param name="rot"></param>
2429 public void UpdateGroupRotation(LLQuaternion rot) 2400 public void UpdateGroupRotation(Quaternion rot)
2430 { 2401 {
2431 m_rootPart.UpdateRotation(rot); 2402 m_rootPart.UpdateRotation(rot);
2432 if (m_rootPart.PhysActor != null) 2403 if (m_rootPart.PhysActor != null)
2433 { 2404 {
2434 m_rootPart.PhysActor.Orientation = 2405 m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
2435 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
2436 m_rootPart.RotationOffset.Z);
2437 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); 2406 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
2438 } 2407 }
2439 2408
@@ -2446,14 +2415,12 @@ namespace OpenSim.Region.Environment.Scenes
2446 /// </summary> 2415 /// </summary>
2447 /// <param name="pos"></param> 2416 /// <param name="pos"></param>
2448 /// <param name="rot"></param> 2417 /// <param name="rot"></param>
2449 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) 2418 public void UpdateGroupRotation(Vector3 pos, Quaternion rot)
2450 { 2419 {
2451 m_rootPart.UpdateRotation(rot); 2420 m_rootPart.UpdateRotation(rot);
2452 if (m_rootPart.PhysActor != null) 2421 if (m_rootPart.PhysActor != null)
2453 { 2422 {
2454 m_rootPart.PhysActor.Orientation = 2423 m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
2455 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
2456 m_rootPart.RotationOffset.Z);
2457 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); 2424 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
2458 } 2425 }
2459 AbsolutePosition = pos; 2426 AbsolutePosition = pos;
@@ -2467,7 +2434,7 @@ namespace OpenSim.Region.Environment.Scenes
2467 /// </summary> 2434 /// </summary>
2468 /// <param name="rot"></param> 2435 /// <param name="rot"></param>
2469 /// <param name="localID"></param> 2436 /// <param name="localID"></param>
2470 public void UpdateSingleRotation(LLQuaternion rot, uint localID) 2437 public void UpdateSingleRotation(Quaternion rot, uint localID)
2471 { 2438 {
2472 SceneObjectPart part = GetChildPart(localID); 2439 SceneObjectPart part = GetChildPart(localID);
2473 if (part != null) 2440 if (part != null)
@@ -2487,19 +2454,15 @@ namespace OpenSim.Region.Environment.Scenes
2487 /// 2454 ///
2488 /// </summary> 2455 /// </summary>
2489 /// <param name="rot"></param> 2456 /// <param name="rot"></param>
2490 private void UpdateRootRotation(LLQuaternion rot) 2457 private void UpdateRootRotation(Quaternion rot)
2491 { 2458 {
2492 Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); 2459 Quaternion axRot = rot;
2493 Quaternion oldParentRot = 2460 Quaternion oldParentRot = m_rootPart.RotationOffset;
2494 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
2495 m_rootPart.RotationOffset.Z);
2496 2461
2497 m_rootPart.UpdateRotation(rot); 2462 m_rootPart.UpdateRotation(rot);
2498 if (m_rootPart.PhysActor != null) 2463 if (m_rootPart.PhysActor != null)
2499 { 2464 {
2500 m_rootPart.PhysActor.Orientation = 2465 m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
2501 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
2502 m_rootPart.RotationOffset.Z);
2503 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); 2466 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
2504 } 2467 }
2505 2468
@@ -2509,16 +2472,14 @@ namespace OpenSim.Region.Environment.Scenes
2509 { 2472 {
2510 if (prim.UUID != m_rootPart.UUID) 2473 if (prim.UUID != m_rootPart.UUID)
2511 { 2474 {
2512 Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z); 2475 Vector3 axPos = prim.OffsetPosition;
2513 axPos = oldParentRot * axPos; 2476 axPos *= oldParentRot;
2514 axPos = axRot.Inverse() * axPos; 2477 axPos *= Quaternion.Inverse(axRot);
2515 prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); 2478 prim.OffsetPosition = axPos;
2516 Quaternion primsRot = 2479 Quaternion primsRot = prim.RotationOffset;
2517 new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y,
2518 prim.RotationOffset.Z);
2519 Quaternion newRot = oldParentRot * primsRot; 2480 Quaternion newRot = oldParentRot * primsRot;
2520 newRot = axRot.Inverse() * newRot; 2481 newRot *= Quaternion.Inverse(axRot);
2521 prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); 2482 prim.RotationOffset = newRot;
2522 prim.ScheduleTerseUpdate(); 2483 prim.ScheduleTerseUpdate();
2523 } 2484 }
2524 } 2485 }
@@ -2562,7 +2523,7 @@ namespace OpenSim.Region.Environment.Scenes
2562 } 2523 }
2563 } 2524 }
2564 2525
2565 public int registerTargetWaypoint(LLVector3 target, float tolerance) 2526 public int registerTargetWaypoint(Vector3 target, float tolerance)
2566 { 2527 {
2567 scriptPosTarget waypoint = new scriptPosTarget(); 2528 scriptPosTarget waypoint = new scriptPosTarget();
2568 waypoint.targetPos = target; 2529 waypoint.targetPos = target;
@@ -2590,7 +2551,7 @@ namespace OpenSim.Region.Environment.Scenes
2590 if (m_targets.Count > 0) 2551 if (m_targets.Count > 0)
2591 { 2552 {
2592 bool at_target = false; 2553 bool at_target = false;
2593 //LLVector3 targetPos; 2554 //Vector3 targetPos;
2594 //uint targetHandle; 2555 //uint targetHandle;
2595 Dictionary<uint, scriptPosTarget> atTargets = new Dictionary<uint, scriptPosTarget>(); 2556 Dictionary<uint, scriptPosTarget> atTargets = new Dictionary<uint, scriptPosTarget>();
2596 lock (m_targets) 2557 lock (m_targets)
@@ -2681,11 +2642,11 @@ namespace OpenSim.Region.Environment.Scenes
2681 { 2642 {
2682 if (RootPart != null) 2643 if (RootPart != null)
2683 { 2644 {
2684 if ((RootPart.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Phantom) == 0) 2645 if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) == 0)
2685 { 2646 {
2686 foreach (SceneObjectPart part in m_parts.Values) 2647 foreach (SceneObjectPart part in m_parts.Values)
2687 { 2648 {
2688 if (part.Shape.SculptEntry && part.Shape.SculptTexture != LLUUID.Zero) 2649 if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero)
2689 { 2650 {
2690 m_scene.AssetCache.GetAsset(part.Shape.SculptTexture, part.SculptTextureCallback, true); 2651 m_scene.AssetCache.GetAsset(part.Shape.SculptTexture, part.SculptTextureCallback, true);
2691 } 2652 }
@@ -2700,7 +2661,7 @@ namespace OpenSim.Region.Environment.Scenes
2700 /// </summary> 2661 /// </summary>
2701 /// <param name="GroupID"></param> 2662 /// <param name="GroupID"></param>
2702 /// <param name="client"></param> 2663 /// <param name="client"></param>
2703 public void SetGroup(LLUUID GroupID, IClientAPI client) 2664 public void SetGroup(UUID GroupID, IClientAPI client)
2704 { 2665 {
2705 lock (m_parts) 2666 lock (m_parts)
2706 { 2667 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 3bfe7e9..2beb9bb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using libsecondlife; 31using OpenMetaverse;
32using log4net; 32using log4net;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache; 34using OpenSim.Framework.Communications.Cache;
@@ -69,7 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
69 } 69 }
70 70
71 /// <summary> 71 /// <summary>
72 /// Reset LLUUIDs for all the items in the prim's inventory. This involves either generating 72 /// Reset UUIDs for all the items in the prim's inventory. This involves either generating
73 /// new ones or setting existing UUIDs to the correct parent UUIDs. 73 /// new ones or setting existing UUIDs to the correct parent UUIDs.
74 /// 74 ///
75 /// If this method is called and there are inventory items, then we regard the inventory as having changed. 75 /// If this method is called and there are inventory items, then we regard the inventory as having changed.
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Scenes
99 /// Change every item in this prim's inventory to a new owner. 99 /// Change every item in this prim's inventory to a new owner.
100 /// </summary> 100 /// </summary>
101 /// <param name="ownerId"></param> 101 /// <param name="ownerId"></param>
102 public void ChangeInventoryOwner(LLUUID ownerId) 102 public void ChangeInventoryOwner(UUID ownerId)
103 { 103 {
104 lock (TaskInventory) 104 lock (TaskInventory)
105 { 105 {
@@ -172,13 +172,13 @@ namespace OpenSim.Region.Environment.Scenes
172 if (!m_parentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, UUID, item.OwnerID)) 172 if (!m_parentGroup.Scene.ExternalChecks.ExternalChecksCanRunScript(item.ItemID, UUID, item.OwnerID))
173 return; 173 return;
174 174
175 AddFlag(LLObject.ObjectFlags.Scripted); 175 AddFlag(PrimFlags.Scripted);
176 176
177 if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) 177 if (!m_parentGroup.Scene.RegionInfo.RegionSettings.DisableScripts)
178 { 178 {
179 AssetCache cache = m_parentGroup.Scene.AssetCache; 179 AssetCache cache = m_parentGroup.Scene.AssetCache;
180 180
181 cache.GetAsset(item.AssetID, delegate(LLUUID assetID, AssetBase asset) 181 cache.GetAsset(item.AssetID, delegate(UUID assetID, AssetBase asset)
182 { 182 {
183 if (null == asset) 183 if (null == asset)
184 { 184 {
@@ -190,8 +190,8 @@ namespace OpenSim.Region.Environment.Scenes
190 else 190 else
191 { 191 {
192 m_taskInventory[item.ItemID].PermsMask = 0; 192 m_taskInventory[item.ItemID].PermsMask = 0;
193 m_taskInventory[item.ItemID].PermsGranter = LLUUID.Zero; 193 m_taskInventory[item.ItemID].PermsGranter = UUID.Zero;
194 string script = Helpers.FieldToUTF8String(asset.Data); 194 string script = Utils.BytesToString(asset.Data);
195 m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId, item.ItemID, script, 195 m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId, item.ItemID, script,
196 startParam, postOnRez); 196 startParam, postOnRez);
197 m_parentGroup.AddActiveScriptCount(1); 197 m_parentGroup.AddActiveScriptCount(1);
@@ -205,9 +205,9 @@ namespace OpenSim.Region.Environment.Scenes
205 /// Start a script which is in this prim's inventory. 205 /// Start a script which is in this prim's inventory.
206 /// </summary> 206 /// </summary>
207 /// <param name="itemId"> 207 /// <param name="itemId">
208 /// A <see cref="LLUUID"/> 208 /// A <see cref="UUID"/>
209 /// </param> 209 /// </param>
210 public void CreateScriptInstance(LLUUID itemId, int startParam, bool postOnRez) 210 public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez)
211 { 211 {
212 lock (m_taskInventory) 212 lock (m_taskInventory)
213 { 213 {
@@ -229,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes
229 /// Stop a script which is in this prim's inventory. 229 /// Stop a script which is in this prim's inventory.
230 /// </summary> 230 /// </summary>
231 /// <param name="itemId"></param> 231 /// <param name="itemId"></param>
232 public void RemoveScriptInstance(LLUUID itemId) 232 public void RemoveScriptInstance(UUID itemId)
233 { 233 {
234 if (m_taskInventory.ContainsKey(itemId)) 234 if (m_taskInventory.ContainsKey(itemId))
235 { 235 {
@@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
370 /// </summary> 370 /// </summary>
371 /// <param name="itemID"></param> 371 /// <param name="itemID"></param>
372 /// <returns>null if the item does not exist</returns> 372 /// <returns>null if the item does not exist</returns>
373 public TaskInventoryItem GetInventoryItem(LLUUID itemId) 373 public TaskInventoryItem GetInventoryItem(UUID itemId)
374 { 374 {
375 TaskInventoryItem item; 375 TaskInventoryItem item;
376 m_taskInventory.TryGetValue(itemId, out item); 376 m_taskInventory.TryGetValue(itemId, out item);
@@ -426,7 +426,7 @@ namespace OpenSim.Region.Environment.Scenes
426 /// <param name="itemID"></param> 426 /// <param name="itemID"></param>
427 /// <returns>Numeric asset type of the item removed. Returns -1 if the item did not exist 427 /// <returns>Numeric asset type of the item removed. Returns -1 if the item did not exist
428 /// in this prim's inventory.</returns> 428 /// in this prim's inventory.</returns>
429 public int RemoveInventoryItem(LLUUID itemID) 429 public int RemoveInventoryItem(UUID itemID)
430 { 430 {
431 lock (m_taskInventory) 431 lock (m_taskInventory)
432 { 432 {
@@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Scenes
455 455
456 if (scriptcount <= 0) 456 if (scriptcount <= 0)
457 { 457 {
458 RemFlag(LLObject.ObjectFlags.Scripted); 458 RemFlag(PrimFlags.Scripted);
459 } 459 }
460 460
461 ScheduleFullUpdate(); 461 ScheduleFullUpdate();
@@ -477,10 +477,10 @@ namespace OpenSim.Region.Environment.Scenes
477 public string GetInventoryFileName() 477 public string GetInventoryFileName()
478 { 478 {
479 if (m_inventoryFileName == String.Empty) 479 if (m_inventoryFileName == String.Empty)
480 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 480 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
481 if (m_inventoryFileNameSerial < m_inventorySerial) 481 if (m_inventoryFileNameSerial < m_inventorySerial)
482 { 482 {
483 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 483 m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
484 } 484 }
485 return m_inventoryFileName; 485 return m_inventoryFileName;
486 } 486 }
@@ -499,7 +499,7 @@ namespace OpenSim.Region.Environment.Scenes
499 if (m_inventorySerial > 0) 499 if (m_inventorySerial > 0)
500 { 500 {
501 client.SendTaskInventory(m_uuid, (short)m_inventorySerial, 501 client.SendTaskInventory(m_uuid, (short)m_inventorySerial,
502 Helpers.StringToField(GetInventoryFileName())); 502 Utils.StringToBytes(GetInventoryFileName()));
503 return true; 503 return true;
504 } 504 }
505 else 505 else
@@ -520,13 +520,13 @@ namespace OpenSim.Region.Environment.Scenes
520 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches 520 // Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches
521 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality 521 // what appears to happen in the Second Life protocol. If this isn't the case. then various functionality
522 // isn't available (such as drag from prim inventory to agent inventory) 522 // isn't available (such as drag from prim inventory to agent inventory)
523 InventoryStringBuilder invString = new InventoryStringBuilder(UUID, LLUUID.Zero); 523 InventoryStringBuilder invString = new InventoryStringBuilder(UUID, UUID.Zero);
524 524
525 lock (m_taskInventory) 525 lock (m_taskInventory)
526 { 526 {
527 foreach (TaskInventoryItem item in m_taskInventory.Values) 527 foreach (TaskInventoryItem item in m_taskInventory.Values)
528 { 528 {
529 LLUUID ownerID = item.OwnerID; 529 UUID ownerID = item.OwnerID;
530 uint everyoneMask = 0; 530 uint everyoneMask = 0;
531 uint baseMask = item.BasePermissions; 531 uint baseMask = item.BasePermissions;
532 uint ownerMask = item.CurrentPermissions; 532 uint ownerMask = item.CurrentPermissions;
@@ -587,10 +587,10 @@ namespace OpenSim.Region.Environment.Scenes
587 } 587 }
588 } 588 }
589 589
590 fileData = Helpers.StringToField(invString.BuildString); 590 fileData = Utils.StringToBytes(invString.BuildString);
591 591
592 //Console.WriteLine(Helpers.FieldToUTF8String(fileData)); 592 //Console.WriteLine(Utils.BytesToString(fileData));
593 //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Helpers.FieldToUTF8String(fileData)); 593 //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Utils.BytesToString(fileData));
594 594
595 if (fileData.Length > 2) 595 if (fileData.Length > 2)
596 { 596 {
@@ -619,7 +619,7 @@ namespace OpenSim.Region.Environment.Scenes
619 { 619 {
620 public string BuildString = String.Empty; 620 public string BuildString = String.Empty;
621 621
622 public InventoryStringBuilder(LLUUID folderID, LLUUID parentID) 622 public InventoryStringBuilder(UUID folderID, UUID parentID)
623 { 623 {
624 BuildString += "\tinv_object\t0\n\t{\n"; 624 BuildString += "\tinv_object\t0\n\t{\n";
625 AddNameValueLine("obj_id", folderID.ToString()); 625 AddNameValueLine("obj_id", folderID.ToString());
@@ -746,9 +746,9 @@ namespace OpenSim.Region.Environment.Scenes
746 return false; 746 return false;
747 } 747 }
748 748
749 public List<LLUUID> GetInventoryList() 749 public List<UUID> GetInventoryList()
750 { 750 {
751 List<LLUUID> ret = new List<LLUUID>(); 751 List<UUID> ret = new List<UUID>();
752 752
753 foreach (TaskInventoryItem item in m_taskInventory.Values) 753 foreach (TaskInventoryItem item in m_taskInventory.Values)
754 ret.Add(item.ItemID); 754 ret.Add(item.ItemID);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 5861298..ea10fe6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -33,10 +33,8 @@ using System.Security.Permissions;
33using System.Xml; 33using System.Xml;
34using System.Xml.Serialization; 34using System.Xml.Serialization;
35 35
36using Axiom.Math; 36using OpenMetaverse;
37 37using OpenMetaverse.Packets;
38using libsecondlife;
39using libsecondlife.Packets;
40 38
41using OpenSim.Framework; 39using OpenSim.Framework;
42using OpenSim.Region.Environment.Scenes.Scripting; 40using OpenSim.Region.Environment.Scenes.Scripting;
@@ -114,7 +112,7 @@ namespace OpenSim.Region.Environment.Scenes
114 // Not a big problem as long as the script that sets it remains in the prim on startup. 112 // Not a big problem as long as the script that sets it remains in the prim on startup.
115 // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script) 113 // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script)
116 [XmlIgnore] 114 [XmlIgnore]
117 public LLUUID Sound; 115 public UUID Sound;
118 [XmlIgnore] 116 [XmlIgnore]
119 public byte SoundFlags; 117 public byte SoundFlags;
120 [XmlIgnore] 118 [XmlIgnore]
@@ -128,15 +126,15 @@ namespace OpenSim.Region.Environment.Scenes
128 [XmlIgnore] 126 [XmlIgnore]
129 public uint TimeStampTerse = 0; 127 public uint TimeStampTerse = 0;
130 [XmlIgnore] 128 [XmlIgnore]
131 public LLUUID FromAssetID = LLUUID.Zero; 129 public UUID FromAssetID = UUID.Zero;
132 [XmlIgnore] 130 [XmlIgnore]
133 public bool IsAttachment = false; 131 public bool IsAttachment = false;
134 [XmlIgnore] 132 [XmlIgnore]
135 public scriptEvents AggregateScriptEvents = 0; 133 public scriptEvents AggregateScriptEvents = 0;
136 [XmlIgnore] 134 [XmlIgnore]
137 public LLUUID AttachedAvatar = LLUUID.Zero; 135 public UUID AttachedAvatar = UUID.Zero;
138 [XmlIgnore] 136 [XmlIgnore]
139 public LLVector3 AttachedPos = LLVector3.Zero; 137 public Vector3 AttachedPos = Vector3.Zero;
140 [XmlIgnore] 138 [XmlIgnore]
141 public uint AttachmentPoint = (byte)0; 139 public uint AttachmentPoint = (byte)0;
142 [XmlIgnore] 140 [XmlIgnore]
@@ -146,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
146 public bool Undoing = false; 144 public bool Undoing = false;
147 145
148 [XmlIgnore] 146 [XmlIgnore]
149 private LLObject.ObjectFlags LocalFlags = LLObject.ObjectFlags.None; 147 private PrimFlags LocalFlags = 0;
150 private byte[] m_TextureAnimation; 148 private byte[] m_TextureAnimation;
151 private byte m_clickAction = 0; 149 private byte m_clickAction = 0;
152 private Color m_color = Color.Black; 150 private Color m_color = Color.Black;
@@ -157,14 +155,14 @@ namespace OpenSim.Region.Environment.Scenes
157 [XmlIgnore] 155 [XmlIgnore]
158 private int m_scriptAccessPin = 0; 156 private int m_scriptAccessPin = 0;
159 [XmlIgnore] 157 [XmlIgnore]
160 private readonly Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); 158 private readonly Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>();
161 private string m_sitName = String.Empty; 159 private string m_sitName = String.Empty;
162 private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); 160 private Quaternion m_sitTargetOrientation = Quaternion.Identity;
163 private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); 161 private Vector3 m_sitTargetPosition = Vector3.Zero;
164 private string m_text = String.Empty; 162 private string m_text = String.Empty;
165 private string m_touchName = String.Empty; 163 private string m_touchName = String.Empty;
166 private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); 164 private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
167 private LLUUID _creatorID; 165 private UUID _creatorID;
168 166
169 /// <summary> 167 /// <summary>
170 /// Only used internally to schedule client updates. 168 /// Only used internally to schedule client updates.
@@ -176,29 +174,29 @@ namespace OpenSim.Region.Environment.Scenes
176 /// </summary> 174 /// </summary>
177 private byte m_updateFlag; 175 private byte m_updateFlag;
178 176
179 protected LLVector3 m_acceleration; 177 protected Vector3 m_acceleration;
180 protected LLVector3 m_angularVelocity; 178 protected Vector3 m_angularVelocity;
181 179
182 //unkown if this will be kept, added as a way of removing the group position from the group class 180 //unkown if this will be kept, added as a way of removing the group position from the group class
183 protected LLVector3 m_groupPosition; 181 protected Vector3 m_groupPosition;
184 protected uint m_localId; 182 protected uint m_localId;
185 protected LLObject.MaterialType m_material = 0; 183 protected Material m_material = 0;
186 protected string m_name; 184 protected string m_name;
187 protected LLVector3 m_offsetPosition; 185 protected Vector3 m_offsetPosition;
188 186
189 // FIXME, TODO, ERROR: 'ParentGroup' can't be in here, move it out. 187 // FIXME, TODO, ERROR: 'ParentGroup' can't be in here, move it out.
190 protected SceneObjectGroup m_parentGroup; 188 protected SceneObjectGroup m_parentGroup;
191 protected byte[] m_particleSystem = new byte[0]; 189 protected byte[] m_particleSystem = new byte[0];
192 protected ulong m_regionHandle; 190 protected ulong m_regionHandle;
193 protected LLQuaternion m_rotationOffset; 191 protected Quaternion m_rotationOffset;
194 protected PrimitiveBaseShape m_shape = null; 192 protected PrimitiveBaseShape m_shape = null;
195 protected LLUUID m_uuid; 193 protected UUID m_uuid;
196 protected LLVector3 m_velocity; 194 protected Vector3 m_velocity;
197 195
198 // TODO: Those have to be changed into persistent properties at some later point, 196 // TODO: Those have to be changed into persistent properties at some later point,
199 // or sit-camera on vehicles will break on sim-crossing. 197 // or sit-camera on vehicles will break on sim-crossing.
200 private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); 198 private Vector3 m_cameraEyeOffset = new Vector3(0.0f, 0.0f, 0.0f);
201 private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); 199 private Vector3 m_cameraAtOffset = new Vector3(0.0f, 0.0f, 0.0f);
202 private bool m_forceMouselook = false; 200 private bool m_forceMouselook = false;
203 201
204 #endregion Fields 202 #endregion Fields
@@ -214,9 +212,9 @@ namespace OpenSim.Region.Environment.Scenes
214 m_TextureAnimation = new byte[0]; 212 m_TextureAnimation = new byte[0];
215 } 213 }
216 214
217 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, 215 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID,
218 PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) 216 PrimitiveBaseShape shape, Vector3 groupPosition, Vector3 offsetPosition)
219 : this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition) 217 : this(regionHandle, parent, ownerID, localID, shape, groupPosition, Quaternion.Identity, offsetPosition)
220 { 218 {
221 } 219 }
222 220
@@ -229,9 +227,9 @@ namespace OpenSim.Region.Environment.Scenes
229 /// <param name="localID"></param> 227 /// <param name="localID"></param>
230 /// <param name="shape"></param> 228 /// <param name="shape"></param>
231 /// <param name="position"></param> 229 /// <param name="position"></param>
232 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, 230 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID,
233 PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, 231 PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset,
234 LLVector3 offsetPosition) 232 Vector3 offsetPosition)
235 { 233 {
236 m_name = "Primitive"; 234 m_name = "Primitive";
237 m_regionHandle = regionHandle; 235 m_regionHandle = regionHandle;
@@ -240,8 +238,8 @@ namespace OpenSim.Region.Environment.Scenes
240 _creationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 238 _creationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
241 _ownerID = ownerID; 239 _ownerID = ownerID;
242 _creatorID = _ownerID; 240 _creatorID = _ownerID;
243 _lastOwnerID = LLUUID.Zero; 241 _lastOwnerID = UUID.Zero;
244 UUID = LLUUID.Random(); 242 UUID = UUID.Random();
245 LocalId = (uint) (localID); 243 LocalId = (uint) (localID);
246 Shape = shape; 244 Shape = shape;
247 // Todo: Add More Object Parameter from above! 245 // Todo: Add More Object Parameter from above!
@@ -254,9 +252,9 @@ namespace OpenSim.Region.Environment.Scenes
254 GroupPosition = groupPosition; 252 GroupPosition = groupPosition;
255 OffsetPosition = offsetPosition; 253 OffsetPosition = offsetPosition;
256 RotationOffset = rotationOffset; 254 RotationOffset = rotationOffset;
257 Velocity = new LLVector3(0, 0, 0); 255 Velocity = new Vector3(0, 0, 0);
258 AngularVelocity = new LLVector3(0, 0, 0); 256 AngularVelocity = new Vector3(0, 0, 0);
259 Acceleration = new LLVector3(0, 0, 0); 257 Acceleration = new Vector3(0, 0, 0);
260 m_TextureAnimation = new byte[0]; 258 m_TextureAnimation = new byte[0];
261 259
262 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, 260 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
@@ -264,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes
264 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log 262 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
265 263
266 _flags = 0; 264 _flags = 0;
267 _flags |= LLObject.ObjectFlags.CreateSelected; 265 _flags |= PrimFlags.CreateSelected;
268 266
269 TrimPermissions(); 267 TrimPermissions();
270 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); 268 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo());
@@ -282,9 +280,9 @@ namespace OpenSim.Region.Environment.Scenes
282 /// <param name="localID"></param> 280 /// <param name="localID"></param>
283 /// <param name="shape"></param> 281 /// <param name="shape"></param>
284 /// <param name="position"></param> 282 /// <param name="position"></param>
285 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, LLUUID ownerID, 283 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, UUID ownerID,
286 LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, 284 UUID creatorID, UUID lastOwnerID, uint localID, PrimitiveBaseShape shape,
287 LLVector3 position, LLQuaternion rotation, uint flags) 285 Vector3 position, Quaternion rotation, uint flags)
288 { 286 {
289 m_regionHandle = regionHandle; 287 m_regionHandle = regionHandle;
290 m_parentGroup = parent; 288 m_parentGroup = parent;
@@ -293,7 +291,7 @@ namespace OpenSim.Region.Environment.Scenes
293 _ownerID = ownerID; 291 _ownerID = ownerID;
294 _creatorID = creatorID; 292 _creatorID = creatorID;
295 _lastOwnerID = lastOwnerID; 293 _lastOwnerID = lastOwnerID;
296 UUID = LLUUID.Random(); 294 UUID = UUID.Random();
297 LocalId = (uint) (localID); 295 LocalId = (uint) (localID);
298 Shape = shape; 296 Shape = shape;
299 _ownershipCost = 0; 297 _ownershipCost = 0;
@@ -307,7 +305,7 @@ namespace OpenSim.Region.Environment.Scenes
307 305
308 // Since we don't store script state, this is only a 'temporary' objectflag now 306 // Since we don't store script state, this is only a 'temporary' objectflag now
309 // If the object is scripted, the script will get loaded and this will be set again 307 // If the object is scripted, the script will get loaded and this will be set again
310 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch); 308 ObjectFlags &= ~(uint)(PrimFlags.Scripted | PrimFlags.Touch);
311 309
312 TrimPermissions(); 310 TrimPermissions();
313 // ApplyPhysics(); 311 // ApplyPhysics();
@@ -326,7 +324,7 @@ namespace OpenSim.Region.Environment.Scenes
326 324
327 /* 325 /*
328 m_queue = (Queue<SceneObjectPart>)info.GetValue("m_queue", typeof(Queue<SceneObjectPart>)); 326 m_queue = (Queue<SceneObjectPart>)info.GetValue("m_queue", typeof(Queue<SceneObjectPart>));
329 m_ids = (List<LLUUID>)info.GetValue("m_ids", typeof(List<LLUUID>)); 327 m_ids = (List<UUID>)info.GetValue("m_ids", typeof(List<UUID>));
330 */ 328 */
331 329
332 //System.Console.WriteLine("SceneObjectPart Deserialize END"); 330 //System.Console.WriteLine("SceneObjectPart Deserialize END");
@@ -336,24 +334,24 @@ namespace OpenSim.Region.Environment.Scenes
336 334
337 #region XML Schema 335 #region XML Schema
338 336
339 private LLUUID _lastOwnerID; 337 private UUID _lastOwnerID;
340 private LLUUID _ownerID; 338 private UUID _ownerID;
341 private LLUUID _groupID; 339 private UUID _groupID;
342 private int _ownershipCost; 340 private int _ownershipCost;
343 private byte _objectSaleType; 341 private byte _objectSaleType;
344 private int _salePrice; 342 private int _salePrice;
345 private uint _category; 343 private uint _category;
346 private Int32 _creationDate; 344 private Int32 _creationDate;
347 private uint _parentID = 0; 345 private uint _parentID = 0;
348 private LLUUID m_sitTargetAvatar = LLUUID.Zero; 346 private UUID m_sitTargetAvatar = UUID.Zero;
349 private uint _baseMask = (uint)PermissionMask.All; 347 private uint _baseMask = (uint)PermissionMask.All;
350 private uint _ownerMask = (uint)PermissionMask.All; 348 private uint _ownerMask = (uint)PermissionMask.All;
351 private uint _groupMask = (uint)PermissionMask.None; 349 private uint _groupMask = (uint)PermissionMask.None;
352 private uint _everyoneMask = (uint)PermissionMask.None; 350 private uint _everyoneMask = (uint)PermissionMask.None;
353 private uint _nextOwnerMask = (uint)PermissionMask.All; 351 private uint _nextOwnerMask = (uint)PermissionMask.All;
354 private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; 352 private PrimFlags _flags = 0;
355 353
356 public LLUUID CreatorID { 354 public UUID CreatorID {
357 get 355 get
358 { 356 {
359 return _creatorID; 357 return _creatorID;
@@ -368,7 +366,7 @@ namespace OpenSim.Region.Environment.Scenes
368 /// Exposing this is not particularly good, but it's one of the least evils at the moment to see 366 /// Exposing this is not particularly good, but it's one of the least evils at the moment to see
369 /// folder id from prim inventory item data, since it's not (yet) actually stored with the prim. 367 /// folder id from prim inventory item data, since it's not (yet) actually stored with the prim.
370 /// </summary> 368 /// </summary>
371 public LLUUID FolderID 369 public UUID FolderID
372 { 370 {
373 get { return UUID; } 371 get { return UUID; }
374 set { } // Don't allow assignment, or legacy prims wil b0rk 372 set { } // Don't allow assignment, or legacy prims wil b0rk
@@ -389,10 +387,10 @@ namespace OpenSim.Region.Environment.Scenes
389 public uint ObjectFlags 387 public uint ObjectFlags
390 { 388 {
391 get { return (uint)_flags; } 389 get { return (uint)_flags; }
392 set { _flags = (LLObject.ObjectFlags)value; } 390 set { _flags = (PrimFlags)value; }
393 } 391 }
394 392
395 public LLUUID UUID 393 public UUID UUID
396 { 394 {
397 get { return m_uuid; } 395 get { return m_uuid; }
398 set { m_uuid = value; } 396 set { m_uuid = value; }
@@ -413,7 +411,7 @@ namespace OpenSim.Region.Environment.Scenes
413 public byte Material 411 public byte Material
414 { 412 {
415 get { return (byte) m_material; } 413 get { return (byte) m_material; }
416 set { m_material = (LLObject.MaterialType) value; } 414 set { m_material = (Material)value; }
417 } 415 }
418 416
419 public ulong RegionHandle 417 public ulong RegionHandle
@@ -435,7 +433,7 @@ namespace OpenSim.Region.Environment.Scenes
435 set { m_TextureAnimation = value; } 433 set { m_TextureAnimation = value; }
436 } 434 }
437 435
438 public LLVector3 GroupPosition 436 public Vector3 GroupPosition
439 { 437 {
440 get 438 get
441 { 439 {
@@ -479,10 +477,10 @@ namespace OpenSim.Region.Environment.Scenes
479 477
480 // To move the child prim in respect to the group position and rotation we have to calculate 478 // To move the child prim in respect to the group position and rotation we have to calculate
481 479
482 LLVector3 resultingposition = GetWorldPosition(); 480 Vector3 resultingposition = GetWorldPosition();
483 PhysActor.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z); 481 PhysActor.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z);
484 LLQuaternion resultingrot = GetWorldRotation(); 482 Quaternion resultingrot = GetWorldRotation();
485 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z); 483 PhysActor.Orientation = resultingrot;
486 } 484 }
487 485
488 // Tell the physics engines that this prim changed. 486 // Tell the physics engines that this prim changed.
@@ -497,7 +495,7 @@ namespace OpenSim.Region.Environment.Scenes
497 } 495 }
498 } 496 }
499 497
500 public LLVector3 OffsetPosition 498 public Vector3 OffsetPosition
501 { 499 {
502 get { return m_offsetPosition; } 500 get { return m_offsetPosition; }
503 set 501 set
@@ -518,20 +516,17 @@ namespace OpenSim.Region.Environment.Scenes
518 } 516 }
519 } 517 }
520 518
521 public LLQuaternion RotationOffset 519 public Quaternion RotationOffset
522 { 520 {
523 get 521 get
524 { 522 {
525 // We don't want the physics engine mucking up the rotations in a linkset 523 // We don't want the physics engine mucking up the rotations in a linkset
526 if (PhysActor != null && _parentID == 0) 524 if (PhysActor != null && _parentID == 0)
527 { 525 {
528 if (PhysActor.Orientation.x != 0 || PhysActor.Orientation.y != 0 526 if (PhysActor.Orientation.X != 0 || PhysActor.Orientation.Y != 0
529 || PhysActor.Orientation.z != 0 || PhysActor.Orientation.w != 0) 527 || PhysActor.Orientation.Z != 0 || PhysActor.Orientation.W != 0)
530 { 528 {
531 m_rotationOffset.X = PhysActor.Orientation.x; 529 m_rotationOffset = PhysActor.Orientation;
532 m_rotationOffset.Y = PhysActor.Orientation.y;
533 m_rotationOffset.Z = PhysActor.Orientation.z;
534 m_rotationOffset.W = PhysActor.Orientation.w;
535 } 530 }
536 } 531 }
537 return m_rotationOffset; 532 return m_rotationOffset;
@@ -548,14 +543,14 @@ namespace OpenSim.Region.Environment.Scenes
548 // Root prim gets value directly 543 // Root prim gets value directly
549 if (_parentID == 0) 544 if (_parentID == 0)
550 { 545 {
551 PhysActor.Orientation = new Quaternion(value.W, value.X, value.Y, value.Z); 546 PhysActor.Orientation = value;
552 //m_log.Info("[PART]: RO1:" + PhysActor.Orientation.ToString()); 547 //m_log.Info("[PART]: RO1:" + PhysActor.Orientation.ToString());
553 } 548 }
554 else 549 else
555 { 550 {
556 // Child prim we have to calculate it's world rotationwel 551 // Child prim we have to calculate it's world rotationwel
557 LLQuaternion resultingrotation = GetWorldRotation(); 552 Quaternion resultingrotation = GetWorldRotation();
558 PhysActor.Orientation = new Quaternion(resultingrotation.W, resultingrotation.X, resultingrotation.Y, resultingrotation.Z); 553 PhysActor.Orientation = resultingrotation;
559 //m_log.Info("[PART]: RO2:" + PhysActor.Orientation.ToString()); 554 //m_log.Info("[PART]: RO2:" + PhysActor.Orientation.ToString());
560 } 555 }
561 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 556 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
@@ -571,12 +566,12 @@ namespace OpenSim.Region.Environment.Scenes
571 } 566 }
572 567
573 /// <summary></summary> 568 /// <summary></summary>
574 public LLVector3 Velocity 569 public Vector3 Velocity
575 { 570 {
576 get 571 get
577 { 572 {
578 //if (PhysActor.Velocity.x != 0 || PhysActor.Velocity.y != 0 573 //if (PhysActor.Velocity.X != 0 || PhysActor.Velocity.Y != 0
579 //|| PhysActor.Velocity.z != 0) 574 //|| PhysActor.Velocity.Z != 0)
580 //{ 575 //{
581 if (PhysActor != null) 576 if (PhysActor != null)
582 { 577 {
@@ -605,14 +600,14 @@ namespace OpenSim.Region.Environment.Scenes
605 } 600 }
606 } 601 }
607 602
608 public LLVector3 RotationalVelocity 603 public Vector3 RotationalVelocity
609 { 604 {
610 get { return AngularVelocity; } 605 get { return AngularVelocity; }
611 set { AngularVelocity = value; } 606 set { AngularVelocity = value; }
612 } 607 }
613 608
614 /// <summary></summary> 609 /// <summary></summary>
615 public LLVector3 AngularVelocity 610 public Vector3 AngularVelocity
616 { 611 {
617 get 612 get
618 { 613 {
@@ -626,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes
626 } 621 }
627 622
628 /// <summary></summary> 623 /// <summary></summary>
629 public LLVector3 Acceleration 624 public Vector3 Acceleration
630 { 625 {
631 get { return m_acceleration; } 626 get { return m_acceleration; }
632 set { m_acceleration = value; } 627 set { m_acceleration = value; }
@@ -718,7 +713,7 @@ namespace OpenSim.Region.Environment.Scenes
718 TriggerScriptChangedEvent(Changed.SHAPE); 713 TriggerScriptChangedEvent(Changed.SHAPE);
719 } 714 }
720 } 715 }
721 public LLVector3 Scale 716 public Vector3 Scale
722 { 717 {
723 get { return m_shape.Scale; } 718 get { return m_shape.Scale; }
724 set 719 set
@@ -754,7 +749,7 @@ namespace OpenSim.Region.Environment.Scenes
754 #region Public Properties with only Get 749 #region Public Properties with only Get
755 750
756 751
757 public LLVector3 AbsolutePosition 752 public Vector3 AbsolutePosition
758 { 753 {
759 get { 754 get {
760 if (IsAttachment) 755 if (IsAttachment)
@@ -763,12 +758,12 @@ namespace OpenSim.Region.Environment.Scenes
763 return m_offsetPosition + m_groupPosition; } 758 return m_offsetPosition + m_groupPosition; }
764 } 759 }
765 760
766 public LLUUID ObjectCreator 761 public UUID ObjectCreator
767 { 762 {
768 get { return _creatorID; } 763 get { return _creatorID; }
769 } 764 }
770 765
771 public LLUUID ObjectOwner 766 public UUID ObjectOwner
772 { 767 {
773 get { return _ownerID; } 768 get { return _ownerID; }
774 } 769 }
@@ -801,29 +796,27 @@ namespace OpenSim.Region.Environment.Scenes
801 796
802 // This sort of sucks, but I'm adding these in to make some of 797 // This sort of sucks, but I'm adding these in to make some of
803 // the mappings more consistant. 798 // the mappings more consistant.
804 public LLVector3 SitTargetPositionLL 799 public Vector3 SitTargetPositionLL
805 { 800 {
806 get { return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y,m_sitTargetPosition.z); } 801 get { return new Vector3(m_sitTargetPosition.X, m_sitTargetPosition.Y,m_sitTargetPosition.Z); }
807 set { m_sitTargetPosition = new Vector3(value.X, value.Y, value.Z); } 802 set { m_sitTargetPosition = value; }
808 } 803 }
809 804
810 public LLQuaternion SitTargetOrientationLL 805 public Quaternion SitTargetOrientationLL
811 { 806 {
812 get 807 get
813 { 808 {
814 return new LLQuaternion( 809 return new Quaternion(
815 m_sitTargetOrientation.x, 810 m_sitTargetOrientation.X,
816 m_sitTargetOrientation.y, 811 m_sitTargetOrientation.Y,
817 m_sitTargetOrientation.z, 812 m_sitTargetOrientation.Z,
818 m_sitTargetOrientation.w 813 m_sitTargetOrientation.W
819 ); 814 );
820 } 815 }
821 816
822 set { m_sitTargetOrientation = new Quaternion(value.W, value.X, value.Y, value.Z); } 817 set { m_sitTargetOrientation = new Quaternion(value.W, value.X, value.Y, value.Z); }
823 } 818 }
824 819
825
826
827 public bool Stopped 820 public bool Stopped
828 { 821 {
829 get { 822 get {
@@ -873,19 +866,19 @@ namespace OpenSim.Region.Environment.Scenes
873 set { _ownershipCost = value; } 866 set { _ownershipCost = value; }
874 } 867 }
875 868
876 public LLUUID GroupID 869 public UUID GroupID
877 { 870 {
878 get { return _groupID; } 871 get { return _groupID; }
879 set { _groupID = value; } 872 set { _groupID = value; }
880 } 873 }
881 874
882 public LLUUID OwnerID 875 public UUID OwnerID
883 { 876 {
884 get { return _ownerID; } 877 get { return _ownerID; }
885 set { _ownerID = value; } 878 set { _ownerID = value; }
886 } 879 }
887 880
888 public LLUUID LastOwnerID 881 public UUID LastOwnerID
889 { 882 {
890 get { return _lastOwnerID; } 883 get { return _lastOwnerID; }
891 set { _lastOwnerID = value; } 884 set { _lastOwnerID = value; }
@@ -921,34 +914,34 @@ namespace OpenSim.Region.Environment.Scenes
921 set { _nextOwnerMask = value; } 914 set { _nextOwnerMask = value; }
922 } 915 }
923 916
924 public libsecondlife.LLObject.ObjectFlags Flags 917 public PrimFlags Flags
925 { 918 {
926 get { return _flags; } 919 get { return _flags; }
927 set { _flags = value; } 920 set { _flags = value; }
928 } 921 }
929 922
930 public LLUUID SitTargetAvatar 923 public UUID SitTargetAvatar
931 { 924 {
932 get { return m_sitTargetAvatar; } 925 get { return m_sitTargetAvatar; }
933 set { m_sitTargetAvatar = value; } 926 set { m_sitTargetAvatar = value; }
934 } 927 }
935 928
936 [XmlIgnore] 929 [XmlIgnore]
937 public virtual LLUUID RegionID 930 public virtual UUID RegionID
938 { 931 {
939 get 932 get
940 { 933 {
941 if (ParentGroup != null && ParentGroup.Scene != null) 934 if (ParentGroup != null && ParentGroup.Scene != null)
942 return ParentGroup.Scene.RegionInfo.RegionID; 935 return ParentGroup.Scene.RegionInfo.RegionID;
943 else 936 else
944 return LLUUID.Zero; 937 return UUID.Zero;
945 } 938 }
946 set {} // read only 939 set {} // read only
947 } 940 }
948 941
949 private LLUUID _parentUUID = LLUUID.Zero; 942 private UUID _parentUUID = UUID.Zero;
950 [XmlIgnore] 943 [XmlIgnore]
951 public LLUUID ParentUUID 944 public UUID ParentUUID
952 { 945 {
953 get 946 get
954 { 947 {
@@ -985,7 +978,7 @@ namespace OpenSim.Region.Environment.Scenes
985 m_updateFlag = 0; 978 m_updateFlag = 0;
986 } 979 }
987 980
988 private void SendObjectPropertiesToClient(LLUUID AgentID) 981 private void SendObjectPropertiesToClient(UUID AgentID)
989 { 982 {
990 List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences(); 983 List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
991 for (int i = 0; i < avatars.Count; i++) 984 for (int i = 0; i < avatars.Count; i++)
@@ -1027,13 +1020,13 @@ namespace OpenSim.Region.Environment.Scenes
1027 1020
1028 #region Public Methods 1021 #region Public Methods
1029 1022
1030 public void AddFlag(LLObject.ObjectFlags flag) 1023 public void AddFlag(PrimFlags flag)
1031 { 1024 {
1032 // LLObject.ObjectFlags prevflag = Flags; 1025 // PrimFlags prevflag = Flags;
1033 //uint objflags = Flags; 1026 //uint objflags = Flags;
1034 if ((ObjectFlags & (uint) flag) == 0) 1027 if ((ObjectFlags & (uint) flag) == 0)
1035 { 1028 {
1036 //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString()); 1029 //Console.WriteLine("Adding flag: " + ((PrimFlags) flag).ToString());
1037 _flags |= flag; 1030 _flags |= flag;
1038 } 1031 }
1039 //uint currflag = (uint)Flags; 1032 //uint currflag = (uint)Flags;
@@ -1091,7 +1084,7 @@ namespace OpenSim.Region.Environment.Scenes
1091 // The flags don't like conversion from uint to byte, so we have to do 1084 // The flags don't like conversion from uint to byte, so we have to do
1092 // it the crappy way. See the above function :( 1085 // it the crappy way. See the above function :(
1093 1086
1094 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++; 1087 data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++;
1095 data[pos] = (byte)pTexAnim.Face; pos++; 1088 data[pos] = (byte)pTexAnim.Face; pos++;
1096 data[pos] = (byte)pTexAnim.SizeX; pos++; 1089 data[pos] = (byte)pTexAnim.SizeX; pos++;
1097 data[pos] = (byte)pTexAnim.SizeY; pos++; 1090 data[pos] = (byte)pTexAnim.SizeY; pos++;
@@ -1124,19 +1117,17 @@ namespace OpenSim.Region.Environment.Scenes
1124 /// </summary> 1117 /// </summary>
1125 /// <param name="impulsei">Vector force</param> 1118 /// <param name="impulsei">Vector force</param>
1126 /// <param name="localGlobalTF">true for the local frame, false for the global frame</param> 1119 /// <param name="localGlobalTF">true for the local frame, false for the global frame</param>
1127 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF) 1120 public void ApplyImpulse(Vector3 impulsei, bool localGlobalTF)
1128 { 1121 {
1129 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); 1122 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z);
1130 1123
1131 if (localGlobalTF) 1124 if (localGlobalTF)
1132 { 1125 {
1133 1126 Quaternion grot = GetWorldRotation();
1134 LLQuaternion grot = GetWorldRotation(); 1127 Quaternion AXgrot = grot;
1135 Quaternion AXgrot = new Quaternion(grot.W,grot.X,grot.Y,grot.Z); 1128 Vector3 AXimpulsei = impulsei;
1136 Vector3 AXimpulsei = new Vector3(impulsei.X, impulsei.Y, impulsei.Z); 1129 Vector3 newimpulse = AXimpulsei * AXgrot;
1137 Vector3 newimpulse = AXgrot * AXimpulsei; 1130 impulse = new PhysicsVector(newimpulse.X, newimpulse.Y, newimpulse.Z);
1138 impulse = new PhysicsVector(newimpulse.x, newimpulse.y, newimpulse.z);
1139
1140 } 1131 }
1141 else 1132 else
1142 { 1133 {
@@ -1155,8 +1146,8 @@ namespace OpenSim.Region.Environment.Scenes
1155 /// <param name="m_physicalPrim"></param> 1146 /// <param name="m_physicalPrim"></param>
1156 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) 1147 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim)
1157 { 1148 {
1158 bool isPhysical = (((rootObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0) && m_physicalPrim); 1149 bool isPhysical = (((rootObjectFlags & (uint) PrimFlags.Physics) != 0) && m_physicalPrim);
1159 bool isPhantom = ((rootObjectFlags & (uint) LLObject.ObjectFlags.Phantom) != 0); 1150 bool isPhantom = ((rootObjectFlags & (uint) PrimFlags.Phantom) != 0);
1160 1151
1161 // Added clarification.. since A rigid body is an object that you can kick around, etc. 1152 // Added clarification.. since A rigid body is an object that you can kick around, etc.
1162 bool RigidBody = isPhysical && !isPhantom; 1153 bool RigidBody = isPhysical && !isPhantom;
@@ -1167,11 +1158,10 @@ namespace OpenSim.Region.Environment.Scenes
1167 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( 1158 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
1168 Name, 1159 Name,
1169 Shape, 1160 Shape,
1170 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 1161 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z),
1171 AbsolutePosition.Z),
1172 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 1162 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
1173 new Quaternion(RotationOffset.W, RotationOffset.X, 1163 RotationOffset,
1174 RotationOffset.Y, RotationOffset.Z), RigidBody); 1164 RigidBody);
1175 1165
1176 // Basic Physics returns null.. joy joy joy. 1166 // Basic Physics returns null.. joy joy joy.
1177 if (PhysActor != null) 1167 if (PhysActor != null)
@@ -1208,24 +1198,23 @@ namespace OpenSim.Region.Environment.Scenes
1208 /// Duplicates this part. 1198 /// Duplicates this part.
1209 /// </summary> 1199 /// </summary>
1210 /// <returns></returns> 1200 /// <returns></returns>
1211 public SceneObjectPart Copy(uint localID, LLUUID AgentID, LLUUID GroupID, int linkNum, bool userExposed) 1201 public SceneObjectPart Copy(uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed)
1212 { 1202 {
1213 SceneObjectPart dupe = (SceneObjectPart) MemberwiseClone(); 1203 SceneObjectPart dupe = (SceneObjectPart) MemberwiseClone();
1214 dupe.m_shape = m_shape.Copy(); 1204 dupe.m_shape = m_shape.Copy();
1215 dupe.m_regionHandle = m_regionHandle; 1205 dupe.m_regionHandle = m_regionHandle;
1216 if (userExposed) 1206 if (userExposed)
1217 dupe.UUID = LLUUID.Random(); 1207 dupe.UUID = UUID.Random();
1218 1208
1219 dupe.LocalId = localID; 1209 dupe.LocalId = localID;
1220 dupe._ownerID = AgentID; 1210 dupe._ownerID = AgentID;
1221 dupe._groupID = GroupID; 1211 dupe._groupID = GroupID;
1222 dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z); 1212 dupe.GroupPosition = GroupPosition;
1223 dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z); 1213 dupe.OffsetPosition = OffsetPosition;
1224 dupe.RotationOffset = 1214 dupe.RotationOffset = RotationOffset;
1225 new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W); 1215 dupe.Velocity = Vector3.Zero;
1226 dupe.Velocity = new LLVector3(0, 0, 0); 1216 dupe.Acceleration = Vector3.Zero;
1227 dupe.Acceleration = new LLVector3(0, 0, 0); 1217 dupe.AngularVelocity = Vector3.Zero;
1228 dupe.AngularVelocity = new LLVector3(0, 0, 0);
1229 dupe.ObjectFlags = ObjectFlags; 1218 dupe.ObjectFlags = ObjectFlags;
1230 1219
1231 dupe._ownershipCost = _ownershipCost; 1220 dupe._ownershipCost = _ownershipCost;
@@ -1247,11 +1236,11 @@ namespace OpenSim.Region.Environment.Scenes
1247 1236
1248 if (userExposed) 1237 if (userExposed)
1249 { 1238 {
1250 if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != LLUUID.Zero) 1239 if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero)
1251 { 1240 {
1252 m_parentGroup.Scene.AssetCache.GetAsset(dupe.m_shape.SculptTexture, dupe.SculptTextureCallback, true); 1241 m_parentGroup.Scene.AssetCache.GetAsset(dupe.m_shape.SculptTexture, dupe.SculptTextureCallback, true);
1253 } 1242 }
1254 bool UsePhysics = ((dupe.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); 1243 bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0);
1255 dupe.DoPhysicsPropertyUpdate(UsePhysics, true); 1244 dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
1256 } 1245 }
1257 return dupe; 1246 return dupe;
@@ -1260,13 +1249,13 @@ namespace OpenSim.Region.Environment.Scenes
1260 public static SceneObjectPart Create() 1249 public static SceneObjectPart Create()
1261 { 1250 {
1262 SceneObjectPart part = new SceneObjectPart(); 1251 SceneObjectPart part = new SceneObjectPart();
1263 part.UUID = LLUUID.Random(); 1252 part.UUID = UUID.Random();
1264 1253
1265 PrimitiveBaseShape shape = PrimitiveBaseShape.Create(); 1254 PrimitiveBaseShape shape = PrimitiveBaseShape.Create();
1266 part.Shape = shape; 1255 part.Shape = shape;
1267 1256
1268 part.Name = "Primitive"; 1257 part.Name = "Primitive";
1269 part._ownerID = LLUUID.Random(); 1258 part._ownerID = UUID.Random();
1270 1259
1271 return part; 1260 return part;
1272 } 1261 }
@@ -1295,16 +1284,8 @@ namespace OpenSim.Region.Environment.Scenes
1295 /// that's not wholesome. Had to make Scene public 1284 /// that's not wholesome. Had to make Scene public
1296 //PhysActor = null; 1285 //PhysActor = null;
1297 1286
1298 if ((ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 1287 if ((ObjectFlags & (uint) PrimFlags.Phantom) == 0)
1299 { 1288 {
1300 //PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
1301 //Name,
1302 //Shape,
1303 //new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
1304 //AbsolutePosition.Z),
1305 //new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
1306 //new Quaternion(RotationOffset.W, RotationOffset.X,
1307 //RotationOffset.Y, RotationOffset.Z), UsePhysics);
1308 if (UsePhysics) 1289 if (UsePhysics)
1309 { 1290 {
1310 ParentGroup.Scene.AddPhysicalPrim(1); 1291 ParentGroup.Scene.AddPhysicalPrim(1);
@@ -1339,7 +1320,7 @@ namespace OpenSim.Region.Environment.Scenes
1339 return newobject; 1320 return newobject;
1340 } 1321 }
1341 1322
1342 public LLUUID GetAvatarOnSitTarget() 1323 public UUID GetAvatarOnSitTarget()
1343 { 1324 {
1344 return m_sitTargetAvatar; 1325 return m_sitTargetAvatar;
1345 } 1326 }
@@ -1356,30 +1337,30 @@ namespace OpenSim.Region.Environment.Scenes
1356 1337
1357 public double GetDistanceTo(Vector3 a, Vector3 b) 1338 public double GetDistanceTo(Vector3 a, Vector3 b)
1358 { 1339 {
1359 float dx = a.x - b.x; 1340 float dx = a.X - b.X;
1360 float dy = a.y - b.y; 1341 float dy = a.Y - b.Y;
1361 float dz = a.z - b.z; 1342 float dz = a.Z - b.Z;
1362 return Math.Sqrt(dx * dx + dy * dy + dz * dz); 1343 return Math.Sqrt(dx * dx + dy * dy + dz * dz);
1363 } 1344 }
1364 1345
1365 public uint GetEffectiveObjectFlags() 1346 public uint GetEffectiveObjectFlags()
1366 { 1347 {
1367 LLObject.ObjectFlags f = _flags; 1348 PrimFlags f = _flags;
1368 if (m_parentGroup == null || m_parentGroup.RootPart == this) 1349 if (m_parentGroup == null || m_parentGroup.RootPart == this)
1369 f &= ~(LLObject.ObjectFlags.Touch | LLObject.ObjectFlags.Money); 1350 f &= ~(PrimFlags.Touch | PrimFlags.Money);
1370 1351
1371 return (uint)_flags | (uint)LocalFlags; 1352 return (uint)_flags | (uint)LocalFlags;
1372 } 1353 }
1373 1354
1374 public LLVector3 GetGeometricCenter() 1355 public Vector3 GetGeometricCenter()
1375 { 1356 {
1376 if (PhysActor != null) 1357 if (PhysActor != null)
1377 { 1358 {
1378 return new LLVector3(PhysActor.CenterOfMass.X, PhysActor.CenterOfMass.Y, PhysActor.CenterOfMass.Z); 1359 return new Vector3(PhysActor.CenterOfMass.X, PhysActor.CenterOfMass.Y, PhysActor.CenterOfMass.Z);
1379 } 1360 }
1380 else 1361 else
1381 { 1362 {
1382 return new LLVector3(0, 0, 0); 1363 return new Vector3(0, 0, 0);
1383 } 1364 }
1384 } 1365 }
1385 1366
@@ -1419,16 +1400,16 @@ namespace OpenSim.Region.Environment.Scenes
1419 1400
1420 Dictionary<Guid, TaskInventoryItem> TaskInventory_work = new Dictionary<Guid, TaskInventoryItem>(); 1401 Dictionary<Guid, TaskInventoryItem> TaskInventory_work = new Dictionary<Guid, TaskInventoryItem>();
1421 1402
1422 foreach (LLUUID id in TaskInventory.Keys) 1403 foreach (UUID id in TaskInventory.Keys)
1423 { 1404 {
1424 TaskInventory_work.Add(id.UUID, TaskInventory[id]); 1405 TaskInventory_work.Add(id.Guid, TaskInventory[id]);
1425 } 1406 }
1426 1407
1427 info.AddValue("TaskInventory", TaskInventory_work); 1408 info.AddValue("TaskInventory", TaskInventory_work);
1428 1409
1429 info.AddValue("LastOwnerID", _lastOwnerID.UUID); 1410 info.AddValue("LastOwnerID", _lastOwnerID.Guid);
1430 info.AddValue("OwnerID", _ownerID.UUID); 1411 info.AddValue("OwnerID", _ownerID.Guid);
1431 info.AddValue("GroupID", _groupID.UUID); 1412 info.AddValue("GroupID", _groupID.Guid);
1432 1413
1433 info.AddValue("OwnershipCost", _ownershipCost); 1414 info.AddValue("OwnershipCost", _ownershipCost);
1434 info.AddValue("ObjectSaleType", _objectSaleType); 1415 info.AddValue("ObjectSaleType", _objectSaleType);
@@ -1451,10 +1432,10 @@ namespace OpenSim.Region.Environment.Scenes
1451 info.AddValue("TimeStampLastActivity", TimeStampLastActivity); 1432 info.AddValue("TimeStampLastActivity", TimeStampLastActivity);
1452 1433
1453 info.AddValue("m_updateFlag", m_updateFlag); 1434 info.AddValue("m_updateFlag", m_updateFlag);
1454 info.AddValue("CreatorID", _creatorID.UUID); 1435 info.AddValue("CreatorID", _creatorID.Guid);
1455 1436
1456 info.AddValue("m_inventorySerial", m_inventorySerial); 1437 info.AddValue("m_inventorySerial", m_inventorySerial);
1457 info.AddValue("m_uuid", m_uuid.UUID); 1438 info.AddValue("m_uuid", m_uuid.Guid);
1458 info.AddValue("m_localID", m_localId); 1439 info.AddValue("m_localID", m_localId);
1459 info.AddValue("m_name", m_name); 1440 info.AddValue("m_name", m_name);
1460 info.AddValue("m_flags", _flags); 1441 info.AddValue("m_flags", _flags);
@@ -1503,7 +1484,7 @@ namespace OpenSim.Region.Environment.Scenes
1503 1484
1504 public void GetProperties(IClientAPI client) 1485 public void GetProperties(IClientAPI client)
1505 { 1486 {
1506 client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)_creationDate, _creatorID, LLUUID.Zero, LLUUID.Zero, 1487 client.SendObjectPropertiesReply(UUID.Zero, (ulong)_creationDate, _creatorID, UUID.Zero, UUID.Zero,
1507 _groupID, (short)InventorySerial, _lastOwnerID, UUID, _ownerID, 1488 _groupID, (short)InventorySerial, _lastOwnerID, UUID, _ownerID,
1508 ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description, 1489 ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description,
1509 ParentGroup.RootPart._ownerMask, ParentGroup.RootPart._nextOwnerMask, ParentGroup.RootPart._groupMask, ParentGroup.RootPart._everyoneMask, 1490 ParentGroup.RootPart._ownerMask, ParentGroup.RootPart._nextOwnerMask, ParentGroup.RootPart._groupMask, ParentGroup.RootPart._everyoneMask,
@@ -1512,13 +1493,13 @@ namespace OpenSim.Region.Environment.Scenes
1512 ParentGroup.RootPart.SalePrice); 1493 ParentGroup.RootPart.SalePrice);
1513 } 1494 }
1514 1495
1515 public LLUUID GetRootPartUUID() 1496 public UUID GetRootPartUUID()
1516 { 1497 {
1517 if (m_parentGroup != null) 1498 if (m_parentGroup != null)
1518 { 1499 {
1519 return m_parentGroup.UUID; 1500 return m_parentGroup.UUID;
1520 } 1501 }
1521 return LLUUID.Zero; 1502 return UUID.Zero;
1522 } 1503 }
1523 1504
1524 /// <summary> 1505 /// <summary>
@@ -1526,63 +1507,40 @@ namespace OpenSim.Region.Environment.Scenes
1526 /// Remember, the Group Position simply gives the position of the group itself 1507 /// Remember, the Group Position simply gives the position of the group itself
1527 /// </summary> 1508 /// </summary>
1528 /// <returns>A Linked Child Prim objects position in world</returns> 1509 /// <returns>A Linked Child Prim objects position in world</returns>
1529 public LLVector3 GetWorldPosition() 1510 public Vector3 GetWorldPosition()
1530 { 1511 {
1531 Quaternion parentRot = new Quaternion( 1512 Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
1532 ParentGroup.RootPart.RotationOffset.W, 1513
1533 ParentGroup.RootPart.RotationOffset.X, 1514 Vector3 axPos = OffsetPosition;
1534 ParentGroup.RootPart.RotationOffset.Y,
1535 ParentGroup.RootPart.RotationOffset.Z);
1536
1537 Vector3 axPos
1538 = new Vector3(
1539 OffsetPosition.X,
1540 OffsetPosition.Y,
1541 OffsetPosition.Z);
1542
1543 axPos = parentRot * axPos;
1544 LLVector3 translationOffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
1545 return GroupPosition + translationOffsetPosition;
1546 1515
1547 //return (new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z) + AbsolutePosition); 1516 axPos *= parentRot;
1517 Vector3 translationOffsetPosition = axPos;
1518 return GroupPosition + translationOffsetPosition;
1548 } 1519 }
1549 1520
1550 /// <summary> 1521 /// <summary>
1551 /// Gets the rotation of this prim offset by the group rotation 1522 /// Gets the rotation of this prim offset by the group rotation
1552 /// </summary> 1523 /// </summary>
1553 /// <returns></returns> 1524 /// <returns></returns>
1554 public LLQuaternion GetWorldRotation() 1525 public Quaternion GetWorldRotation()
1555 { 1526 {
1556 Quaternion newRot; 1527 Quaternion newRot;
1557 1528
1558 if (this.LinkNum == 0) 1529 if (this.LinkNum == 0)
1559 { 1530 {
1560 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z); 1531 newRot = RotationOffset;
1561
1562 } 1532 }
1563 else 1533 else
1564 { 1534 {
1565 Quaternion parentRot = new Quaternion( 1535 Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
1566 ParentGroup.RootPart.RotationOffset.W, 1536 Quaternion oldRot = RotationOffset;
1567 ParentGroup.RootPart.RotationOffset.X,
1568 ParentGroup.RootPart.RotationOffset.Y,
1569 ParentGroup.RootPart.RotationOffset.Z);
1570
1571 Quaternion oldRot
1572 = new Quaternion(
1573 RotationOffset.W,
1574 RotationOffset.X,
1575 RotationOffset.Y,
1576 RotationOffset.Z);
1577
1578 newRot = parentRot * oldRot; 1537 newRot = parentRot * oldRot;
1579 } 1538 }
1580 return new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
1581 1539
1582 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); 1540 return newRot;
1583 } 1541 }
1584 1542
1585 public void MoveToTarget(LLVector3 target, float tau) 1543 public void MoveToTarget(Vector3 target, float tau)
1586 { 1544 {
1587 if (tau > 0) 1545 if (tau > 0)
1588 { 1546 {
@@ -1594,7 +1552,7 @@ namespace OpenSim.Region.Environment.Scenes
1594 } 1552 }
1595 } 1553 }
1596 1554
1597 public virtual void OnGrab(LLVector3 offsetPos, IClientAPI remoteClient) 1555 public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient)
1598 { 1556 {
1599 } 1557 }
1600 1558
@@ -1694,7 +1652,7 @@ namespace OpenSim.Region.Environment.Scenes
1694 detobj.nameStr = av.ControllingClient.Name; 1652 detobj.nameStr = av.ControllingClient.Name;
1695 detobj.ownerUUID = av.UUID; 1653 detobj.ownerUUID = av.UUID;
1696 detobj.posVector = av.AbsolutePosition; 1654 detobj.posVector = av.AbsolutePosition;
1697 detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); 1655 detobj.rotQuat = av.Rotation;
1698 detobj.velVector = av.Velocity; 1656 detobj.velVector = av.Velocity;
1699 detobj.colliderType = 0; 1657 detobj.colliderType = 0;
1700 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 1658 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
@@ -1760,7 +1718,7 @@ namespace OpenSim.Region.Environment.Scenes
1760 detobj.nameStr = av.Name; 1718 detobj.nameStr = av.Name;
1761 detobj.ownerUUID = av.UUID; 1719 detobj.ownerUUID = av.UUID;
1762 detobj.posVector = av.AbsolutePosition; 1720 detobj.posVector = av.AbsolutePosition;
1763 detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); 1721 detobj.rotQuat = av.Rotation;
1764 detobj.velVector = av.Velocity; 1722 detobj.velVector = av.Velocity;
1765 detobj.colliderType = 0; 1723 detobj.colliderType = 0;
1766 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 1724 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
@@ -1828,7 +1786,7 @@ namespace OpenSim.Region.Environment.Scenes
1828 detobj.nameStr = av.Name; 1786 detobj.nameStr = av.Name;
1829 detobj.ownerUUID = av.UUID; 1787 detobj.ownerUUID = av.UUID;
1830 detobj.posVector = av.AbsolutePosition; 1788 detobj.posVector = av.AbsolutePosition;
1831 detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); 1789 detobj.rotQuat = av.Rotation;
1832 detobj.velVector = av.Velocity; 1790 detobj.velVector = av.Velocity;
1833 detobj.colliderType = 0; 1791 detobj.colliderType = 0;
1834 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 1792 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
@@ -1857,7 +1815,7 @@ namespace OpenSim.Region.Environment.Scenes
1857 public void PhysicsOutOfBounds(PhysicsVector pos) 1815 public void PhysicsOutOfBounds(PhysicsVector pos)
1858 { 1816 {
1859 m_log.Info("[PHYSICS]: Physical Object went out of bounds."); 1817 m_log.Info("[PHYSICS]: Physical Object went out of bounds.");
1860 RemFlag(LLObject.ObjectFlags.Physics); 1818 RemFlag(PrimFlags.Physics);
1861 DoPhysicsPropertyUpdate(false, true); 1819 DoPhysicsPropertyUpdate(false, true);
1862 //m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 1820 //m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
1863 } 1821 }
@@ -1866,7 +1824,7 @@ namespace OpenSim.Region.Environment.Scenes
1866 { 1824 {
1867 if (PhysActor != null) 1825 if (PhysActor != null)
1868 { 1826 {
1869 LLVector3 newpos = new LLVector3(PhysActor.Position.GetBytes(), 0); 1827 Vector3 newpos = new Vector3(PhysActor.Position.GetBytes(), 0);
1870 if (newpos.X > 257f || newpos.X < -1f || newpos.Y > 257f || newpos.Y < -1f) 1828 if (newpos.X > 257f || newpos.X < -1f || newpos.Y > 257f || newpos.Y < -1f)
1871 { 1829 {
1872 m_parentGroup.AbsolutePosition = newpos; 1830 m_parentGroup.AbsolutePosition = newpos;
@@ -1880,16 +1838,16 @@ namespace OpenSim.Region.Environment.Scenes
1880 1838
1881 public void PreloadSound(string sound) 1839 public void PreloadSound(string sound)
1882 { 1840 {
1883 // LLUUID ownerID = OwnerID; 1841 // UUID ownerID = OwnerID;
1884 LLUUID objectID = UUID; 1842 UUID objectID = UUID;
1885 LLUUID soundID = LLUUID.Zero; 1843 UUID soundID = UUID.Zero;
1886 1844
1887 if (!LLUUID.TryParse(sound, out soundID)) 1845 if (!UUID.TryParse(sound, out soundID))
1888 { 1846 {
1889 //Trys to fetch sound id from prim's inventory. 1847 //Trys to fetch sound id from prim's inventory.
1890 //Prim's inventory doesn't support non script items yet 1848 //Prim's inventory doesn't support non script items yet
1891 SceneObjectPart op = this; 1849 SceneObjectPart op = this;
1892 foreach (KeyValuePair<LLUUID, TaskInventoryItem> item in op.TaskInventory) 1850 foreach (KeyValuePair<UUID, TaskInventoryItem> item in op.TaskInventory)
1893 { 1851 {
1894 if (item.Value.Name == sound) 1852 if (item.Value.Name == sound)
1895 { 1853 {
@@ -1908,19 +1866,19 @@ namespace OpenSim.Region.Environment.Scenes
1908 } 1866 }
1909 } 1867 }
1910 1868
1911 public void RemFlag(LLObject.ObjectFlags flag) 1869 public void RemFlag(PrimFlags flag)
1912 { 1870 {
1913 // LLObject.ObjectFlags prevflag = Flags; 1871 // PrimFlags prevflag = Flags;
1914 if ((ObjectFlags & (uint) flag) != 0) 1872 if ((ObjectFlags & (uint) flag) != 0)
1915 { 1873 {
1916 //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString()); 1874 //Console.WriteLine("Removing flag: " + ((PrimFlags)flag).ToString());
1917 _flags &= ~flag; 1875 _flags &= ~flag;
1918 } 1876 }
1919 //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); 1877 //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + Flags.ToString());
1920 //ScheduleFullUpdate(); 1878 //ScheduleFullUpdate();
1921 } 1879 }
1922 1880
1923 public void RemoveScriptEvents(LLUUID scriptid) 1881 public void RemoveScriptEvents(UUID scriptid)
1924 { 1882 {
1925 lock (m_scriptEvents) 1883 lock (m_scriptEvents)
1926 { 1884 {
@@ -1938,13 +1896,13 @@ namespace OpenSim.Region.Environment.Scenes
1938 } 1896 }
1939 1897
1940 /// <summary> 1898 /// <summary>
1941 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and 1899 /// Reset UUIDs for this part. This involves generate this part's own UUID and
1942 /// generating new LLUUIDs for all the items in the inventory. 1900 /// generating new UUIDs for all the items in the inventory.
1943 /// </summary> 1901 /// </summary>
1944 /// <param name="linkNum">Link number for the part</param> 1902 /// <param name="linkNum">Link number for the part</param>
1945 public void ResetIDs(int linkNum) 1903 public void ResetIDs(int linkNum)
1946 { 1904 {
1947 UUID = LLUUID.Random(); 1905 UUID = UUID.Random();
1948 LinkNum = linkNum; 1906 LinkNum = linkNum;
1949 1907
1950 ResetInventoryIDs(); 1908 ResetInventoryIDs();
@@ -1954,7 +1912,7 @@ namespace OpenSim.Region.Environment.Scenes
1954 /// Resize this part. 1912 /// Resize this part.
1955 /// </summary> 1913 /// </summary>
1956 /// <param name="scale"></param> 1914 /// <param name="scale"></param>
1957 public void Resize(LLVector3 scale) 1915 public void Resize(Vector3 scale)
1958 { 1916 {
1959 StoreUndoState(); 1917 StoreUndoState();
1960 m_shape.Scale = scale; 1918 m_shape.Scale = scale;
@@ -2032,7 +1990,7 @@ namespace OpenSim.Region.Environment.Scenes
2032 m_parentGroup.ScriptSetPhysicsStatus(UsePhysics); 1990 m_parentGroup.ScriptSetPhysicsStatus(UsePhysics);
2033 } 1991 }
2034 1992
2035 public void SculptTextureCallback(LLUUID textureID, AssetBase texture) 1993 public void SculptTextureCallback(UUID textureID, AssetBase texture)
2036 { 1994 {
2037 if (m_shape.SculptEntry) 1995 if (m_shape.SculptEntry)
2038 { 1996 {
@@ -2073,7 +2031,7 @@ namespace OpenSim.Region.Environment.Scenes
2073 } 2031 }
2074 } 2032 }
2075 2033
2076 public void SendFullUpdateToAllClientsExcept(LLUUID agentID) 2034 public void SendFullUpdateToAllClientsExcept(UUID agentID)
2077 { 2035 {
2078 List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences(); 2036 List<ScenePresence> avatars = m_parentGroup.Scene.GetScenePresences();
2079 for (int i = 0; i < avatars.Count; i++) 2037 for (int i = 0; i < avatars.Count; i++)
@@ -2094,7 +2052,7 @@ namespace OpenSim.Region.Environment.Scenes
2094 /// <param name="clientFlags"></param> 2052 /// <param name="clientFlags"></param>
2095 public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags) 2053 public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags)
2096 { 2054 {
2097 LLVector3 lPos; 2055 Vector3 lPos;
2098 lPos = OffsetPosition; 2056 lPos = OffsetPosition;
2099 SendFullUpdateToClient(remoteClient, lPos, clientflags); 2057 SendFullUpdateToClient(remoteClient, lPos, clientflags);
2100 } 2058 }
@@ -2105,16 +2063,16 @@ namespace OpenSim.Region.Environment.Scenes
2105 /// <param name="remoteClient"></param> 2063 /// <param name="remoteClient"></param>
2106 /// <param name="lPos"></param> 2064 /// <param name="lPos"></param>
2107 /// <param name="clientFlags"></param> 2065 /// <param name="clientFlags"></param>
2108 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags) 2066 public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags)
2109 { 2067 {
2110 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected; 2068 clientFlags &= ~(uint) PrimFlags.CreateSelected;
2111 2069
2112 if (remoteClient.AgentId == _ownerID) 2070 if (remoteClient.AgentId == _ownerID)
2113 { 2071 {
2114 if ((uint) (_flags & LLObject.ObjectFlags.CreateSelected) != 0) 2072 if ((uint) (_flags & PrimFlags.CreateSelected) != 0)
2115 { 2073 {
2116 clientFlags |= (uint) LLObject.ObjectFlags.CreateSelected; 2074 clientFlags |= (uint) PrimFlags.CreateSelected;
2117 _flags &= ~LLObject.ObjectFlags.CreateSelected; 2075 _flags &= ~PrimFlags.CreateSelected;
2118 } 2076 }
2119 } 2077 }
2120 //bool isattachment = IsAttachment; 2078 //bool isattachment = IsAttachment;
@@ -2140,7 +2098,7 @@ namespace OpenSim.Region.Environment.Scenes
2140 2098
2141 // This causes the Scene to 'poll' physical objects every couple of frames 2099 // This causes the Scene to 'poll' physical objects every couple of frames
2142 // bad, so it's been replaced by an event driven method. 2100 // bad, so it's been replaced by an event driven method.
2143 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0) 2101 //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0)
2144 //{ 2102 //{
2145 // Only send the constant terse updates on physical objects! 2103 // Only send the constant terse updates on physical objects!
2146 //ScheduleTerseUpdate(); 2104 //ScheduleTerseUpdate();
@@ -2163,20 +2121,20 @@ namespace OpenSim.Region.Environment.Scenes
2163 if (volume < 0) 2121 if (volume < 0)
2164 volume = 0; 2122 volume = 0;
2165 2123
2166 LLUUID ownerID = _ownerID; 2124 UUID ownerID = _ownerID;
2167 LLUUID objectID = UUID; 2125 UUID objectID = UUID;
2168 LLUUID parentID = GetRootPartUUID(); 2126 UUID parentID = GetRootPartUUID();
2169 LLUUID soundID = LLUUID.Zero; 2127 UUID soundID = UUID.Zero;
2170 LLVector3 position = AbsolutePosition; // region local 2128 Vector3 position = AbsolutePosition; // region local
2171 ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; 2129 ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle;
2172 2130
2173 //byte flags = 0; 2131 //byte flags = 0;
2174 2132
2175 if (!LLUUID.TryParse(sound, out soundID)) 2133 if (!UUID.TryParse(sound, out soundID))
2176 { 2134 {
2177 // search sound file from inventory 2135 // search sound file from inventory
2178 SceneObjectPart op = this; 2136 SceneObjectPart op = this;
2179 foreach (KeyValuePair<LLUUID, TaskInventoryItem> item in op.TaskInventory) 2137 foreach (KeyValuePair<UUID, TaskInventoryItem> item in op.TaskInventory)
2180 { 2138 {
2181 if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) 2139 if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
2182 { 2140 {
@@ -2186,7 +2144,7 @@ namespace OpenSim.Region.Environment.Scenes
2186 } 2144 }
2187 } 2145 }
2188 2146
2189 if (soundID == LLUUID.Zero) 2147 if (soundID == UUID.Zero)
2190 return; 2148 return;
2191 2149
2192 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); 2150 List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
@@ -2233,11 +2191,11 @@ namespace OpenSim.Region.Environment.Scenes
2233 2191
2234 public void SendTerseUpdateToClient(IClientAPI remoteClient) 2192 public void SendTerseUpdateToClient(IClientAPI remoteClient)
2235 { 2193 {
2236 LLVector3 lPos; 2194 Vector3 lPos;
2237 lPos = OffsetPosition; 2195 lPos = OffsetPosition;
2238 LLQuaternion mRot = RotationOffset; 2196 Quaternion mRot = RotationOffset;
2239 // TODO: I have no idea why we are making this check. This should be sorted out 2197 // TODO: I have no idea why we are making this check. This should be sorted out
2240 if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0) 2198 if ((ObjectFlags & (uint) PrimFlags.Physics) == 0)
2241 { 2199 {
2242 remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, RotationalVelocity, Shape.State, FromAssetID); 2200 remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, RotationalVelocity, Shape.State, FromAssetID);
2243 } 2201 }
@@ -2249,9 +2207,9 @@ namespace OpenSim.Region.Environment.Scenes
2249 } 2207 }
2250 } 2208 }
2251 2209
2252 public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) 2210 public void SendTerseUpdateToClient(IClientAPI remoteClient, Vector3 lPos)
2253 { 2211 {
2254 LLQuaternion mRot = RotationOffset; 2212 Quaternion mRot = RotationOffset;
2255 //bool isattachment = IsAttachment; 2213 //bool isattachment = IsAttachment;
2256 //if (LocalId != ParentGroup.RootPart.LocalId) 2214 //if (LocalId != ParentGroup.RootPart.LocalId)
2257 //isattachment = ParentGroup.RootPart.IsAttachment; 2215 //isattachment = ParentGroup.RootPart.IsAttachment;
@@ -2263,7 +2221,7 @@ namespace OpenSim.Region.Environment.Scenes
2263 } 2221 }
2264 else 2222 else
2265 { 2223 {
2266 if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == 0) 2224 if ((ObjectFlags & (uint)PrimFlags.Physics) == 0)
2267 { 2225 {
2268 remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, RotationalVelocity, Shape.State, FromAssetID); 2226 remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity, RotationalVelocity, Shape.State, FromAssetID);
2269 } 2227 }
@@ -2296,7 +2254,7 @@ namespace OpenSim.Region.Environment.Scenes
2296 //} 2254 //}
2297 } 2255 }
2298 2256
2299 public void SetAvatarOnSitTarget(LLUUID avatarID) 2257 public void SetAvatarOnSitTarget(UUID avatarID)
2300 { 2258 {
2301 m_sitTargetAvatar = avatarID; 2259 m_sitTargetAvatar = avatarID;
2302 if (ParentGroup != null) 2260 if (ParentGroup != null)
@@ -2352,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes
2352 } 2310 }
2353 } 2311 }
2354 2312
2355 public void SetGroup(LLUUID groupID, IClientAPI client) 2313 public void SetGroup(UUID groupID, IClientAPI client)
2356 { 2314 {
2357 _groupID = groupID; 2315 _groupID = groupID;
2358 GetProperties(client); 2316 GetProperties(client);
@@ -2379,7 +2337,7 @@ namespace OpenSim.Region.Environment.Scenes
2379 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 2337 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
2380 } 2338 }
2381 2339
2382 public void SetScriptEvents(LLUUID scriptid, int events) 2340 public void SetScriptEvents(UUID scriptid, int events)
2383 { 2341 {
2384 // scriptEvents oldparts; 2342 // scriptEvents oldparts;
2385 lock (m_scriptEvents) 2343 lock (m_scriptEvents)
@@ -2399,24 +2357,6 @@ namespace OpenSim.Region.Environment.Scenes
2399 aggregateScriptEvents(); 2357 aggregateScriptEvents();
2400 } 2358 }
2401 2359
2402 // public void SetSitTarget(Vector3 offset, Quaternion orientation)
2403 // {
2404 // m_sitTargetPosition = offset;
2405 // m_sitTargetOrientation = orientation;
2406 // }
2407
2408 // // Utility function so the databases don't have to reference axiom.math
2409 // public void SetSitTargetLL(LLVector3 offset, LLQuaternion orientation)
2410 // {
2411 // if (
2412 // !(offset.X == 0 && offset.Y == 0 && offset.Z == 0 && (orientation.W == 0 || orientation.W == 1) &&
2413 // orientation.X == 0 && orientation.Y == 0 && orientation.Z == 0))
2414 // {
2415 // m_sitTargetPosition = new Vector3(offset.X, offset.Y, offset.Z);
2416 // m_sitTargetOrientation = new Quaternion(orientation.W, orientation.X, orientation.Y, orientation.Z);
2417 // }
2418 // }
2419
2420 /// <summary> 2360 /// <summary>
2421 /// Set the text displayed for this part. 2361 /// Set the text displayed for this part.
2422 /// </summary> 2362 /// </summary>
@@ -2438,9 +2378,9 @@ namespace OpenSim.Region.Environment.Scenes
2438 public void SetText(string text, Vector3 color, double alpha) 2378 public void SetText(string text, Vector3 color, double alpha)
2439 { 2379 {
2440 Color = Color.FromArgb(0xff - (int) (alpha*0xff), 2380 Color = Color.FromArgb(0xff - (int) (alpha*0xff),
2441 (int) (color.x*0xff), 2381 (int) (color.X*0xff),
2442 (int) (color.y*0xff), 2382 (int) (color.Y*0xff),
2443 (int) (color.z*0xff)); 2383 (int) (color.Z*0xff));
2444 SetText(text); 2384 SetText(text);
2445 } 2385 }
2446 2386
@@ -2491,33 +2431,22 @@ namespace OpenSim.Region.Environment.Scenes
2491 2431
2492 2432
2493 EntityIntersection returnresult = new EntityIntersection(); 2433 EntityIntersection returnresult = new EntityIntersection();
2494 Vector3 vAbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 2434 Vector3 vAbsolutePosition = AbsolutePosition;
2495 2435 Vector3 vScale = Scale;
2496 Vector3 vScale = new Vector3(Scale.X, Scale.Y, Scale.Z);
2497 // Quaternion qRotation =
2498 // new Quaternion(RotationOffset.W, RotationOffset.X, RotationOffset.Y, RotationOffset.Z);
2499
2500
2501 //Quaternion worldRotation = (qRotation*parentrot);
2502 //Matrix3 worldRotM = worldRotation.ToRotationMatrix();
2503
2504
2505 Vector3 rOrigin = iray.Origin; 2436 Vector3 rOrigin = iray.Origin;
2506 Vector3 rDirection = iray.Direction; 2437 Vector3 rDirection = iray.Direction;
2507 2438
2508
2509
2510 //rDirection = rDirection.Normalize(); 2439 //rDirection = rDirection.Normalize();
2511 // Buidling the first part of the Quadratic equation 2440 // Buidling the first part of the Quadratic equation
2512 Vector3 r2ndDirection = rDirection*rDirection; 2441 Vector3 r2ndDirection = rDirection*rDirection;
2513 float itestPart1 = r2ndDirection.x + r2ndDirection.y + r2ndDirection.z; 2442 float itestPart1 = r2ndDirection.X + r2ndDirection.Y + r2ndDirection.Z;
2514 2443
2515 // Buidling the second part of the Quadratic equation 2444 // Buidling the second part of the Quadratic equation
2516 Vector3 tmVal2 = rOrigin - vAbsolutePosition; 2445 Vector3 tmVal2 = rOrigin - vAbsolutePosition;
2517 Vector3 r2Direction = rDirection*2.0f; 2446 Vector3 r2Direction = rDirection*2.0f;
2518 Vector3 tmVal3 = r2Direction*tmVal2; 2447 Vector3 tmVal3 = r2Direction*tmVal2;
2519 2448
2520 float itestPart2 = tmVal3.x + tmVal3.y + tmVal3.z; 2449 float itestPart2 = tmVal3.X + tmVal3.Y + tmVal3.Z;
2521 2450
2522 // Buidling the third part of the Quadratic equation 2451 // Buidling the third part of the Quadratic equation
2523 Vector3 tmVal4 = rOrigin*rOrigin; 2452 Vector3 tmVal4 = rOrigin*rOrigin;
@@ -2528,12 +2457,12 @@ namespace OpenSim.Region.Environment.Scenes
2528 2457
2529 // Set Radius to the largest dimention of the prim 2458 // Set Radius to the largest dimention of the prim
2530 float radius = 0f; 2459 float radius = 0f;
2531 if (vScale.x > radius) 2460 if (vScale.X > radius)
2532 radius = vScale.x; 2461 radius = vScale.X;
2533 if (vScale.y > radius) 2462 if (vScale.Y > radius)
2534 radius = vScale.y; 2463 radius = vScale.Y;
2535 if (vScale.z > radius) 2464 if (vScale.Z > radius)
2536 radius = vScale.z; 2465 radius = vScale.Z;
2537 2466
2538 // the second part of this is the default prim size 2467 // the second part of this is the default prim size
2539 // once we factor in the aabb of the prim we're adding we can 2468 // once we factor in the aabb of the prim we're adding we can
@@ -2544,8 +2473,8 @@ namespace OpenSim.Region.Environment.Scenes
2544 2473
2545 //radius = radius; 2474 //radius = radius;
2546 2475
2547 float itestPart3 = tmVal4.x + tmVal4.y + tmVal4.z + tmVal5.x + tmVal5.y + tmVal5.z - 2476 float itestPart3 = tmVal4.X + tmVal4.Y + tmVal4.Z + tmVal5.X + tmVal5.Y + tmVal5.Z -
2548 (2.0f*(tmVal6.x + tmVal6.y + tmVal6.z + (radius*radius))); 2477 (2.0f*(tmVal6.X + tmVal6.Y + tmVal6.Z + (radius*radius)));
2549 2478
2550 // Yuk Quadradrics.. Solve first 2479 // Yuk Quadradrics.. Solve first
2551 float rootsqr = (itestPart2*itestPart2) - (4.0f*itestPart1*itestPart3); 2480 float rootsqr = (itestPart2*itestPart2) - (4.0f*itestPart1*itestPart3);
@@ -2572,21 +2501,21 @@ namespace OpenSim.Region.Environment.Scenes
2572 // We got an intersection. putting together an EntityIntersection object with the 2501 // We got an intersection. putting together an EntityIntersection object with the
2573 // intersection information 2502 // intersection information
2574 Vector3 ipoint = 2503 Vector3 ipoint =
2575 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root), 2504 new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root),
2576 iray.Origin.z + (iray.Direction.z*root)); 2505 iray.Origin.Z + (iray.Direction.Z*root));
2577 2506
2578 returnresult.HitTF = true; 2507 returnresult.HitTF = true;
2579 returnresult.ipoint = ipoint; 2508 returnresult.ipoint = ipoint;
2580 2509
2581 // Normal is calculated by the difference and then normalizing the result 2510 // Normal is calculated by the difference and then normalizing the result
2582 Vector3 normalpart = ipoint - vAbsolutePosition; 2511 Vector3 normalpart = ipoint - vAbsolutePosition;
2583 returnresult.normal = normalpart / normalpart.Length; 2512 returnresult.normal = normalpart / normalpart.Length();
2584 2513
2585 // It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesn't. 2514 // It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't.
2586 // I can write a function to do it.. but I like the fact that this one is Static. 2515 // I can write a function to do it.. but I like the fact that this one is Static.
2587 2516
2588 LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z); 2517 Vector3 distanceConvert1 = new Vector3(iray.Origin.X, iray.Origin.Y, iray.Origin.Z);
2589 LLVector3 distanceConvert2 = new LLVector3(ipoint.x, ipoint.y, ipoint.z); 2518 Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z);
2590 float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2); 2519 float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2);
2591 2520
2592 returnresult.distance = distance; 2521 returnresult.distance = distance;
@@ -2621,21 +2550,21 @@ namespace OpenSim.Region.Environment.Scenes
2621 Vector3 AmBb = new Vector3(0, 0, 0); // Vertex B - Vertex C 2550 Vector3 AmBb = new Vector3(0, 0, 0); // Vertex B - Vertex C
2622 Vector3 cross = new Vector3(); 2551 Vector3 cross = new Vector3();
2623 2552
2624 LLVector3 pos = GetWorldPosition(); 2553 Vector3 pos = GetWorldPosition();
2625 LLQuaternion rot = GetWorldRotation(); 2554 Quaternion rot = GetWorldRotation();
2626 2555
2627 // Variables prefixed with AX are Axiom.Math copies of the LL variety. 2556 // Variables prefixed with AX are Axiom.Math copies of the LL variety.
2628 2557
2629 Quaternion AXrot = new Quaternion(rot.W,rot.X,rot.Y,rot.Z); 2558 Quaternion AXrot = rot;
2630 AXrot.Normalize(); 2559 AXrot.Normalize();
2631 2560
2632 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z); 2561 Vector3 AXpos = pos;
2633 2562
2634 // tScale is the offset to derive the vertex based on the scale. 2563 // tScale is the offset to derive the vertex based on the scale.
2635 // it's different for each vertex because we've got to rotate it 2564 // it's different for each vertex because we've got to rotate it
2636 // to get the world position of the vertex to produce the Oriented Bounding Box 2565 // to get the world position of the vertex to produce the Oriented Bounding Box
2637 2566
2638 Vector3 tScale = new Vector3(); 2567 Vector3 tScale = Vector3.Zero;
2639 2568
2640 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f); 2569 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f);
2641 2570
@@ -2680,97 +2609,97 @@ namespace OpenSim.Region.Environment.Scenes
2680 #endregion 2609 #endregion
2681 2610
2682 #region Plane Decomposition of Oriented Bounding Box 2611 #region Plane Decomposition of Oriented Bounding Box
2683 tScale = new Vector3(AXscale.x, -AXscale.y, AXscale.z); 2612 tScale = new Vector3(AXscale.X, -AXscale.Y, AXscale.Z);
2684 rScale = ((AXrot * tScale)); 2613 rScale = tScale * AXrot;
2685 vertexes[0] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2614 vertexes[0] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2686 // vertexes[0].x = pos.X + vertexes[0].x; 2615 // vertexes[0].X = pos.X + vertexes[0].X;
2687 //vertexes[0].y = pos.Y + vertexes[0].y; 2616 //vertexes[0].Y = pos.Y + vertexes[0].Y;
2688 //vertexes[0].z = pos.Z + vertexes[0].z; 2617 //vertexes[0].Z = pos.Z + vertexes[0].Z;
2689 2618
2690 FaceA[0] = vertexes[0]; 2619 FaceA[0] = vertexes[0];
2691 FaceB[3] = vertexes[0]; 2620 FaceB[3] = vertexes[0];
2692 FaceA[4] = vertexes[0]; 2621 FaceA[4] = vertexes[0];
2693 2622
2694 tScale = AXscale; 2623 tScale = AXscale;
2695 rScale = ((AXrot * tScale)); 2624 rScale = tScale * AXrot;
2696 vertexes[1] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2625 vertexes[1] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2697 2626
2698 // vertexes[1].x = pos.X + vertexes[1].x; 2627 // vertexes[1].X = pos.X + vertexes[1].X;
2699 // vertexes[1].y = pos.Y + vertexes[1].y; 2628 // vertexes[1].Y = pos.Y + vertexes[1].Y;
2700 //vertexes[1].z = pos.Z + vertexes[1].z; 2629 //vertexes[1].Z = pos.Z + vertexes[1].Z;
2701 2630
2702 FaceB[0] = vertexes[1]; 2631 FaceB[0] = vertexes[1];
2703 FaceA[1] = vertexes[1]; 2632 FaceA[1] = vertexes[1];
2704 FaceC[4] = vertexes[1]; 2633 FaceC[4] = vertexes[1];
2705 2634
2706 tScale = new Vector3(AXscale.x, -AXscale.y, -AXscale.z); 2635 tScale = new Vector3(AXscale.X, -AXscale.Y, -AXscale.Z);
2707 rScale = ((AXrot * tScale)); 2636 rScale = tScale * AXrot;
2708 2637
2709 vertexes[2] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2638 vertexes[2] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2710 2639
2711 //vertexes[2].x = pos.X + vertexes[2].x; 2640 //vertexes[2].X = pos.X + vertexes[2].X;
2712 //vertexes[2].y = pos.Y + vertexes[2].y; 2641 //vertexes[2].Y = pos.Y + vertexes[2].Y;
2713 //vertexes[2].z = pos.Z + vertexes[2].z; 2642 //vertexes[2].Z = pos.Z + vertexes[2].Z;
2714 2643
2715 FaceC[0] = vertexes[2]; 2644 FaceC[0] = vertexes[2];
2716 FaceD[3] = vertexes[2]; 2645 FaceD[3] = vertexes[2];
2717 FaceC[5] = vertexes[2]; 2646 FaceC[5] = vertexes[2];
2718 2647
2719 tScale = new Vector3(AXscale.x, AXscale.y, -AXscale.z); 2648 tScale = new Vector3(AXscale.X, AXscale.Y, -AXscale.Z);
2720 rScale = ((AXrot * tScale)); 2649 rScale = tScale * AXrot;
2721 vertexes[3] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2650 vertexes[3] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2722 2651
2723 //vertexes[3].x = pos.X + vertexes[3].x; 2652 //vertexes[3].X = pos.X + vertexes[3].X;
2724 // vertexes[3].y = pos.Y + vertexes[3].y; 2653 // vertexes[3].Y = pos.Y + vertexes[3].Y;
2725 // vertexes[3].z = pos.Z + vertexes[3].z; 2654 // vertexes[3].Z = pos.Z + vertexes[3].Z;
2726 2655
2727 FaceD[0] = vertexes[3]; 2656 FaceD[0] = vertexes[3];
2728 FaceC[1] = vertexes[3]; 2657 FaceC[1] = vertexes[3];
2729 FaceA[5] = vertexes[3]; 2658 FaceA[5] = vertexes[3];
2730 2659
2731 tScale = new Vector3(-AXscale.x, AXscale.y, AXscale.z); 2660 tScale = new Vector3(-AXscale.X, AXscale.Y, AXscale.Z);
2732 rScale = ((AXrot * tScale)); 2661 rScale = tScale * AXrot;
2733 vertexes[4] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2662 vertexes[4] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2734 2663
2735 // vertexes[4].x = pos.X + vertexes[4].x; 2664 // vertexes[4].X = pos.X + vertexes[4].X;
2736 // vertexes[4].y = pos.Y + vertexes[4].y; 2665 // vertexes[4].Y = pos.Y + vertexes[4].Y;
2737 // vertexes[4].z = pos.Z + vertexes[4].z; 2666 // vertexes[4].Z = pos.Z + vertexes[4].Z;
2738 2667
2739 FaceB[1] = vertexes[4]; 2668 FaceB[1] = vertexes[4];
2740 FaceA[2] = vertexes[4]; 2669 FaceA[2] = vertexes[4];
2741 FaceD[4] = vertexes[4]; 2670 FaceD[4] = vertexes[4];
2742 2671
2743 tScale = new Vector3(-AXscale.x, AXscale.y, -AXscale.z); 2672 tScale = new Vector3(-AXscale.X, AXscale.Y, -AXscale.Z);
2744 rScale = ((AXrot * tScale)); 2673 rScale = tScale * AXrot;
2745 vertexes[5] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2674 vertexes[5] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2746 2675
2747 // vertexes[5].x = pos.X + vertexes[5].x; 2676 // vertexes[5].X = pos.X + vertexes[5].X;
2748 // vertexes[5].y = pos.Y + vertexes[5].y; 2677 // vertexes[5].Y = pos.Y + vertexes[5].Y;
2749 // vertexes[5].z = pos.Z + vertexes[5].z; 2678 // vertexes[5].Z = pos.Z + vertexes[5].Z;
2750 2679
2751 FaceD[1] = vertexes[5]; 2680 FaceD[1] = vertexes[5];
2752 FaceC[2] = vertexes[5]; 2681 FaceC[2] = vertexes[5];
2753 FaceB[5] = vertexes[5]; 2682 FaceB[5] = vertexes[5];
2754 2683
2755 tScale = new Vector3(-AXscale.x, -AXscale.y, AXscale.z); 2684 tScale = new Vector3(-AXscale.X, -AXscale.Y, AXscale.Z);
2756 rScale = ((AXrot * tScale)); 2685 rScale = tScale * AXrot;
2757 vertexes[6] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2686 vertexes[6] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2758 2687
2759 // vertexes[6].x = pos.X + vertexes[6].x; 2688 // vertexes[6].X = pos.X + vertexes[6].X;
2760 // vertexes[6].y = pos.Y + vertexes[6].y; 2689 // vertexes[6].Y = pos.Y + vertexes[6].Y;
2761 // vertexes[6].z = pos.Z + vertexes[6].z; 2690 // vertexes[6].Z = pos.Z + vertexes[6].Z;
2762 2691
2763 FaceB[2] = vertexes[6]; 2692 FaceB[2] = vertexes[6];
2764 FaceA[3] = vertexes[6]; 2693 FaceA[3] = vertexes[6];
2765 FaceB[4] = vertexes[6]; 2694 FaceB[4] = vertexes[6];
2766 2695
2767 tScale = new Vector3(-AXscale.x, -AXscale.y, -AXscale.z); 2696 tScale = new Vector3(-AXscale.X, -AXscale.Y, -AXscale.Z);
2768 rScale = ((AXrot * tScale)); 2697 rScale = tScale * AXrot;
2769 vertexes[7] = (new Vector3((pos.X + rScale.x), (pos.Y + rScale.y), (pos.Z + rScale.z))); 2698 vertexes[7] = (new Vector3((pos.X + rScale.X), (pos.Y + rScale.Y), (pos.Z + rScale.Z)));
2770 2699
2771 // vertexes[7].x = pos.X + vertexes[7].x; 2700 // vertexes[7].X = pos.X + vertexes[7].X;
2772 // vertexes[7].y = pos.Y + vertexes[7].y; 2701 // vertexes[7].Y = pos.Y + vertexes[7].Y;
2773 // vertexes[7].z = pos.Z + vertexes[7].z; 2702 // vertexes[7].Z = pos.Z + vertexes[7].Z;
2774 2703
2775 FaceD[2] = vertexes[7]; 2704 FaceD[2] = vertexes[7];
2776 FaceC[3] = vertexes[7]; 2705 FaceC[3] = vertexes[7];
@@ -2786,13 +2715,13 @@ namespace OpenSim.Region.Environment.Scenes
2786 AmBa = FaceA[i] - FaceB[i]; 2715 AmBa = FaceA[i] - FaceB[i];
2787 AmBb = FaceB[i] - FaceC[i]; 2716 AmBb = FaceB[i] - FaceC[i];
2788 2717
2789 cross = AmBb.Cross(AmBa); 2718 cross = Vector3.Cross(AmBb, AmBa);
2790 2719
2791 // normalize the cross product to get the normal. 2720 // normalize the cross product to get the normal.
2792 normals[i] = cross / cross.Length; 2721 normals[i] = cross / cross.Length();
2793 2722
2794 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString()); 2723 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString());
2795 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1; 2724 //distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1;
2796 } 2725 }
2797 2726
2798 EntityIntersection returnresult = new EntityIntersection(); 2727 EntityIntersection returnresult = new EntityIntersection();
@@ -2862,7 +2791,7 @@ namespace OpenSim.Region.Environment.Scenes
2862 { 2791 {
2863 AmBa = FaceA[i] - FaceB[i]; 2792 AmBa = FaceA[i] - FaceB[i];
2864 AmBb = FaceB[i] - FaceC[i]; 2793 AmBb = FaceB[i] - FaceC[i];
2865 d = normals[i].Dot(FaceB[i]); 2794 d = Vector3.Dot(normals[i], FaceB[i]);
2866 2795
2867 //if (faceCenters) 2796 //if (faceCenters)
2868 //{ 2797 //{
@@ -2870,30 +2799,26 @@ namespace OpenSim.Region.Environment.Scenes
2870 //} 2799 //}
2871 //else 2800 //else
2872 //{ 2801 //{
2873 c = iray.Direction.Dot(normals[i]); 2802 c = Vector3.Dot(iray.Direction, normals[i]);
2874 //} 2803 //}
2875 if (c == 0) 2804 if (c == 0)
2876 continue; 2805 continue;
2877 2806
2878 a = (d - iray.Origin.Dot(normals[i])) / c; 2807 a = (d - Vector3.Dot(iray.Origin, normals[i])) / c;
2879 2808
2880 if (a < 0) 2809 if (a < 0)
2881 continue; 2810 continue;
2882 2811
2883 // If the normal is pointing outside the object 2812 // If the normal is pointing outside the object
2884 2813 if (Vector3.Dot(iray.Direction, normals[i]) < 0 || !frontFacesOnly)
2885
2886
2887 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly)
2888 { 2814 {
2889
2890 //if (faceCenters) 2815 //if (faceCenters)
2891 //{ //(FaceA[i] + FaceB[i] + FaceC[1] + FaceD[i]) / 4f; 2816 //{ //(FaceA[i] + FaceB[i] + FaceC[1] + FaceD[i]) / 4f;
2892 // q = iray.Origin + a * normals[i]; 2817 // q = iray.Origin + a * normals[i];
2893 //} 2818 //}
2894 //else 2819 //else
2895 //{ 2820 //{
2896 q = iray.Origin + a * iray.Direction; 2821 q = iray.Origin + iray.Direction * a;
2897 //} 2822 //}
2898 2823
2899 float distance2 = (float)GetDistanceTo(q, AXpos); 2824 float distance2 = (float)GetDistanceTo(q, AXpos);
@@ -2913,13 +2838,13 @@ namespace OpenSim.Region.Environment.Scenes
2913 //m_log.Info("[DIST]: " + distance2.ToString()); 2838 //m_log.Info("[DIST]: " + distance2.ToString());
2914 if (faceCenters) 2839 if (faceCenters)
2915 { 2840 {
2916 returnresult.normal = (AXrot * AAfacenormals[i]); 2841 returnresult.normal = AAfacenormals[i] * AXrot;
2917 2842
2918 Vector3 scaleComponent = AAfacenormals[i]; 2843 Vector3 scaleComponent = AAfacenormals[i];
2919 float ScaleOffset = 0.5f; 2844 float ScaleOffset = 0.5f;
2920 if (scaleComponent.x != 0) ScaleOffset = AXscale.x; 2845 if (scaleComponent.X != 0) ScaleOffset = AXscale.X;
2921 if (scaleComponent.y != 0) ScaleOffset = AXscale.y; 2846 if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y;
2922 if (scaleComponent.z != 0) ScaleOffset = AXscale.z; 2847 if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z;
2923 ScaleOffset = Math.Abs(ScaleOffset); 2848 ScaleOffset = Math.Abs(ScaleOffset);
2924 Vector3 offset = returnresult.normal * ScaleOffset; 2849 Vector3 offset = returnresult.normal * ScaleOffset;
2925 returnresult.ipoint = AXpos + offset; 2850 returnresult.ipoint = AXpos + offset;
@@ -2984,7 +2909,7 @@ namespace OpenSim.Region.Environment.Scenes
2984 2909
2985 if (type == 0x30) 2910 if (type == 0x30)
2986 { 2911 {
2987 if (m_shape.SculptEntry && m_shape.SculptTexture != LLUUID.Zero) 2912 if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero)
2988 { 2913 {
2989 //AssetBase tx = m_parentGroup.Scene.getase 2914 //AssetBase tx = m_parentGroup.Scene.getase
2990 m_parentGroup.Scene.AssetCache.GetAsset(m_shape.SculptTexture, SculptTextureCallback, true); 2915 m_parentGroup.Scene.AssetCache.GetAsset(m_shape.SculptTexture, SculptTextureCallback, true);
@@ -2995,13 +2920,13 @@ namespace OpenSim.Region.Environment.Scenes
2995 ScheduleFullUpdate(); 2920 ScheduleFullUpdate();
2996 } 2921 }
2997 2922
2998 public void UpdateGroupPosition(LLVector3 pos) 2923 public void UpdateGroupPosition(Vector3 pos)
2999 { 2924 {
3000 if ((pos.X != GroupPosition.X) || 2925 if ((pos.X != GroupPosition.X) ||
3001 (pos.Y != GroupPosition.Y) || 2926 (pos.Y != GroupPosition.Y) ||
3002 (pos.Z != GroupPosition.Z)) 2927 (pos.Z != GroupPosition.Z))
3003 { 2928 {
3004 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); 2929 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
3005 GroupPosition = newPos; 2930 GroupPosition = newPos;
3006 ScheduleTerseUpdate(); 2931 ScheduleTerseUpdate();
3007 } 2932 }
@@ -3015,19 +2940,19 @@ namespace OpenSim.Region.Environment.Scenes
3015 /// 2940 ///
3016 /// </summary> 2941 /// </summary>
3017 /// <param name="pos"></param> 2942 /// <param name="pos"></param>
3018 public void UpdateOffSet(LLVector3 pos) 2943 public void UpdateOffSet(Vector3 pos)
3019 { 2944 {
3020 if ((pos.X != OffsetPosition.X) || 2945 if ((pos.X != OffsetPosition.X) ||
3021 (pos.Y != OffsetPosition.Y) || 2946 (pos.Y != OffsetPosition.Y) ||
3022 (pos.Z != OffsetPosition.Z)) 2947 (pos.Z != OffsetPosition.Z))
3023 { 2948 {
3024 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); 2949 Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
3025 OffsetPosition = newPos; 2950 OffsetPosition = newPos;
3026 ScheduleTerseUpdate(); 2951 ScheduleTerseUpdate();
3027 } 2952 }
3028 } 2953 }
3029 2954
3030 public void UpdatePermissions(LLUUID AgentID, byte field, uint localID, uint mask, byte addRemTF) 2955 public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF)
3031 { 2956 {
3032 bool set = addRemTF == 1; 2957 bool set = addRemTF == 1;
3033 2958
@@ -3069,7 +2994,7 @@ namespace OpenSim.Region.Environment.Scenes
3069 bool IsTemporary = false; 2994 bool IsTemporary = false;
3070 bool IsPhantom = false; 2995 bool IsPhantom = false;
3071 // bool castsShadows = false; 2996 // bool castsShadows = false;
3072 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0); 2997 bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0);
3073 //bool IsLocked = false; 2998 //bool IsLocked = false;
3074 int i = 0; 2999 int i = 0;
3075 3000
@@ -3091,7 +3016,7 @@ namespace OpenSim.Region.Environment.Scenes
3091 3016
3092 if (usePhysics) 3017 if (usePhysics)
3093 { 3018 {
3094 AddFlag(LLObject.ObjectFlags.Physics); 3019 AddFlag(PrimFlags.Physics);
3095 if (!wasUsingPhysics) 3020 if (!wasUsingPhysics)
3096 { 3021 {
3097 DoPhysicsPropertyUpdate(usePhysics, false); 3022 DoPhysicsPropertyUpdate(usePhysics, false);
@@ -3109,7 +3034,7 @@ namespace OpenSim.Region.Environment.Scenes
3109 } 3034 }
3110 else 3035 else
3111 { 3036 {
3112 RemFlag(LLObject.ObjectFlags.Physics); 3037 RemFlag(PrimFlags.Physics);
3113 if (wasUsingPhysics) 3038 if (wasUsingPhysics)
3114 { 3039 {
3115 DoPhysicsPropertyUpdate(usePhysics, false); 3040 DoPhysicsPropertyUpdate(usePhysics, false);
@@ -3118,7 +3043,7 @@ namespace OpenSim.Region.Environment.Scenes
3118 3043
3119 if (IsPhantom) 3044 if (IsPhantom)
3120 { 3045 {
3121 AddFlag(LLObject.ObjectFlags.Phantom); 3046 AddFlag(PrimFlags.Phantom);
3122 if (PhysActor != null) 3047 if (PhysActor != null)
3123 { 3048 {
3124 m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); 3049 m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor);
@@ -3128,17 +3053,16 @@ namespace OpenSim.Region.Environment.Scenes
3128 } 3053 }
3129 else 3054 else
3130 { 3055 {
3131 RemFlag(LLObject.ObjectFlags.Phantom); 3056 RemFlag(PrimFlags.Phantom);
3132 if (PhysActor == null) 3057 if (PhysActor == null)
3133 { 3058 {
3134 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( 3059 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
3135 Name, 3060 Name,
3136 Shape, 3061 Shape,
3137 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 3062 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z),
3138 AbsolutePosition.Z),
3139 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 3063 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
3140 new Quaternion(RotationOffset.W, RotationOffset.X, 3064 RotationOffset,
3141 RotationOffset.Y, RotationOffset.Z), usePhysics); 3065 usePhysics);
3142 3066
3143 if (PhysActor != null) 3067 if (PhysActor != null)
3144 { 3068 {
@@ -3175,17 +3099,17 @@ namespace OpenSim.Region.Environment.Scenes
3175 3099
3176 if (IsTemporary) 3100 if (IsTemporary)
3177 { 3101 {
3178 AddFlag(LLObject.ObjectFlags.TemporaryOnRez); 3102 AddFlag(PrimFlags.TemporaryOnRez);
3179 } 3103 }
3180 else 3104 else
3181 { 3105 {
3182 RemFlag(LLObject.ObjectFlags.TemporaryOnRez); 3106 RemFlag(PrimFlags.TemporaryOnRez);
3183 } 3107 }
3184 // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); 3108 // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
3185 ScheduleFullUpdate(); 3109 ScheduleFullUpdate();
3186 } 3110 }
3187 3111
3188 public void UpdateRotation(LLQuaternion rot) 3112 public void UpdateRotation(Quaternion rot)
3189 { 3113 {
3190 if ((rot.X != RotationOffset.X) || 3114 if ((rot.X != RotationOffset.X) ||
3191 (rot.Y != RotationOffset.Y) || 3115 (rot.Y != RotationOffset.Y) ||
@@ -3193,7 +3117,7 @@ namespace OpenSim.Region.Environment.Scenes
3193 (rot.W != RotationOffset.W)) 3117 (rot.W != RotationOffset.W))
3194 { 3118 {
3195 //StoreUndoState(); 3119 //StoreUndoState();
3196 RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W); 3120 RotationOffset = rot;
3197 ParentGroup.HasGroupChanged = true; 3121 ParentGroup.HasGroupChanged = true;
3198 ScheduleTerseUpdate(); 3122 ScheduleTerseUpdate();
3199 } 3123 }
@@ -3235,9 +3159,9 @@ namespace OpenSim.Region.Environment.Scenes
3235 // Added to handle bug in libsecondlife's TextureEntry.ToBytes() 3159 // Added to handle bug in libsecondlife's TextureEntry.ToBytes()
3236 // not handling RGBA properly. Cycles through, and "fixes" the color 3160 // not handling RGBA properly. Cycles through, and "fixes" the color
3237 // info 3161 // info
3238 public void UpdateTexture(LLObject.TextureEntry tex) 3162 public void UpdateTexture(Primitive.TextureEntry tex)
3239 { 3163 {
3240 //LLColor tmpcolor; 3164 //Color4 tmpcolor;
3241 //for (uint i = 0; i < 32; i++) 3165 //for (uint i = 0; i < 32; i++)
3242 //{ 3166 //{
3243 // if (tex.FaceTextures[i] != null) 3167 // if (tex.FaceTextures[i] != null)
@@ -3291,17 +3215,17 @@ namespace OpenSim.Region.Environment.Scenes
3291 ((AggregateScriptEvents & scriptEvents.touch_start) != 0) 3215 ((AggregateScriptEvents & scriptEvents.touch_start) != 0)
3292 ) 3216 )
3293 { 3217 {
3294 objectflagupdate |= (uint) LLObject.ObjectFlags.Touch; 3218 objectflagupdate |= (uint) PrimFlags.Touch;
3295 } 3219 }
3296 3220
3297 if ((AggregateScriptEvents & scriptEvents.money) != 0) 3221 if ((AggregateScriptEvents & scriptEvents.money) != 0)
3298 { 3222 {
3299 objectflagupdate |= (uint) LLObject.ObjectFlags.Money; 3223 objectflagupdate |= (uint) PrimFlags.Money;
3300 } 3224 }
3301 3225
3302 if (AllowedDrop) 3226 if (AllowedDrop)
3303 { 3227 {
3304 objectflagupdate |= (uint) LLObject.ObjectFlags.AllowInventoryDrop; 3228 objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop;
3305 } 3229 }
3306 3230
3307 if ( 3231 if (
@@ -3326,7 +3250,7 @@ namespace OpenSim.Region.Environment.Scenes
3326 PhysActor.OnCollisionUpdate -= PhysicsCollision; 3250 PhysActor.OnCollisionUpdate -= PhysicsCollision;
3327 } 3251 }
3328 } 3252 }
3329 if ((GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0) 3253 if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
3330 { 3254 {
3331 m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; 3255 m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
3332 } 3256 }
@@ -3335,7 +3259,7 @@ namespace OpenSim.Region.Environment.Scenes
3335 m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; 3259 m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
3336 } 3260 }
3337 3261
3338 LocalFlags=(LLObject.ObjectFlags)objectflagupdate; 3262 LocalFlags=(PrimFlags)objectflagupdate;
3339 3263
3340 if (m_parentGroup != null && m_parentGroup.RootPart == this) 3264 if (m_parentGroup != null && m_parentGroup.RootPart == this)
3341 m_parentGroup.aggregateScriptEvents(); 3265 m_parentGroup.aggregateScriptEvents();
@@ -3343,7 +3267,7 @@ namespace OpenSim.Region.Environment.Scenes
3343 ScheduleFullUpdate(); 3267 ScheduleFullUpdate();
3344 } 3268 }
3345 3269
3346 public int registerTargetWaypoint(LLVector3 target, float tolerance) 3270 public int registerTargetWaypoint(Vector3 target, float tolerance)
3347 { 3271 {
3348 if (m_parentGroup != null) 3272 if (m_parentGroup != null)
3349 { 3273 {
@@ -3360,11 +3284,11 @@ namespace OpenSim.Region.Environment.Scenes
3360 } 3284 }
3361 } 3285 }
3362 3286
3363 public void SetCameraAtOffset(LLVector3 v) { 3287 public void SetCameraAtOffset(Vector3 v) {
3364 m_cameraAtOffset = v; 3288 m_cameraAtOffset = v;
3365 } 3289 }
3366 3290
3367 public void SetCameraEyeOffset(LLVector3 v) { 3291 public void SetCameraEyeOffset(Vector3 v) {
3368 m_cameraEyeOffset = v; 3292 m_cameraEyeOffset = v;
3369 } 3293 }
3370 3294
@@ -3372,11 +3296,11 @@ namespace OpenSim.Region.Environment.Scenes
3372 m_forceMouselook = force; 3296 m_forceMouselook = force;
3373 } 3297 }
3374 3298
3375 public LLVector3 GetCameraAtOffset() { 3299 public Vector3 GetCameraAtOffset() {
3376 return m_cameraAtOffset; 3300 return m_cameraAtOffset;
3377 } 3301 }
3378 3302
3379 public LLVector3 GetCameraEyeOffset() { 3303 public Vector3 GetCameraEyeOffset() {
3380 return m_cameraEyeOffset; 3304 return m_cameraEyeOffset;
3381 } 3305 }
3382 3306
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 1694613..e51f1be 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -30,9 +30,8 @@ using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Runtime.Serialization; 31using System.Runtime.Serialization;
32using System.Security.Permissions; 32using System.Security.Permissions;
33using Axiom.Math; 33using OpenMetaverse;
34using libsecondlife; 34using OpenMetaverse.Packets;
35using libsecondlife.Packets;
36using log4net; 35using log4net;
37using OpenSim.Framework; 36using OpenSim.Framework;
38using OpenSim.Framework.Communications.Cache; 37using OpenSim.Framework.Communications.Cache;
@@ -60,7 +59,7 @@ namespace OpenSim.Region.Environment.Scenes
60 59
61 struct ScriptControllers 60 struct ScriptControllers
62 { 61 {
63 public LLUUID itemID; 62 public UUID itemID;
64 public uint objID; 63 public uint objID;
65 public ScriptControlled ignoreControls; 64 public ScriptControlled ignoreControls;
66 public ScriptControlled eventControls; 65 public ScriptControlled eventControls;
@@ -78,9 +77,9 @@ namespace OpenSim.Region.Environment.Scenes
78 77
79 public static byte[] DefaultTexture; 78 public static byte[] DefaultTexture;
80 79
81 public LLUUID currentParcelUUID = LLUUID.Zero; 80 public UUID currentParcelUUID = UUID.Zero;
82 private AnimationSet m_animations = new AnimationSet(); 81 private AnimationSet m_animations = new AnimationSet();
83 private Dictionary<LLUUID, ScriptControllers> scriptedcontrols = new Dictionary<LLUUID, ScriptControllers>(); 82 private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>();
84 private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; 83 private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO;
85 private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; 84 private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO;
86 private SceneObjectGroup proxyObjectGroup = null; 85 private SceneObjectGroup proxyObjectGroup = null;
@@ -94,11 +93,11 @@ namespace OpenSim.Region.Environment.Scenes
94 private readonly List<NewForce> m_forcesList = new List<NewForce>(); 93 private readonly List<NewForce> m_forcesList = new List<NewForce>();
95 private short m_updateCount = 0; 94 private short m_updateCount = 0;
96 private uint m_requestedSitTargetID = 0; 95 private uint m_requestedSitTargetID = 0;
97 private LLUUID m_requestedSitTargetUUID = LLUUID.Zero; 96 private UUID m_requestedSitTargetUUID = UUID.Zero;
98 97
99 private LLVector3 m_requestedSitOffset = new LLVector3(); 98 private Vector3 m_requestedSitOffset = new Vector3();
100 99
101 private LLVector3 m_LastFinitePos = new LLVector3(); 100 private Vector3 m_LastFinitePos = new Vector3();
102 101
103 private float m_sitAvatarHeight = 2.0f; 102 private float m_sitAvatarHeight = 2.0f;
104 103
@@ -108,14 +107,14 @@ namespace OpenSim.Region.Environment.Scenes
108 // with varying parameters for sit target location, prim size, prim 107 // with varying parameters for sit target location, prim size, prim
109 // rotation, prim cut, prim twist, prim taper, and prim shear. See mantis 108 // rotation, prim cut, prim twist, prim taper, and prim shear. See mantis
110 // issue #1716 109 // issue #1716
111 private static readonly LLVector3 m_sitTargetCorrectionOffset = new LLVector3(0.1f, 0.0f, 0.3f); 110 private static readonly Vector3 m_sitTargetCorrectionOffset = new Vector3(0.1f, 0.0f, 0.3f);
112 private float m_godlevel = 0; 111 private float m_godlevel = 0;
113 112
114 private bool m_attachmentsTransported = false; 113 private bool m_attachmentsTransported = false;
115 114
116 private bool m_invulnerable = true; 115 private bool m_invulnerable = true;
117 116
118 private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3(); 117 private Vector3 m_LastChildAgentUpdatePosition = new Vector3();
119 118
120 private int m_perfMonMS = 0; 119 private int m_perfMonMS = 0;
121 120
@@ -132,7 +131,7 @@ namespace OpenSim.Region.Environment.Scenes
132 private bool m_newCoarseLocations = true; 131 private bool m_newCoarseLocations = true;
133 private float m_health = 100f; 132 private float m_health = 100f;
134 133
135 private LLVector3 m_lastVelocity = LLVector3.Zero; 134 private Vector3 m_lastVelocity = Vector3.Zero;
136 135
137 // Default AV Height 136 // Default AV Height
138 private float m_avHeight = 127.0f; 137 private float m_avHeight = 127.0f;
@@ -141,25 +140,25 @@ namespace OpenSim.Region.Environment.Scenes
141 protected ulong crossingFromRegion = 0; 140 protected ulong crossingFromRegion = 0;
142 141
143 private readonly Vector3[] Dir_Vectors = new Vector3[6]; 142 private readonly Vector3[] Dir_Vectors = new Vector3[6];
144 private LLVector3 lastPhysPos = new LLVector3(); 143 private Vector3 lastPhysPos = Vector3.Zero;
145 144
146 // Position of agent's camera in world (region cordinates) 145 // Position of agent's camera in world (region cordinates)
147 protected Vector3 m_CameraCenter = new Vector3(0, 0, 0); 146 protected Vector3 m_CameraCenter = Vector3.Zero;
148 147
149 // Use these three vectors to figure out what the agent is looking at 148 // Use these three vectors to figure out what the agent is looking at
150 // Convert it to a Matrix and/or Quaternion 149 // Convert it to a Matrix and/or Quaternion
151 protected Vector3 m_CameraAtAxis = new Vector3(0, 0, 0); 150 protected Vector3 m_CameraAtAxis = Vector3.Zero;
152 protected Vector3 m_CameraLeftAxis = new Vector3(0, 0, 0); 151 protected Vector3 m_CameraLeftAxis = Vector3.Zero;
153 protected Vector3 m_CameraUpAxis = new Vector3(0, 0, 0); 152 protected Vector3 m_CameraUpAxis = Vector3.Zero;
154 private uint m_AgentControlFlags = (uint) 0; 153 private uint m_AgentControlFlags = 0;
155 private LLQuaternion m_headrotation = new LLQuaternion(); 154 private Quaternion m_headrotation = Quaternion.Identity;
156 private byte m_state = (byte) 0; 155 private byte m_state = 0;
157 156
158 //Reuse the LLVector3 instead of creating a new one on the UpdateMovement method 157 //Reuse the Vector3 instead of creating a new one on the UpdateMovement method
159 private LLVector3 movementvector = new LLVector3(); 158 private Vector3 movementvector = Vector3.Zero;
160 159
161 private bool m_autopilotMoving = false; 160 private bool m_autopilotMoving = false;
162 private LLVector3 m_autoPilotTarget = LLVector3.Zero; 161 private Vector3 m_autoPilotTarget = Vector3.Zero;
163 private bool m_sitAtAutoTarget = false; 162 private bool m_sitAtAutoTarget = false;
164 163
165 // Agent's Draw distance. 164 // Agent's Draw distance.
@@ -189,12 +188,12 @@ namespace OpenSim.Region.Environment.Scenes
189 /// <summary> 188 /// <summary>
190 /// Position at which a significant movement was made 189 /// Position at which a significant movement was made
191 /// </summary> 190 /// </summary>
192 private LLVector3 posLastSignificantMove = new LLVector3(); 191 private Vector3 posLastSignificantMove = new Vector3();
193 192
194 private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); 193 private UpdateQueue m_partsUpdateQueue = new UpdateQueue();
195 private Queue<SceneObjectGroup> m_pendingObjects = null; 194 private Queue<SceneObjectGroup> m_pendingObjects = null;
196 195
197 private Dictionary<LLUUID, ScenePartUpdate> m_updateTimes = new Dictionary<LLUUID, ScenePartUpdate>(); 196 private Dictionary<UUID, ScenePartUpdate> m_updateTimes = new Dictionary<UUID, ScenePartUpdate>();
198 197
199 #region Properties 198 #region Properties
200 199
@@ -282,12 +281,12 @@ namespace OpenSim.Region.Environment.Scenes
282 set { m_controllingClient = value; } 281 set { m_controllingClient = value; }
283 } 282 }
284 283
285 protected LLVector3 m_parentPosition = new LLVector3(); 284 protected Vector3 m_parentPosition = new Vector3();
286 285
287 /// <summary> 286 /// <summary>
288 /// Absolute position of this avatar in 'region cordinates' 287 /// Absolute position of this avatar in 'region cordinates'
289 /// </summary> 288 /// </summary>
290 public override LLVector3 AbsolutePosition 289 public override Vector3 AbsolutePosition
291 { 290 {
292 get 291 get
293 { 292 {
@@ -318,14 +317,14 @@ namespace OpenSim.Region.Environment.Scenes
318 } 317 }
319 318
320 m_pos = value; 319 m_pos = value;
321 m_parentPosition=new LLVector3(0, 0, 0); 320 m_parentPosition=new Vector3(0, 0, 0);
322 } 321 }
323 } 322 }
324 323
325 /// <summary> 324 /// <summary>
326 /// Current Velocity of the avatar. 325 /// Current Velocity of the avatar.
327 /// </summary> 326 /// </summary>
328 public override LLVector3 Velocity 327 public override Vector3 Velocity
329 { 328 {
330 get 329 get
331 { 330 {
@@ -486,7 +485,7 @@ namespace OpenSim.Region.Environment.Scenes
486 // } 485 // }
487 } 486 }
488 487
489 public uint GenerateClientFlags(LLUUID ObjectID) 488 public uint GenerateClientFlags(UUID ObjectID)
490 { 489 {
491 return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID); 490 return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID);
492 } 491 }
@@ -609,7 +608,7 @@ namespace OpenSim.Region.Environment.Scenes
609 /// This is called when an agent teleports into a region, or if an 608 /// This is called when an agent teleports into a region, or if an
610 /// agent crosses into this region from a neighbor over the border 609 /// agent crosses into this region from a neighbor over the border
611 /// </summary> 610 /// </summary>
612 public void MakeRootAgent(LLVector3 pos, bool isFlying) 611 public void MakeRootAgent(Vector3 pos, bool isFlying)
613 { 612 {
614 m_scene.SetRootAgentScene(m_uuid); 613 m_scene.SetRootAgentScene(m_uuid);
615 614
@@ -625,7 +624,7 @@ namespace OpenSim.Region.Environment.Scenes
625 624
626 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0) 625 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0)
627 { 626 {
628 LLVector3 emergencyPos = new LLVector3(128, 128, 128); 627 Vector3 emergencyPos = new Vector3(128, 128, 128);
629 628
630 m_log.WarnFormat( 629 m_log.WarnFormat(
631 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 630 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
@@ -681,12 +680,12 @@ namespace OpenSim.Region.Environment.Scenes
681// "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", 680// "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}",
682// Name, UUID, m_scene.RegionInfo.RegionName); 681// Name, UUID, m_scene.RegionInfo.RegionName);
683 682
684 Velocity = new LLVector3(0, 0, 0); 683 Velocity = new Vector3(0, 0, 0);
685 m_isChildAgent = true; 684 m_isChildAgent = true;
686 m_scene.SwapRootAgentCount(true); 685 m_scene.SwapRootAgentCount(true);
687 RemoveFromPhysicalScene(); 686 RemoveFromPhysicalScene();
688 m_scene.EventManager.TriggerOnMakeChildAgent(this); 687 m_scene.EventManager.TriggerOnMakeChildAgent(this);
689 //this.Pos = new LLVector3(128, 128, 70); 688 //this.Pos = new Vector3(128, 128, 70);
690 } 689 }
691 690
692 /// <summary> 691 /// <summary>
@@ -708,10 +707,10 @@ namespace OpenSim.Region.Environment.Scenes
708 /// 707 ///
709 /// </summary> 708 /// </summary>
710 /// <param name="pos"></param> 709 /// <param name="pos"></param>
711 public void Teleport(LLVector3 pos) 710 public void Teleport(Vector3 pos)
712 { 711 {
713 RemoveFromPhysicalScene(); 712 RemoveFromPhysicalScene();
714 Velocity = new LLVector3(0, 0, 0); 713 Velocity = new Vector3(0, 0, 0);
715 AbsolutePosition = pos; 714 AbsolutePosition = pos;
716 AddToPhysicalScene(); 715 AddToPhysicalScene();
717 SendTerseUpdateToAllClients(); 716 SendTerseUpdateToAllClients();
@@ -735,11 +734,11 @@ namespace OpenSim.Region.Environment.Scenes
735 734
736 if (m_avHeight != 127.0f) 735 if (m_avHeight != 127.0f)
737 { 736 {
738 AbsolutePosition = AbsolutePosition + new LLVector3(0, 0, (m_avHeight / 6)); 737 AbsolutePosition = AbsolutePosition + new Vector3(0, 0, (m_avHeight / 6f));
739 } 738 }
740 else 739 else
741 { 740 {
742 AbsolutePosition = AbsolutePosition + new LLVector3(0, 0, (1.56f / 6)); 741 AbsolutePosition = AbsolutePosition + new Vector3(0, 0, (1.56f / 6f));
743 } 742 }
744 TrySetMovementAnimation("LAND"); 743 TrySetMovementAnimation("LAND");
745 SendFullUpdateToAllClients(); 744 SendFullUpdateToAllClients();
@@ -788,10 +787,10 @@ namespace OpenSim.Region.Environment.Scenes
788 /// </summary> 787 /// </summary>
789 public void CompleteMovement() 788 public void CompleteMovement()
790 { 789 {
791 LLVector3 look = Velocity; 790 Vector3 look = Velocity;
792 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) 791 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
793 { 792 {
794 look = new LLVector3(0.99f, 0.042f, 0); 793 look = new Vector3(0.99f, 0.042f, 0);
795 } 794 }
796 795
797 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); 796 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
@@ -846,7 +845,7 @@ namespace OpenSim.Region.Environment.Scenes
846 //ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 845 //ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
847 //if (land != null) 846 //if (land != null)
848 //{ 847 //{
849 //if (land.landData.landingType == (byte)1 && land.landData.userLocation != LLVector3.Zero) 848 //if (land.landData.landingType == (byte)1 && land.landData.userLocation != Vector3.Zero)
850 //{ 849 //{
851 // agent.startpos = land.landData.userLocation; 850 // agent.startpos = land.landData.userLocation;
852 //} 851 //}
@@ -855,27 +854,17 @@ namespace OpenSim.Region.Environment.Scenes
855 m_perfMonMS = System.Environment.TickCount; 854 m_perfMonMS = System.Environment.TickCount;
856 855
857 uint flags = agentData.ControlFlags; 856 uint flags = agentData.ControlFlags;
858 LLQuaternion bodyRotation = agentData.BodyRotation; 857 Quaternion bodyRotation = agentData.BodyRotation;
859 858
860 // Camera location in world. We'll need to raytrace 859 // Camera location in world. We'll need to raytrace
861 // from this location from time to time. 860 // from this location from time to time.
862 m_CameraCenter.x = agentData.CameraCenter.X; 861 m_CameraCenter = agentData.CameraCenter;
863 m_CameraCenter.y = agentData.CameraCenter.Y;
864 m_CameraCenter.z = agentData.CameraCenter.Z;
865 862
866 // Use these three vectors to figure out what the agent is looking at 863 // Use these three vectors to figure out what the agent is looking at
867 // Convert it to a Matrix and/or Quaternion 864 // Convert it to a Matrix and/or Quaternion
868 m_CameraAtAxis.x = agentData.CameraAtAxis.X; 865 m_CameraAtAxis = agentData.CameraAtAxis;
869 m_CameraAtAxis.y = agentData.CameraAtAxis.Y; 866 m_CameraLeftAxis = agentData.CameraLeftAxis;
870 m_CameraAtAxis.z = agentData.CameraAtAxis.Z; 867 m_CameraUpAxis = agentData.CameraUpAxis;
871
872 m_CameraLeftAxis.x = agentData.CameraLeftAxis.X;
873 m_CameraLeftAxis.y = agentData.CameraLeftAxis.Y;
874 m_CameraLeftAxis.z = agentData.CameraLeftAxis.Z;
875
876 m_CameraUpAxis.x = agentData.CameraUpAxis.X;
877 m_CameraUpAxis.y = agentData.CameraUpAxis.Y;
878 m_CameraUpAxis.z = agentData.CameraUpAxis.Z;
879 868
880 // The Agent's Draw distance setting 869 // The Agent's Draw distance setting
881 m_DrawDistance = agentData.Far; 870 m_DrawDistance = agentData.Far;
@@ -923,7 +912,7 @@ namespace OpenSim.Region.Environment.Scenes
923 bool update_rotation = false; 912 bool update_rotation = false;
924 bool DCFlagKeyPressed = false; 913 bool DCFlagKeyPressed = false;
925 Vector3 agent_control_v3 = new Vector3(0, 0, 0); 914 Vector3 agent_control_v3 = new Vector3(0, 0, 0);
926 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); 915 Quaternion q = bodyRotation;
927 if (PhysicsActor != null) 916 if (PhysicsActor != null)
928 { 917 {
929 bool oldflying = PhysicsActor.Flying; 918 bool oldflying = PhysicsActor.Flying;
@@ -1005,7 +994,7 @@ namespace OpenSim.Region.Environment.Scenes
1005 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 994 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1006 } 995 }
1007 996
1008 public void DoAutoPilot(uint not_used, LLVector3 Pos, IClientAPI remote_client) 997 public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client)
1009 { 998 {
1010 m_autopilotMoving = true; 999 m_autopilotMoving = true;
1011 m_autoPilotTarget = Pos; 1000 m_autoPilotTarget = Pos;
@@ -1014,17 +1003,17 @@ namespace OpenSim.Region.Environment.Scenes
1014 //proxy.PCode = (byte)PCode.ParticleSystem; 1003 //proxy.PCode = (byte)PCode.ParticleSystem;
1015 uint nextUUID = m_scene.NextLocalId; 1004 uint nextUUID = m_scene.NextLocalId;
1016 1005
1017 proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, Pos, new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w), proxy); 1006 proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, Pos, Rotation, proxy);
1018 if (proxyObjectGroup != null) 1007 if (proxyObjectGroup != null)
1019 { 1008 {
1020 proxyObjectGroup.SendGroupFullUpdate(); 1009 proxyObjectGroup.SendGroupFullUpdate();
1021 remote_client.SendSitResponse(proxyObjectGroup.UUID, LLVector3.Zero, LLQuaternion.Identity, true, LLVector3.Zero, LLVector3.Zero, false); 1010 remote_client.SendSitResponse(proxyObjectGroup.UUID, Vector3.Zero, Quaternion.Identity, true, Vector3.Zero, Vector3.Zero, false);
1022 m_scene.DeleteSceneObject(proxyObjectGroup); 1011 m_scene.DeleteSceneObject(proxyObjectGroup);
1023 } 1012 }
1024 else 1013 else
1025 { 1014 {
1026 m_autopilotMoving = false; 1015 m_autopilotMoving = false;
1027 m_autoPilotTarget = LLVector3.Zero; 1016 m_autoPilotTarget = Vector3.Zero;
1028 ControllingClient.SendAlertMessage("Autopilot cancelled"); 1017 ControllingClient.SendAlertMessage("Autopilot cancelled");
1029 } 1018 }
1030 1019
@@ -1041,13 +1030,13 @@ namespace OpenSim.Region.Environment.Scenes
1041 if (part != null) 1030 if (part != null)
1042 { 1031 {
1043 AbsolutePosition = part.AbsolutePosition; 1032 AbsolutePosition = part.AbsolutePosition;
1044 Velocity = new LLVector3(0, 0, 0); 1033 Velocity = new Vector3(0, 0, 0);
1045 SendFullUpdateToAllClients(); 1034 SendFullUpdateToAllClients();
1046 1035
1047 //HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); 1036 //HandleAgentSit(ControllingClient, m_requestedSitTargetUUID);
1048 } 1037 }
1049 //ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, LLQuaternion.Identity, false, LLVector3.Zero, LLVector3.Zero, false); 1038 //ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, Quaternion.Identity, false, Vector3.Zero, Vector3.Zero, false);
1050 m_requestedSitTargetUUID = LLUUID.Zero; 1039 m_requestedSitTargetUUID = UUID.Zero;
1051 } 1040 }
1052 else 1041 else
1053 { 1042 {
@@ -1057,15 +1046,15 @@ namespace OpenSim.Region.Environment.Scenes
1057 //proxy.PCode = (byte)PCode.ParticleSystem; 1046 //proxy.PCode = (byte)PCode.ParticleSystem;
1058 ////uint nextUUID = m_scene.NextLocalId; 1047 ////uint nextUUID = m_scene.NextLocalId;
1059 1048
1060 //proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, m_autoPilotTarget, LLQuaternion.Identity, proxy); 1049 //proxyObjectGroup = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, UUID, nextUUID, m_autoPilotTarget, Quaternion.Identity, proxy);
1061 //if (proxyObjectGroup != null) 1050 //if (proxyObjectGroup != null)
1062 //{ 1051 //{
1063 //proxyObjectGroup.SendGroupFullUpdate(); 1052 //proxyObjectGroup.SendGroupFullUpdate();
1064 //ControllingClient.SendSitResponse(LLUUID.Zero, m_autoPilotTarget, LLQuaternion.Identity, true, LLVector3.Zero, LLVector3.Zero, false); 1053 //ControllingClient.SendSitResponse(UUID.Zero, m_autoPilotTarget, Quaternion.Identity, true, Vector3.Zero, Vector3.Zero, false);
1065 //m_scene.DeleteSceneObject(proxyObjectGroup); 1054 //m_scene.DeleteSceneObject(proxyObjectGroup);
1066 //} 1055 //}
1067 } 1056 }
1068 m_autoPilotTarget = LLVector3.Zero; 1057 m_autoPilotTarget = Vector3.Zero;
1069 m_autopilotMoving = false; 1058 m_autopilotMoving = false;
1070 } 1059 }
1071 } 1060 }
@@ -1082,7 +1071,7 @@ namespace OpenSim.Region.Environment.Scenes
1082 { 1071 {
1083 // Reset sit target. 1072 // Reset sit target.
1084 if (part.GetAvatarOnSitTarget() == UUID) 1073 if (part.GetAvatarOnSitTarget() == UUID)
1085 part.SetAvatarOnSitTarget(LLUUID.Zero); 1074 part.SetAvatarOnSitTarget(UUID.Zero);
1086 1075
1087 m_parentPosition = part.GetWorldPosition(); 1076 m_parentPosition = part.GetWorldPosition();
1088 } 1077 }
@@ -1092,8 +1081,8 @@ namespace OpenSim.Region.Environment.Scenes
1092 AddToPhysicalScene(); 1081 AddToPhysicalScene();
1093 } 1082 }
1094 1083
1095 m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); 1084 m_pos += m_parentPosition + new Vector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
1096 m_parentPosition = new LLVector3(); 1085 m_parentPosition = new Vector3();
1097 1086
1098 m_parentID = 0; 1087 m_parentID = 0;
1099 SendFullUpdateToAllClients(); 1088 SendFullUpdateToAllClients();
@@ -1107,7 +1096,7 @@ namespace OpenSim.Region.Environment.Scenes
1107 TrySetMovementAnimation("STAND"); 1096 TrySetMovementAnimation("STAND");
1108 } 1097 }
1109 1098
1110 private SceneObjectPart FindNextAvailableSitTarget(LLUUID targetID) 1099 private SceneObjectPart FindNextAvailableSitTarget(UUID targetID)
1111 { 1100 {
1112 SceneObjectPart targetPart = m_scene.GetSceneObjectPart(targetID); 1101 SceneObjectPart targetPart = m_scene.GetSceneObjectPart(targetID);
1113 if (targetPart == null) 1102 if (targetPart == null)
@@ -1133,12 +1122,12 @@ namespace OpenSim.Region.Environment.Scenes
1133 // Is a sit target available? 1122 // Is a sit target available?
1134 Vector3 avSitOffSet = part.SitTargetPosition; 1123 Vector3 avSitOffSet = part.SitTargetPosition;
1135 Quaternion avSitOrientation = part.SitTargetOrientation; 1124 Quaternion avSitOrientation = part.SitTargetOrientation;
1136 LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget(); 1125 UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
1137 1126
1138 bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero)); 1127 bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
1139 bool SitTargetisSet = 1128 bool SitTargetisSet =
1140 (!(avSitOffSet.x == 0 && avSitOffSet.y == 0 && avSitOffSet.z == 0 && avSitOrientation.w == 0 && 1129 (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f &&
1141 avSitOrientation.x == 0 && avSitOrientation.y == 0 && avSitOrientation.z == 1)); 1130 avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f));
1142 1131
1143 if (SitTargetisSet && SitTargetUnOccupied) 1132 if (SitTargetisSet && SitTargetUnOccupied)
1144 { 1133 {
@@ -1151,13 +1140,13 @@ namespace OpenSim.Region.Environment.Scenes
1151 return targetPart; 1140 return targetPart;
1152 } 1141 }
1153 1142
1154 private void SendSitResponse(IClientAPI remoteClient, LLUUID targetID, LLVector3 offset) 1143 private void SendSitResponse(IClientAPI remoteClient, UUID targetID, Vector3 offset)
1155 { 1144 {
1156 bool autopilot = true; 1145 bool autopilot = true;
1157 LLVector3 pos = new LLVector3(); 1146 Vector3 pos = new Vector3();
1158 LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); 1147 Quaternion sitOrientation = Quaternion.Identity;
1159 LLVector3 cameraEyeOffset = LLVector3.Zero; 1148 Vector3 cameraEyeOffset = Vector3.Zero;
1160 LLVector3 cameraAtOffset = LLVector3.Zero; 1149 Vector3 cameraAtOffset = Vector3.Zero;
1161 bool forceMouselook = false; 1150 bool forceMouselook = false;
1162 1151
1163 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); 1152 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
@@ -1170,19 +1159,18 @@ namespace OpenSim.Region.Environment.Scenes
1170 // Is a sit target available? 1159 // Is a sit target available?
1171 Vector3 avSitOffSet = part.SitTargetPosition; 1160 Vector3 avSitOffSet = part.SitTargetPosition;
1172 Quaternion avSitOrientation = part.SitTargetOrientation; 1161 Quaternion avSitOrientation = part.SitTargetOrientation;
1173 LLUUID avOnTargetAlready = part.GetAvatarOnSitTarget(); 1162 UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
1174 1163
1175 bool SitTargetUnOccupied = (!(avOnTargetAlready != LLUUID.Zero)); 1164 bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
1176 bool SitTargetisSet = 1165 bool SitTargetisSet =
1177 (!(avSitOffSet.x == 0 && avSitOffSet.y == 0 && avSitOffSet.z == 0 && avSitOrientation.w == 0 && 1166 (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f &&
1178 avSitOrientation.x == 0 && avSitOrientation.y == 0 && avSitOrientation.z == 1)); 1167 avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f));
1179 1168
1180 if (SitTargetisSet && SitTargetUnOccupied) 1169 if (SitTargetisSet && SitTargetUnOccupied)
1181 { 1170 {
1182 part.SetAvatarOnSitTarget(UUID); 1171 part.SetAvatarOnSitTarget(UUID);
1183 offset = new LLVector3(avSitOffSet.x, avSitOffSet.y, avSitOffSet.z); 1172 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z);
1184 sitOrientation = 1173 sitOrientation = avSitOrientation;
1185 new LLQuaternion(avSitOrientation.x, avSitOrientation.y, avSitOrientation.z, avSitOrientation.w);
1186 autopilot = false; 1174 autopilot = false;
1187 } 1175 }
1188 1176
@@ -1205,7 +1193,7 @@ namespace OpenSim.Region.Environment.Scenes
1205 autopilot = false; 1193 autopilot = false;
1206 1194
1207 RemoveFromPhysicalScene(); 1195 RemoveFromPhysicalScene();
1208 AbsolutePosition = pos + new LLVector3(0.0f, 0.0f, m_sitAvatarHeight); 1196 AbsolutePosition = pos + new Vector3(0.0f, 0.0f, m_sitAvatarHeight);
1209 } 1197 }
1210 } 1198 }
1211 else 1199 else
@@ -1232,7 +1220,7 @@ namespace OpenSim.Region.Environment.Scenes
1232 HandleAgentSit(remoteClient, UUID); 1220 HandleAgentSit(remoteClient, UUID);
1233 } 1221 }
1234 1222
1235 public void HandleAgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset) 1223 public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset)
1236 { 1224 {
1237 if (m_parentID != 0) 1225 if (m_parentID != 0)
1238 { 1226 {
@@ -1254,7 +1242,7 @@ namespace OpenSim.Region.Environment.Scenes
1254 SendSitResponse(remoteClient, targetID, offset); 1242 SendSitResponse(remoteClient, targetID, offset);
1255 } 1243 }
1256 1244
1257 public void HandleAgentSit(IClientAPI remoteClient, LLUUID agentID) 1245 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID)
1258 { 1246 {
1259 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 1247 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
1260 1248
@@ -1267,12 +1255,12 @@ namespace OpenSim.Region.Environment.Scenes
1267 Vector3 sitTargetPos = part.SitTargetPosition; 1255 Vector3 sitTargetPos = part.SitTargetPosition;
1268 Quaternion sitTargetOrient = part.SitTargetOrientation; 1256 Quaternion sitTargetOrient = part.SitTargetOrientation;
1269 1257
1270 //Quaternion vq = new Quaternion(sitTargetPos.x, sitTargetPos.y+0.2f, sitTargetPos.z+0.2f, 0); 1258 //Quaternion vq = new Quaternion(sitTargetPos.X, sitTargetPos.Y+0.2f, sitTargetPos.Z+0.2f, 0);
1271 //Quaternion nq = new Quaternion(sitTargetOrient.w, -sitTargetOrient.x, -sitTargetOrient.y, -sitTargetOrient.z); 1259 //Quaternion nq = new Quaternion(-sitTargetOrient.X, -sitTargetOrient.Y, -sitTargetOrient.Z, sitTargetOrient.w);
1272 1260
1273 //Quaternion result = (sitTargetOrient * vq) * nq; 1261 //Quaternion result = (sitTargetOrient * vq) * nq;
1274 1262
1275 m_pos = new LLVector3(sitTargetPos.x, sitTargetPos.y, sitTargetPos.z); 1263 m_pos = new Vector3(sitTargetPos.X, sitTargetPos.Y, sitTargetPos.Z);
1276 m_pos += m_sitTargetCorrectionOffset; 1264 m_pos += m_sitTargetCorrectionOffset;
1277 m_bodyRot = sitTargetOrient; 1265 m_bodyRot = sitTargetOrient;
1278 //Rotation = sitTargetOrient; 1266 //Rotation = sitTargetOrient;
@@ -1293,7 +1281,7 @@ namespace OpenSim.Region.Environment.Scenes
1293 } 1281 }
1294 m_parentID = m_requestedSitTargetID; 1282 m_parentID = m_requestedSitTargetID;
1295 1283
1296 Velocity = new LLVector3(0, 0, 0); 1284 Velocity = new Vector3(0, 0, 0);
1297 RemoveFromPhysicalScene(); 1285 RemoveFromPhysicalScene();
1298 1286
1299 TrySetMovementAnimation("SIT"); 1287 TrySetMovementAnimation("SIT");
@@ -1317,7 +1305,7 @@ namespace OpenSim.Region.Environment.Scenes
1317 } 1305 }
1318 } 1306 }
1319 1307
1320 public void AddAnimation(LLUUID animID) 1308 public void AddAnimation(UUID animID)
1321 { 1309 {
1322 if (m_isChildAgent) 1310 if (m_isChildAgent)
1323 return; 1311 return;
@@ -1333,14 +1321,14 @@ namespace OpenSim.Region.Environment.Scenes
1333 if (m_isChildAgent) 1321 if (m_isChildAgent)
1334 return; 1322 return;
1335 1323
1336 LLUUID animID = m_controllingClient.GetDefaultAnimation(name); 1324 UUID animID = m_controllingClient.GetDefaultAnimation(name);
1337 if (animID == LLUUID.Zero) 1325 if (animID == UUID.Zero)
1338 return; 1326 return;
1339 1327
1340 AddAnimation(animID); 1328 AddAnimation(animID);
1341 } 1329 }
1342 1330
1343 public void RemoveAnimation(LLUUID animID) 1331 public void RemoveAnimation(UUID animID)
1344 { 1332 {
1345 if (m_isChildAgent) 1333 if (m_isChildAgent)
1346 return; 1334 return;
@@ -1356,27 +1344,27 @@ namespace OpenSim.Region.Environment.Scenes
1356 if (m_isChildAgent) 1344 if (m_isChildAgent)
1357 return; 1345 return;
1358 1346
1359 LLUUID animID = m_controllingClient.GetDefaultAnimation(name); 1347 UUID animID = m_controllingClient.GetDefaultAnimation(name);
1360 if (animID == LLUUID.Zero) 1348 if (animID == UUID.Zero)
1361 return; 1349 return;
1362 1350
1363 RemoveAnimation(animID); 1351 RemoveAnimation(animID);
1364 } 1352 }
1365 1353
1366 public LLUUID[] GetAnimationArray() 1354 public UUID[] GetAnimationArray()
1367 { 1355 {
1368 LLUUID[] animIDs; 1356 UUID[] animIDs;
1369 int[] sequenceNums; 1357 int[] sequenceNums;
1370 m_animations.GetArrays( out animIDs, out sequenceNums ); 1358 m_animations.GetArrays( out animIDs, out sequenceNums );
1371 return animIDs; 1359 return animIDs;
1372 } 1360 }
1373 1361
1374 public void HandleStartAnim(IClientAPI remoteClient, LLUUID animID) 1362 public void HandleStartAnim(IClientAPI remoteClient, UUID animID)
1375 { 1363 {
1376 AddAnimation(animID); 1364 AddAnimation(animID);
1377 } 1365 }
1378 1366
1379 public void HandleStopAnim(IClientAPI remoteClient, LLUUID animID) 1367 public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
1380 { 1368 {
1381 RemoveAnimation(animID); 1369 RemoveAnimation(animID);
1382 } 1370 }
@@ -1385,7 +1373,7 @@ namespace OpenSim.Region.Environment.Scenes
1385 /// The movement animation is reserved for "main" animations 1373 /// The movement animation is reserved for "main" animations
1386 /// that are mutually exclusive, e.g. flying and sitting. 1374 /// that are mutually exclusive, e.g. flying and sitting.
1387 /// </summary> 1375 /// </summary>
1388 protected void SetMovementAnimation(LLUUID animID) 1376 protected void SetMovementAnimation(UUID animID)
1389 { 1377 {
1390 if (m_animations.SetDefaultAnimation(animID, m_controllingClient.NextAnimationSequenceNumber)) 1378 if (m_animations.SetDefaultAnimation(animID, m_controllingClient.NextAnimationSequenceNumber))
1391 { 1379 {
@@ -1494,10 +1482,10 @@ namespace OpenSim.Region.Environment.Scenes
1494 1482
1495 m_rotation = rotation; 1483 m_rotation = rotation;
1496 NewForce newVelocity = new NewForce(); 1484 NewForce newVelocity = new NewForce();
1497 Vector3 direc = rotation*vec; 1485 Vector3 direc = vec * rotation;
1498 direc.Normalize(); 1486 direc.Normalize();
1499 1487
1500 direc *= 0.03f*128f; 1488 direc *= 0.03f * 128f;
1501 if (m_physicsActor.Flying) 1489 if (m_physicsActor.Flying)
1502 { 1490 {
1503 direc *= 4; 1491 direc *= 4;
@@ -1517,9 +1505,9 @@ namespace OpenSim.Region.Environment.Scenes
1517 { 1505 {
1518 if (!m_physicsActor.Flying && m_physicsActor.IsColliding) 1506 if (!m_physicsActor.Flying && m_physicsActor.IsColliding)
1519 { 1507 {
1520 if (direc.z > 2.0f) 1508 if (direc.Z > 2.0f)
1521 { 1509 {
1522 direc.z *= 3; 1510 direc.Z *= 3;
1523 1511
1524 // TODO: PreJump and jump happen too quickly. Many times prejump gets ignored. 1512 // TODO: PreJump and jump happen too quickly. Many times prejump gets ignored.
1525 TrySetMovementAnimation("PREJUMP"); 1513 TrySetMovementAnimation("PREJUMP");
@@ -1528,9 +1516,9 @@ namespace OpenSim.Region.Environment.Scenes
1528 } 1516 }
1529 } 1517 }
1530 1518
1531 newVelocity.X = direc.x; 1519 newVelocity.X = direc.X;
1532 newVelocity.Y = direc.y; 1520 newVelocity.Y = direc.Y;
1533 newVelocity.Z = direc.z; 1521 newVelocity.Z = direc.Z;
1534 m_forcesList.Add(newVelocity); 1522 m_forcesList.Add(newVelocity);
1535 1523
1536 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 1524 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
@@ -1595,11 +1583,11 @@ namespace OpenSim.Region.Environment.Scenes
1595 { 1583 {
1596 m_perfMonMS = System.Environment.TickCount; 1584 m_perfMonMS = System.Environment.TickCount;
1597 1585
1598 LLVector3 pos = m_pos; 1586 Vector3 pos = m_pos;
1599 LLVector3 vel = Velocity; 1587 Vector3 vel = Velocity;
1600 LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); 1588 Quaternion rot = m_bodyRot;
1601 remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new LLVector3(pos.X, pos.Y, pos.Z), 1589 remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z),
1602 new LLVector3(vel.X, vel.Y, vel.Z), rot); 1590 new Vector3(vel.X, vel.Y, vel.Z), rot);
1603 1591
1604 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 1592 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1605 m_scene.AddAgentUpdates(1); 1593 m_scene.AddAgentUpdates(1);
@@ -1625,7 +1613,7 @@ namespace OpenSim.Region.Environment.Scenes
1625 { 1613 {
1626 m_perfMonMS = System.Environment.TickCount; 1614 m_perfMonMS = System.Environment.TickCount;
1627 1615
1628 List<LLVector3> CoarseLocations = new List<LLVector3>(); 1616 List<Vector3> CoarseLocations = new List<Vector3>();
1629 List<ScenePresence> avatars = m_scene.GetAvatars(); 1617 List<ScenePresence> avatars = m_scene.GetAvatars();
1630 for (int i = 0; i < avatars.Count; i++) 1618 for (int i = 0; i < avatars.Count; i++)
1631 { 1619 {
@@ -1660,8 +1648,8 @@ namespace OpenSim.Region.Environment.Scenes
1660 if (m_appearance.Texture == null) 1648 if (m_appearance.Texture == null)
1661 return; 1649 return;
1662 1650
1663 // Note: because LLQuaternion is a struct, it can't be null 1651 // Note: because Quaternion is a struct, it can't be null
1664 LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); 1652 Quaternion rot = m_bodyRot;
1665 1653
1666 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, 1654 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
1667 LocalId, m_pos, m_appearance.Texture.ToBytes(), 1655 LocalId, m_pos, m_appearance.Texture.ToBytes(),
@@ -1723,8 +1711,8 @@ namespace OpenSim.Region.Environment.Scenes
1723 // Needed for standalone 1711 // Needed for standalone
1724 m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); 1712 m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
1725 1713
1726 // Note: because LLQuaternion is a struct, it can't be null 1714 // Note: because Quaternion is a struct, it can't be null
1727 LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); 1715 Quaternion rot = m_bodyRot;
1728 1716
1729 m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId, 1717 m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId,
1730 m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot); 1718 m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot);
@@ -1813,7 +1801,7 @@ namespace OpenSim.Region.Environment.Scenes
1813 /// </summary> 1801 /// </summary>
1814 /// <param name="animations"></param> 1802 /// <param name="animations"></param>
1815 /// <param name="seqs"></param> 1803 /// <param name="seqs"></param>
1816 public void SendAnimPack(LLUUID[] animations, int[] seqs) 1804 public void SendAnimPack(UUID[] animations, int[] seqs)
1817 { 1805 {
1818 if (m_isChildAgent) 1806 if (m_isChildAgent)
1819 return; 1807 return;
@@ -1826,7 +1814,7 @@ namespace OpenSim.Region.Environment.Scenes
1826 { 1814 {
1827 if (m_isChildAgent) 1815 if (m_isChildAgent)
1828 return; 1816 return;
1829 LLUUID[] animIDs; 1817 UUID[] animIDs;
1830 int[] sequenceNums; 1818 int[] sequenceNums;
1831 1819
1832 m_animations.GetArrays(out animIDs, out sequenceNums); 1820 m_animations.GetArrays(out animIDs, out sequenceNums);
@@ -1842,7 +1830,7 @@ namespace OpenSim.Region.Environment.Scenes
1842 if (m_isChildAgent) 1830 if (m_isChildAgent)
1843 return; 1831 return;
1844 1832
1845 LLUUID[] animIDs; 1833 UUID[] animIDs;
1846 int[] sequenceNums; 1834 int[] sequenceNums;
1847 1835
1848 m_animations.GetArrays(out animIDs, out sequenceNums); 1836 m_animations.GetArrays(out animIDs, out sequenceNums);
@@ -1870,16 +1858,16 @@ namespace OpenSim.Region.Environment.Scenes
1870 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32) 1858 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32)
1871 { 1859 {
1872 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); 1860 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate();
1873 cadu.ActiveGroupID=LLUUID.Zero.UUID; 1861 cadu.ActiveGroupID = UUID.Zero.Guid;
1874 cadu.AgentID = UUID.UUID; 1862 cadu.AgentID = UUID.Guid;
1875 cadu.alwaysrun = m_setAlwaysRun; 1863 cadu.alwaysrun = m_setAlwaysRun;
1876 cadu.AVHeight = m_avHeight; 1864 cadu.AVHeight = m_avHeight;
1877 LLVector3 tempCameraCenter = new LLVector3(m_CameraCenter.x, m_CameraCenter.y, m_CameraCenter.z); 1865 Vector3 tempCameraCenter = new Vector3(m_CameraCenter.X, m_CameraCenter.Y, m_CameraCenter.Z);
1878 cadu.cameraPosition = new sLLVector3(tempCameraCenter); 1866 cadu.cameraPosition = tempCameraCenter;
1879 cadu.drawdistance = m_DrawDistance; 1867 cadu.drawdistance = m_DrawDistance;
1880 cadu.godlevel = m_godlevel; 1868 cadu.godlevel = m_godlevel;
1881 cadu.GroupAccess = 0; 1869 cadu.GroupAccess = 0;
1882 cadu.Position = new sLLVector3(AbsolutePosition); 1870 cadu.Position = AbsolutePosition;
1883 cadu.regionHandle = m_scene.RegionInfo.RegionHandle; 1871 cadu.regionHandle = m_scene.RegionInfo.RegionHandle;
1884 float multiplier = 1; 1872 float multiplier = 1;
1885 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 1873 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount();
@@ -1899,7 +1887,7 @@ namespace OpenSim.Region.Environment.Scenes
1899 1887
1900 1888
1901 1889
1902 cadu.Velocity = new sLLVector3(Velocity); 1890 cadu.Velocity = Velocity;
1903 m_scene.SendOutChildAgentUpdates(cadu,this); 1891 m_scene.SendOutChildAgentUpdates(cadu,this);
1904 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; 1892 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X;
1905 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; 1893 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y;
@@ -1919,8 +1907,8 @@ namespace OpenSim.Region.Environment.Scenes
1919 if (IsChildAgent) 1907 if (IsChildAgent)
1920 return; 1908 return;
1921 1909
1922 LLVector3 pos2 = AbsolutePosition; 1910 Vector3 pos2 = AbsolutePosition;
1923 LLVector3 vel = Velocity; 1911 Vector3 vel = Velocity;
1924 1912
1925 float timeStep = 0.1f; 1913 float timeStep = 0.1f;
1926 pos2.X = pos2.X + (vel.X*timeStep); 1914 pos2.X = pos2.X + (vel.X*timeStep);
@@ -1946,8 +1934,8 @@ namespace OpenSim.Region.Environment.Scenes
1946 /// </summary> 1934 /// </summary>
1947 protected void CrossToNewRegion() 1935 protected void CrossToNewRegion()
1948 { 1936 {
1949 LLVector3 pos = AbsolutePosition; 1937 Vector3 pos = AbsolutePosition;
1950 LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z); 1938 Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z);
1951 uint neighbourx = m_regionInfo.RegionLocX; 1939 uint neighbourx = m_regionInfo.RegionLocX;
1952 uint neighboury = m_regionInfo.RegionLocY; 1940 uint neighboury = m_regionInfo.RegionLocY;
1953 1941
@@ -1979,7 +1967,7 @@ namespace OpenSim.Region.Environment.Scenes
1979 newpos.Y = enterDistance; 1967 newpos.Y = enterDistance;
1980 } 1968 }
1981 1969
1982 LLVector3 vel = m_velocity; 1970 Vector3 vel = m_velocity;
1983 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 1971 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
1984 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 1972 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
1985 if (neighbourRegion != null && ValidateAttachments()) 1973 if (neighbourRegion != null && ValidateAttachments())
@@ -2023,7 +2011,7 @@ namespace OpenSim.Region.Environment.Scenes
2023 2011
2024 CrossAttachmentsIntoNewRegion(neighbourHandle); 2012 CrossAttachmentsIntoNewRegion(neighbourHandle);
2025 2013
2026 m_scene.SendKillObject(m_localId); 2014 m_scene.SendKiPrimitive(m_localId);
2027 2015
2028 m_scene.NotifyMyCoarseLocationChange(); 2016 m_scene.NotifyMyCoarseLocationChange();
2029 // the user may change their profile information in other region, 2017 // the user may change their profile information in other region,
@@ -2047,7 +2035,7 @@ namespace OpenSim.Region.Environment.Scenes
2047 /// This allows the Sim owner the abiility to kick users from their sim currently. 2035 /// This allows the Sim owner the abiility to kick users from their sim currently.
2048 /// It tells the client that the agent has permission to do so. 2036 /// It tells the client that the agent has permission to do so.
2049 /// </summary> 2037 /// </summary>
2050 public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token, bool godStatus) 2038 public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus)
2051 { 2039 {
2052 if (godStatus) 2040 if (godStatus)
2053 { 2041 {
@@ -2082,11 +2070,11 @@ namespace OpenSim.Region.Environment.Scenes
2082 int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; 2070 int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize;
2083 2071
2084 m_DrawDistance = cAgentData.drawdistance; 2072 m_DrawDistance = cAgentData.drawdistance;
2085 m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z); 2073 m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z);
2086 2074
2087 // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region 2075 // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region
2088 m_CameraCenter = 2076 m_CameraCenter =
2089 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); 2077 new Vector3(cAgentData.cameraPosition.X, cAgentData.cameraPosition.Y, cAgentData.cameraPosition.Z);
2090 2078
2091 2079
2092 m_godlevel = cAgentData.godlevel; 2080 m_godlevel = cAgentData.godlevel;
@@ -2147,7 +2135,7 @@ namespace OpenSim.Region.Environment.Scenes
2147 static ScenePresence() 2135 static ScenePresence()
2148 { 2136 {
2149 2137
2150 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 2138 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
2151 DefaultTexture = textu.ToBytes(); 2139 DefaultTexture = textu.ToBytes();
2152 } 2140 }
2153 2141
@@ -2166,13 +2154,13 @@ namespace OpenSim.Region.Environment.Scenes
2166 [Serializable] 2154 [Serializable]
2167 public class ScenePartUpdate : ISerializable 2155 public class ScenePartUpdate : ISerializable
2168 { 2156 {
2169 public LLUUID FullID; 2157 public UUID FullID;
2170 public uint LastFullUpdateTime; 2158 public uint LastFullUpdateTime;
2171 public uint LastTerseUpdateTime; 2159 public uint LastTerseUpdateTime;
2172 2160
2173 public ScenePartUpdate() 2161 public ScenePartUpdate()
2174 { 2162 {
2175 FullID = LLUUID.Zero; 2163 FullID = UUID.Zero;
2176 LastFullUpdateTime = 0; 2164 LastFullUpdateTime = 0;
2177 LastTerseUpdateTime = 0; 2165 LastTerseUpdateTime = 0;
2178 } 2166 }
@@ -2186,7 +2174,7 @@ namespace OpenSim.Region.Environment.Scenes
2186 throw new ArgumentNullException("info"); 2174 throw new ArgumentNullException("info");
2187 } 2175 }
2188 2176
2189 FullID = new LLUUID((Guid)info.GetValue("FullID", typeof(Guid))); 2177 FullID = new UUID((Guid)info.GetValue("FullID", typeof(Guid)));
2190 LastFullUpdateTime = (uint)info.GetValue("LastFullUpdateTime", typeof(uint)); 2178 LastFullUpdateTime = (uint)info.GetValue("LastFullUpdateTime", typeof(uint));
2191 LastTerseUpdateTime = (uint)info.GetValue("LastTerseUpdateTime", typeof(uint)); 2179 LastTerseUpdateTime = (uint)info.GetValue("LastTerseUpdateTime", typeof(uint));
2192 2180
@@ -2203,7 +2191,7 @@ namespace OpenSim.Region.Environment.Scenes
2203 throw new ArgumentNullException("info"); 2191 throw new ArgumentNullException("info");
2204 } 2192 }
2205 2193
2206 info.AddValue("FullID", FullID.UUID); 2194 info.AddValue("FullID", FullID.Guid);
2207 info.AddValue("LastFullUpdateTime", LastFullUpdateTime); 2195 info.AddValue("LastFullUpdateTime", LastFullUpdateTime);
2208 info.AddValue("LastTerseUpdateTime", LastTerseUpdateTime); 2196 info.AddValue("LastTerseUpdateTime", LastTerseUpdateTime);
2209 } 2197 }
@@ -2333,7 +2321,7 @@ namespace OpenSim.Region.Environment.Scenes
2333*/ 2321*/
2334 if (DefaultTexture == null) 2322 if (DefaultTexture == null)
2335 { 2323 {
2336 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 2324 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
2337 DefaultTexture = textu.ToBytes(); 2325 DefaultTexture = textu.ToBytes();
2338 } 2326 }
2339 } 2327 }
@@ -2421,8 +2409,8 @@ namespace OpenSim.Region.Environment.Scenes
2421 Animations = new AvatarAnimations(); 2409 Animations = new AvatarAnimations();
2422 Animations.LoadAnims(); 2410 Animations.LoadAnims();
2423 2411
2424 m_animations = new List<LLUUID>(); 2412 m_animations = new List<UUID>();
2425 m_animations.Add(Animations.AnimsLLUUID["STAND"]); 2413 m_animations.Add(Animations.AnimsUUID["STAND"]);
2426 m_animationSeqs.Add(m_controllingClient.NextAnimationSequenceNumber); 2414 m_animationSeqs.Add(m_controllingClient.NextAnimationSequenceNumber);
2427 2415
2428 SetDirectionVectors(); 2416 SetDirectionVectors();
@@ -2447,7 +2435,7 @@ namespace OpenSim.Region.Environment.Scenes
2447*/ 2435*/
2448 if (DefaultTexture == null) 2436 if (DefaultTexture == null)
2449 { 2437 {
2450 LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); 2438 Primitive.TextureEntry textu = AvatarAppearance.GetDefaultTexture();
2451 DefaultTexture = textu.ToBytes(); 2439 DefaultTexture = textu.ToBytes();
2452 } 2440 }
2453 2441
@@ -2459,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes
2459 m_requestedSitTargetID = (uint)info.GetValue("m_requestedSitTargetID", typeof(uint)); 2447 m_requestedSitTargetID = (uint)info.GetValue("m_requestedSitTargetID", typeof(uint));
2460 2448
2461 m_requestedSitOffset 2449 m_requestedSitOffset
2462 = new LLVector3( 2450 = new Vector3(
2463 (float)info.GetValue("m_requestedSitOffset.X", typeof(float)), 2451 (float)info.GetValue("m_requestedSitOffset.X", typeof(float)),
2464 (float)info.GetValue("m_requestedSitOffset.Y", typeof(float)), 2452 (float)info.GetValue("m_requestedSitOffset.Y", typeof(float)),
2465 (float)info.GetValue("m_requestedSitOffset.Z", typeof(float))); 2453 (float)info.GetValue("m_requestedSitOffset.Z", typeof(float)));
@@ -2470,10 +2458,10 @@ namespace OpenSim.Region.Environment.Scenes
2470 2458
2471 m_bodyRot 2459 m_bodyRot
2472 = new Quaternion( 2460 = new Quaternion(
2473 (float)info.GetValue("m_bodyRot.w", typeof(float)), 2461 (float)info.GetValue("m_bodyRot.X", typeof(float)),
2474 (float)info.GetValue("m_bodyRot.x", typeof(float)), 2462 (float)info.GetValue("m_bodyRot.Y", typeof(float)),
2475 (float)info.GetValue("m_bodyRot.y", typeof(float)), 2463 (float)info.GetValue("m_bodyRot.Z", typeof(float)),
2476 (float)info.GetValue("m_bodyRot.z", typeof(float))); 2464 (float)info.GetValue("m_bodyRot.W", typeof(float)));
2477 2465
2478 IsRestrictedToRegion = (bool)info.GetValue("IsRestrictedToRegion", typeof(bool)); 2466 IsRestrictedToRegion = (bool)info.GetValue("IsRestrictedToRegion", typeof(bool));
2479 m_newForce = (bool)info.GetValue("m_newForce", typeof(bool)); 2467 m_newForce = (bool)info.GetValue("m_newForce", typeof(bool));
@@ -2493,7 +2481,7 @@ namespace OpenSim.Region.Environment.Scenes
2493 Dir_Vectors = Dir_Vectors_work2.ToArray(); 2481 Dir_Vectors = Dir_Vectors_work2.ToArray();
2494 2482
2495 lastPhysPos 2483 lastPhysPos
2496 = new LLVector3( 2484 = new Vector3(
2497 (float)info.GetValue("lastPhysPos.X", typeof(float)), 2485 (float)info.GetValue("lastPhysPos.X", typeof(float)),
2498 (float)info.GetValue("lastPhysPos.Y", typeof(float)), 2486 (float)info.GetValue("lastPhysPos.Y", typeof(float)),
2499 (float)info.GetValue("lastPhysPos.Z", typeof(float))); 2487 (float)info.GetValue("lastPhysPos.Z", typeof(float)));
@@ -2527,7 +2515,7 @@ namespace OpenSim.Region.Environment.Scenes
2527 m_knownChildRegions = (List<ulong>)info.GetValue("m_knownChildRegions", typeof(List<ulong>)); 2515 m_knownChildRegions = (List<ulong>)info.GetValue("m_knownChildRegions", typeof(List<ulong>));
2528 2516
2529 posLastSignificantMove 2517 posLastSignificantMove
2530 = new LLVector3( 2518 = new Vector3(
2531 (float)info.GetValue("posLastSignificantMove.X", typeof(float)), 2519 (float)info.GetValue("posLastSignificantMove.X", typeof(float)),
2532 (float)info.GetValue("posLastSignificantMove.Y", typeof(float)), 2520 (float)info.GetValue("posLastSignificantMove.Y", typeof(float)),
2533 (float)info.GetValue("posLastSignificantMove.Z", typeof(float))); 2521 (float)info.GetValue("posLastSignificantMove.Z", typeof(float)));
@@ -2540,14 +2528,14 @@ namespace OpenSim.Region.Environment.Scenes
2540 2528
2541 foreach (Guid id in updateTimes_work.Keys) 2529 foreach (Guid id in updateTimes_work.Keys)
2542 { 2530 {
2543 m_updateTimes.Add(new LLUUID(id), updateTimes_work[id]); 2531 m_updateTimes.Add(new UUID(id), updateTimes_work[id]);
2544 } 2532 }
2545 */ 2533 */
2546 m_regionHandle = (ulong)info.GetValue("m_regionHandle", typeof(ulong)); 2534 m_regionHandle = (ulong)info.GetValue("m_regionHandle", typeof(ulong));
2547 m_firstname = (string)info.GetValue("m_firstname", typeof(string)); 2535 m_firstname = (string)info.GetValue("m_firstname", typeof(string));
2548 m_lastname = (string)info.GetValue("m_lastname", typeof(string)); 2536 m_lastname = (string)info.GetValue("m_lastname", typeof(string));
2549 m_allowMovement = (bool)info.GetValue("m_allowMovement", typeof(bool)); 2537 m_allowMovement = (bool)info.GetValue("m_allowMovement", typeof(bool));
2550 m_parentPosition = new LLVector3((float)info.GetValue("m_parentPosition.X", typeof(float)), 2538 m_parentPosition = new Vector3((float)info.GetValue("m_parentPosition.X", typeof(float)),
2551 (float)info.GetValue("m_parentPosition.Y", typeof(float)), 2539 (float)info.GetValue("m_parentPosition.Y", typeof(float)),
2552 (float)info.GetValue("m_parentPosition.Z", typeof(float))); 2540 (float)info.GetValue("m_parentPosition.Z", typeof(float)));
2553 2541
@@ -2555,7 +2543,7 @@ namespace OpenSim.Region.Environment.Scenes
2555 m_parentID = (uint)info.GetValue("m_parentID", typeof(uint)); 2543 m_parentID = (uint)info.GetValue("m_parentID", typeof(uint));
2556 2544
2557// for OpenSim_v0.5 2545// for OpenSim_v0.5
2558 currentParcelUUID = new LLUUID((Guid)info.GetValue("currentParcelUUID", typeof(Guid))); 2546 currentParcelUUID = new UUID((Guid)info.GetValue("currentParcelUUID", typeof(Guid)));
2559 2547
2560 lastKnownAllowedPosition 2548 lastKnownAllowedPosition
2561 = new Vector3( 2549 = new Vector3(
@@ -2566,7 +2554,7 @@ namespace OpenSim.Region.Environment.Scenes
2566 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool)); 2554 sentMessageAboutRestrictedParcelFlyingDown = (bool)info.GetValue("sentMessageAboutRestrictedParcelFlyingDown", typeof(bool));
2567 2555
2568 m_LastChildAgentUpdatePosition 2556 m_LastChildAgentUpdatePosition
2569 = new LLVector3( 2557 = new Vector3(
2570 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)), 2558 (float)info.GetValue("m_LastChildAgentUpdatePosition.X", typeof(float)),
2571 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)), 2559 (float)info.GetValue("m_LastChildAgentUpdatePosition.Y", typeof(float)),
2572 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float))); 2560 (float)info.GetValue("m_LastChildAgentUpdatePosition.Z", typeof(float)));
@@ -2575,11 +2563,11 @@ namespace OpenSim.Region.Environment.Scenes
2575 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint)); 2563 m_AgentControlFlags = (uint)info.GetValue("m_AgentControlFlags", typeof(uint));
2576 2564
2577 m_headrotation 2565 m_headrotation
2578 = new LLQuaternion( 2566 = new Quaternion(
2579 (float)info.GetValue("m_headrotation.W", typeof(float)),
2580 (float)info.GetValue("m_headrotation.X", typeof(float)), 2567 (float)info.GetValue("m_headrotation.X", typeof(float)),
2581 (float)info.GetValue("m_headrotation.Y", typeof(float)), 2568 (float)info.GetValue("m_headrotation.Y", typeof(float)),
2582 (float)info.GetValue("m_headrotation.Z", typeof(float))); 2569 (float)info.GetValue("m_headrotation.Z", typeof(float)),
2570 (float)info.GetValue("m_headrotation.W", typeof(float)));
2583 2571
2584 m_state = (byte)info.GetValue("m_state", typeof(byte)); 2572 m_state = (byte)info.GetValue("m_state", typeof(byte));
2585 2573
@@ -2605,7 +2593,7 @@ namespace OpenSim.Region.Environment.Scenes
2605 info.AddValue("m_updateCount", m_updateCount); 2593 info.AddValue("m_updateCount", m_updateCount);
2606 info.AddValue("m_requestedSitTargetID", m_requestedSitTargetID); 2594 info.AddValue("m_requestedSitTargetID", m_requestedSitTargetID);
2607 2595
2608 // LLVector3 2596 // Vector3
2609 info.AddValue("m_requestedSitOffset.X", m_requestedSitOffset.X); 2597 info.AddValue("m_requestedSitOffset.X", m_requestedSitOffset.X);
2610 info.AddValue("m_requestedSitOffset.Y", m_requestedSitOffset.Y); 2598 info.AddValue("m_requestedSitOffset.Y", m_requestedSitOffset.Y);
2611 info.AddValue("m_requestedSitOffset.Z", m_requestedSitOffset.Z); 2599 info.AddValue("m_requestedSitOffset.Z", m_requestedSitOffset.Z);
@@ -2615,16 +2603,16 @@ namespace OpenSim.Region.Environment.Scenes
2615 info.AddValue("m_setAlwaysRun", m_setAlwaysRun); 2603 info.AddValue("m_setAlwaysRun", m_setAlwaysRun);
2616 2604
2617 // Quaternion 2605 // Quaternion
2618 info.AddValue("m_bodyRot.w", m_bodyRot.w); 2606 info.AddValue("m_bodyRot.X", m_bodyRot.X);
2619 info.AddValue("m_bodyRot.x", m_bodyRot.x); 2607 info.AddValue("m_bodyRot.Y", m_bodyRot.Y);
2620 info.AddValue("m_bodyRot.y", m_bodyRot.y); 2608 info.AddValue("m_bodyRot.Z", m_bodyRot.Z);
2621 info.AddValue("m_bodyRot.z", m_bodyRot.z); 2609 info.AddValue("m_bodyRot.W", m_bodyRot.W);
2622 2610
2623 info.AddValue("IsRestrictedToRegion", IsRestrictedToRegion); 2611 info.AddValue("IsRestrictedToRegion", IsRestrictedToRegion);
2624 info.AddValue("m_newForce", m_newForce); 2612 info.AddValue("m_newForce", m_newForce);
2625 //info.AddValue("m_newAvatar", m_newAvatar); 2613 //info.AddValue("m_newAvatar", m_newAvatar);
2626 info.AddValue("m_newCoarseLocations", m_newCoarseLocations); 2614 info.AddValue("m_newCoarseLocations", m_newCoarseLocations);
2627 info.AddValue("m_gotAllObjectsInScene", false); 2615 info.AddValue("m_gotAPrimitivesInScene", false);
2628 info.AddValue("m_avHeight", m_avHeight); 2616 info.AddValue("m_avHeight", m_avHeight);
2629 2617
2630 // info.AddValue("m_regionInfo", m_regionInfo); 2618 // info.AddValue("m_regionInfo", m_regionInfo);
@@ -2635,41 +2623,41 @@ namespace OpenSim.Region.Environment.Scenes
2635 2623
2636 foreach (Vector3 v3 in Dir_Vectors) 2624 foreach (Vector3 v3 in Dir_Vectors)
2637 { 2625 {
2638 Dir_Vectors_work.Add(new float[] { v3.x, v3.y, v3.z }); 2626 Dir_Vectors_work.Add(new float[] { v3.X, v3.Y, v3.Z });
2639 } 2627 }
2640 2628
2641 info.AddValue("Dir_Vectors", Dir_Vectors_work); 2629 info.AddValue("Dir_Vectors", Dir_Vectors_work);
2642 2630
2643 // LLVector3 2631 // Vector3
2644 info.AddValue("lastPhysPos.X", lastPhysPos.X); 2632 info.AddValue("lastPhysPos.X", lastPhysPos.X);
2645 info.AddValue("lastPhysPos.Y", lastPhysPos.Y); 2633 info.AddValue("lastPhysPos.Y", lastPhysPos.Y);
2646 info.AddValue("lastPhysPos.Z", lastPhysPos.Z); 2634 info.AddValue("lastPhysPos.Z", lastPhysPos.Z);
2647 2635
2648 // Vector3 2636 // Vector3
2649 info.AddValue("m_CameraCenter.X", m_CameraCenter.x); 2637 info.AddValue("m_CameraCenter.X", m_CameraCenter.X);
2650 info.AddValue("m_CameraCenter.Y", m_CameraCenter.y); 2638 info.AddValue("m_CameraCenter.Y", m_CameraCenter.Y);
2651 info.AddValue("m_CameraCenter.Z", m_CameraCenter.z); 2639 info.AddValue("m_CameraCenter.Z", m_CameraCenter.Z);
2652 2640
2653 // Vector3 2641 // Vector3
2654 info.AddValue("m_CameraAtAxis.X", m_CameraAtAxis.x); 2642 info.AddValue("m_CameraAtAxis.X", m_CameraAtAxis.X);
2655 info.AddValue("m_CameraAtAxis.Y", m_CameraAtAxis.y); 2643 info.AddValue("m_CameraAtAxis.Y", m_CameraAtAxis.Y);
2656 info.AddValue("m_CameraAtAxis.Z", m_CameraAtAxis.z); 2644 info.AddValue("m_CameraAtAxis.Z", m_CameraAtAxis.Z);
2657 2645
2658 // Vector3 2646 // Vector3
2659 info.AddValue("m_CameraLeftAxis.X", m_CameraLeftAxis.x); 2647 info.AddValue("m_CameraLeftAxis.X", m_CameraLeftAxis.X);
2660 info.AddValue("m_CameraLeftAxis.Y", m_CameraLeftAxis.y); 2648 info.AddValue("m_CameraLeftAxis.Y", m_CameraLeftAxis.Y);
2661 info.AddValue("m_CameraLeftAxis.Z", m_CameraLeftAxis.z); 2649 info.AddValue("m_CameraLeftAxis.Z", m_CameraLeftAxis.Z);
2662 2650
2663 // Vector3 2651 // Vector3
2664 info.AddValue("m_CameraUpAxis.X", m_CameraUpAxis.x); 2652 info.AddValue("m_CameraUpAxis.X", m_CameraUpAxis.X);
2665 info.AddValue("m_CameraUpAxis.Y", m_CameraUpAxis.y); 2653 info.AddValue("m_CameraUpAxis.Y", m_CameraUpAxis.Y);
2666 info.AddValue("m_CameraUpAxis.Z", m_CameraUpAxis.z); 2654 info.AddValue("m_CameraUpAxis.Z", m_CameraUpAxis.Z);
2667 2655
2668 info.AddValue("m_DrawDistance", m_DrawDistance); 2656 info.AddValue("m_DrawDistance", m_DrawDistance);
2669 info.AddValue("m_appearance", m_appearance); 2657 info.AddValue("m_appearance", m_appearance);
2670 info.AddValue("m_knownChildRegions", m_knownChildRegions); 2658 info.AddValue("m_knownChildRegions", m_knownChildRegions);
2671 2659
2672 // LLVector3 2660 // Vector3
2673 info.AddValue("posLastSignificantMove.X", posLastSignificantMove.X); 2661 info.AddValue("posLastSignificantMove.X", posLastSignificantMove.X);
2674 info.AddValue("posLastSignificantMove.Y", posLastSignificantMove.Y); 2662 info.AddValue("posLastSignificantMove.Y", posLastSignificantMove.Y);
2675 info.AddValue("posLastSignificantMove.Z", posLastSignificantMove.Z); 2663 info.AddValue("posLastSignificantMove.Z", posLastSignificantMove.Z);
@@ -2679,7 +2667,7 @@ namespace OpenSim.Region.Environment.Scenes
2679 /* 2667 /*
2680 Dictionary<Guid, ScenePartUpdate> updateTimes_work = new Dictionary<Guid, ScenePartUpdate>(); 2668 Dictionary<Guid, ScenePartUpdate> updateTimes_work = new Dictionary<Guid, ScenePartUpdate>();
2681 2669
2682 foreach (LLUUID id in m_updateTimes.Keys) 2670 foreach (UUID id in m_updateTimes.Keys)
2683 { 2671 {
2684 updateTimes_work.Add(id.UUID, m_updateTimes[id]); 2672 updateTimes_work.Add(id.UUID, m_updateTimes[id]);
2685 } 2673 }
@@ -2699,11 +2687,11 @@ namespace OpenSim.Region.Environment.Scenes
2699 info.AddValue("m_parentID", m_parentID); 2687 info.AddValue("m_parentID", m_parentID);
2700 2688
2701// for OpenSim_v0.5 2689// for OpenSim_v0.5
2702 info.AddValue("currentParcelUUID", currentParcelUUID.UUID); 2690 info.AddValue("currentParcelUUID", currentParcelUUID.Guid);
2703 2691
2704 info.AddValue("lastKnownAllowedPosition.X", lastKnownAllowedPosition.x); 2692 info.AddValue("lastKnownAllowedPosition.X", lastKnownAllowedPosition.X);
2705 info.AddValue("lastKnownAllowedPosition.Y", lastKnownAllowedPosition.y); 2693 info.AddValue("lastKnownAllowedPosition.Y", lastKnownAllowedPosition.Y);
2706 info.AddValue("lastKnownAllowedPosition.Z", lastKnownAllowedPosition.z); 2694 info.AddValue("lastKnownAllowedPosition.Z", lastKnownAllowedPosition.Z);
2707 2695
2708 info.AddValue("sentMessageAboutRestrictedParcelFlyingDown", sentMessageAboutRestrictedParcelFlyingDown); 2696 info.AddValue("sentMessageAboutRestrictedParcelFlyingDown", sentMessageAboutRestrictedParcelFlyingDown);
2709 2697
@@ -2734,13 +2722,13 @@ namespace OpenSim.Region.Environment.Scenes
2734 } 2722 }
2735 } 2723 }
2736 2724
2737 public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, LLUUID Script_item_LLUUID) 2725 public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, UUID Script_item_UUID)
2738 { 2726 {
2739 ScriptControllers obj = new ScriptControllers(); 2727 ScriptControllers obj = new ScriptControllers();
2740 obj.ignoreControls = ScriptControlled.CONTROL_ZERO; 2728 obj.ignoreControls = ScriptControlled.CONTROL_ZERO;
2741 obj.eventControls = ScriptControlled.CONTROL_ZERO; 2729 obj.eventControls = ScriptControlled.CONTROL_ZERO;
2742 2730
2743 obj.itemID = Script_item_LLUUID; 2731 obj.itemID = Script_item_UUID;
2744 obj.objID = Obj_localID; 2732 obj.objID = Obj_localID;
2745 if (pass_on == 0 && accept == 0) 2733 if (pass_on == 0 && accept == 0)
2746 { 2734 {
@@ -2766,27 +2754,27 @@ namespace OpenSim.Region.Environment.Scenes
2766 if (pass_on == 1 && accept == 0) 2754 if (pass_on == 1 && accept == 0)
2767 { 2755 {
2768 IgnoredControls &= ~(ScriptControlled)controls; 2756 IgnoredControls &= ~(ScriptControlled)controls;
2769 if (scriptedcontrols.ContainsKey(Script_item_LLUUID)) 2757 if (scriptedcontrols.ContainsKey(Script_item_UUID))
2770 scriptedcontrols.Remove(Script_item_LLUUID); 2758 scriptedcontrols.Remove(Script_item_UUID);
2771 2759
2772 } 2760 }
2773 else 2761 else
2774 { 2762 {
2775 2763
2776 if (scriptedcontrols.ContainsKey(Script_item_LLUUID)) 2764 if (scriptedcontrols.ContainsKey(Script_item_UUID))
2777 { 2765 {
2778 scriptedcontrols[Script_item_LLUUID] = obj; 2766 scriptedcontrols[Script_item_UUID] = obj;
2779 } 2767 }
2780 else 2768 else
2781 { 2769 {
2782 scriptedcontrols.Add(Script_item_LLUUID, obj); 2770 scriptedcontrols.Add(Script_item_UUID, obj);
2783 } 2771 }
2784 } 2772 }
2785 } 2773 }
2786 ControllingClient.SendTakeControls(controls, pass_on == 1 ? true : false, true); 2774 ControllingClient.SendTakeControls(controls, pass_on == 1 ? true : false, true);
2787 } 2775 }
2788 2776
2789 public void HandleForceReleaseControls(IClientAPI remoteClient, LLUUID agentID) 2777 public void HandleForceReleaseControls(IClientAPI remoteClient, UUID agentID)
2790 { 2778 {
2791 IgnoredControls = ScriptControlled.CONTROL_ZERO; 2779 IgnoredControls = ScriptControlled.CONTROL_ZERO;
2792 lock (scriptedcontrols) 2780 lock (scriptedcontrols)
@@ -2796,13 +2784,13 @@ namespace OpenSim.Region.Environment.Scenes
2796 ControllingClient.SendTakeControls(int.MaxValue, false, false); 2784 ControllingClient.SendTakeControls(int.MaxValue, false, false);
2797 } 2785 }
2798 2786
2799 public void UnRegisterControlEventsToScript(uint Obj_localID, LLUUID Script_item_LLUUID) 2787 public void UnRegisterControlEventsToScript(uint Obj_localID, UUID Script_item_UUID)
2800 { 2788 {
2801 lock (scriptedcontrols) 2789 lock (scriptedcontrols)
2802 { 2790 {
2803 if (scriptedcontrols.ContainsKey(Script_item_LLUUID)) 2791 if (scriptedcontrols.ContainsKey(Script_item_UUID))
2804 { 2792 {
2805 scriptedcontrols.Remove(Script_item_LLUUID); 2793 scriptedcontrols.Remove(Script_item_UUID);
2806 IgnoredControls = ScriptControlled.CONTROL_ZERO; 2794 IgnoredControls = ScriptControlled.CONTROL_ZERO;
2807 foreach (ScriptControllers scData in scriptedcontrols.Values) 2795 foreach (ScriptControllers scData in scriptedcontrols.Values)
2808 { 2796 {
@@ -2864,7 +2852,7 @@ namespace OpenSim.Region.Environment.Scenes
2864 { 2852 {
2865 lock (scriptedcontrols) 2853 lock (scriptedcontrols)
2866 { 2854 {
2867 foreach (LLUUID scriptUUID in scriptedcontrols.Keys) 2855 foreach (UUID scriptUUID in scriptedcontrols.Keys)
2868 { 2856 {
2869 ScriptControllers scriptControlData = scriptedcontrols[scriptUUID]; 2857 ScriptControllers scriptControlData = scriptedcontrols[scriptUUID];
2870 ScriptControlled localHeld = allflags & scriptControlData.eventControls; // the flags interesting for us 2858 ScriptControlled localHeld = allflags & scriptControlData.eventControls; // the flags interesting for us
@@ -2916,14 +2904,14 @@ namespace OpenSim.Region.Environment.Scenes
2916 return flags; 2904 return flags;
2917 } 2905 }
2918 2906
2919 private void ItemReceived(LLUUID itemID) 2907 private void ItemReceived(UUID itemID)
2920 { 2908 {
2921 int attachpoint = m_appearance.GetAttachpoint(itemID); 2909 int attachpoint = m_appearance.GetAttachpoint(itemID);
2922 if (attachpoint == 0) 2910 if (attachpoint == 0)
2923 return; 2911 return;
2924 2912
2925 LLUUID asset = m_appearance.GetAttachedAsset(attachpoint); 2913 UUID asset = m_appearance.GetAttachedAsset(attachpoint);
2926 if (asset == LLUUID.Zero) // We have just logged in 2914 if (asset == UUID.Zero) // We have just logged in
2927 { 2915 {
2928 m_log.InfoFormat("[ATTACHMENT] Rez attachment {0}", 2916 m_log.InfoFormat("[ATTACHMENT] Rez attachment {0}",
2929 itemID.ToString()); 2917 itemID.ToString());
@@ -2947,7 +2935,7 @@ namespace OpenSim.Region.Environment.Scenes
2947 2935
2948 // Attach from world, if not already attached 2936 // Attach from world, if not already attached
2949 if (att.ParentGroup != null && !att.IsAttachment) 2937 if (att.ParentGroup != null && !att.IsAttachment)
2950 m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, LLVector3.Zero); 2938 m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero);
2951 } 2939 }
2952 } 2940 }
2953 } 2941 }
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
index dbe2516..152825f 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
@@ -25,8 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using Axiom.Math; 28using OpenMetaverse;
29using libsecondlife;
30 29
31namespace OpenSim.Region.Environment.Scenes.Scripting 30namespace OpenSim.Region.Environment.Scenes.Scripting
32{ 31{
@@ -35,10 +34,10 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
35 string Name { get; set; } 34 string Name { get; set; }
36 string Description { get; set; } 35 string Description { get; set; }
37 36
38 LLUUID UUID { get; } 37 UUID UUID { get; }
39 LLUUID ObjectOwner { get; } 38 UUID ObjectOwner { get; }
40 LLUUID ObjectCreator { get; } 39 UUID ObjectCreator { get; }
41 LLVector3 AbsolutePosition { get; } 40 Vector3 AbsolutePosition { get; }
42 41
43 string SitName { get; set; } 42 string SitName { get; set; }
44 string TouchName { get; set; } 43 string TouchName { get; set; }
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
index 4b1b56a..37f5d43 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
@@ -26,14 +26,13 @@
26 */ 26 */
27 27
28using System; 28using System;
29using Axiom.Math; 29using OpenMetaverse;
30using libsecondlife;
31 30
32namespace OpenSim.Region.Environment.Scenes.Scripting 31namespace OpenSim.Region.Environment.Scenes.Scripting
33{ 32{
34 public class NullScriptHost : IScriptHost 33 public class NullScriptHost : IScriptHost
35 { 34 {
36 private LLVector3 m_pos = new LLVector3(128, 128, 30); 35 private Vector3 m_pos = new Vector3(128, 128, 30);
37 36
38 public string Name 37 public string Name
39 { 38 {
@@ -59,22 +58,22 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
59 set { } 58 set { }
60 } 59 }
61 60
62 public LLUUID UUID 61 public UUID UUID
63 { 62 {
64 get { return LLUUID.Zero; } 63 get { return UUID.Zero; }
65 } 64 }
66 65
67 public LLUUID ObjectOwner 66 public UUID ObjectOwner
68 { 67 {
69 get { return LLUUID.Zero; } 68 get { return UUID.Zero; }
70 } 69 }
71 70
72 public LLUUID ObjectCreator 71 public UUID ObjectCreator
73 { 72 {
74 get { return LLUUID.Zero; } 73 get { return UUID.Zero; }
75 } 74 }
76 75
77 public LLVector3 AbsolutePosition 76 public Vector3 AbsolutePosition
78 { 77 {
79 get { return m_pos; } 78 get { return m_pos; }
80 } 79 }
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index 0e551cb..5f0f316 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -27,7 +27,7 @@
27 27
28using System; 28using System;
29using System.Timers; 29using System.Timers;
30using libsecondlife.Packets; 30using OpenMetaverse.Packets;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Framework.Statistics; 32using OpenSim.Framework.Statistics;
33using OpenSim.Region.Environment.Interfaces; 33using OpenSim.Region.Environment.Interfaces;
diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs
index fdbfa8c..d828d8d 100644
--- a/OpenSim/Region/Environment/Scenes/UndoState.cs
+++ b/OpenSim/Region/Environment/Scenes/UndoState.cs
@@ -25,17 +25,17 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using libsecondlife; 28using OpenMetaverse;
29 29
30namespace OpenSim.Region.Environment.Scenes 30namespace OpenSim.Region.Environment.Scenes
31{ 31{
32 public class UndoState 32 public class UndoState
33 { 33 {
34 public LLVector3 Position = LLVector3.Zero; 34 public Vector3 Position = Vector3.Zero;
35 public LLVector3 Scale = LLVector3.Zero; 35 public Vector3 Scale = Vector3.Zero;
36 public LLQuaternion Rotation = LLQuaternion.Identity; 36 public Quaternion Rotation = Quaternion.Identity;
37 37
38 public UndoState(LLVector3 pos, LLQuaternion rot, LLVector3 scale) 38 public UndoState(Vector3 pos, Quaternion rot, Vector3 scale)
39 { 39 {
40 Position = pos; 40 Position = pos;
41 Rotation = rot; 41 Rotation = rot;