diff options
author | Tedd Hansen | 2007-12-31 19:31:40 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-12-31 19:31:40 +0000 |
commit | a8cb20355c9be4b57ea7a0e4f6691c3f0cfbbde2 (patch) | |
tree | a0943948864efd357f2a23f9d911a684a0b7a471 /OpenSim | |
parent | Changed type comparison from String to object type (diff) | |
download | opensim-SC-a8cb20355c9be4b57ea7a0e4f6691c3f0cfbbde2.zip opensim-SC-a8cb20355c9be4b57ea7a0e4f6691c3f0cfbbde2.tar.gz opensim-SC-a8cb20355c9be4b57ea7a0e4f6691c3f0cfbbde2.tar.bz2 opensim-SC-a8cb20355c9be4b57ea7a0e4f6691c3f0cfbbde2.tar.xz |
Correction of last commit
Diffstat (limited to '')
3 files changed, 102 insertions, 97 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 4e3296c..48523e4 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | |||
@@ -439,6 +439,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
439 | } | 439 | } |
440 | return output; | 440 | return output; |
441 | } | 441 | } |
442 | |||
443 | public class String | ||
444 | { | ||
445 | |||
446 | } | ||
442 | } | 447 | } |
443 | } | 448 | } |
444 | } | 449 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index dfdf8f4..109b8e2 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
47 | dataTypes.Add("void", "void"); | 47 | dataTypes.Add("void", "void"); |
48 | dataTypes.Add("integer", "int"); | 48 | dataTypes.Add("integer", "int"); |
49 | dataTypes.Add("float", "double"); | 49 | dataTypes.Add("float", "double"); |
50 | dataTypes.Add("string", "string"); | 50 | dataTypes.Add("string", "LSL_Types.String"); |
51 | dataTypes.Add("key", "string"); | 51 | dataTypes.Add("key", "string"); |
52 | dataTypes.Add("vector", "LSL_Types.Vector3"); | 52 | dataTypes.Add("vector", "LSL_Types.Vector3"); |
53 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); | 53 | dataTypes.Add("rotation", "LSL_Types.Quaternion"); |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index 77f31b5..0ad10cc 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
88 | { | 88 | { |
89 | //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); | 89 | //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); |
90 | // return null; | 90 | // return null; |
91 | ILease lease = (ILease) base.InitializeLifetimeService(); | 91 | ILease lease = (ILease)base.InitializeLifetimeService(); |
92 | 92 | ||
93 | if (lease.CurrentState == LeaseState.Initial) | 93 | if (lease.CurrentState == LeaseState.Initial) |
94 | { | 94 | { |
@@ -108,43 +108,43 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
108 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 | 108 | //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 |
109 | public double llSin(double f) | 109 | public double llSin(double f) |
110 | { | 110 | { |
111 | 111 | ||
112 | return (double) Math.Sin(f); | 112 | return (double)Math.Sin(f); |
113 | } | 113 | } |
114 | 114 | ||
115 | public double llCos(double f) | 115 | public double llCos(double f) |
116 | { | 116 | { |
117 | return (double) Math.Cos(f); | 117 | return (double)Math.Cos(f); |
118 | } | 118 | } |
119 | 119 | ||
120 | public double llTan(double f) | 120 | public double llTan(double f) |
121 | { | 121 | { |
122 | return (double) Math.Tan(f); | 122 | return (double)Math.Tan(f); |
123 | } | 123 | } |
124 | 124 | ||
125 | public double llAtan2(double x, double y) | 125 | public double llAtan2(double x, double y) |
126 | { | 126 | { |
127 | return (double) Math.Atan2(y, x); | 127 | return (double)Math.Atan2(y, x); |
128 | } | 128 | } |
129 | 129 | ||
130 | public double llSqrt(double f) | 130 | public double llSqrt(double f) |
131 | { | 131 | { |
132 | return (double) Math.Sqrt(f); | 132 | return (double)Math.Sqrt(f); |
133 | } | 133 | } |
134 | 134 | ||
135 | public double llPow(double fbase, double fexponent) | 135 | public double llPow(double fbase, double fexponent) |
136 | { | 136 | { |
137 | return (double) Math.Pow(fbase, fexponent); | 137 | return (double)Math.Pow(fbase, fexponent); |
138 | } | 138 | } |
139 | 139 | ||
140 | public int llAbs(int i) | 140 | public int llAbs(int i) |
141 | { | 141 | { |
142 | return (int) Math.Abs(i); | 142 | return (int)Math.Abs(i); |
143 | } | 143 | } |
144 | 144 | ||
145 | public double llFabs(double f) | 145 | public double llFabs(double f) |
146 | { | 146 | { |
147 | return (double) Math.Abs(f); | 147 | return (double)Math.Abs(f); |
148 | } | 148 | } |
149 | 149 | ||
150 | public double llFrand(double mag) | 150 | public double llFrand(double mag) |
@@ -157,32 +157,32 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
157 | 157 | ||
158 | public int llFloor(double f) | 158 | public int llFloor(double f) |
159 | { | 159 | { |
160 | return (int) Math.Floor(f); | 160 | return (int)Math.Floor(f); |
161 | } | 161 | } |
162 | 162 | ||
163 | public int llCeil(double f) | 163 | public int llCeil(double f) |
164 | { | 164 | { |
165 | return (int) Math.Ceiling(f); | 165 | return (int)Math.Ceiling(f); |
166 | } | 166 | } |
167 | 167 | ||
168 | public int llRound(double f) | 168 | public int llRound(double f) |
169 | { | 169 | { |
170 | return (int) Math.Round(f, 0); | 170 | return (int)Math.Round(f, 0); |
171 | } | 171 | } |
172 | 172 | ||
173 | //This next group are vector operations involving squaring and square root. ckrinke | 173 | //This next group are vector operations involving squaring and square root. ckrinke |
174 | public double llVecMag(LSL_Types.Vector3 v) | 174 | public double llVecMag(LSL_Types.Vector3 v) |
175 | { | 175 | { |
176 | return (v.x*v.x + v.y*v.y + v.z*v.z); | 176 | return (v.x * v.x + v.y * v.y + v.z * v.z); |
177 | } | 177 | } |
178 | 178 | ||
179 | public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) | 179 | public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) |
180 | { | 180 | { |
181 | double mag = v.x*v.x + v.y*v.y + v.z*v.z; | 181 | double mag = v.x * v.x + v.y * v.y + v.z * v.z; |
182 | LSL_Types.Vector3 nor = new LSL_Types.Vector3(); | 182 | LSL_Types.Vector3 nor = new LSL_Types.Vector3(); |
183 | nor.x = v.x/mag; | 183 | nor.x = v.x / mag; |
184 | nor.y = v.y/mag; | 184 | nor.y = v.y / mag; |
185 | nor.z = v.z/mag; | 185 | nor.z = v.z / mag; |
186 | return nor; | 186 | return nor; |
187 | } | 187 | } |
188 | 188 | ||
@@ -191,46 +191,46 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
191 | double dx = a.x - b.x; | 191 | double dx = a.x - b.x; |
192 | double dy = a.y - b.y; | 192 | double dy = a.y - b.y; |
193 | double dz = a.z - b.z; | 193 | double dz = a.z - b.z; |
194 | return Math.Sqrt(dx*dx + dy*dy + dz*dz); | 194 | return Math.Sqrt(dx * dx + dy * dy + dz * dz); |
195 | } | 195 | } |
196 | 196 | ||
197 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke | 197 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke |
198 | public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) | 198 | public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) |
199 | { | 199 | { |
200 | //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke | 200 | //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke |
201 | LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.x*r.x, r.y*r.y, r.z*r.z, r.s*r.s); | 201 | LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s); |
202 | double m = (t.x + t.y + t.z + t.s); | 202 | double m = (t.x + t.y + t.z + t.s); |
203 | if (m == 0) return new LSL_Types.Vector3(); | 203 | if (m == 0) return new LSL_Types.Vector3(); |
204 | double n = 2*(r.y*r.s + r.x*r.z); | 204 | double n = 2 * (r.y * r.s + r.x * r.z); |
205 | double p = m*m - n*n; | 205 | double p = m * m - n * n; |
206 | if (p > 0) | 206 | if (p > 0) |
207 | return new LSL_Types.Vector3(Math.Atan2(2.0*(r.x*r.s - r.y*r.z), (-t.x - t.y + t.z + t.s)), | 207 | return new LSL_Types.Vector3(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)), |
208 | Math.Atan2(n, Math.Sqrt(p)), | 208 | Math.Atan2(n, Math.Sqrt(p)), |
209 | Math.Atan2(2.0*(r.z*r.s - r.x*r.y), (t.x - t.y - t.z + t.s))); | 209 | Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))); |
210 | else if (n > 0) | 210 | else if (n > 0) |
211 | return new LSL_Types.Vector3(0.0, Math.PI/2, Math.Atan2((r.z*r.s + r.x*r.y), 0.5 - t.x - t.z)); | 211 | return new LSL_Types.Vector3(0.0, Math.PI / 2, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); |
212 | else | 212 | else |
213 | return new LSL_Types.Vector3(0.0, -Math.PI/2, Math.Atan2((r.z*r.s + r.x*r.y), 0.5 - t.x - t.z)); | 213 | return new LSL_Types.Vector3(0.0, -Math.PI / 2, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); |
214 | } | 214 | } |
215 | 215 | ||
216 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) | 216 | public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) |
217 | { | 217 | { |
218 | //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 | 218 | //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 |
219 | float err = 0.00001f; | 219 | float err = 0.00001f; |
220 | double ax = Math.Sin(v.x/2); | 220 | double ax = Math.Sin(v.x / 2); |
221 | double aw = Math.Cos(v.x/2); | 221 | double aw = Math.Cos(v.x / 2); |
222 | double by = Math.Sin(v.y/2); | 222 | double by = Math.Sin(v.y / 2); |
223 | double bw = Math.Cos(v.y/2); | 223 | double bw = Math.Cos(v.y / 2); |
224 | double cz = Math.Sin(v.z/2); | 224 | double cz = Math.Sin(v.z / 2); |
225 | double cw = Math.Cos(v.z/2); | 225 | double cw = Math.Cos(v.z / 2); |
226 | LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw); | 226 | LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw); |
227 | LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); | 227 | LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); |
228 | LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); | 228 | LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); |
229 | LSL_Types.Quaternion a = (a1 * a2) * a3; | 229 | LSL_Types.Quaternion a = (a1 * a2) * a3; |
230 | //This multiplication doesnt compile, yet. a = a1 * a2 * a3; | 230 | //This multiplication doesnt compile, yet. a = a1 * a2 * a3; |
231 | LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax*bw*cw + aw*by*cz, | 231 | LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz, |
232 | aw*by*cw - ax*bw*cz, aw*bw*cz + ax*by*cw, | 232 | aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw, |
233 | aw*bw*cw - ax*by*cz); | 233 | aw * bw * cw - ax * by * cz); |
234 | LSL_Types.Quaternion c = new LSL_Types.Quaternion(); | 234 | LSL_Types.Quaternion c = new LSL_Types.Quaternion(); |
235 | //This addition doesnt compile yet c = a + b; | 235 | //This addition doesnt compile yet c = a + b; |
236 | LSL_Types.Quaternion d = new LSL_Types.Quaternion(); | 236 | LSL_Types.Quaternion d = new LSL_Types.Quaternion(); |
@@ -448,9 +448,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
448 | { | 448 | { |
449 | // TODO: this needs to trigger a persistance save as well | 449 | // TODO: this needs to trigger a persistance save as well |
450 | LLVector3 tmp = m_host.Scale; | 450 | LLVector3 tmp = m_host.Scale; |
451 | tmp.X = (float) scale.x; | 451 | tmp.X = (float)scale.x; |
452 | tmp.Y = (float) scale.y; | 452 | tmp.Y = (float)scale.y; |
453 | tmp.Z = (float) scale.z; | 453 | tmp.Z = (float)scale.z; |
454 | m_host.Scale = tmp; | 454 | m_host.Scale = tmp; |
455 | m_host.SendFullUpdateToAllClients(); | 455 | m_host.SendFullUpdateToAllClients(); |
456 | return; | 456 | return; |
@@ -712,11 +712,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
712 | { | 712 | { |
713 | if (m_host.ParentID != 0) | 713 | if (m_host.ParentID != 0) |
714 | { | 714 | { |
715 | m_host.UpdateOffSet(new LLVector3((float) pos.x, (float) pos.y, (float) pos.z)); | 715 | m_host.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); |
716 | } | 716 | } |
717 | else | 717 | else |
718 | { | 718 | { |
719 | m_host.UpdateGroupPosition(new LLVector3((float) pos.x, (float) pos.y, (float) pos.z)); | 719 | m_host.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); |
720 | } | 720 | } |
721 | } | 721 | } |
722 | 722 | ||
@@ -745,7 +745,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
745 | 745 | ||
746 | public void llSetRot(LSL_Types.Quaternion rot) | 746 | public void llSetRot(LSL_Types.Quaternion rot) |
747 | { | 747 | { |
748 | m_host.UpdateRotation(new LLQuaternion((float) rot.x, (float) rot.y, (float) rot.z, (float) rot.s)); | 748 | m_host.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); |
749 | } | 749 | } |
750 | 750 | ||
751 | public LSL_Types.Quaternion llGetRot() | 751 | public LSL_Types.Quaternion llGetRot() |
@@ -992,7 +992,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
992 | 992 | ||
993 | public void llSleep(double sec) | 993 | public void llSleep(double sec) |
994 | { | 994 | { |
995 | Thread.Sleep((int) (sec*1000)); | 995 | Thread.Sleep((int)(sec * 1000)); |
996 | } | 996 | } |
997 | 997 | ||
998 | public double llGetMass() | 998 | public double llGetMass() |
@@ -1344,7 +1344,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1344 | 1344 | ||
1345 | public void llSetText(string text, LSL_Types.Vector3 color, double alpha) | 1345 | public void llSetText(string text, LSL_Types.Vector3 color, double alpha) |
1346 | { | 1346 | { |
1347 | Vector3 av3 = new Vector3((float) color.x, (float) color.y, (float) color.z); | 1347 | Vector3 av3 = new Vector3((float)color.x, (float)color.y, (float)color.z); |
1348 | m_host.SetText(text, av3, alpha); | 1348 | m_host.SetText(text, av3, alpha); |
1349 | } | 1349 | } |
1350 | 1350 | ||
@@ -1443,12 +1443,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1443 | 1443 | ||
1444 | public double llAcos(double val) | 1444 | public double llAcos(double val) |
1445 | { | 1445 | { |
1446 | return (double) Math.Acos(val); | 1446 | return (double)Math.Acos(val); |
1447 | } | 1447 | } |
1448 | 1448 | ||
1449 | public double llAsin(double val) | 1449 | public double llAsin(double val) |
1450 | { | 1450 | { |
1451 | return (double) Math.Asin(val); | 1451 | return (double)Math.Asin(val); |
1452 | } | 1452 | } |
1453 | 1453 | ||
1454 | public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) | 1454 | public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) |
@@ -1527,7 +1527,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1527 | 1527 | ||
1528 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) | 1528 | public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) |
1529 | { | 1529 | { |
1530 | // SortedList<string, LSL_Types.list> sorted = new SortedList<string, LSL_Types.list>(); | 1530 | // SortedList<string, LSL_Types.list> sorted = new SortedList<string, LSL_Types.list>(); |
1531 | // Add chunks to an array | 1531 | // Add chunks to an array |
1532 | //int s = stride; | 1532 | //int s = stride; |
1533 | //if (s < 1) | 1533 | //if (s < 1) |
@@ -1660,7 +1660,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1660 | } | 1660 | } |
1661 | else | 1661 | else |
1662 | { | 1662 | { |
1663 | return new LSL_Types.Vector3(0,0,0); | 1663 | return new LSL_Types.Vector3(0, 0, 0); |
1664 | } | 1664 | } |
1665 | } | 1665 | } |
1666 | 1666 | ||
@@ -1709,31 +1709,31 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1709 | { | 1709 | { |
1710 | return 0; | 1710 | return 0; |
1711 | } | 1711 | } |
1712 | switch (src.Data[index].GetType()) | 1712 | |
1713 | if (src.Data[index] is System.Int32) | ||
1714 | return 1; | ||
1715 | if (src.Data[index] is System.Double) | ||
1716 | return 2; | ||
1717 | if (src.Data[index] is System.String) | ||
1713 | { | 1718 | { |
1714 | case typeof(System.Int32): | 1719 | LLUUID tuuid; |
1715 | return 1; | 1720 | if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid)) |
1716 | case typeof(System.Double): | 1721 | { |
1717 | return 2; | 1722 | return 3; |
1718 | case typeof(System.String): | 1723 | } |
1719 | LLUUID tuuid; | 1724 | else |
1720 | if (LLUUID.TryParse(src.Data[index].ToString(),out tuuid)) | 1725 | { |
1721 | { | 1726 | return 4; |
1722 | return 3; | 1727 | } |
1723 | } | ||
1724 | else | ||
1725 | { | ||
1726 | return 4; | ||
1727 | } | ||
1728 | case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3): | ||
1729 | return 5; | ||
1730 | case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion): | ||
1731 | return 6; | ||
1732 | case typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.list): | ||
1733 | return 7; | ||
1734 | default: | ||
1735 | return 0; | ||
1736 | } | 1728 | } |
1729 | if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3) | ||
1730 | return 5; | ||
1731 | if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion) | ||
1732 | return 6; | ||
1733 | if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.list) | ||
1734 | return 7; | ||
1735 | return 0; | ||
1736 | |||
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | public string llList2CSV(LSL_Types.list src) | 1739 | public string llList2CSV(LSL_Types.list src) |
@@ -1823,7 +1823,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1823 | 1823 | ||
1824 | public LSL_Types.Vector3 llGetRegionCorner() | 1824 | public LSL_Types.Vector3 llGetRegionCorner() |
1825 | { | 1825 | { |
1826 | return new LSL_Types.Vector3(World.RegionInfo.RegionLocX*256, World.RegionInfo.RegionLocY*256, 0); | 1826 | return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0); |
1827 | } | 1827 | } |
1828 | 1828 | ||
1829 | public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start) | 1829 | public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start) |
@@ -2034,14 +2034,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2034 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); | 2034 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); |
2035 | for (int i = 0; i < rules.Count; i += 2) | 2035 | for (int i = 0; i < rules.Count; i += 2) |
2036 | { | 2036 | { |
2037 | switch ((int) rules[i]) | 2037 | switch ((int)rules[i]) |
2038 | { | 2038 | { |
2039 | case (int) LSL_BaseClass.PSYS_PART_FLAGS: | 2039 | case (int)LSL_BaseClass.PSYS_PART_FLAGS: |
2040 | prules.PartFlags = (uint) rules[i + 1]; | 2040 | prules.PartFlags = (uint)rules[i + 1]; |
2041 | break; | 2041 | break; |
2042 | 2042 | ||
2043 | case (int)LSL_BaseClass.PSYS_PART_START_COLOR: | 2043 | case (int)LSL_BaseClass.PSYS_PART_START_COLOR: |
2044 | prules.PartStartColor = (LLColor) rules[i + 1]; | 2044 | prules.PartStartColor = (LLColor)rules[i + 1]; |
2045 | break; | 2045 | break; |
2046 | 2046 | ||
2047 | case (int)LSL_BaseClass.PSYS_PART_START_ALPHA: | 2047 | case (int)LSL_BaseClass.PSYS_PART_START_ALPHA: |
@@ -2049,7 +2049,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2049 | break; | 2049 | break; |
2050 | 2050 | ||
2051 | case (int)LSL_BaseClass.PSYS_PART_END_COLOR: | 2051 | case (int)LSL_BaseClass.PSYS_PART_END_COLOR: |
2052 | prules.PartEndColor = (LLColor) rules[i + 1]; | 2052 | prules.PartEndColor = (LLColor)rules[i + 1]; |
2053 | break; | 2053 | break; |
2054 | 2054 | ||
2055 | case (int)LSL_BaseClass.PSYS_PART_END_ALPHA: | 2055 | case (int)LSL_BaseClass.PSYS_PART_END_ALPHA: |
@@ -2065,7 +2065,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2065 | break; | 2065 | break; |
2066 | 2066 | ||
2067 | case (int)LSL_BaseClass.PSYS_PART_MAX_AGE: | 2067 | case (int)LSL_BaseClass.PSYS_PART_MAX_AGE: |
2068 | prules.MaxAge = (float) rules[i + 1]; | 2068 | prules.MaxAge = (float)rules[i + 1]; |
2069 | break; | 2069 | break; |
2070 | 2070 | ||
2071 | case (int)LSL_BaseClass.PSYS_SRC_ACCEL: | 2071 | case (int)LSL_BaseClass.PSYS_SRC_ACCEL: |
@@ -2077,35 +2077,35 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2077 | break; | 2077 | break; |
2078 | 2078 | ||
2079 | case (int)LSL_BaseClass.PSYS_SRC_TEXTURE: | 2079 | case (int)LSL_BaseClass.PSYS_SRC_TEXTURE: |
2080 | prules.Texture = (LLUUID) rules[i + 1]; | 2080 | prules.Texture = (LLUUID)rules[i + 1]; |
2081 | break; | 2081 | break; |
2082 | 2082 | ||
2083 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE: | 2083 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE: |
2084 | prules.BurstRate = (float) rules[i + 1]; | 2084 | prules.BurstRate = (float)rules[i + 1]; |
2085 | break; | 2085 | break; |
2086 | 2086 | ||
2087 | case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT: | 2087 | case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT: |
2088 | prules.BurstPartCount = (byte) rules[i + 1]; | 2088 | prules.BurstPartCount = (byte)rules[i + 1]; |
2089 | break; | 2089 | break; |
2090 | 2090 | ||
2091 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS: | 2091 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS: |
2092 | prules.BurstRadius = (float) rules[i + 1]; | 2092 | prules.BurstRadius = (float)rules[i + 1]; |
2093 | break; | 2093 | break; |
2094 | 2094 | ||
2095 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN: | 2095 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN: |
2096 | prules.BurstSpeedMin = (float) rules[i + 1]; | 2096 | prules.BurstSpeedMin = (float)rules[i + 1]; |
2097 | break; | 2097 | break; |
2098 | 2098 | ||
2099 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX: | 2099 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX: |
2100 | prules.BurstSpeedMax = (float) rules[i + 1]; | 2100 | prules.BurstSpeedMax = (float)rules[i + 1]; |
2101 | break; | 2101 | break; |
2102 | 2102 | ||
2103 | case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE: | 2103 | case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE: |
2104 | prules.MaxAge = (float) rules[i + 1]; | 2104 | prules.MaxAge = (float)rules[i + 1]; |
2105 | break; | 2105 | break; |
2106 | 2106 | ||
2107 | case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY: | 2107 | case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY: |
2108 | prules.Target = (LLUUID) rules[i + 1]; | 2108 | prules.Target = (LLUUID)rules[i + 1]; |
2109 | break; | 2109 | break; |
2110 | 2110 | ||
2111 | case (int)LSL_BaseClass.PSYS_SRC_OMEGA: | 2111 | case (int)LSL_BaseClass.PSYS_SRC_OMEGA: |
@@ -2113,11 +2113,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2113 | break; | 2113 | break; |
2114 | 2114 | ||
2115 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN: | 2115 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN: |
2116 | prules.InnerAngle = (float) rules[i + 1]; | 2116 | prules.InnerAngle = (float)rules[i + 1]; |
2117 | break; | 2117 | break; |
2118 | 2118 | ||
2119 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END: | 2119 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END: |
2120 | prules.OuterAngle = (float) rules[i + 1]; | 2120 | prules.OuterAngle = (float)rules[i + 1]; |
2121 | break; | 2121 | break; |
2122 | } | 2122 | } |
2123 | } | 2123 | } |
@@ -2180,7 +2180,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2180 | 2180 | ||
2181 | if (AVID != LLUUID.Zero) | 2181 | if (AVID != LLUUID.Zero) |
2182 | return AVID.ToString(); | 2182 | return AVID.ToString(); |
2183 | else | 2183 | else |
2184 | return ""; | 2184 | return ""; |
2185 | } | 2185 | } |
2186 | 2186 | ||
@@ -2355,12 +2355,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2355 | 2355 | ||
2356 | public double llLog10(double val) | 2356 | public double llLog10(double val) |
2357 | { | 2357 | { |
2358 | return (double) Math.Log10(val); | 2358 | return (double)Math.Log10(val); |
2359 | } | 2359 | } |
2360 | 2360 | ||
2361 | public double llLog(double val) | 2361 | public double llLog(double val) |
2362 | { | 2362 | { |
2363 | return (double) Math.Log(val); | 2363 | return (double)Math.Log(val); |
2364 | } | 2364 | } |
2365 | 2365 | ||
2366 | public LSL_Types.list llGetAnimationList(string id) | 2366 | public LSL_Types.list llGetAnimationList(string id) |
@@ -2590,7 +2590,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2590 | public void llOwnerSay(string msg) | 2590 | public void llOwnerSay(string msg) |
2591 | { | 2591 | { |
2592 | //temp fix so that lsl wiki examples aren't annoying to use to test other functions | 2592 | //temp fix so that lsl wiki examples aren't annoying to use to test other functions |
2593 | World.SimChat(Helpers.StringToField(msg),ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); | 2593 | World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); |
2594 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 2594 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); |
2595 | wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg); | 2595 | wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg); |
2596 | } | 2596 | } |
@@ -2613,7 +2613,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2613 | 2613 | ||
2614 | public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) | 2614 | public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) |
2615 | { | 2615 | { |
2616 | return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1); | 2616 | return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1); |
2617 | } | 2617 | } |
2618 | 2618 | ||
2619 | public void llLoadURL(string avatar_id, string message, string url) | 2619 | public void llLoadURL(string avatar_id, string message, string url) |
@@ -2779,7 +2779,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2779 | LLUUID reqID = httpScriptMod. | 2779 | LLUUID reqID = httpScriptMod. |
2780 | StartHttpRequest(m_localID, m_itemID, url, param, body); | 2780 | StartHttpRequest(m_localID, m_itemID, url, param, body); |
2781 | 2781 | ||
2782 | if( reqID != null ) | 2782 | if (reqID != null) |
2783 | return reqID.ToString(); | 2783 | return reqID.ToString(); |
2784 | else | 2784 | else |
2785 | return null; | 2785 | return null; |
@@ -2840,7 +2840,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2840 | decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; | 2840 | decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; |
2841 | return (int)v; | 2841 | return (int)v; |
2842 | } | 2842 | } |
2843 | 2843 | ||
2844 | } | 2844 | } |
2845 | 2845 | ||
2846 | public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param) | 2846 | public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param) |
@@ -2851,9 +2851,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
2851 | return new LSL_Types.list(0); | 2851 | return new LSL_Types.list(0); |
2852 | } | 2852 | } |
2853 | LSL_Types.list ret = new LSL_Types.list(); | 2853 | LSL_Types.list ret = new LSL_Types.list(); |
2854 | foreach(object o in param.Data) | 2854 | foreach (object o in param.Data) |
2855 | { | 2855 | { |
2856 | switch(o.ToString()) | 2856 | switch (o.ToString()) |
2857 | { | 2857 | { |
2858 | case "0": | 2858 | case "0": |
2859 | ret = ret + new LSL_Types.list(land.landName); | 2859 | ret = ret + new LSL_Types.list(land.landName); |