diff options
author | Jeff Ames | 2008-05-16 01:22:11 +0000 |
---|---|---|
committer | Jeff Ames | 2008-05-16 01:22:11 +0000 |
commit | 65c5efe43b68700bad94076d4cd421160203c5de (patch) | |
tree | 589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Region/ScriptEngine | |
parent | Thank you very much, mjm for : (diff) | |
download | opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.zip opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2 opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
26 files changed, 218 insertions, 259 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs index afc3ff2..2c33b57 100644 --- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs | |||
@@ -108,7 +108,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
108 | public void state(string state) | 108 | public void state(string state) |
109 | { | 109 | { |
110 | State = state; | 110 | State = state; |
111 | 111 | ||
112 | } | 112 | } |
113 | 113 | ||
114 | public void Start(BuilIn_Commands LSL_Functions) | 114 | public void Start(BuilIn_Commands LSL_Functions) |
@@ -125,9 +125,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
125 | ads.ConfigurationFile | 125 | ads.ConfigurationFile |
126 | ); | 126 | ); |
127 | 127 | ||
128 | // Display the name of the calling AppDomain and the name | 128 | // Display the name of the calling AppDomain and the name |
129 | // of the second domain. | 129 | // of the second domain. |
130 | // NOTE: The application's thread has transitioned between | 130 | // NOTE: The application's thread has transitioned between |
131 | // AppDomains. | 131 | // AppDomains. |
132 | Console.WriteLine("Calling to '{0}'.", | 132 | Console.WriteLine("Calling to '{0}'.", |
133 | Thread.GetDomain().FriendlyName | 133 | Thread.GetDomain().FriendlyName |
diff --git a/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs b/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs index 2e35b46..2887f1e 100644 --- a/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs +++ b/OpenSim/Region/ScriptEngine/Common/ExecutorBase.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
42 | /// </summary> | 42 | /// </summary> |
43 | protected bool m_Running = true; | 43 | protected bool m_Running = true; |
44 | /// <summary> | 44 | /// <summary> |
45 | /// True indicates that the ScriptManager has stopped | 45 | /// True indicates that the ScriptManager has stopped |
46 | /// this script. This prevents a script that has been | 46 | /// this script. This prevents a script that has been |
47 | /// stopped as part of deactivation from being | 47 | /// stopped as part of deactivation from being |
48 | /// resumed by a pending llSetScriptState request. | 48 | /// resumed by a pending llSetScriptState request. |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index d73a47a..ab91424 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
57 | internal uint m_localID; | 57 | internal uint m_localID; |
58 | internal LLUUID m_itemID; | 58 | internal LLUUID m_itemID; |
59 | internal bool throwErrorOnNotImplemented = true; | 59 | internal bool throwErrorOnNotImplemented = true; |
60 | 60 | ||
61 | public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) | 61 | public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) |
62 | { | 62 | { |
63 | m_ScriptEngine = ScriptEngine; | 63 | m_ScriptEngine = ScriptEngine; |
@@ -93,7 +93,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
93 | try | 93 | try |
94 | { | 94 | { |
95 | int eventFlags = m_ScriptEngine.m_ScriptManager.GetStateEventFlags(m_localID, m_itemID); | 95 | int eventFlags = m_ScriptEngine.m_ScriptManager.GetStateEventFlags(m_localID, m_itemID); |
96 | m_host.SetScriptEvents(m_itemID, eventFlags); | 96 | m_host.SetScriptEvents(m_itemID, eventFlags); |
97 | m_ScriptEngine.m_EventManager.state_entry(m_localID); | 97 | m_ScriptEngine.m_EventManager.state_entry(m_localID); |
98 | } | 98 | } |
99 | catch (AppDomainUnloadedException) | 99 | catch (AppDomainUnloadedException) |
@@ -186,7 +186,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
186 | World.EventManager.TriggerRequestChangeWaterHeight((float)height); | 186 | World.EventManager.TriggerRequestChangeWaterHeight((float)height); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | //These are the implementations of the various ll-functions used by the LSL scripts. | 190 | //These are the implementations of the various ll-functions used by the LSL scripts. |
191 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 | 191 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 |
192 | public double llSin(double f) | 192 | public double llSin(double f) |
@@ -331,9 +331,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
331 | // New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler. | 331 | // New and improved, now actually works as described. Prim rotates as expected as does llRot2Euler. |
332 | 332 | ||
333 | /* From wiki: | 333 | /* From wiki: |
334 | The Euler angle vector (in radians) is converted to a rotation by doing the rotations around the 3 axes | 334 | The Euler angle vector (in radians) is converted to a rotation by doing the rotations around the 3 axes |
335 | in Z, Y, X order. So llEuler2Rot(<1.0, 2.0, 3.0> * DEG_TO_RAD) generates a rotation by taking the zero rotation, | 335 | in Z, Y, X order. So llEuler2Rot(<1.0, 2.0, 3.0> * DEG_TO_RAD) generates a rotation by taking the zero rotation, |
336 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting | 336 | a vector pointing along the X axis, first rotating it 3 degrees around the global Z axis, then rotating the resulting |
337 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. | 337 | vector 2 degrees around the global Y axis, and finally rotating that 1 degree around the global X axis. |
338 | */ | 338 | */ |
339 | 339 | ||
@@ -349,24 +349,24 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
349 | double sinX = Math.Sin(v.x); | 349 | double sinX = Math.Sin(v.x); |
350 | double sinY = Math.Sin(v.y); | 350 | double sinY = Math.Sin(v.y); |
351 | double sinZ = Math.Sin(v.z); | 351 | double sinZ = Math.Sin(v.z); |
352 | 352 | ||
353 | s = Math.Sqrt( cosY * cosZ - sinX * sinY * sinZ + cosX * cosZ + cosX * cosY + 1.0f) * 0.5f; | 353 | s = Math.Sqrt(cosY * cosZ - sinX * sinY * sinZ + cosX * cosZ + cosX * cosY + 1.0f) * 0.5f; |
354 | if (Math.Abs(s) < 0.00001) // null rotation | 354 | if (Math.Abs(s) < 0.00001) // null rotation |
355 | { | 355 | { |
356 | x = 0.0f; | 356 | x = 0.0f; |
357 | y = 1.0f; | 357 | y = 1.0f; |
358 | z = 0.0f; | 358 | z = 0.0f; |
359 | } | 359 | } |
360 | else | 360 | else |
361 | { | 361 | { |
362 | s_i = 1.0f / (4.0f * s); | 362 | s_i = 1.0f / (4.0f * s); |
363 | x = - ( -sinX * cosY - cosX * sinY * sinZ - sinX * cosZ) * s_i; | 363 | x = - (-sinX * cosY - cosX * sinY * sinZ - sinX * cosZ) * s_i; |
364 | y = - ( -cosX * sinY * cosZ + sinX * sinZ - sinY) * s_i; | 364 | y = - (-cosX * sinY * cosZ + sinX * sinZ - sinY) * s_i; |
365 | z = - ( -cosY * sinZ - sinX * sinY * cosZ - cosX * sinZ) * s_i; | 365 | z = - (-cosY * sinZ - sinX * sinY * cosZ - cosX * sinZ) * s_i; |
366 | } | 366 | } |
367 | return new LSL_Types.Quaternion(x, y, z, s); | 367 | return new LSL_Types.Quaternion(x, y, z, s); |
368 | } | 368 | } |
369 | 369 | ||
370 | 370 | ||
371 | public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) | 371 | public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) |
372 | { | 372 | { |
@@ -477,7 +477,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
477 | m_host.AddScriptLPS(1); | 477 | m_host.AddScriptLPS(1); |
478 | LLUUID keyID = LLUUID.Zero; | 478 | LLUUID keyID = LLUUID.Zero; |
479 | LLUUID.TryParse(id, out keyID); | 479 | LLUUID.TryParse(id, out keyID); |
480 | 480 | ||
481 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); | 481 | m_ScriptEngine.m_ASYNCLSLCommandManager.m_SensorRepeat.SenseOnce(m_localID, m_itemID, name, keyID, type, range, arc, m_host); |
482 | } | 482 | } |
483 | 483 | ||
@@ -625,7 +625,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
625 | 625 | ||
626 | 626 | ||
627 | return String.Empty; | 627 | return String.Empty; |
628 | 628 | ||
629 | } | 629 | } |
630 | 630 | ||
631 | public LSL_Types.LSLInteger llDetectedType(int number) | 631 | public LSL_Types.LSLInteger llDetectedType(int number) |
@@ -644,7 +644,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
644 | mask |= 0x04; // passive non-moving | 644 | mask |= 0x04; // passive non-moving |
645 | else | 645 | else |
646 | mask |= 0x02; // active moving | 646 | mask |= 0x02; // active moving |
647 | if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ... | 647 | if (SensedObject is IScript) mask |= 0x08; // Scripted. It COULD have one hidden ... |
648 | return mask; | 648 | return mask; |
649 | 649 | ||
650 | } | 650 | } |
@@ -655,7 +655,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
655 | EntityBase SensedObject = entityDetectedKey(number); | 655 | EntityBase SensedObject = entityDetectedKey(number); |
656 | if (SensedObject == null) | 656 | if (SensedObject == null) |
657 | return new LSL_Types.Vector3(0, 0, 0); | 657 | return new LSL_Types.Vector3(0, 0, 0); |
658 | 658 | ||
659 | return new LSL_Types.Vector3(SensedObject.AbsolutePosition.X,SensedObject.AbsolutePosition.Y,SensedObject.AbsolutePosition.Z); | 659 | return new LSL_Types.Vector3(SensedObject.AbsolutePosition.X,SensedObject.AbsolutePosition.Y,SensedObject.AbsolutePosition.Z); |
660 | } | 660 | } |
661 | 661 | ||
@@ -757,7 +757,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
757 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) | 757 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_X) |
758 | { | 758 | { |
759 | statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X; | 759 | statusrotationaxis |= BuiltIn_Commands_BaseClass.STATUS_ROTATE_X; |
760 | 760 | ||
761 | } | 761 | } |
762 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) | 762 | if ((status & BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) == BuiltIn_Commands_BaseClass.STATUS_ROTATE_Y) |
763 | { | 763 | { |
@@ -824,9 +824,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
824 | 824 | ||
825 | if (m_host.GetDieAtEdge()) | 825 | if (m_host.GetDieAtEdge()) |
826 | return 1; | 826 | return 1; |
827 | else | 827 | else |
828 | return 0; | 828 | return 0; |
829 | 829 | ||
830 | case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE: | 830 | case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE: |
831 | NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); | 831 | NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); |
832 | return 0; | 832 | return 0; |
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1248 | { | 1248 | { |
1249 | m_host.AddScriptLPS(1); | 1249 | m_host.AddScriptLPS(1); |
1250 | return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); | 1250 | return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); |
1251 | 1251 | ||
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | public void llTargetRemove(int number) | 1254 | public void llTargetRemove(int number) |
@@ -1286,21 +1286,21 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1286 | { | 1286 | { |
1287 | m_host.AddScriptLPS(1); | 1287 | m_host.AddScriptLPS(1); |
1288 | //No energy force yet | 1288 | //No energy force yet |
1289 | 1289 | ||
1290 | if (force.x > 20000) | 1290 | if (force.x > 20000) |
1291 | force.x = 20000; | 1291 | force.x = 20000; |
1292 | if (force.y > 20000) | 1292 | if (force.y > 20000) |
1293 | force.y = 20000; | 1293 | force.y = 20000; |
1294 | if (force.z > 20000) | 1294 | if (force.z > 20000) |
1295 | force.z = 20000; | 1295 | force.z = 20000; |
1296 | 1296 | ||
1297 | if (local == 1) | 1297 | if (local == 1) |
1298 | { | 1298 | { |
1299 | m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), true); | 1299 | m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), true); |
1300 | } | 1300 | } |
1301 | else | 1301 | else |
1302 | { | 1302 | { |
1303 | 1303 | ||
1304 | m_host.ApplyImpulse(new LLVector3((float)force.x,(float)force.y,(float)force.z), false); | 1304 | m_host.ApplyImpulse(new LLVector3((float)force.x,(float)force.y,(float)force.z), false); |
1305 | } | 1305 | } |
1306 | } | 1306 | } |
@@ -1475,7 +1475,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1475 | } | 1475 | } |
1476 | // If end is positive, then it directly | 1476 | // If end is positive, then it directly |
1477 | // corresponds to the lengt of the substring | 1477 | // corresponds to the lengt of the substring |
1478 | // needed (plus one of course). BUT, it | 1478 | // needed (plus one of course). BUT, it |
1479 | // must be within bounds. | 1479 | // must be within bounds. |
1480 | if (end >= src.Length) | 1480 | if (end >= src.Length) |
1481 | { | 1481 | { |
@@ -1493,15 +1493,15 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1493 | // Inverted substring (end < start) | 1493 | // Inverted substring (end < start) |
1494 | else | 1494 | else |
1495 | { | 1495 | { |
1496 | // Implies both indices are below the | 1496 | // Implies both indices are below the |
1497 | // lower bound. In the inverted case, that | 1497 | // lower bound. In the inverted case, that |
1498 | // means the entire string will be returned | 1498 | // means the entire string will be returned |
1499 | // unchanged. | 1499 | // unchanged. |
1500 | if (start < 0) | 1500 | if (start < 0) |
1501 | { | 1501 | { |
1502 | return src; | 1502 | return src; |
1503 | } | 1503 | } |
1504 | // If both indices are greater than the upper | 1504 | // If both indices are greater than the upper |
1505 | // bound the result may seem initially counter | 1505 | // bound the result may seem initially counter |
1506 | // intuitive. | 1506 | // intuitive. |
1507 | if (end >= src.Length) | 1507 | if (end >= src.Length) |
@@ -1536,7 +1536,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1536 | 1536 | ||
1537 | /// <summary> | 1537 | /// <summary> |
1538 | /// Delete substring removes the specified substring bounded | 1538 | /// Delete substring removes the specified substring bounded |
1539 | /// by the inclusive indices start and end. Indices may be | 1539 | /// by the inclusive indices start and end. Indices may be |
1540 | /// negative (indicating end-relative) and may be inverted, | 1540 | /// negative (indicating end-relative) and may be inverted, |
1541 | /// i.e. end < start. | 1541 | /// i.e. end < start. |
1542 | /// </summary> | 1542 | /// </summary> |
@@ -1591,7 +1591,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1591 | { | 1591 | { |
1592 | return String.Empty; | 1592 | return String.Empty; |
1593 | } | 1593 | } |
1594 | 1594 | ||
1595 | if (end > 0) | 1595 | if (end > 0) |
1596 | { | 1596 | { |
1597 | if (start < src.Length) | 1597 | if (start < src.Length) |
@@ -1616,7 +1616,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1616 | } | 1616 | } |
1617 | } | 1617 | } |
1618 | } | 1618 | } |
1619 | 1619 | ||
1620 | /// <summary> | 1620 | /// <summary> |
1621 | /// Insert string inserts the specified string identified by src | 1621 | /// Insert string inserts the specified string identified by src |
1622 | /// at the index indicated by index. Index may be negative, in | 1622 | /// at the index indicated by index. Index may be negative, in |
@@ -1655,13 +1655,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1655 | 1655 | ||
1656 | // The index is in bounds. | 1656 | // The index is in bounds. |
1657 | // In this case the index refers to the index that will | 1657 | // In this case the index refers to the index that will |
1658 | // be assigned to the first character of the inserted string. | 1658 | // be assigned to the first character of the inserted string. |
1659 | // So unlike the other string operations, we do not add one | 1659 | // So unlike the other string operations, we do not add one |
1660 | // to get the correct string length. | 1660 | // to get the correct string length. |
1661 | return dest.Substring(0,index)+src+dest.Substring(index); | 1661 | return dest.Substring(0,index)+src+dest.Substring(index); |
1662 | 1662 | ||
1663 | } | 1663 | } |
1664 | 1664 | ||
1665 | public string llToUpper(string src) | 1665 | public string llToUpper(string src) |
1666 | { | 1666 | { |
1667 | m_host.AddScriptLPS(1); | 1667 | m_host.AddScriptLPS(1); |
@@ -1767,12 +1767,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1767 | return; // wiki says, if it's further away then 10m, silently fail. | 1767 | return; // wiki says, if it's further away then 10m, silently fail. |
1768 | 1768 | ||
1769 | LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z); | 1769 | LLVector3 llvel = new LLVector3((float)vel.x, (float)vel.y, (float)vel.z); |
1770 | 1770 | ||
1771 | // need the magnitude later | 1771 | // need the magnitude later |
1772 | float velmag = (float)Util.GetMagnitude(llvel); | 1772 | float velmag = (float)Util.GetMagnitude(llvel); |
1773 | 1773 | ||
1774 | SceneObjectGroup new_group = World.RezObject(inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); | 1774 | SceneObjectGroup new_group = World.RezObject(inv.Value, llpos, new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), llvel, param); |
1775 | 1775 | ||
1776 | // If either of these are null, then there was an unknown error. | 1776 | // If either of these are null, then there was an unknown error. |
1777 | if (new_group == null) | 1777 | if (new_group == null) |
1778 | continue; | 1778 | continue; |
@@ -1844,7 +1844,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1844 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) | 1844 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) |
1845 | { | 1845 | { |
1846 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); | 1846 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); |
1847 | 1847 | ||
1848 | if (presence != null) | 1848 | if (presence != null) |
1849 | { | 1849 | { |
1850 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) | 1850 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) |
@@ -1871,7 +1871,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1871 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) | 1871 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) |
1872 | { | 1872 | { |
1873 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); | 1873 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); |
1874 | 1874 | ||
1875 | if (presence != null) | 1875 | if (presence != null) |
1876 | { | 1876 | { |
1877 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) | 1877 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) |
@@ -1924,7 +1924,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1924 | // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent, | 1924 | // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent, |
1925 | // but I don't think we have a list of scenes available from here. | 1925 | // but I don't think we have a list of scenes available from here. |
1926 | // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.) | 1926 | // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.) |
1927 | 1927 | ||
1928 | // user is a UUID | 1928 | // user is a UUID |
1929 | 1929 | ||
1930 | // TODO: figure out values for client, fromSession, and imSessionID | 1930 | // TODO: figure out values for client, fromSession, and imSessionID |
@@ -1991,7 +1991,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1991 | } | 1991 | } |
1992 | } | 1992 | } |
1993 | 1993 | ||
1994 | 1994 | ||
1995 | 1995 | ||
1996 | public void llSetHoverHeight(double height, int water, double tau) | 1996 | public void llSetHoverHeight(double height, int water, double tau) |
1997 | { | 1997 | { |
@@ -2050,7 +2050,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2050 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) | 2050 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) |
2051 | { | 2051 | { |
2052 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); | 2052 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); |
2053 | 2053 | ||
2054 | if (presence != null) | 2054 | if (presence != null) |
2055 | { | 2055 | { |
2056 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID | 2056 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID |
@@ -2087,7 +2087,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2087 | return; | 2087 | return; |
2088 | 2088 | ||
2089 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); | 2089 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); |
2090 | 2090 | ||
2091 | if (presence != null) | 2091 | if (presence != null) |
2092 | { | 2092 | { |
2093 | if (animID == LLUUID.Zero) | 2093 | if (animID == LLUUID.Zero) |
@@ -2194,7 +2194,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2194 | } | 2194 | } |
2195 | 2195 | ||
2196 | ScenePresence presence = World.GetScenePresence(agentID); | 2196 | ScenePresence presence = World.GetScenePresence(agentID); |
2197 | 2197 | ||
2198 | if (presence != null) | 2198 | if (presence != null) |
2199 | { | 2199 | { |
2200 | string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); | 2200 | string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); |
@@ -2467,7 +2467,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2467 | 2467 | ||
2468 | // These functions are supposed to be robust, | 2468 | // These functions are supposed to be robust, |
2469 | // so get the state one step at a time. | 2469 | // so get the state one step at a time. |
2470 | 2470 | ||
2471 | if ((item = ScriptByName(name)) != LLUUID.Zero) | 2471 | if ((item = ScriptByName(name)) != LLUUID.Zero) |
2472 | { | 2472 | { |
2473 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | 2473 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) |
@@ -2480,14 +2480,14 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2480 | } | 2480 | } |
2481 | } | 2481 | } |
2482 | } | 2482 | } |
2483 | } | 2483 | } |
2484 | 2484 | ||
2485 | // Required by SL | 2485 | // Required by SL |
2486 | 2486 | ||
2487 | if (script == null) | 2487 | if (script == null) |
2488 | ShoutError("llSetScriptState: script "+name+" not found"); | 2488 | ShoutError("llSetScriptState: script "+name+" not found"); |
2489 | 2489 | ||
2490 | // If we didn't find it, then it's safe to | 2490 | // If we didn't find it, then it's safe to |
2491 | // assume it is not running. | 2491 | // assume it is not running. |
2492 | } | 2492 | } |
2493 | 2493 | ||
@@ -2806,23 +2806,23 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2806 | 2806 | ||
2807 | 2807 | ||
2808 | /* The new / changed functions were tested with the following LSL script: | 2808 | /* The new / changed functions were tested with the following LSL script: |
2809 | 2809 | ||
2810 | default | 2810 | default |
2811 | { | 2811 | { |
2812 | state_entry() | 2812 | state_entry() |
2813 | { | 2813 | { |
2814 | rotation rot = llEuler2Rot(<0,70,0> * DEG_TO_RAD); | 2814 | rotation rot = llEuler2Rot(<0,70,0> * DEG_TO_RAD); |
2815 | 2815 | ||
2816 | llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot)); | 2816 | llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot)); |
2817 | llOwnerSay("and we rotate for: "+ (llRot2Angle(rot) * RAD_TO_DEG)); | 2817 | llOwnerSay("and we rotate for: "+ (llRot2Angle(rot) * RAD_TO_DEG)); |
2818 | 2818 | ||
2819 | // convert back and forth between quaternion <-> vector and angle | 2819 | // convert back and forth between quaternion <-> vector and angle |
2820 | 2820 | ||
2821 | rotation newrot = llAxisAngle2Rot(llRot2Axis(rot),llRot2Angle(rot)); | 2821 | rotation newrot = llAxisAngle2Rot(llRot2Axis(rot),llRot2Angle(rot)); |
2822 | 2822 | ||
2823 | llOwnerSay("Old rotation was: "+(string) rot); | 2823 | llOwnerSay("Old rotation was: "+(string) rot); |
2824 | llOwnerSay("re-converted rotation is: "+(string) newrot); | 2824 | llOwnerSay("re-converted rotation is: "+(string) newrot); |
2825 | 2825 | ||
2826 | llSetRot(rot); // to check the parameters in the prim | 2826 | llSetRot(rot); // to check the parameters in the prim |
2827 | } | 2827 | } |
2828 | } | 2828 | } |
@@ -2832,7 +2832,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2832 | 2832 | ||
2833 | // Xantor 29/apr/2008 | 2833 | // Xantor 29/apr/2008 |
2834 | // Returns rotation described by rotating angle radians about axis. | 2834 | // Returns rotation described by rotating angle radians about axis. |
2835 | // q = cos(a/2) + i ( x * sin(a/2)) + j (y * sin(a/2)) + k ( z * sin(a/2)) | 2835 | // q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2)) |
2836 | public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) | 2836 | public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) |
2837 | { | 2837 | { |
2838 | m_host.AddScriptLPS(1); | 2838 | m_host.AddScriptLPS(1); |
@@ -2849,7 +2849,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2849 | // NotImplemented("llAxisAngle2Rot"); | 2849 | // NotImplemented("llAxisAngle2Rot"); |
2850 | } | 2850 | } |
2851 | 2851 | ||
2852 | 2852 | ||
2853 | // Xantor 29/apr/2008 | 2853 | // Xantor 29/apr/2008 |
2854 | // converts a Quaternion to X,Y,Z axis rotations | 2854 | // converts a Quaternion to X,Y,Z axis rotations |
2855 | public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) | 2855 | public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) |
@@ -3264,7 +3264,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3264 | /// <summary> | 3264 | /// <summary> |
3265 | /// The supplied string is scanned for commas | 3265 | /// The supplied string is scanned for commas |
3266 | /// and converted into a list. Commas are only | 3266 | /// and converted into a list. Commas are only |
3267 | /// effective if they are encountered outside | 3267 | /// effective if they are encountered outside |
3268 | /// of '<' '>' delimiters. Any whitespace | 3268 | /// of '<' '>' delimiters. Any whitespace |
3269 | /// before or after an element is trimmed. | 3269 | /// before or after an element is trimmed. |
3270 | /// </summary> | 3270 | /// </summary> |
@@ -3314,7 +3314,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3314 | } | 3314 | } |
3315 | 3315 | ||
3316 | /// <summary> | 3316 | /// <summary> |
3317 | /// Randomizes the list, be arbitrarily reordering | 3317 | /// Randomizes the list, be arbitrarily reordering |
3318 | /// sublists of stride elements. As the stride approaches | 3318 | /// sublists of stride elements. As the stride approaches |
3319 | /// the size of the list, the options become very | 3319 | /// the size of the list, the options become very |
3320 | /// limited. | 3320 | /// limited. |
@@ -3323,7 +3323,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3323 | /// This could take a while for very large list | 3323 | /// This could take a while for very large list |
3324 | /// sizes. | 3324 | /// sizes. |
3325 | /// </remarks> | 3325 | /// </remarks> |
3326 | 3326 | ||
3327 | public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) | 3327 | public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) |
3328 | { | 3328 | { |
3329 | 3329 | ||
@@ -3344,7 +3344,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3344 | // Stride MUST be a factor of the list length | 3344 | // Stride MUST be a factor of the list length |
3345 | // If not, then return the src list. This also | 3345 | // If not, then return the src list. This also |
3346 | // traps those cases where stride > length. | 3346 | // traps those cases where stride > length. |
3347 | 3347 | ||
3348 | if (src.Length != stride && src.Length%stride == 0) | 3348 | if (src.Length != stride && src.Length%stride == 0) |
3349 | { | 3349 | { |
3350 | chunkk = src.Length/stride; | 3350 | chunkk = src.Length/stride; |
@@ -3384,7 +3384,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3384 | object[] array = new object[src.Length]; | 3384 | object[] array = new object[src.Length]; |
3385 | Array.Copy(src.Data, 0, array, 0, src.Length); | 3385 | Array.Copy(src.Data, 0, array, 0, src.Length); |
3386 | result = new LSL_Types.list(array); | 3386 | result = new LSL_Types.list(array); |
3387 | } | 3387 | } |
3388 | 3388 | ||
3389 | return result; | 3389 | return result; |
3390 | 3390 | ||
@@ -3394,10 +3394,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3394 | /// Elements in the source list starting with 0 and then | 3394 | /// Elements in the source list starting with 0 and then |
3395 | /// every i+stride. If the stride is negative then the scan | 3395 | /// every i+stride. If the stride is negative then the scan |
3396 | /// is backwards producing an inverted result. | 3396 | /// is backwards producing an inverted result. |
3397 | /// Only those elements that are also in the specified | 3397 | /// Only those elements that are also in the specified |
3398 | /// range are included in the result. | 3398 | /// range are included in the result. |
3399 | /// </summary> | 3399 | /// </summary> |
3400 | 3400 | ||
3401 | public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) | 3401 | public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) |
3402 | { | 3402 | { |
3403 | 3403 | ||
@@ -3415,7 +3415,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3415 | if (end < 0) | 3415 | if (end < 0) |
3416 | end = src.Length+end; | 3416 | end = src.Length+end; |
3417 | 3417 | ||
3418 | // Out of bounds indices are OK, just trim them | 3418 | // Out of bounds indices are OK, just trim them |
3419 | // accordingly | 3419 | // accordingly |
3420 | 3420 | ||
3421 | if (start > src.Length) | 3421 | if (start > src.Length) |
@@ -3429,7 +3429,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3429 | if (start != end) | 3429 | if (start != end) |
3430 | { | 3430 | { |
3431 | 3431 | ||
3432 | if (start <= end) | 3432 | if (start <= end) |
3433 | { | 3433 | { |
3434 | si[0] = start; | 3434 | si[0] = start; |
3435 | ei[0] = end; | 3435 | ei[0] = end; |
@@ -3448,8 +3448,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3448 | // fall within the specified sub-range. The specified | 3448 | // fall within the specified sub-range. The specified |
3449 | // range values are inclusive. | 3449 | // range values are inclusive. |
3450 | // A negative stride reverses the direction of the | 3450 | // A negative stride reverses the direction of the |
3451 | // scan producing an inverted list as a result. | 3451 | // scan producing an inverted list as a result. |
3452 | 3452 | ||
3453 | if (stride == 0) | 3453 | if (stride == 0) |
3454 | stride = 1; | 3454 | stride = 1; |
3455 | 3455 | ||
@@ -3492,7 +3492,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3492 | 3492 | ||
3493 | public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int index) | 3493 | public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int index) |
3494 | { | 3494 | { |
3495 | 3495 | ||
3496 | LSL_Types.list pref = null; | 3496 | LSL_Types.list pref = null; |
3497 | LSL_Types.list suff = null; | 3497 | LSL_Types.list suff = null; |
3498 | 3498 | ||
@@ -3539,7 +3539,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3539 | /// Returns the index of the first occurrence of test | 3539 | /// Returns the index of the first occurrence of test |
3540 | /// in src. | 3540 | /// in src. |
3541 | /// </summary> | 3541 | /// </summary> |
3542 | 3542 | ||
3543 | public LSL_Types.LSLInteger llListFindList(LSL_Types.list src, LSL_Types.list test) | 3543 | public LSL_Types.LSLInteger llListFindList(LSL_Types.list src, LSL_Types.list test) |
3544 | { | 3544 | { |
3545 | 3545 | ||
@@ -3568,7 +3568,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3568 | } | 3568 | } |
3569 | } | 3569 | } |
3570 | } | 3570 | } |
3571 | 3571 | ||
3572 | return index; | 3572 | return index; |
3573 | 3573 | ||
3574 | } | 3574 | } |
@@ -3632,12 +3632,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3632 | if (LLUUID.TryParse(id,out key)) | 3632 | if (LLUUID.TryParse(id,out key)) |
3633 | { | 3633 | { |
3634 | ScenePresence presence = World.GetScenePresence(key); | 3634 | ScenePresence presence = World.GetScenePresence(key); |
3635 | 3635 | ||
3636 | if (presence != null) | 3636 | if (presence != null) |
3637 | { | 3637 | { |
3638 | return presence.Name; | 3638 | return presence.Name; |
3639 | } | 3639 | } |
3640 | 3640 | ||
3641 | if (World.GetSceneObjectPart(key) != null) | 3641 | if (World.GetSceneObjectPart(key) != null) |
3642 | { | 3642 | { |
3643 | return World.GetSceneObjectPart(key).Name; | 3643 | return World.GetSceneObjectPart(key).Name; |
@@ -3646,18 +3646,18 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3646 | return String.Empty; | 3646 | return String.Empty; |
3647 | } | 3647 | } |
3648 | 3648 | ||
3649 | 3649 | ||
3650 | 3650 | ||
3651 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) | 3651 | public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) |
3652 | { | 3652 | { |
3653 | m_host.AddScriptLPS(1); | 3653 | m_host.AddScriptLPS(1); |
3654 | Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); | 3654 | Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation(); |
3655 | pTexAnim.Flags =(uint) mode; | 3655 | pTexAnim.Flags =(uint) mode; |
3656 | 3656 | ||
3657 | //ALL_SIDES | 3657 | //ALL_SIDES |
3658 | if (face == -1) | 3658 | if (face == -1) |
3659 | face = 255; | 3659 | face = 255; |
3660 | 3660 | ||
3661 | pTexAnim.Face = (uint)face; | 3661 | pTexAnim.Face = (uint)face; |
3662 | pTexAnim.Length = (float)length; | 3662 | pTexAnim.Length = (float)length; |
3663 | pTexAnim.Rate = (float)rate; | 3663 | pTexAnim.Rate = (float)rate; |
@@ -3688,7 +3688,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3688 | LSL_Types.list ret = new LSL_Types.list(); | 3688 | LSL_Types.list ret = new LSL_Types.list(); |
3689 | object[] delimiters = new object[separators.Length + spacers.Length]; | 3689 | object[] delimiters = new object[separators.Length + spacers.Length]; |
3690 | separators.Data.CopyTo(delimiters, 0); | 3690 | separators.Data.CopyTo(delimiters, 0); |
3691 | spacers.Data.CopyTo(delimiters, separators.Length); | 3691 | spacers.Data.CopyTo(delimiters, separators.Length); |
3692 | bool dfound = false; | 3692 | bool dfound = false; |
3693 | do | 3693 | do |
3694 | { | 3694 | { |
@@ -3735,7 +3735,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3735 | 3735 | ||
3736 | public LSL_Types.LSLInteger llOverMyLand(string id) | 3736 | public LSL_Types.LSLInteger llOverMyLand(string id) |
3737 | { | 3737 | { |
3738 | 3738 | ||
3739 | m_host.AddScriptLPS(1); | 3739 | m_host.AddScriptLPS(1); |
3740 | LLUUID key = new LLUUID(); | 3740 | LLUUID key = new LLUUID(); |
3741 | if (LLUUID.TryParse(id,out key)) | 3741 | if (LLUUID.TryParse(id,out key)) |
@@ -3790,14 +3790,14 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3790 | 3790 | ||
3791 | LLUUID key = new LLUUID(); | 3791 | LLUUID key = new LLUUID(); |
3792 | if (LLUUID.TryParse(id, out key)) | 3792 | if (LLUUID.TryParse(id, out key)) |
3793 | { | 3793 | { |
3794 | ScenePresence av = World.GetScenePresence(key); | 3794 | ScenePresence av = World.GetScenePresence(key); |
3795 | 3795 | ||
3796 | if (av != null) | 3796 | if (av != null) |
3797 | { | 3797 | { |
3798 | if (llAvatarOnSitTarget() == id) | 3798 | if (llAvatarOnSitTarget() == id) |
3799 | { | 3799 | { |
3800 | // if the avatar is sitting on this object, then | 3800 | // if the avatar is sitting on this object, then |
3801 | // we can unsit them. We don't want random scripts unsitting random people | 3801 | // we can unsit them. We don't want random scripts unsitting random people |
3802 | // Lets avoid the popcorn avatar scenario. | 3802 | // Lets avoid the popcorn avatar scenario. |
3803 | av.StandUp(); | 3803 | av.StandUp(); |
@@ -3809,12 +3809,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3809 | // if the land is group owned and the object is group owned by the same group | 3809 | // if the land is group owned and the object is group owned by the same group |
3810 | // or | 3810 | // or |
3811 | // if the object is owned by a person with estate access. | 3811 | // if the object is owned by a person with estate access. |
3812 | 3812 | ||
3813 | ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); | 3813 | ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y); |
3814 | if (parcel != null) | 3814 | if (parcel != null) |
3815 | { | 3815 | { |
3816 | if (m_host.ObjectOwner == parcel.landData.ownerID || | 3816 | if (m_host.ObjectOwner == parcel.landData.ownerID || |
3817 | (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID | 3817 | (m_host.OwnerID == m_host.GroupID && m_host.GroupID == parcel.landData.groupID |
3818 | && parcel.landData.isGroupOwned) || World.ExternalChecks.ExternalChecksCanBeGodLike(m_host.OwnerID)) | 3818 | && parcel.landData.isGroupOwned) || World.ExternalChecks.ExternalChecksCanBeGodLike(m_host.OwnerID)) |
3819 | { | 3819 | { |
3820 | av.StandUp(); | 3820 | av.StandUp(); |
@@ -3822,7 +3822,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3822 | } | 3822 | } |
3823 | } | 3823 | } |
3824 | } | 3824 | } |
3825 | 3825 | ||
3826 | } | 3826 | } |
3827 | 3827 | ||
3828 | } | 3828 | } |
@@ -3928,7 +3928,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3928 | m_host.AddScriptLPS(1); | 3928 | m_host.AddScriptLPS(1); |
3929 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); | 3929 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); |
3930 | LSL_Types.Vector3 tempv = new LSL_Types.Vector3(); | 3930 | LSL_Types.Vector3 tempv = new LSL_Types.Vector3(); |
3931 | 3931 | ||
3932 | float tempf = 0; | 3932 | float tempf = 0; |
3933 | 3933 | ||
3934 | for (int i = 0; i < rules.Length; i += 2) | 3934 | for (int i = 0; i < rules.Length; i += 2) |
@@ -3954,7 +3954,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3954 | case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_COLOR: | 3954 | case (int)BuiltIn_Commands_BaseClass.PSYS_PART_END_COLOR: |
3955 | tempv = (LSL_Types.Vector3)rules.Data[i + 1]; | 3955 | tempv = (LSL_Types.Vector3)rules.Data[i + 1]; |
3956 | //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); | 3956 | //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); |
3957 | 3957 | ||
3958 | prules.PartEndColor.R = (float)tempv.x; | 3958 | prules.PartEndColor.R = (float)tempv.x; |
3959 | prules.PartEndColor.G = (float)tempv.y; | 3959 | prules.PartEndColor.G = (float)tempv.y; |
3960 | prules.PartEndColor.B = (float)tempv.z; | 3960 | prules.PartEndColor.B = (float)tempv.z; |
@@ -3996,7 +3996,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3996 | 3996 | ||
3997 | // Xantor 03-May-2008 | 3997 | // Xantor 03-May-2008 |
3998 | // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture | 3998 | // Wiki: PSYS_SRC_TEXTURE string inventory item name or key of the particle texture |
3999 | // "" = default texture. | 3999 | // "" = default texture. |
4000 | case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE: | 4000 | case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_TEXTURE: |
4001 | LLUUID tkey = LLUUID.Zero; | 4001 | LLUUID tkey = LLUUID.Zero; |
4002 | 4002 | ||
@@ -4007,11 +4007,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4007 | } | 4007 | } |
4008 | // else try to locate the name in inventory of object. found returns key, | 4008 | // else try to locate the name in inventory of object. found returns key, |
4009 | // not found returns LLUUID.Zero which will translate to the default particle texture | 4009 | // not found returns LLUUID.Zero which will translate to the default particle texture |
4010 | else | 4010 | else |
4011 | { | 4011 | { |
4012 | prules.Texture = InventoryKey(rules.Data[i+1].ToString()); | 4012 | prules.Texture = InventoryKey(rules.Data[i+1].ToString()); |
4013 | } | 4013 | } |
4014 | break; | 4014 | break; |
4015 | 4015 | ||
4016 | case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_RATE: | 4016 | case (int)BuiltIn_Commands_BaseClass.PSYS_SRC_BURST_RATE: |
4017 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); | 4017 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
@@ -4150,7 +4150,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4150 | m_host.AddScriptLPS(1); | 4150 | m_host.AddScriptLPS(1); |
4151 | return m_host.GetAvatarOnSitTarget().ToString(); | 4151 | return m_host.GetAvatarOnSitTarget().ToString(); |
4152 | //LLUUID AVID = m_host.GetAvatarOnSitTarget(); | 4152 | //LLUUID AVID = m_host.GetAvatarOnSitTarget(); |
4153 | 4153 | ||
4154 | //if (AVID != LLUUID.Zero) | 4154 | //if (AVID != LLUUID.Zero) |
4155 | // return AVID.ToString(); | 4155 | // return AVID.ToString(); |
4156 | //else | 4156 | //else |
@@ -4283,7 +4283,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4283 | 4283 | ||
4284 | // These functions are supposed to be robust, | 4284 | // These functions are supposed to be robust, |
4285 | // so get the state one step at a time. | 4285 | // so get the state one step at a time. |
4286 | 4286 | ||
4287 | if ((item = ScriptByName(name)) != LLUUID.Zero) | 4287 | if ((item = ScriptByName(name)) != LLUUID.Zero) |
4288 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | 4288 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) |
4289 | sm.ResetScript(m_localID, item); | 4289 | sm.ResetScript(m_localID, item); |
@@ -4293,7 +4293,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4293 | if (script == null) | 4293 | if (script == null) |
4294 | ShoutError("llResetOtherScript: script "+name+" not found"); | 4294 | ShoutError("llResetOtherScript: script "+name+" not found"); |
4295 | 4295 | ||
4296 | // If we didn't find it, then it's safe to | 4296 | // If we didn't find it, then it's safe to |
4297 | // assume it is not running. | 4297 | // assume it is not running. |
4298 | } | 4298 | } |
4299 | 4299 | ||
@@ -4307,7 +4307,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4307 | 4307 | ||
4308 | // These functions are supposed to be robust, | 4308 | // These functions are supposed to be robust, |
4309 | // so get the state one step at a time. | 4309 | // so get the state one step at a time. |
4310 | 4310 | ||
4311 | if ((item = ScriptByName(name)) != LLUUID.Zero) | 4311 | if ((item = ScriptByName(name)) != LLUUID.Zero) |
4312 | { | 4312 | { |
4313 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | 4313 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) |
@@ -4324,7 +4324,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4324 | if (script == null) | 4324 | if (script == null) |
4325 | ShoutError("llGetScriptState: script "+name+" not found"); | 4325 | ShoutError("llGetScriptState: script "+name+" not found"); |
4326 | 4326 | ||
4327 | // If we didn't find it, then it's safe to | 4327 | // If we didn't find it, then it's safe to |
4328 | // assume it is not running. | 4328 | // assume it is not running. |
4329 | 4329 | ||
4330 | return 0; | 4330 | return 0; |
@@ -4586,7 +4586,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4586 | { | 4586 | { |
4587 | return; | 4587 | return; |
4588 | } | 4588 | } |
4589 | 4589 | ||
4590 | if (landowner != m_host.ObjectOwner) | 4590 | if (landowner != m_host.ObjectOwner) |
4591 | { | 4591 | { |
4592 | return; | 4592 | return; |
@@ -4857,7 +4857,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4857 | 4857 | ||
4858 | case 21: // PRIM_FLEXIBLE | 4858 | case 21: // PRIM_FLEXIBLE |
4859 | PrimitiveBaseShape shape = m_host.Shape; | 4859 | PrimitiveBaseShape shape = m_host.Shape; |
4860 | 4860 | ||
4861 | if (shape.FlexiEntry) | 4861 | if (shape.FlexiEntry) |
4862 | res.Add(new LSL_Types.LSLInteger(1)); // active | 4862 | res.Add(new LSL_Types.LSLInteger(1)); // active |
4863 | else | 4863 | else |
@@ -4885,7 +4885,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4885 | 4885 | ||
4886 | case 23: // PRIM_POINT_LIGHT: | 4886 | case 23: // PRIM_POINT_LIGHT: |
4887 | shape = m_host.Shape; | 4887 | shape = m_host.Shape; |
4888 | 4888 | ||
4889 | if (shape.LightEntry) | 4889 | if (shape.LightEntry) |
4890 | res.Add(new LSL_Types.LSLInteger(1)); // active | 4890 | res.Add(new LSL_Types.LSLInteger(1)); // active |
4891 | else | 4891 | else |
@@ -4932,12 +4932,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4932 | // </para> | 4932 | // </para> |
4933 | // <para> | 4933 | // <para> |
4934 | // Each point in a base-64 string represents | 4934 | // Each point in a base-64 string represents |
4935 | // a 6 bit value. A 32-bit integer can be | 4935 | // a 6 bit value. A 32-bit integer can be |
4936 | // represented using 6 characters (with some | 4936 | // represented using 6 characters (with some |
4937 | // redundancy). | 4937 | // redundancy). |
4938 | // </para> | 4938 | // </para> |
4939 | // <para> | 4939 | // <para> |
4940 | // LSL requires a base64 string to be 8 | 4940 | // LSL requires a base64 string to be 8 |
4941 | // characters in length. LSL also uses '/' | 4941 | // characters in length. LSL also uses '/' |
4942 | // rather than '-' (MIME compliant). | 4942 | // rather than '-' (MIME compliant). |
4943 | // </para> | 4943 | // </para> |
@@ -4948,7 +4948,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4948 | // <para> | 4948 | // <para> |
4949 | // SL do not record any kind of exception for | 4949 | // SL do not record any kind of exception for |
4950 | // these functions, so the string to integer | 4950 | // these functions, so the string to integer |
4951 | // conversion returns '0' if an invalid | 4951 | // conversion returns '0' if an invalid |
4952 | // character is encountered during conversion. | 4952 | // character is encountered during conversion. |
4953 | // </para> | 4953 | // </para> |
4954 | // <para> | 4954 | // <para> |
@@ -4962,13 +4962,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4962 | // </list> | 4962 | // </list> |
4963 | // </para> | 4963 | // </para> |
4964 | // </remarks> | 4964 | // </remarks> |
4965 | 4965 | ||
4966 | // <summary> | 4966 | // <summary> |
4967 | // Table for converting 6-bit integers into | 4967 | // Table for converting 6-bit integers into |
4968 | // base-64 characters | 4968 | // base-64 characters |
4969 | // </summary> | 4969 | // </summary> |
4970 | 4970 | ||
4971 | private static readonly char[] i2ctable = | 4971 | private static readonly char[] i2ctable = |
4972 | { | 4972 | { |
4973 | 'A','B','C','D','E','F','G','H', | 4973 | 'A','B','C','D','E','F','G','H', |
4974 | 'I','J','K','L','M','N','O','P', | 4974 | 'I','J','K','L','M','N','O','P', |
@@ -4992,7 +4992,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4992 | { | 4992 | { |
4993 | -1,-1,-1,-1,-1,-1,-1,-1, // 0x | 4993 | -1,-1,-1,-1,-1,-1,-1,-1, // 0x |
4994 | -1,-1,-1,-1,-1,-1,-1,-1, | 4994 | -1,-1,-1,-1,-1,-1,-1,-1, |
4995 | -1,-1,-1,-1,-1,-1,-1,-1, // 1x | 4995 | -1,-1,-1,-1,-1,-1,-1,-1, // 1x |
4996 | -1,-1,-1,-1,-1,-1,-1,-1, | 4996 | -1,-1,-1,-1,-1,-1,-1,-1, |
4997 | -1,-1,-1,-1,-1,-1,-1,-1, // 2x | 4997 | -1,-1,-1,-1,-1,-1,-1,-1, // 2x |
4998 | -1,-1,-1,63,-1,-1,-1,64, | 4998 | -1,-1,-1,63,-1,-1,-1,64, |
@@ -5070,25 +5070,25 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5070 | // length strings return zero. | 5070 | // length strings return zero. |
5071 | // </param> | 5071 | // </param> |
5072 | // <returns> | 5072 | // <returns> |
5073 | // Returns an integer representing the | 5073 | // Returns an integer representing the |
5074 | // encoded value providedint he 1st 6 | 5074 | // encoded value providedint he 1st 6 |
5075 | // characters of the string. | 5075 | // characters of the string. |
5076 | // </returns> | 5076 | // </returns> |
5077 | // <remarks> | 5077 | // <remarks> |
5078 | // This is coded to behave like LSL's | 5078 | // This is coded to behave like LSL's |
5079 | // implementation (I think), based upon the | 5079 | // implementation (I think), based upon the |
5080 | // information available at the Wiki. | 5080 | // information available at the Wiki. |
5081 | // If more than 8 characters are supplied, | 5081 | // If more than 8 characters are supplied, |
5082 | // zero is returned. | 5082 | // zero is returned. |
5083 | // If a NULL string is supplied, zero will | 5083 | // If a NULL string is supplied, zero will |
5084 | // be returned. | 5084 | // be returned. |
5085 | // If fewer than 6 characters are supplied, then | 5085 | // If fewer than 6 characters are supplied, then |
5086 | // the answer will reflect a partial | 5086 | // the answer will reflect a partial |
5087 | // accumulation. | 5087 | // accumulation. |
5088 | // <para> | 5088 | // <para> |
5089 | // The 6-bit segments are | 5089 | // The 6-bit segments are |
5090 | // extracted left-to-right in big-endian mode, | 5090 | // extracted left-to-right in big-endian mode, |
5091 | // which means that segment 6 only contains the | 5091 | // which means that segment 6 only contains the |
5092 | // two low-order bits of the 32 bit integer as | 5092 | // two low-order bits of the 32 bit integer as |
5093 | // its high order 2 bits. A short string therefore | 5093 | // its high order 2 bits. A short string therefore |
5094 | // means loss of low-order information. E.g. | 5094 | // means loss of low-order information. E.g. |
@@ -5126,39 +5126,39 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5126 | return digit<0?(int)0:number; | 5126 | return digit<0?(int)0:number; |
5127 | } | 5127 | } |
5128 | number += --digit<<26; | 5128 | number += --digit<<26; |
5129 | 5129 | ||
5130 | if ((digit=c2itable[str[1]])<=0) | 5130 | if ((digit=c2itable[str[1]])<=0) |
5131 | { | 5131 | { |
5132 | return digit<0?(int)0:number; | 5132 | return digit<0?(int)0:number; |
5133 | } | 5133 | } |
5134 | number += --digit<<20; | 5134 | number += --digit<<20; |
5135 | 5135 | ||
5136 | if ((digit=c2itable[str[2]])<=0) | 5136 | if ((digit=c2itable[str[2]])<=0) |
5137 | { | 5137 | { |
5138 | return digit<0?(int)0:number; | 5138 | return digit<0?(int)0:number; |
5139 | } | 5139 | } |
5140 | number += --digit<<14; | 5140 | number += --digit<<14; |
5141 | 5141 | ||
5142 | if ((digit=c2itable[str[3]])<=0) | 5142 | if ((digit=c2itable[str[3]])<=0) |
5143 | { | 5143 | { |
5144 | return digit<0?(int)0:number; | 5144 | return digit<0?(int)0:number; |
5145 | } | 5145 | } |
5146 | number += --digit<<8; | 5146 | number += --digit<<8; |
5147 | 5147 | ||
5148 | if ((digit=c2itable[str[4]])<=0) | 5148 | if ((digit=c2itable[str[4]])<=0) |
5149 | { | 5149 | { |
5150 | return digit<0?(int)0:number; | 5150 | return digit<0?(int)0:number; |
5151 | } | 5151 | } |
5152 | number += --digit<<2; | 5152 | number += --digit<<2; |
5153 | 5153 | ||
5154 | if ((digit=c2itable[str[5]])<=0) | 5154 | if ((digit=c2itable[str[5]])<=0) |
5155 | { | 5155 | { |
5156 | return digit<0?(int)0:number; | 5156 | return digit<0?(int)0:number; |
5157 | } | 5157 | } |
5158 | number += --digit>>4; | 5158 | number += --digit>>4; |
5159 | 5159 | ||
5160 | // ignore trailing padding | 5160 | // ignore trailing padding |
5161 | 5161 | ||
5162 | return number; | 5162 | return number; |
5163 | } | 5163 | } |
5164 | 5164 | ||
@@ -5182,8 +5182,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5182 | 5182 | ||
5183 | // <summary> | 5183 | // <summary> |
5184 | // Scan the string supplied in 'src' and | 5184 | // Scan the string supplied in 'src' and |
5185 | // tokenize it based upon two sets of | 5185 | // tokenize it based upon two sets of |
5186 | // tokenizers provided in two lists, | 5186 | // tokenizers provided in two lists, |
5187 | // separators and spacers. | 5187 | // separators and spacers. |
5188 | // </summary> | 5188 | // </summary> |
5189 | // | 5189 | // |
@@ -5196,38 +5196,38 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5196 | // Both separators and spacers may be arbitrarily | 5196 | // Both separators and spacers may be arbitrarily |
5197 | // long strings. i.e. ":::". | 5197 | // long strings. i.e. ":::". |
5198 | // | 5198 | // |
5199 | // The function returns an ordered list | 5199 | // The function returns an ordered list |
5200 | // representing the tokens found in the supplied | 5200 | // representing the tokens found in the supplied |
5201 | // sources string. If two successive tokenizers | 5201 | // sources string. If two successive tokenizers |
5202 | // are encountered, then a NULL entry is added | 5202 | // are encountered, then a NULL entry is added |
5203 | // to the list. | 5203 | // to the list. |
5204 | // | 5204 | // |
5205 | // It is a precondition that the source and | 5205 | // It is a precondition that the source and |
5206 | // toekizer lisst are non-null. If they are null, | 5206 | // toekizer lisst are non-null. If they are null, |
5207 | // then a null pointer exception will be thrown | 5207 | // then a null pointer exception will be thrown |
5208 | // while their lengths are being determined. | 5208 | // while their lengths are being determined. |
5209 | // | 5209 | // |
5210 | // A small amount of working memoryis required | 5210 | // A small amount of working memoryis required |
5211 | // of approximately 8*#tokenizers. | 5211 | // of approximately 8*#tokenizers. |
5212 | // | 5212 | // |
5213 | // There are many ways in which this function | 5213 | // There are many ways in which this function |
5214 | // can be implemented, this implementation is | 5214 | // can be implemented, this implementation is |
5215 | // fairly naive and assumes that when the | 5215 | // fairly naive and assumes that when the |
5216 | // function is invooked with a short source | 5216 | // function is invooked with a short source |
5217 | // string and/or short lists of tokenizers, then | 5217 | // string and/or short lists of tokenizers, then |
5218 | // performance will not be an issue. | 5218 | // performance will not be an issue. |
5219 | // | 5219 | // |
5220 | // In order to minimize the perofrmance | 5220 | // In order to minimize the perofrmance |
5221 | // effects of long strings, or large numbers | 5221 | // effects of long strings, or large numbers |
5222 | // of tokeizers, the function skips as far as | 5222 | // of tokeizers, the function skips as far as |
5223 | // possible whenever a toekenizer is found, | 5223 | // possible whenever a toekenizer is found, |
5224 | // and eliminates redundant tokenizers as soon | 5224 | // and eliminates redundant tokenizers as soon |
5225 | // as is possible. | 5225 | // as is possible. |
5226 | // | 5226 | // |
5227 | // The implementation tries to avoid any copying | 5227 | // The implementation tries to avoid any copying |
5228 | // of arrays or other objects. | 5228 | // of arrays or other objects. |
5229 | // </remarks> | 5229 | // </remarks> |
5230 | 5230 | ||
5231 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list separators, LSL_Types.list spacers) | 5231 | public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list separators, LSL_Types.list spacers) |
5232 | { | 5232 | { |
5233 | int beginning = 0; | 5233 | int beginning = 0; |
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5256 | active[i] = true; | 5256 | active[i] = true; |
5257 | 5257 | ||
5258 | offset[mlen] = srclen; | 5258 | offset[mlen] = srclen; |
5259 | 5259 | ||
5260 | while (beginning < srclen) | 5260 | while (beginning < srclen) |
5261 | { | 5261 | { |
5262 | 5262 | ||
@@ -5270,7 +5270,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5270 | { | 5270 | { |
5271 | // scan all of the markers | 5271 | // scan all of the markers |
5272 | if ((offset[j] = src.IndexOf((string)separray[j],beginning)) == -1) | 5272 | if ((offset[j] = src.IndexOf((string)separray[j],beginning)) == -1) |
5273 | { | 5273 | { |
5274 | // not present at all | 5274 | // not present at all |
5275 | active[j] = false; | 5275 | active[j] = false; |
5276 | } | 5276 | } |
@@ -5278,7 +5278,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5278 | { | 5278 | { |
5279 | // present and correct | 5279 | // present and correct |
5280 | if (offset[j] < offset[best]) | 5280 | if (offset[j] < offset[best]) |
5281 | { | 5281 | { |
5282 | // closest so far | 5282 | // closest so far |
5283 | best = j; | 5283 | best = j; |
5284 | if (offset[best] == beginning) | 5284 | if (offset[best] == beginning) |
@@ -5293,19 +5293,19 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5293 | if (offset[best] != beginning) | 5293 | if (offset[best] != beginning) |
5294 | { | 5294 | { |
5295 | for (j = seplen; (j < mlen) && (offset[best] > beginning); j++) | 5295 | for (j = seplen; (j < mlen) && (offset[best] > beginning); j++) |
5296 | { | 5296 | { |
5297 | if (active[j]) | 5297 | if (active[j]) |
5298 | { | 5298 | { |
5299 | // scan all of the markers | 5299 | // scan all of the markers |
5300 | if ((offset[j] = src.IndexOf((string)spcarray[j-seplen],beginning)) == -1) | 5300 | if ((offset[j] = src.IndexOf((string)spcarray[j-seplen],beginning)) == -1) |
5301 | { | 5301 | { |
5302 | // not present at all | 5302 | // not present at all |
5303 | active[j] = false; | 5303 | active[j] = false; |
5304 | } else | 5304 | } else |
5305 | { | 5305 | { |
5306 | // present and correct | 5306 | // present and correct |
5307 | if (offset[j] < offset[best]) | 5307 | if (offset[j] < offset[best]) |
5308 | { | 5308 | { |
5309 | // closest so far | 5309 | // closest so far |
5310 | best = j; | 5310 | best = j; |
5311 | } | 5311 | } |
@@ -5317,7 +5317,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5317 | // This is the normal exit from the scanning loop | 5317 | // This is the normal exit from the scanning loop |
5318 | 5318 | ||
5319 | if (best == mlen) | 5319 | if (best == mlen) |
5320 | { | 5320 | { |
5321 | // no markers were found on this pass | 5321 | // no markers were found on this pass |
5322 | // so we're pretty much done | 5322 | // so we're pretty much done |
5323 | tokens.Add(src.Substring(beginning, srclen-beginning)); | 5323 | tokens.Add(src.Substring(beginning, srclen-beginning)); |
@@ -5478,7 +5478,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5478 | //should be similar to : llInstantMessage(llGetOwner(),msg) | 5478 | //should be similar to : llInstantMessage(llGetOwner(),msg) |
5479 | // llGetOwner ==> m_host.ObjectOwner.ToString() | 5479 | // llGetOwner ==> m_host.ObjectOwner.ToString() |
5480 | llInstantMessage(m_host.ObjectOwner.ToString(),msg); | 5480 | llInstantMessage(m_host.ObjectOwner.ToString(),msg); |
5481 | 5481 | ||
5482 | //World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 5482 | //World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Owner, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
5483 | //IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 5483 | //IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
5484 | //wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg); | 5484 | //wComm.DeliverMessage(ChatTypeEnum.Owner, 0, m_host.Name, m_host.UUID, msg); |
@@ -5509,19 +5509,19 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5509 | 5509 | ||
5510 | /// <summary> | 5510 | /// <summary> |
5511 | /// illListReplaceList removes the sub-list defined by the inclusive indices | 5511 | /// illListReplaceList removes the sub-list defined by the inclusive indices |
5512 | /// start and end and inserts the src list in its place. The inclusive | 5512 | /// start and end and inserts the src list in its place. The inclusive |
5513 | /// nature of the indices means that at least one element must be deleted | 5513 | /// nature of the indices means that at least one element must be deleted |
5514 | /// if the indices are within the bounds of the existing list. I.e. 2,2 | 5514 | /// if the indices are within the bounds of the existing list. I.e. 2,2 |
5515 | /// will remove the element at index 2 and replace it with the source | 5515 | /// will remove the element at index 2 and replace it with the source |
5516 | /// list. Both indices may be negative, with the usual interpretation. An | 5516 | /// list. Both indices may be negative, with the usual interpretation. An |
5517 | /// interesting case is where end is lower than start. As these indices | 5517 | /// interesting case is where end is lower than start. As these indices |
5518 | /// bound the list to be removed, then 0->end, and start->lim are removed | 5518 | /// bound the list to be removed, then 0->end, and start->lim are removed |
5519 | /// and the source list is added as a suffix. | 5519 | /// and the source list is added as a suffix. |
5520 | /// </summary> | 5520 | /// </summary> |
5521 | 5521 | ||
5522 | public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) | 5522 | public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) |
5523 | { | 5523 | { |
5524 | 5524 | ||
5525 | LSL_Types.list pref = null; | 5525 | LSL_Types.list pref = null; |
5526 | 5526 | ||
5527 | m_host.AddScriptLPS(1); | 5527 | m_host.AddScriptLPS(1); |
@@ -5542,9 +5542,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5542 | // list. | 5542 | // list. |
5543 | if (start <= end) | 5543 | if (start <= end) |
5544 | { | 5544 | { |
5545 | // If greater than zero, then there is going to be a | 5545 | // If greater than zero, then there is going to be a |
5546 | // surviving prefix. Otherwise the inclusive nature | 5546 | // surviving prefix. Otherwise the inclusive nature |
5547 | // of the indices mean that we're going to add the | 5547 | // of the indices mean that we're going to add the |
5548 | // source list as a prefix. | 5548 | // source list as a prefix. |
5549 | if (start > 0) | 5549 | if (start > 0) |
5550 | { | 5550 | { |
@@ -5580,7 +5580,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5580 | } | 5580 | } |
5581 | // Finally, if start > end, we strip away a prefix and | 5581 | // Finally, if start > end, we strip away a prefix and |
5582 | // a suffix, to leave the list that sits <between> ens | 5582 | // a suffix, to leave the list that sits <between> ens |
5583 | // and start, and then tag on the src list. AT least | 5583 | // and start, and then tag on the src list. AT least |
5584 | // that's my interpretation. We can get sublist to do | 5584 | // that's my interpretation. We can get sublist to do |
5585 | // this for us. Note that one, or both of the indices | 5585 | // this for us. Note that one, or both of the indices |
5586 | // might have been negative. | 5586 | // might have been negative. |
@@ -6084,7 +6084,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6084 | if (LLUUID.TryParse(id, out key)) | 6084 | if (LLUUID.TryParse(id, out key)) |
6085 | { | 6085 | { |
6086 | ScenePresence av = World.GetScenePresence(key); | 6086 | ScenePresence av = World.GetScenePresence(key); |
6087 | 6087 | ||
6088 | if (av != null) | 6088 | if (av != null) |
6089 | { | 6089 | { |
6090 | foreach (object o in args.Data) | 6090 | foreach (object o in args.Data) |
@@ -6103,7 +6103,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6103 | case "4": | 6103 | case "4": |
6104 | ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w)); | 6104 | ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w)); |
6105 | break; | 6105 | break; |
6106 | case "5": | 6106 | case "5": |
6107 | ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z)); | 6107 | ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z)); |
6108 | break; | 6108 | break; |
6109 | case "6": | 6109 | case "6": |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index e031c01..c8c51f8 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -493,7 +493,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
493 | 493 | ||
494 | // now, this makes the math easier | 494 | // now, this makes the math easier |
495 | int remove=end+1-start; | 495 | int remove=end+1-start; |
496 | 496 | ||
497 | ret=new Object[m_data.Length-remove]; | 497 | ret=new Object[m_data.Length-remove]; |
498 | if (ret.Length == 0) | 498 | if (ret.Length == 0) |
499 | return new list(ret); | 499 | return new list(ret); |
@@ -519,7 +519,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
519 | // NOTE that either index may still be negative after | 519 | // NOTE that either index may still be negative after |
520 | // adding the length, so we must take additional | 520 | // adding the length, so we must take additional |
521 | // measures to protect against this. Note also that | 521 | // measures to protect against this. Note also that |
522 | // after normalisation the negative indices are no | 522 | // after normalisation the negative indices are no |
523 | // longer relative to the end of the list. | 523 | // longer relative to the end of the list. |
524 | 524 | ||
525 | if (start < 0) | 525 | if (start < 0) |
@@ -533,7 +533,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
533 | } | 533 | } |
534 | 534 | ||
535 | // The conventional case is start <= end | 535 | // The conventional case is start <= end |
536 | // NOTE that the case of an empty list is | 536 | // NOTE that the case of an empty list is |
537 | // dealt with by the initial test. Start | 537 | // dealt with by the initial test. Start |
538 | // less than end is taken to be the most | 538 | // less than end is taken to be the most |
539 | // common case. | 539 | // common case. |
@@ -553,7 +553,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
553 | { | 553 | { |
554 | end = m_data.Length - 1; | 554 | end = m_data.Length - 1; |
555 | } | 555 | } |
556 | 556 | ||
557 | // Sublist still starts before the beginning of the list | 557 | // Sublist still starts before the beginning of the list |
558 | if (start < 0) | 558 | if (start < 0) |
559 | { | 559 | { |
@@ -561,7 +561,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
561 | } | 561 | } |
562 | 562 | ||
563 | ret = new object[end - start + 1]; | 563 | ret = new object[end - start + 1]; |
564 | 564 | ||
565 | Array.Copy(m_data, start, ret, 0, end - start + 1); | 565 | Array.Copy(m_data, start, ret, 0, end - start + 1); |
566 | 566 | ||
567 | return new list(ret); | 567 | return new list(ret); |
@@ -580,7 +580,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
580 | { | 580 | { |
581 | result = new list(); | 581 | result = new list(); |
582 | // If start is still negative, then the whole of | 582 | // If start is still negative, then the whole of |
583 | // the existing list is returned. This case is | 583 | // the existing list is returned. This case is |
584 | // only admitted if end is also still negative. | 584 | // only admitted if end is also still negative. |
585 | if (start < 0) | 585 | if (start < 0) |
586 | { | 586 | { |
@@ -593,7 +593,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
593 | result = GetSublist(0,end); | 593 | result = GetSublist(0,end); |
594 | } | 594 | } |
595 | 595 | ||
596 | // If start is outside of list, then just return | 596 | // If start is outside of list, then just return |
597 | // the prefix, whatever it is. | 597 | // the prefix, whatever it is. |
598 | if (start >= m_data.Length) | 598 | if (start >= m_data.Length) |
599 | { | 599 | { |
@@ -896,7 +896,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
896 | } | 896 | } |
897 | } | 897 | } |
898 | 898 | ||
899 | #endregion | 899 | #endregion |
900 | 900 | ||
901 | public string ToPrettyString() | 901 | public string ToPrettyString() |
902 | { | 902 | { |
@@ -962,7 +962,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
962 | } | 962 | } |
963 | 963 | ||
964 | // | 964 | // |
965 | // BELOW IS WORK IN PROGRESS... IT WILL CHANGE, SO DON'T USE YET! :) | 965 | // BELOW IS WORK IN PROGRESS... IT WILL CHANGE, SO DON'T USE YET! :) |
966 | // | 966 | // |
967 | 967 | ||
968 | public struct StringTest | 968 | public struct StringTest |
@@ -1103,7 +1103,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1103 | } | 1103 | } |
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | 1106 | ||
1107 | 1107 | ||
1108 | static public implicit operator String(LSLString s) | 1108 | static public implicit operator String(LSLString s) |
1109 | { | 1109 | { |
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1267 | i.value++; | 1267 | i.value++; |
1268 | return i; | 1268 | return i; |
1269 | } | 1269 | } |
1270 | 1270 | ||
1271 | 1271 | ||
1272 | public static LSLInteger operator --(LSLInteger i) | 1272 | public static LSLInteger operator --(LSLInteger i) |
1273 | { | 1273 | { |
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index 2b6f6d9..03d3a41 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | |||
@@ -268,7 +268,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
270 | } | 270 | } |
271 | 271 | ||
272 | public double osTerrainGetHeight(int x, int y) | 272 | public double osTerrainGetHeight(int x, int y) |
273 | { | 273 | { |
274 | m_host.AddScriptLPS(1); | 274 | m_host.AddScriptLPS(1); |
@@ -448,7 +448,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
448 | } | 448 | } |
449 | } | 449 | } |
450 | 450 | ||
451 | //Texture draw functions | 451 | //Texture draw functions |
452 | public string osMovePen(string drawList, int x, int y) | 452 | public string osMovePen(string drawList, int x, int y) |
453 | { | 453 | { |
454 | m_host.AddScriptLPS(1); | 454 | m_host.AddScriptLPS(1); |
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs index 2d58b57..aa9c8c7 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands_Interface.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
60 | string osSetPenSize(string drawList, int penSize); | 60 | string osSetPenSize(string drawList, int penSize); |
61 | string osSetPenColour(string drawList, string colour); | 61 | string osSetPenColour(string drawList, string colour); |
62 | string osDrawImage(string drawList, int width, int height, string imageUrl); | 62 | string osDrawImage(string drawList, int width, int height, string imageUrl); |
63 | void osSetStateEvents(int events); | 63 | void osSetStateEvents(int events); |
64 | 64 | ||
65 | } | 65 | } |
66 | } | 66 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs index f438120..335d1a0 100644 --- a/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | 30 | ||
31 | // General Information about an assembly is controlled through the following | 31 | // General information about an assembly is controlled through the following |
32 | // set of attributes. Change these attribute values to modify the information | 32 | // set of attributes. Change these attribute values to modify the information |
33 | // associated with an assembly. | 33 | // associated with an assembly. |
34 | 34 | ||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices; | |||
41 | [assembly : AssemblyTrademark("")] | 41 | [assembly : AssemblyTrademark("")] |
42 | [assembly : AssemblyCulture("")] | 42 | [assembly : AssemblyCulture("")] |
43 | 43 | ||
44 | // Setting ComVisible to false makes the types in this assembly not visible | 44 | // Setting ComVisible to false makes the types in this assembly not visible |
45 | // to COM components. If you need to access a type in this assembly from | 45 | // to COM components. If you need to access a type in this assembly from |
46 | // COM, set the ComVisible attribute to true on that type. | 46 | // COM, set the ComVisible attribute to true on that type. |
47 | 47 | ||
48 | [assembly : ComVisible(false)] | 48 | [assembly : ComVisible(false)] |
@@ -54,7 +54,7 @@ using System.Runtime.InteropServices; | |||
54 | // Version information for an assembly consists of the following four values: | 54 | // Version information for an assembly consists of the following four values: |
55 | // | 55 | // |
56 | // Major Version | 56 | // Major Version |
57 | // Minor Version | 57 | // Minor Version |
58 | // Build Number | 58 | // Build Number |
59 | // Revision | 59 | // Revision |
60 | // | 60 | // |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs index f3af621..2a0ed37 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandManager.cs | |||
@@ -115,7 +115,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
115 | Thread.Sleep(cmdHandlerThreadCycleSleepms); | 115 | Thread.Sleep(cmdHandlerThreadCycleSleepms); |
116 | //lock (ScriptEngine.ScriptEngines) | 116 | //lock (ScriptEngine.ScriptEngines) |
117 | //{ | 117 | //{ |
118 | foreach (ScriptEngine se in new ArrayList(ScriptEngine.ScriptEngines)) | 118 | foreach (ScriptEngine se in new ArrayList(ScriptEngine.ScriptEngines)) |
119 | { | 119 | { |
120 | se.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); | 120 | se.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); |
121 | } | 121 | } |
@@ -176,7 +176,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
176 | 176 | ||
177 | #region Check llRemoteData channels | 177 | #region Check llRemoteData channels |
178 | 178 | ||
179 | 179 | ||
180 | #endregion | 180 | #endregion |
181 | 181 | ||
182 | #region Check llListeners | 182 | #region Check llListeners |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs index 4311836..13c9d25 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs | |||
@@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin | |||
218 | objtype |= 0x04; // passive non-moving | 218 | objtype |= 0x04; // passive non-moving |
219 | else | 219 | else |
220 | objtype |= 0x02; // active moving | 220 | objtype |= 0x02; // active moving |
221 | if (ent is IScript) objtype |= 0x08; // Scripted. It COULD have one hidden ... | 221 | if (ent is IScript) objtype |= 0x08; // Scripted. It COULD have one hidden ... |
222 | 222 | ||
223 | if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type)) | 223 | if (((ts.type & objtype) != 0) || ((ts.type & objtype) == ts.type)) |
224 | { | 224 | { |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs index 141e471..6f88e11 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Timer.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | // Old method: Create new list | 97 | // Old method: Create new list |
98 | //List<TimerClass> NewTimers = new List<TimerClass>(); | 98 | //List<TimerClass> NewTimers = new List<TimerClass>(); |
99 | //foreach (TimerClass ts in Timers) | 99 | //foreach (TimerClass ts in Timers) |
100 | //{ | 100 | //{ |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index 715e465..fc005ab 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
39 | /// </summary> | 39 | /// </summary> |
40 | public class MaintenanceThread : iScriptEngineFunctionModule | 40 | public class MaintenanceThread : iScriptEngineFunctionModule |
41 | { | 41 | { |
42 | 42 | ||
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | //public ScriptEngine m_ScriptEngine; | 45 | //public ScriptEngine m_ScriptEngine; |
@@ -238,6 +238,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
238 | // get { return _PleaseShutdown; } | 238 | // get { return _PleaseShutdown; } |
239 | // set { _PleaseShutdown = value; } | 239 | // set { _PleaseShutdown = value; } |
240 | //} | 240 | //} |
241 | //private bool _PleaseShutdown = false; | 241 | //private bool _PleaseShutdown = false; |
242 | } | 242 | } |
243 | } | 243 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index a7ad50d..b0c6314 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
38 | /// <summary> | 38 | /// <summary> |
39 | /// This is the root object for ScriptEngine. Objects access each other trough this class. | 39 | /// This is the root object for ScriptEngine. Objects access each other trough this class. |
40 | /// </summary> | 40 | /// </summary> |
41 | /// | 41 | /// |
42 | [Serializable] | 42 | [Serializable] |
43 | public abstract class ScriptEngine : IRegionModule, ScriptServerInterfaces.ScriptEngine, iScriptEngineFunctionModule | 43 | public abstract class ScriptEngine : IRegionModule, ScriptServerInterfaces.ScriptEngine, iScriptEngineFunctionModule |
44 | { | 44 | { |
@@ -154,7 +154,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
154 | #region IRegionModule | 154 | #region IRegionModule |
155 | 155 | ||
156 | public abstract void Initialise(Scene scene, IConfigSource config); | 156 | public abstract void Initialise(Scene scene, IConfigSource config); |
157 | 157 | ||
158 | public void PostInitialise() | 158 | public void PostInitialise() |
159 | { | 159 | { |
160 | } | 160 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index 2233913..c84975a 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
41 | /// Compiles them if necessary | 41 | /// Compiles them if necessary |
42 | /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution) | 42 | /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution) |
43 | /// </summary> | 43 | /// </summary> |
44 | /// | 44 | /// |
45 | 45 | ||
46 | // This class is as close as you get to the script without being inside script class. It handles all the dirty work for other classes. | 46 | // This class is as close as you get to the script without being inside script class. It handles all the dirty work for other classes. |
47 | // * Keeps track of running scripts | 47 | // * Keeps track of running scripts |
@@ -212,7 +212,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
212 | if (LUQueue.Count > 0) | 212 | if (LUQueue.Count > 0) |
213 | { | 213 | { |
214 | LUStruct item = LUQueue.Dequeue(); | 214 | LUStruct item = LUQueue.Dequeue(); |
215 | 215 | ||
216 | if (item.Action == LUType.Unload) | 216 | if (item.Action == LUType.Unload) |
217 | { | 217 | { |
218 | _StopScript(item.localID, item.itemID); | 218 | _StopScript(item.localID, item.itemID); |
@@ -224,7 +224,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | #endregion | 228 | #endregion |
229 | 229 | ||
230 | #region Helper functions | 230 | #region Helper functions |
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs index 55a20e7..26892a2 100644 --- a/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs +++ b/OpenSim/Region/ScriptEngine/Common/TRPC/TCPServer.cs | |||
@@ -33,7 +33,7 @@ using System.Net.Sockets; | |||
33 | 33 | ||
34 | namespace OpenSim.Region.ScriptEngine.Common.TRPC | 34 | namespace OpenSim.Region.ScriptEngine.Common.TRPC |
35 | { | 35 | { |
36 | public class TCPServer: TCPCommon.ServerInterface | 36 | public class TCPServer: TCPCommon.ServerInterface |
37 | { | 37 | { |
38 | public readonly int LocalPort; | 38 | public readonly int LocalPort; |
39 | public TCPServer(int localPort) | 39 | public TCPServer(int localPort) |
diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs index c293ecb..a310978 100644 --- a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs +++ b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
44 | public delegate void ReceiveCommandDelegate(int ID, string Command, params object[] p); | 44 | public delegate void ReceiveCommandDelegate(int ID, string Command, params object[] p); |
45 | public event ReceiveCommandDelegate ReceiveCommand; | 45 | public event ReceiveCommandDelegate ReceiveCommand; |
46 | Dictionary<string, Type> TypeDictionary = new Dictionary<string, Type>(); | 46 | Dictionary<string, Type> TypeDictionary = new Dictionary<string, Type>(); |
47 | Type[] Types = | 47 | Type[] Types = |
48 | { | 48 | { |
49 | typeof(String), | 49 | typeof(String), |
50 | typeof(Int16), | 50 | typeof(Int16), |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 1d71182..f661162 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |||
@@ -39,9 +39,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
39 | { | 39 | { |
40 | public class Compiler | 40 | public class Compiler |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log | 42 | private static readonly log4net.ILog m_log |
43 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 43 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | // * Uses "LSL2Converter" to convert LSL to C# if necessary. | 45 | // * Uses "LSL2Converter" to convert LSL to C# if necessary. |
46 | // * Compiles C#-code into an assembly | 46 | // * Compiles C#-code into an assembly |
47 | // * Returns assembly name ready for AppDomain load. | 47 | // * Returns assembly name ready for AppDomain load. |
@@ -278,8 +278,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
278 | 278 | ||
279 | if (enableCommanderLSL == true && l == enumCompileType.cs) | 279 | if (enableCommanderLSL == true && l == enumCompileType.cs) |
280 | { | 280 | { |
281 | foreach (KeyValuePair<string, | 281 | foreach (KeyValuePair<string, |
282 | ICommander> com | 282 | ICommander> com |
283 | in m_scriptEngine.World.GetCommanders()) | 283 | in m_scriptEngine.World.GetCommanders()) |
284 | { | 284 | { |
285 | compileScript = com.Value.GenerateRuntimeAPI() + compileScript; | 285 | compileScript = com.Value.GenerateRuntimeAPI() + compileScript; |
@@ -305,7 +305,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
305 | m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code"); | 305 | m_log.Debug("[ScriptEngine.DotNetEngine]: Preparing to compile the following LSL to C# translated code"); |
306 | m_log.Debug(""); | 306 | m_log.Debug(""); |
307 | m_log.Debug(compileScript); | 307 | m_log.Debug(compileScript); |
308 | 308 | ||
309 | return CompileFromDotNetText(compileScript, l); | 309 | return CompileFromDotNetText(compileScript, l); |
310 | } | 310 | } |
311 | 311 | ||
@@ -322,7 +322,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
322 | 322 | ||
323 | private static string CreateCSCompilerScript(string compileScript) | 323 | private static string CreateCSCompilerScript(string compileScript) |
324 | { | 324 | { |
325 | 325 | ||
326 | 326 | ||
327 | compileScript = String.Empty + | 327 | compileScript = String.Empty + |
328 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + | 328 | "using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;\r\n" + |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 2100900..1832864 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -23,7 +23,7 @@ | |||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
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 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
@@ -32,17 +32,13 @@ using System.Text.RegularExpressions; | |||
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
34 | { | 34 | { |
35 | |||
36 | public class LSL2CSConverter | 35 | public class LSL2CSConverter |
37 | { | 36 | { |
38 | |||
39 | |||
40 | // Uses regex to convert LSL code to C# code. | 37 | // Uses regex to convert LSL code to C# code. |
41 | 38 | ||
42 | //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); | 39 | //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); |
43 | private Dictionary<string, string> dataTypes = new Dictionary<string, string>(); | 40 | private Dictionary<string, string> dataTypes = new Dictionary<string, string>(); |
44 | private Dictionary<string, string> quotes = new Dictionary<string, string>(); | 41 | private Dictionary<string, string> quotes = new Dictionary<string, string>(); |
45 | |||
46 | 42 | ||
47 | public LSL2CSConverter() | 43 | public LSL2CSConverter() |
48 | { | 44 | { |
@@ -72,7 +68,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
72 | Script = Regex.Replace(Script, @"\r\n", "\n"); | 68 | Script = Regex.Replace(Script, @"\r\n", "\n"); |
73 | Script = Regex.Replace(Script, @"\n", "\r\n"); | 69 | Script = Regex.Replace(Script, @"\n", "\r\n"); |
74 | 70 | ||
75 | |||
76 | // QUOTE REPLACEMENT | 71 | // QUOTE REPLACEMENT |
77 | // temporarily replace quotes so we can work our magic on the script without | 72 | // temporarily replace quotes so we can work our magic on the script without |
78 | // always considering if we are inside our outside quotes's | 73 | // always considering if we are inside our outside quotes's |
@@ -86,21 +81,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
86 | bool last_was_escape = false; | 81 | bool last_was_escape = false; |
87 | int quote_replaced_count = 0; | 82 | int quote_replaced_count = 0; |
88 | 83 | ||
89 | |||
90 | |||
91 | string[] blocked = new string[] {"Axiom","Db4objects","libsecondlife","log4net","Microsoft", | 84 | string[] blocked = new string[] {"Axiom","Db4objects","libsecondlife","log4net","Microsoft", |
92 | "Modified","Mono","MonoXnaCompactMaths","mscorlib","MySql", | 85 | "Modified","Mono","MonoXnaCompactMaths","mscorlib","MySql", |
93 | "NHibernate","Nini","nunit","Ode","OpenSim","PhysX_Wrapper_Dotnet", | 86 | "NHibernate","Nini","nunit","Ode","OpenSim","PhysX_Wrapper_Dotnet", |
94 | "PumaCode","RAIL","XMLRPC","System"}; | 87 | "PumaCode","RAIL","XMLRPC","System"}; |
95 | |||
96 | 88 | ||
97 | for (int p = 0; p < blocked.Length;p++) | 89 | for (int p = 0; p < blocked.Length;p++) |
98 | { | 90 | { |
99 | |||
100 | Match SecurityM = Regex.Match(Script, "[;}][^\"']+" + blocked[p].Replace(".", "\\.") + "\\.[^\"']", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 91 | Match SecurityM = Regex.Match(Script, "[;}][^\"']+" + blocked[p].Replace(".", "\\.") + "\\.[^\"']", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
101 | if (SecurityM.Success) | 92 | if (SecurityM.Success) |
102 | throw new Exception("CS0103: 'The name '" + blocked[p] + "' does not exist in the current context'"); | 93 | throw new Exception("CS0103: 'The name '" + blocked[p] + "' does not exist in the current context'"); |
103 | |||
104 | } | 94 | } |
105 | 95 | ||
106 | for (int p = 0; p < Script.Length; p++) | 96 | for (int p = 0; p < Script.Length; p++) |
@@ -166,7 +156,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
166 | // END OF QUOTE REPLACEMENT | 156 | // END OF QUOTE REPLACEMENT |
167 | // | 157 | // |
168 | 158 | ||
169 | |||
170 | // | 159 | // |
171 | // PROCESS STATES | 160 | // PROCESS STATES |
172 | // Remove state definitions and add state names to start of each event within state | 161 | // Remove state definitions and add state names to start of each event within state |
@@ -194,7 +183,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
194 | // if level == 0, add to return | 183 | // if level == 0, add to return |
195 | if (ilevel == 1 && lastlevel == 0) | 184 | if (ilevel == 1 && lastlevel == 0) |
196 | { | 185 | { |
197 | // 0 => 1: Get last | 186 | // 0 => 1: Get last |
198 | Match m = | 187 | Match m = |
199 | //Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", | 188 | //Regex.Match(cache, @"(?![a-zA-Z_]+)\s*([a-zA-Z_]+)[^a-zA-Z_\(\)]*{", |
200 | Regex.Match(cache, @"(?![a-zA-Z_]+)\s*(state\s+)?(?<statename>[a-zA-Z_][a-zA-Z_0-9]*)[^a-zA-Z_0-9\(\)]*{", | 189 | Regex.Match(cache, @"(?![a-zA-Z_]+)\s*(state\s+)?(?<statename>[a-zA-Z_][a-zA-Z_0-9]*)[^a-zA-Z_0-9\(\)]*{", |
@@ -253,7 +242,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
253 | Script = ret; | 242 | Script = ret; |
254 | ret = String.Empty; | 243 | ret = String.Empty; |
255 | 244 | ||
256 | |||
257 | foreach (string key in dataTypes.Keys) | 245 | foreach (string key in dataTypes.Keys) |
258 | { | 246 | { |
259 | string val; | 247 | string val; |
@@ -291,7 +279,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
291 | Regex.Replace(Script, @"\[([^\]]*)\]", @"new LSL_Types.list($1)", | 279 | Regex.Replace(Script, @"\[([^\]]*)\]", @"new LSL_Types.list($1)", |
292 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); | 280 | RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); |
293 | 281 | ||
294 | |||
295 | // Replace (string) to .ToString() // | 282 | // Replace (string) to .ToString() // |
296 | Script = | 283 | Script = |
297 | Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.ToString()", | 284 | Regex.Replace(Script, @"\(string\)\s*([a-zA-Z0-9_.]+(\s*\([^\)]*\))?)", @"$1.ToString()", |
@@ -313,12 +300,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
313 | Script = Script.Replace(key, "\"" + val + "\""); | 300 | Script = Script.Replace(key, "\"" + val + "\""); |
314 | } | 301 | } |
315 | 302 | ||
316 | |||
317 | |||
318 | //System.Console.WriteLine(Script); | 303 | //System.Console.WriteLine(Script); |
319 | Return = String.Empty;// + | 304 | Return = String.Empty;// + |
320 | //"using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;"; | 305 | //"using OpenSim.Region.ScriptEngine.Common; using System.Collections.Generic;"; |
321 | |||
322 | 306 | ||
323 | //Return += String.Empty + | 307 | //Return += String.Empty + |
324 | // "namespace SecondLife { "; | 308 | // "namespace SecondLife { "; |
@@ -328,13 +312,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
328 | //Return += @"public Script() { } "; | 312 | //Return += @"public Script() { } "; |
329 | Return += Script; | 313 | Return += Script; |
330 | //Return += "} }\r\n"; | 314 | //Return += "} }\r\n"; |
331 | 315 | ||
332 | quotes.Clear(); | 316 | quotes.Clear(); |
333 | 317 | ||
334 | return Return; | 318 | return Return; |
335 | } | 319 | } |
336 | |||
337 | } | 320 | } |
338 | |||
339 | |||
340 | } | 321 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs index bce9cfc..799aa92 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Properties/AssemblyInfo.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | 30 | ||
31 | // General Information about an assembly is controlled through the following | 31 | // General information about an assembly is controlled through the following |
32 | // set of attributes. Change these attribute values to modify the information | 32 | // set of attributes. Change these attribute values to modify the information |
33 | // associated with an assembly. | 33 | // associated with an assembly. |
34 | 34 | ||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices; | |||
41 | [assembly : AssemblyTrademark("")] | 41 | [assembly : AssemblyTrademark("")] |
42 | [assembly : AssemblyCulture("")] | 42 | [assembly : AssemblyCulture("")] |
43 | 43 | ||
44 | // Setting ComVisible to false makes the types in this assembly not visible | 44 | // Setting ComVisible to false makes the types in this assembly not visible |
45 | // to COM components. If you need to access a type in this assembly from | 45 | // to COM components. If you need to access a type in this assembly from |
46 | // COM, set the ComVisible attribute to true on that type. | 46 | // COM, set the ComVisible attribute to true on that type. |
47 | 47 | ||
48 | [assembly : ComVisible(false)] | 48 | [assembly : ComVisible(false)] |
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices; | |||
54 | // Version information for an assembly consists of the following four values: | 54 | // Version information for an assembly consists of the following four values: |
55 | // | 55 | // |
56 | // Major Version | 56 | // Major Version |
57 | // Minor Version | 57 | // Minor Version |
58 | // Build Number | 58 | // Build Number |
59 | // Revision | 59 | // Revision |
60 | // | 60 | // |
61 | // You can specify all the values or you can default the Revision and Build Numbers | 61 | // You can specify all the values or you can default the Revision and Build Numbers |
62 | // by using the '*' as shown below: | 62 | // by using the '*' as shown below: |
63 | 63 | ||
64 | [assembly : AssemblyVersion("1.0.0.0")] | 64 | [assembly : AssemblyVersion("1.0.0.0")] |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index ed2c0a3..55289d9 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -102,7 +102,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
102 | 102 | ||
103 | // Fire the first start-event | 103 | // Fire the first start-event |
104 | int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID); | 104 | int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID); |
105 | m_host.SetScriptEvents(itemID, eventFlags); | 105 | m_host.SetScriptEvents(itemID, eventFlags); |
106 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); | 106 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); |
107 | } | 107 | } |
108 | catch (Exception e) // LEGIT: User Scripting | 108 | catch (Exception e) // LEGIT: User Scripting |
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs index 0208350..f53772e 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs | |||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
168 | Common.SendToDebug("IL_CREATE_CONSTRUCTOR()"); | 168 | Common.SendToDebug("IL_CREATE_CONSTRUCTOR()"); |
169 | //ConstructorBuilder constructor = typeBuilder.DefineConstructor( | 169 | //ConstructorBuilder constructor = typeBuilder.DefineConstructor( |
170 | // MethodAttributes.Public, | 170 | // MethodAttributes.Public, |
171 | // CallingConventions.Standard, | 171 | // CallingConventions.Standard, |
172 | // new Type[0]); | 172 | // new Type[0]); |
173 | ConstructorBuilder constructor = typeBuilder.DefineConstructor( | 173 | ConstructorBuilder constructor = typeBuilder.DefineConstructor( |
174 | MethodAttributes.Public | | 174 | MethodAttributes.Public | |
@@ -192,8 +192,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
192 | //// Create state object | 192 | //// Create state object |
193 | //FieldName = "State"; | 193 | //FieldName = "State"; |
194 | //FieldBuilder State_fb = typeBuilder.DefineField( | 194 | //FieldBuilder State_fb = typeBuilder.DefineField( |
195 | // FieldName, | 195 | // FieldName, |
196 | // typeof(UInt32), | 196 | // typeof(UInt32), |
197 | // FieldAttributes.Public); | 197 | // FieldAttributes.Public); |
198 | //il.Emit(OpCodes.Ldarg_0); | 198 | //il.Emit(OpCodes.Ldarg_0); |
199 | //il.Emit(OpCodes.Ldc_I4, 0); | 199 | //il.Emit(OpCodes.Ldc_I4, 0); |
@@ -206,8 +206,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
206 | 206 | ||
207 | //FieldName = "LSL_BuiltIns"; | 207 | //FieldName = "LSL_BuiltIns"; |
208 | //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField( | 208 | //FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField( |
209 | // FieldName, | 209 | // FieldName, |
210 | // objType1, | 210 | // objType1, |
211 | // FieldAttributes.Public); | 211 | // FieldAttributes.Public); |
212 | 212 | ||
213 | ////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation(); | 213 | ////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation(); |
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs index 1b73311..7805aa3 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs | |||
@@ -34,9 +34,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
34 | // * | 34 | // * |
35 | // * These are internal "assembly" commands, | 35 | // * These are internal "assembly" commands, |
36 | // * basic operators like "ADD", "PUSH" and "POP" | 36 | // * basic operators like "ADD", "PUSH" and "POP" |
37 | // * | 37 | // * |
38 | // * It also contains managed stack and keeps track of internal variables, etc. | 38 | // * It also contains managed stack and keeps track of internal variables, etc. |
39 | // * | 39 | // * |
40 | // */ | 40 | // */ |
41 | 41 | ||
42 | 42 | ||
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs index 06ae1e9..b2a2f25 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs | |||
@@ -69,14 +69,12 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
69 | fs.Close(); | 69 | fs.Close(); |
70 | } | 70 | } |
71 | 71 | ||
72 | |||
73 | /// <summary> | 72 | /// <summary> |
74 | /// Parse LSO file. | 73 | /// Parse LSO file. |
75 | /// </summary> | 74 | /// </summary> |
76 | public void Parse() | 75 | public void Parse() |
77 | { | 76 | { |
78 | // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack. | 77 | // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack. |
79 | |||
80 | 78 | ||
81 | // HEADER BLOCK | 79 | // HEADER BLOCK |
82 | Common.SendToDebug("Reading HEADER BLOCK at: 0"); | 80 | Common.SendToDebug("Reading HEADER BLOCK at: 0"); |
@@ -156,7 +154,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
156 | } | 154 | } |
157 | Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount); | 155 | Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount); |
158 | 156 | ||
159 | |||
160 | // FUNCTION BLOCK | 157 | // FUNCTION BLOCK |
161 | // Always right after STATIC BLOCK | 158 | // Always right after STATIC BLOCK |
162 | LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock(); | 159 | LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock(); |
@@ -186,7 +183,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
186 | } | 183 | } |
187 | } | 184 | } |
188 | 185 | ||
189 | |||
190 | // STATE FRAME BLOCK | 186 | // STATE FRAME BLOCK |
191 | // Always right after FUNCTION BLOCK | 187 | // Always right after FUNCTION BLOCK |
192 | Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR); | 188 | Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR); |
@@ -213,7 +209,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
213 | } | 209 | } |
214 | } | 210 | } |
215 | 211 | ||
216 | |||
217 | // STATE BLOCK | 212 | // STATE BLOCK |
218 | // For each StateFrameBlock there is one StateBlock with multiple event handlers | 213 | // For each StateFrameBlock there is one StateBlock with multiple event handlers |
219 | 214 | ||
@@ -239,7 +234,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
239 | 234 | ||
240 | // We need to count number of bits flagged in EventMask? | 235 | // We need to count number of bits flagged in EventMask? |
241 | 236 | ||
242 | |||
243 | // for each bit in myStateFrameBlock.StatePointer[i].EventMask | 237 | // for each bit in myStateFrameBlock.StatePointer[i].EventMask |
244 | 238 | ||
245 | // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE | 239 | // ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE |
@@ -273,7 +267,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
273 | } | 267 | } |
274 | } | 268 | } |
275 | 269 | ||
276 | |||
277 | //// READ FUNCTION CODE CHUNKS | 270 | //// READ FUNCTION CODE CHUNKS |
278 | //// Functions + Function start pos (GFR) | 271 | //// Functions + Function start pos (GFR) |
279 | //// TODO: Somehow be able to identify and reference this | 272 | //// TODO: Somehow be able to identify and reference this |
@@ -293,7 +286,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
293 | { | 286 | { |
294 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) | 287 | for (int i = 0; i < myStateFrameBlock.StateCount; i++) |
295 | { | 288 | { |
296 | // TODO: Somehow organize events and functions so they can be found again, | 289 | // TODO: Somehow organize events and functions so they can be found again, |
297 | // two level search ain't no good | 290 | // two level search ain't no good |
298 | for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) | 291 | for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++) |
299 | { | 292 | { |
@@ -320,7 +313,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
320 | } | 313 | } |
321 | } | 314 | } |
322 | 315 | ||
323 | |||
324 | if (Common.IL_CreateFunctionList) | 316 | if (Common.IL_CreateFunctionList) |
325 | IL_INSERT_FUNCTIONLIST(); | 317 | IL_INSERT_FUNCTIONLIST(); |
326 | } | 318 | } |
@@ -371,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
371 | 363 | ||
372 | //private byte[] br_read_smallendian(int len) | 364 | //private byte[] br_read_smallendian(int len) |
373 | //{ | 365 | //{ |
374 | // byte[] bytes = new byte[len]; | 366 | // byte[] bytes = new byte[len]; |
375 | // br.Read(bytes,0, len); | 367 | // br.Read(bytes,0, len); |
376 | // return bytes; | 368 | // return bytes; |
377 | //} | 369 | //} |
@@ -459,7 +451,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
459 | Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " + | 451 | Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " + |
460 | ((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString()); | 452 | ((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString()); |
461 | 453 | ||
462 | |||
463 | // TODO: How to determine number of codechunks -- does this method work? | 454 | // TODO: How to determine number of codechunks -- does this method work? |
464 | myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>(); | 455 | myCodeChunk.CodeChunkArguments = new List<LSO_Struct.CodeChunkArgument>(); |
465 | byte reader = br_read(1)[0]; | 456 | byte reader = br_read(1)[0]; |
@@ -492,7 +483,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
492 | // End marker is 0x000 | 483 | // End marker is 0x000 |
493 | myCodeChunk.EndMarker = reader; | 484 | myCodeChunk.EndMarker = reader; |
494 | 485 | ||
495 | |||
496 | // | 486 | // |
497 | // Emit: START OF METHOD (FUNCTION) | 487 | // Emit: START OF METHOD (FUNCTION) |
498 | // | 488 | // |
@@ -515,11 +505,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
515 | Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();"); | 505 | Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();"); |
516 | ILGenerator il = methodBuilder.GetILGenerator(); | 506 | ILGenerator il = methodBuilder.GetILGenerator(); |
517 | 507 | ||
518 | |||
519 | if (Common.IL_UseTryCatch) | 508 | if (Common.IL_UseTryCatch) |
520 | IL_INSERT_TRY(il, eventname); | 509 | IL_INSERT_TRY(il, eventname); |
521 | 510 | ||
522 | |||
523 | // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); | 511 | // Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!"); |
524 | //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); | 512 | //Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call..."); |
525 | //il.Emit(OpCodes.Call, typeof(Console).GetMethod | 513 | //il.Emit(OpCodes.Call, typeof(Console).GetMethod |
@@ -534,7 +522,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
534 | il.Emit(OpCodes.Ldarg, _ic); | 522 | il.Emit(OpCodes.Ldarg, _ic); |
535 | } | 523 | } |
536 | 524 | ||
537 | |||
538 | // | 525 | // |
539 | // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL | 526 | // CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL |
540 | // | 527 | // |
@@ -544,7 +531,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
544 | FoundRet = LSL_PROCESS_OPCODE(il); | 531 | FoundRet = LSL_PROCESS_OPCODE(il); |
545 | } | 532 | } |
546 | 533 | ||
547 | |||
548 | if (Common.IL_UseTryCatch) | 534 | if (Common.IL_UseTryCatch) |
549 | IL_INSERT_END_TRY(il, eventname); | 535 | IL_INSERT_END_TRY(il, eventname); |
550 | 536 | ||
@@ -558,17 +544,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
558 | { | 544 | { |
559 | Common.SendToDebug("Creating function list"); | 545 | Common.SendToDebug("Creating function list"); |
560 | 546 | ||
561 | |||
562 | string eventname = "GetFunctions"; | 547 | string eventname = "GetFunctions"; |
563 | 548 | ||
564 | Common.SendToDebug("Creating IL " + eventname); | 549 | Common.SendToDebug("Creating IL " + eventname); |
565 | // Define a private String field. | 550 | // Define a private String field. |
566 | //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public); | 551 | //FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public); |
567 | 552 | ||
568 | |||
569 | //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private); | 553 | //FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private); |
570 | 554 | ||
571 | |||
572 | MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, | 555 | MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname, |
573 | MethodAttributes.Public, | 556 | MethodAttributes.Public, |
574 | typeof (string[]), | 557 | typeof (string[]), |
@@ -579,7 +562,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
579 | 562 | ||
580 | ILGenerator il = methodBuilder.GetILGenerator(); | 563 | ILGenerator il = methodBuilder.GetILGenerator(); |
581 | 564 | ||
582 | |||
583 | // IL_INSERT_TRY(il, eventname); | 565 | // IL_INSERT_TRY(il, eventname); |
584 | 566 | ||
585 | // // Push string to stack | 567 | // // Push string to stack |
@@ -615,17 +597,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
615 | //il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) })); | 597 | //il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) })); |
616 | } | 598 | } |
617 | 599 | ||
618 | |||
619 | // IL_INSERT_END_TRY(il, eventname); | 600 | // IL_INSERT_END_TRY(il, eventname); |
620 | 601 | ||
621 | |||
622 | il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack | 602 | il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack |
623 | // il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) })); | 603 | // il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) })); |
624 | 604 | ||
625 | il.Emit(OpCodes.Ret); // Return | 605 | il.Emit(OpCodes.Ret); // Return |
626 | } | 606 | } |
627 | 607 | ||
628 | |||
629 | private void IL_INSERT_TRY(ILGenerator il, string eventname) | 608 | private void IL_INSERT_TRY(ILGenerator il, string eventname) |
630 | { | 609 | { |
631 | /* | 610 | /* |
@@ -687,7 +666,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | |||
687 | { | 666 | { |
688 | Common.SendToDebug("Found cached STATIC BLOCK"); | 667 | Common.SendToDebug("Found cached STATIC BLOCK"); |
689 | 668 | ||
690 | |||
691 | return StaticBlocks[pos]; | 669 | return StaticBlocks[pos]; |
692 | } | 670 | } |
693 | 671 | ||
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs index 78b44a0..5210ff0 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/Properties/AssemblyInfo.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | 30 | ||
31 | // General Information about an assembly is controlled through the following | 31 | // General information about an assembly is controlled through the following |
32 | // set of attributes. Change these attribute values to modify the information | 32 | // set of attributes. Change these attribute values to modify the information |
33 | // associated with an assembly. | 33 | // associated with an assembly. |
34 | 34 | ||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices; | |||
41 | [assembly : AssemblyTrademark("")] | 41 | [assembly : AssemblyTrademark("")] |
42 | [assembly : AssemblyCulture("")] | 42 | [assembly : AssemblyCulture("")] |
43 | 43 | ||
44 | // Setting ComVisible to false makes the types in this assembly not visible | 44 | // Setting ComVisible to false makes the types in this assembly not visible |
45 | // to COM components. If you need to access a type in this assembly from | 45 | // to COM components. If you need to access a type in this assembly from |
46 | // COM, set the ComVisible attribute to true on that type. | 46 | // COM, set the ComVisible attribute to true on that type. |
47 | 47 | ||
48 | [assembly : ComVisible(false)] | 48 | [assembly : ComVisible(false)] |
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices; | |||
54 | // Version information for an assembly consists of the following four values: | 54 | // Version information for an assembly consists of the following four values: |
55 | // | 55 | // |
56 | // Major Version | 56 | // Major Version |
57 | // Minor Version | 57 | // Minor Version |
58 | // Build Number | 58 | // Build Number |
59 | // Revision | 59 | // Revision |
60 | // | 60 | // |
61 | // You can specify all the values or you can default the Revision and Build Numbers | 61 | // You can specify all the values or you can default the Revision and Build Numbers |
62 | // by using the '*' as shown below: | 62 | // by using the '*' as shown below: |
63 | 63 | ||
64 | [assembly : AssemblyVersion("1.0.0.0")] | 64 | [assembly : AssemblyVersion("1.0.0.0")] |
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs index 20d1a58..617d6f6 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine | |||
92 | 92 | ||
93 | // Fire the first start-event | 93 | // Fire the first start-event |
94 | int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID); | 94 | int eventFlags = m_scriptEngine.m_ScriptManager.GetStateEventFlags(localID, itemID); |
95 | m_host.SetScriptEvents(itemID, eventFlags); | 95 | m_host.SetScriptEvents(itemID, eventFlags); |
96 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); | 96 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); |
97 | } | 97 | } |
98 | catch (Exception e) // LEGIT - User Script Compilation | 98 | catch (Exception e) // LEGIT - User Script Compilation |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs index 70a84f1..77d9b10 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/Properties/AssemblyInfo.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | 30 | ||
31 | // General Information about an assembly is controlled through the following | 31 | // General information about an assembly is controlled through the following |
32 | // set of attributes. Change these attribute values to modify the information | 32 | // set of attributes. Change these attribute values to modify the information |
33 | // associated with an assembly. | 33 | // associated with an assembly. |
34 | 34 | ||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices; | |||
41 | [assembly : AssemblyTrademark("")] | 41 | [assembly : AssemblyTrademark("")] |
42 | [assembly : AssemblyCulture("")] | 42 | [assembly : AssemblyCulture("")] |
43 | 43 | ||
44 | // Setting ComVisible to false makes the types in this assembly not visible | 44 | // Setting ComVisible to false makes the types in this assembly not visible |
45 | // to COM components. If you need to access a type in this assembly from | 45 | // to COM components. If you need to access a type in this assembly from |
46 | // COM, set the ComVisible attribute to true on that type. | 46 | // COM, set the ComVisible attribute to true on that type. |
47 | 47 | ||
48 | [assembly : ComVisible(false)] | 48 | [assembly : ComVisible(false)] |
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices; | |||
54 | // Version information for an assembly consists of the following four values: | 54 | // Version information for an assembly consists of the following four values: |
55 | // | 55 | // |
56 | // Major Version | 56 | // Major Version |
57 | // Minor Version | 57 | // Minor Version |
58 | // Build Number | 58 | // Build Number |
59 | // Revision | 59 | // Revision |
60 | // | 60 | // |
61 | // You can specify all the values or you can default the Revision and Build Numbers | 61 | // You can specify all the values or you can default the Revision and Build Numbers |
62 | // by using the '*' as shown below: | 62 | // by using the '*' as shown below: |
63 | 63 | ||
64 | [assembly : AssemblyVersion("1.0.0.0")] | 64 | [assembly : AssemblyVersion("1.0.0.0")] |
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs index c33cfd1..8754516 100644 --- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer | |||
39 | /// <summary> | 39 | /// <summary> |
40 | /// This is the root object for RemoteServer. Objects access each other trough this class. | 40 | /// This is the root object for RemoteServer. Objects access each other trough this class. |
41 | /// </summary> | 41 | /// </summary> |
42 | /// | 42 | /// |
43 | [Serializable] | 43 | [Serializable] |
44 | public class ScriptEngine : IRegionModule | 44 | public class ScriptEngine : IRegionModule |
45 | { | 45 | { |