aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs62
1 files changed, 60 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
index ae84f65..c51e66b 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
@@ -121,7 +121,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
121 // Add to queue for all scripts in ObjectID object 121 // Add to queue for all scripts in ObjectID object
122 EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); 122 EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
123 detstruct._key = new LSL_Types.key[1]; 123 detstruct._key = new LSL_Types.key[1];
124 detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); 124 detstruct._key2 = new LSL_Types.key[1];
125 detstruct._string = new string[1];
126 detstruct._Vector3 = new LSL_Types.Vector3[1];
127 detstruct._Vector32 = new LSL_Types.Vector3[1];
128 detstruct._Quaternion = new LSL_Types.Quaternion[1];
129 detstruct._int = new int[1];
130 ScenePresence av = myScriptEngine.World.GetScenePresence(remoteClient.AgentId);
131 if (av != null)
132 {
133 detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
134 detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
135 detstruct._string[0] = remoteClient.Name;
136 detstruct._int[0] = 0;
137 detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x,av.Rotation.y,av.Rotation.z,av.Rotation.w);
138 detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X,av.AbsolutePosition.Y,av.AbsolutePosition.Z);
139 detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z);
140 }
141 else
142 {
143 detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
144 detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
145 detstruct._string[0] = remoteClient.Name;
146 detstruct._int[0] = 0;
147 detstruct._Quaternion[0] = new LSL_Types.Quaternion(0, 0, 0, 1);
148 detstruct._Vector3[0] = new LSL_Types.Vector3(0, 0, 0);
149 detstruct._Vector32[0] = new LSL_Types.Vector3(0, 0, 0);
150 }
125 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); 151 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
126 } 152 }
127 153
@@ -130,7 +156,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
130 // Add to queue for all scripts in ObjectID object 156 // Add to queue for all scripts in ObjectID object
131 EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); 157 EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
132 detstruct._key = new LSL_Types.key[1]; 158 detstruct._key = new LSL_Types.key[1];
133 detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); 159 detstruct._key2 = new LSL_Types.key[1];
160 detstruct._string = new string[1];
161 detstruct._Vector3 = new LSL_Types.Vector3[1];
162 detstruct._Vector32 = new LSL_Types.Vector3[1];
163 detstruct._Quaternion = new LSL_Types.Quaternion[1];
164 detstruct._int = new int[1];
165 ScenePresence av = myScriptEngine.World.GetScenePresence(remoteClient.AgentId);
166 if (av != null)
167 {
168 detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
169 detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
170 detstruct._string[0] = remoteClient.Name;
171 detstruct._int[0] = 0;
172 detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w);
173 detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X, av.AbsolutePosition.Y, av.AbsolutePosition.Z);
174 detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z);
175 }
176 else
177 {
178 detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
179 detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
180 detstruct._string[0] = remoteClient.Name;
181 detstruct._int[0] = 0;
182 detstruct._Quaternion[0] = new LSL_Types.Quaternion(0, 0, 0, 1);
183 detstruct._Vector3[0] = new LSL_Types.Vector3(0, 0, 0);
184 detstruct._Vector32[0] = new LSL_Types.Vector3(0, 0, 0);
185 }
134 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); 186 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
135 } 187 }
136 188
@@ -184,6 +236,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
184 detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; 236 detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
185 detstruct._int = new int[col.Colliders.Count]; 237 detstruct._int = new int[col.Colliders.Count];
186 detstruct._key = new LSL_Types.key[col.Colliders.Count]; 238 detstruct._key = new LSL_Types.key[col.Colliders.Count];
239 detstruct._key2 = new LSL_Types.key[col.Colliders.Count];
187 detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; 240 detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
188 detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; 241 detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
189 detstruct._bool = new bool[col.Colliders.Count]; 242 detstruct._bool = new bool[col.Colliders.Count];
@@ -192,6 +245,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
192 foreach (DetectedObject detobj in col.Colliders) 245 foreach (DetectedObject detobj in col.Colliders)
193 { 246 {
194 detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); 247 detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
248 detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString());
195 detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); 249 detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
196 detstruct._string[i] = detobj.nameStr; 250 detstruct._string[i] = detobj.nameStr;
197 detstruct._int[i] = detobj.colliderType; 251 detstruct._int[i] = detobj.colliderType;
@@ -211,6 +265,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
211 detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; 265 detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
212 detstruct._int = new int[col.Colliders.Count]; 266 detstruct._int = new int[col.Colliders.Count];
213 detstruct._key = new LSL_Types.key[col.Colliders.Count]; 267 detstruct._key = new LSL_Types.key[col.Colliders.Count];
268 detstruct._key2 = new LSL_Types.key[col.Colliders.Count];
214 detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; 269 detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
215 detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; 270 detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
216 detstruct._bool = new bool[col.Colliders.Count]; 271 detstruct._bool = new bool[col.Colliders.Count];
@@ -219,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
219 foreach (DetectedObject detobj in col.Colliders) 274 foreach (DetectedObject detobj in col.Colliders)
220 { 275 {
221 detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); 276 detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
277 detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString());
222 detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); 278 detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
223 detstruct._string[i] = detobj.nameStr; 279 detstruct._string[i] = detobj.nameStr;
224 detstruct._int[i] = detobj.colliderType; 280 detstruct._int[i] = detobj.colliderType;
@@ -236,6 +292,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
236 detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; 292 detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
237 detstruct._int = new int[col.Colliders.Count]; 293 detstruct._int = new int[col.Colliders.Count];
238 detstruct._key = new LSL_Types.key[col.Colliders.Count]; 294 detstruct._key = new LSL_Types.key[col.Colliders.Count];
295 detstruct._key2 = new LSL_Types.key[col.Colliders.Count];
239 detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; 296 detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
240 detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; 297 detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
241 detstruct._bool = new bool[col.Colliders.Count]; 298 detstruct._bool = new bool[col.Colliders.Count];
@@ -244,6 +301,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
244 foreach (DetectedObject detobj in col.Colliders) 301 foreach (DetectedObject detobj in col.Colliders)
245 { 302 {
246 detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); 303 detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
304 detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString());
247 detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); 305 detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
248 detstruct._string[i] = detobj.nameStr; 306 detstruct._string[i] = detobj.nameStr;
249 detstruct._int[i] = detobj.colliderType; 307 detstruct._int[i] = detobj.colliderType;