diff options
author | John Hurliman | 2010-01-12 10:27:21 -0800 |
---|---|---|
committer | John Hurliman | 2010-01-12 10:27:21 -0800 |
commit | a8b1a57cd11facdf2c5c583cfa766a44fe5f99c5 (patch) | |
tree | bf12b759e693d6b99494dfa19fb23e13488dd977 /OpenSim/Region/ScriptEngine | |
parent | Bug in llGetNumberOfPrims always returns to script when no clients are connec... (diff) | |
parent | Add the option to reject duplicate region names (diff) | |
download | opensim-SC_OLD-a8b1a57cd11facdf2c5c583cfa766a44fe5f99c5.zip opensim-SC_OLD-a8b1a57cd11facdf2c5c583cfa766a44fe5f99c5.tar.gz opensim-SC_OLD-a8b1a57cd11facdf2c5c583cfa766a44fe5f99c5.tar.bz2 opensim-SC_OLD-a8b1a57cd11facdf2c5c583cfa766a44fe5f99c5.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
4 files changed, 72 insertions, 25 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b9defbe..c9998c0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2109,14 +2109,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2109 | public LSL_Integer llRotTarget(LSL_Rotation rot, double error) | 2109 | public LSL_Integer llRotTarget(LSL_Rotation rot, double error) |
2110 | { | 2110 | { |
2111 | m_host.AddScriptLPS(1); | 2111 | m_host.AddScriptLPS(1); |
2112 | NotImplemented("llRotTarget"); | 2112 | return m_host.registerRotTargetWaypoint(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), (float)error); |
2113 | return 0; | ||
2114 | } | 2113 | } |
2115 | 2114 | ||
2116 | public void llRotTargetRemove(int number) | 2115 | public void llRotTargetRemove(int number) |
2117 | { | 2116 | { |
2118 | m_host.AddScriptLPS(1); | 2117 | m_host.AddScriptLPS(1); |
2119 | NotImplemented("llRotTargetRemove"); | 2118 | m_host.unregisterRotTargetWaypoint(number); |
2120 | } | 2119 | } |
2121 | 2120 | ||
2122 | public void llMoveToTarget(LSL_Vector target, double tau) | 2121 | public void llMoveToTarget(LSL_Vector target, double tau) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d8b9159..2c8b0ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1983,6 +1983,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1983 | 1983 | ||
1984 | return (int)pws; | 1984 | return (int)pws; |
1985 | } | 1985 | } |
1986 | |||
1986 | public void osSetSpeed(string UUID, float SpeedModifier) | 1987 | public void osSetSpeed(string UUID, float SpeedModifier) |
1987 | { | 1988 | { |
1988 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | 1989 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); |
@@ -1990,6 +1991,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1990 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | 1991 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); |
1991 | avatar.SpeedModifier = SpeedModifier; | 1992 | avatar.SpeedModifier = SpeedModifier; |
1992 | } | 1993 | } |
1994 | |||
1993 | public void osKickAvatar(string FirstName,string SurName,string alert) | 1995 | public void osKickAvatar(string FirstName,string SurName,string alert) |
1994 | { | 1996 | { |
1995 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 1997 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
@@ -2010,6 +2012,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2010 | } | 2012 | } |
2011 | } | 2013 | } |
2012 | } | 2014 | } |
2015 | |||
2013 | public void osCauseDamage(string avatar, double damage) | 2016 | public void osCauseDamage(string avatar, double damage) |
2014 | { | 2017 | { |
2015 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); | 2018 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); |
@@ -2037,6 +2040,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2037 | } | 2040 | } |
2038 | } | 2041 | } |
2039 | } | 2042 | } |
2043 | |||
2040 | public void osCauseHealing(string avatar, double healing) | 2044 | public void osCauseHealing(string avatar, double healing) |
2041 | { | 2045 | { |
2042 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); | 2046 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); |
@@ -2061,4 +2065,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2061 | } | 2065 | } |
2062 | } | 2066 | } |
2063 | } | 2067 | } |
2064 | } | 2068 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs index 7f67599..9615315 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
62 | land_collision_end = 4096, | 62 | land_collision_end = 4096, |
63 | land_collision_start = 8192, | 63 | land_collision_start = 8192, |
64 | at_target = 16384, | 64 | at_target = 16384, |
65 | at_rot_target = 16777216, | ||
65 | listen = 32768, | 66 | listen = 32768, |
66 | money = 65536, | 67 | money = 65536, |
67 | moving_end = 131072, | 68 | moving_end = 131072, |
@@ -203,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
203 | } | 204 | } |
204 | 205 | ||
205 | m_eventFlagsMap.Add("attach", scriptEvents.attach); | 206 | m_eventFlagsMap.Add("attach", scriptEvents.attach); |
206 | // m_eventFlagsMap.Add("at_rot_target",(long)scriptEvents.at_rot_target); | 207 | m_eventFlagsMap.Add("at_rot_target", scriptEvents.at_rot_target); |
207 | m_eventFlagsMap.Add("at_target", scriptEvents.at_target); | 208 | m_eventFlagsMap.Add("at_target", scriptEvents.at_target); |
208 | // m_eventFlagsMap.Add("changed",(long)scriptEvents.changed); | 209 | // m_eventFlagsMap.Add("changed",(long)scriptEvents.changed); |
209 | m_eventFlagsMap.Add("collision", scriptEvents.collision); | 210 | m_eventFlagsMap.Add("collision", scriptEvents.collision); |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 8195f33..16309ef 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | |||
@@ -59,10 +59,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
59 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; | 59 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; |
60 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; | 60 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; |
61 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; | 61 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; |
62 | myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; | ||
63 | myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; | ||
62 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; | 64 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; |
63 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; | 65 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; |
64 | myScriptEngine.World.EventManager.OnScriptColliding += collision; | 66 | myScriptEngine.World.EventManager.OnScriptColliding += collision; |
65 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; | 67 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; |
68 | myScriptEngine.World.EventManager.OnScriptLandColliderStart += land_collision_start; | ||
69 | myScriptEngine.World.EventManager.OnScriptLandColliding += land_collision; | ||
70 | myScriptEngine.World.EventManager.OnScriptLandColliderEnd += land_collision_end; | ||
66 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | 71 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); |
67 | if (money != null) | 72 | if (money != null) |
68 | { | 73 | { |
@@ -285,29 +290,63 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
285 | det.ToArray())); | 290 | det.ToArray())); |
286 | } | 291 | } |
287 | 292 | ||
288 | public void land_collision_start(uint localID, UUID itemID) | 293 | public void land_collision_start(uint localID, ColliderArgs col) |
289 | { | 294 | { |
290 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 295 | List<DetectParams> det = new List<DetectParams>(); |
291 | "land_collision_start", | 296 | |
292 | new object[0], | 297 | foreach (DetectedObject detobj in col.Colliders) |
293 | new DetectParams[0])); | 298 | { |
299 | DetectParams d = new DetectParams(); | ||
300 | d.Position = new LSL_Types.Vector3(detobj.posVector.X, | ||
301 | detobj.posVector.Y, | ||
302 | detobj.posVector.Z); | ||
303 | d.Populate(myScriptEngine.World); | ||
304 | det.Add(d); | ||
305 | myScriptEngine.PostObjectEvent(localID, new EventParams( | ||
306 | "land_collision_start", | ||
307 | new Object[] { new LSL_Types.Vector3(d.Position) }, | ||
308 | det.ToArray())); | ||
309 | } | ||
310 | |||
294 | } | 311 | } |
295 | 312 | ||
296 | public void land_collision(uint localID, UUID itemID) | 313 | public void land_collision(uint localID, ColliderArgs col) |
297 | { | 314 | { |
298 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 315 | List<DetectParams> det = new List<DetectParams>(); |
299 | "land_collision", | 316 | |
300 | new object[0], | 317 | foreach (DetectedObject detobj in col.Colliders) |
301 | new DetectParams[0])); | 318 | { |
319 | DetectParams d = new DetectParams(); | ||
320 | d.Position = new LSL_Types.Vector3(detobj.posVector.X, | ||
321 | detobj.posVector.Y, | ||
322 | detobj.posVector.Z); | ||
323 | d.Populate(myScriptEngine.World); | ||
324 | det.Add(d); | ||
325 | myScriptEngine.PostObjectEvent(localID, new EventParams( | ||
326 | "land_collision", | ||
327 | new Object[] { new LSL_Types.Vector3(d.Position) }, | ||
328 | det.ToArray())); | ||
329 | } | ||
302 | } | 330 | } |
303 | 331 | ||
304 | public void land_collision_end(uint localID, UUID itemID) | 332 | public void land_collision_end(uint localID, ColliderArgs col) |
305 | { | 333 | { |
306 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 334 | List<DetectParams> det = new List<DetectParams>(); |
307 | "land_collision_end", | 335 | |
308 | new object[0], | 336 | foreach (DetectedObject detobj in col.Colliders) |
309 | new DetectParams[0])); | 337 | { |
310 | } | 338 | DetectParams d = new DetectParams(); |
339 | d.Position = new LSL_Types.Vector3(detobj.posVector.X, | ||
340 | detobj.posVector.Y, | ||
341 | detobj.posVector.Z); | ||
342 | d.Populate(myScriptEngine.World); | ||
343 | det.Add(d); | ||
344 | myScriptEngine.PostObjectEvent(localID, new EventParams( | ||
345 | "land_collision_end", | ||
346 | new Object[] { new LSL_Types.Vector3(d.Position) }, | ||
347 | det.ToArray())); | ||
348 | } | ||
349 | } | ||
311 | 350 | ||
312 | // timer: not handled here | 351 | // timer: not handled here |
313 | // listen: not handled here | 352 | // listen: not handled here |
@@ -353,14 +392,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
353 | new DetectParams[0])); | 392 | new DetectParams[0])); |
354 | } | 393 | } |
355 | 394 | ||
356 | public void at_rot_target(uint localID, UUID itemID) | 395 | public void at_rot_target(uint localID, uint handle, Quaternion targetrot, |
396 | Quaternion atrot) | ||
357 | { | 397 | { |
358 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 398 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
359 | "at_rot_target",new object[0], | 399 | "at_rot_target", new object[] { |
400 | new LSL_Types.LSLInteger(handle), | ||
401 | new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W), | ||
402 | new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, | ||
360 | new DetectParams[0])); | 403 | new DetectParams[0])); |
361 | } | 404 | } |
362 | 405 | ||
363 | public void not_at_rot_target(uint localID, UUID itemID) | 406 | public void not_at_rot_target(uint localID) |
364 | { | 407 | { |
365 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 408 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
366 | "not_at_rot_target",new object[0], | 409 | "not_at_rot_target",new object[0], |