aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs (renamed from OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs)6018
1 files changed, 3003 insertions, 3015 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 1d9ca96..f4a1a00 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -1,3015 +1,3003 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
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
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Runtime.Remoting.Lifetime; 31using System.Runtime.Remoting.Lifetime;
32using System.Text; 32using System.Text;
33using System.Threading; 33using System.Threading;
34using Axiom.Math; 34using Axiom.Math;
35using libsecondlife; 35using libsecondlife;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Region.Environment.Interfaces; 37using OpenSim.Region.Environment.Interfaces;
38using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
39using OpenSim.Region.ScriptEngine.Common; 39using OpenSim.Region.ScriptEngine.Common;
40using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; 40//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL;
41 41
42namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler 42namespace OpenSim.Region.ScriptEngine.Common
43{ 43{
44 // 44 /// <summary>
45 // !!!IMPORTANT!!! 45 /// Contains all LSL ll-functions. This class will be in Default AppDomain.
46 // 46 /// </summary>
47 // REMEMBER TO UPDATE http://opensimulator.org/wiki/LlFunction_implementation_status 47 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
48 // 48 {
49 49 private ASCIIEncoding enc = new ASCIIEncoding();
50 // Notes: 50 private ScriptEngineBase.ScriptEngine m_ScriptEngine;
51 // * If any function here needs to execute a LSL event in the script, use instance of "EventQueueManager" in "ScriptEngine". 51 private SceneObjectPart m_host;
52 // * If any function here needs to do some more advanced stuff like waiting for IO callbacks or similar that takes a long time then use "llSetTimerEvent" function as example. 52 private uint m_localID;
53 // There is a class called "LSLLongCmdHandler" that is used for long LSL commands. 53 private LLUUID m_itemID;
54 54 private bool throwErrorOnNotImplemented = true;
55 55
56 /// <summary> 56 public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
57 /// Contains all LSL ll-functions. This class will be in Default AppDomain. 57 {
58 /// </summary> 58 m_ScriptEngine = ScriptEngine;
59 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface 59 m_host = host;
60 { 60 m_localID = localID;
61 private ASCIIEncoding enc = new ASCIIEncoding(); 61 m_itemID = itemID;
62 private ScriptEngine m_ScriptEngine; 62
63 private SceneObjectPart m_host; 63 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
64 private uint m_localID; 64 }
65 private LLUUID m_itemID; 65
66 private bool throwErrorOnNotImplemented = true; 66 private DateTime m_timer = DateTime.Now;
67 67 private string m_state = "default";
68 public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) 68
69 { 69 public string State()
70 m_ScriptEngine = ScriptEngine; 70 {
71 m_host = host; 71 return m_state;
72 m_localID = localID; 72 }
73 m_itemID = itemID; 73
74 74 // Object never expires
75 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); 75 public override Object InitializeLifetimeService()
76 } 76 {
77 77 //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()");
78 private DateTime m_timer = DateTime.Now; 78 // return null;
79 private string m_state = "default"; 79 ILease lease = (ILease)base.InitializeLifetimeService();
80 80
81 public string State() 81 if (lease.CurrentState == LeaseState.Initial)
82 { 82 {
83 return m_state; 83 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1);
84 } 84 // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
85 85 // lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
86 // Object never expires 86 }
87 public override Object InitializeLifetimeService() 87 return lease;
88 { 88 }
89 //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); 89
90 // return null; 90 public Scene World
91 ILease lease = (ILease)base.InitializeLifetimeService(); 91 {
92 92 get { return m_ScriptEngine.World; }
93 if (lease.CurrentState == LeaseState.Initial) 93 }
94 { 94
95 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); 95 //These are the implementations of the various ll-functions used by the LSL scripts.
96 // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); 96 //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07
97 // lease.RenewOnCallTime = TimeSpan.FromSeconds(2); 97 public double llSin(double f)
98 } 98 {
99 return lease; 99
100 } 100 return (double)Math.Sin(f);
101 101 }
102 public Scene World 102
103 { 103 public double llCos(double f)
104 get { return m_ScriptEngine.World; } 104 {
105 } 105 return (double)Math.Cos(f);
106 106 }
107 //These are the implementations of the various ll-functions used by the LSL scripts. 107
108 //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 108 public double llTan(double f)
109 public double llSin(double f) 109 {
110 { 110 return (double)Math.Tan(f);
111 111 }
112 return (double)Math.Sin(f); 112
113 } 113 public double llAtan2(double x, double y)
114 114 {
115 public double llCos(double f) 115 return (double)Math.Atan2(y, x);
116 { 116 }
117 return (double)Math.Cos(f); 117
118 } 118 public double llSqrt(double f)
119 119 {
120 public double llTan(double f) 120 return (double)Math.Sqrt(f);
121 { 121 }
122 return (double)Math.Tan(f); 122
123 } 123 public double llPow(double fbase, double fexponent)
124 124 {
125 public double llAtan2(double x, double y) 125 return (double)Math.Pow(fbase, fexponent);
126 { 126 }
127 return (double)Math.Atan2(y, x); 127
128 } 128 public int llAbs(int i)
129 129 {
130 public double llSqrt(double f) 130 return (int)Math.Abs(i);
131 { 131 }
132 return (double)Math.Sqrt(f); 132
133 } 133 public double llFabs(double f)
134 134 {
135 public double llPow(double fbase, double fexponent) 135 return (double)Math.Abs(f);
136 { 136 }
137 return (double)Math.Pow(fbase, fexponent); 137
138 } 138 public double llFrand(double mag)
139 139 {
140 public int llAbs(int i) 140 lock (Util.RandomClass)
141 { 141 {
142 return (int)Math.Abs(i); 142 return Util.RandomClass.NextDouble() * mag;
143 } 143 }
144 144 }
145 public double llFabs(double f) 145
146 { 146 public int llFloor(double f)
147 return (double)Math.Abs(f); 147 {
148 } 148 return (int)Math.Floor(f);
149 149 }
150 public double llFrand(double mag) 150
151 { 151 public int llCeil(double f)
152 lock (Util.RandomClass) 152 {
153 { 153 return (int)Math.Ceiling(f);
154 return Util.RandomClass.NextDouble() * mag; 154 }
155 } 155
156 } 156 public int llRound(double f)
157 157 {
158 public int llFloor(double f) 158 return (int)Math.Round(f, 0);
159 { 159 }
160 return (int)Math.Floor(f); 160
161 } 161 //This next group are vector operations involving squaring and square root. ckrinke
162 162 public double llVecMag(LSL_Types.Vector3 v)
163 public int llCeil(double f) 163 {
164 { 164 return (v.x * v.x + v.y * v.y + v.z * v.z);
165 return (int)Math.Ceiling(f); 165 }
166 } 166
167 167 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v)
168 public int llRound(double f) 168 {
169 { 169 double mag = v.x * v.x + v.y * v.y + v.z * v.z;
170 return (int)Math.Round(f, 0); 170 LSL_Types.Vector3 nor = new LSL_Types.Vector3();
171 } 171 nor.x = v.x / mag;
172 172 nor.y = v.y / mag;
173 //This next group are vector operations involving squaring and square root. ckrinke 173 nor.z = v.z / mag;
174 public double llVecMag(LSL_Types.Vector3 v) 174 return nor;
175 { 175 }
176 return (v.x * v.x + v.y * v.y + v.z * v.z); 176
177 } 177 public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
178 178 {
179 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) 179 double dx = a.x - b.x;
180 { 180 double dy = a.y - b.y;
181 double mag = v.x * v.x + v.y * v.y + v.z * v.z; 181 double dz = a.z - b.z;
182 LSL_Types.Vector3 nor = new LSL_Types.Vector3(); 182 return Math.Sqrt(dx * dx + dy * dy + dz * dz);
183 nor.x = v.x / mag; 183 }
184 nor.y = v.y / mag; 184
185 nor.z = v.z / mag; 185 //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke
186 return nor; 186 public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r)
187 } 187 {
188 188 //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke
189 public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) 189 LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s);
190 { 190 double m = (t.x + t.y + t.z + t.s);
191 double dx = a.x - b.x; 191 if (m == 0) return new LSL_Types.Vector3();
192 double dy = a.y - b.y; 192 double n = 2 * (r.y * r.s + r.x * r.z);
193 double dz = a.z - b.z; 193 double p = m * m - n * n;
194 return Math.Sqrt(dx * dx + dy * dy + dz * dz); 194 if (p > 0)
195 } 195 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)),
196 196 Math.Atan2(n, Math.Sqrt(p)),
197 //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke 197 Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)));
198 public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) 198 else if (n > 0)
199 { 199 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));
200 //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke 200 else
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 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));
202 double m = (t.x + t.y + t.z + t.s); 202 }
203 if (m == 0) return new LSL_Types.Vector3(); 203
204 double n = 2 * (r.y * r.s + r.x * r.z); 204 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v)
205 double p = m * m - n * n; 205 {
206 if (p > 0) 206 //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07
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 float err = 0.00001f;
208 Math.Atan2(n, Math.Sqrt(p)), 208 double ax = Math.Sin(v.x / 2);
209 Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))); 209 double aw = Math.Cos(v.x / 2);
210 else if (n > 0) 210 double by = Math.Sin(v.y / 2);
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 double bw = Math.Cos(v.y / 2);
212 else 212 double cz = Math.Sin(v.z / 2);
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 double cw = Math.Cos(v.z / 2);
214 } 214 LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw);
215 215 LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw);
216 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) 216 LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw);
217 { 217 LSL_Types.Quaternion a = (a1 * a2) * a3;
218 //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 218 //This multiplication doesnt compile, yet. a = a1 * a2 * a3;
219 float err = 0.00001f; 219 LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz,
220 double ax = Math.Sin(v.x / 2); 220 aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw,
221 double aw = Math.Cos(v.x / 2); 221 aw * bw * cw - ax * by * cz);
222 double by = Math.Sin(v.y / 2); 222 LSL_Types.Quaternion c = new LSL_Types.Quaternion();
223 double bw = Math.Cos(v.y / 2); 223 //This addition doesnt compile yet c = a + b;
224 double cz = Math.Sin(v.z / 2); 224 LSL_Types.Quaternion d = new LSL_Types.Quaternion();
225 double cw = Math.Cos(v.z / 2); 225 //This addition doesnt compile yet d = a - b;
226 LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw); 226 if ((Math.Abs(c.x) > err && Math.Abs(d.x) > err) ||
227 LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); 227 (Math.Abs(c.y) > err && Math.Abs(d.y) > err) ||
228 LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); 228 (Math.Abs(c.z) > err && Math.Abs(d.z) > err) ||
229 LSL_Types.Quaternion a = (a1 * a2) * a3; 229 (Math.Abs(c.s) > err && Math.Abs(d.s) > err))
230 //This multiplication doesnt compile, yet. a = a1 * a2 * a3; 230 {
231 LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz, 231 return b;
232 aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw, 232 //return a new Quaternion that is null until I figure this out
233 aw * bw * cw - ax * by * cz); 233 // return b;
234 LSL_Types.Quaternion c = new LSL_Types.Quaternion(); 234 // return a;
235 //This addition doesnt compile yet c = a + b; 235 }
236 LSL_Types.Quaternion d = new LSL_Types.Quaternion(); 236 return a;
237 //This addition doesnt compile yet d = a - b; 237 }
238 if ((Math.Abs(c.x) > err && Math.Abs(d.x) > err) || 238
239 (Math.Abs(c.y) > err && Math.Abs(d.y) > err) || 239 public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
240 (Math.Abs(c.z) > err && Math.Abs(d.z) > err) || 240 {
241 (Math.Abs(c.s) > err && Math.Abs(d.s) > err)) 241 return new LSL_Types.Quaternion();
242 { 242 }
243 return b; 243
244 //return a new Quaternion that is null until I figure this out 244 public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r)
245 // return b; 245 {
246 // return a; 246 return new LSL_Types.Vector3();
247 } 247 }
248 return a; 248
249 } 249 public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r)
250 250 {
251 public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) 251 return new LSL_Types.Vector3();
252 { 252 }
253 return new LSL_Types.Quaternion(); 253
254 } 254 public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r)
255 255 {
256 public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) 256 return new LSL_Types.Vector3();
257 { 257 }
258 return new LSL_Types.Vector3(); 258 public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
259 } 259 {
260 260 //A and B should both be normalized
261 public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) 261
262 { 262 double dotProduct = LSL_Types.Vector3.Dot(a, b);
263 return new LSL_Types.Vector3(); 263 LSL_Types.Vector3 crossProduct = LSL_Types.Vector3.Cross(a, b);
264 } 264 double magProduct = LSL_Types.Vector3.Mag(a) * LSL_Types.Vector3.Mag(b);
265 265 double angle = Math.Acos(dotProduct / magProduct);
266 public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) 266 LSL_Types.Vector3 axis = LSL_Types.Vector3.Norm(crossProduct);
267 { 267 double s = Math.Sin(angle / 2);
268 return new LSL_Types.Vector3(); 268
269 } 269 return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2));
270 public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) 270 }
271 { 271 public void llWhisper(int channelID, string text)
272 //A and B should both be normalized 272 {
273 273 World.SimChat(Helpers.StringToField(text),
274 double dotProduct = LSL_Types.Vector3.Dot(a, b); 274 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
275 LSL_Types.Vector3 crossProduct = LSL_Types.Vector3.Cross(a, b); 275
276 double magProduct = LSL_Types.Vector3.Mag(a) * LSL_Types.Vector3.Mag(b); 276 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
277 double angle = Math.Acos(dotProduct / magProduct); 277 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text);
278 LSL_Types.Vector3 axis = LSL_Types.Vector3.Norm(crossProduct); 278 }
279 double s = Math.Sin(angle / 2); 279
280 280 public void llSay(int channelID, string text)
281 return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2)); 281 {
282 } 282 World.SimChat(Helpers.StringToField(text),
283 public void llWhisper(int channelID, string text) 283 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
284 { 284
285 World.SimChat(Helpers.StringToField(text), 285 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
286 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 286 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text);
287 287 }
288 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 288
289 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text); 289 public void llShout(int channelID, string text)
290 } 290 {
291 291 World.SimChat(Helpers.StringToField(text),
292 public void llSay(int channelID, string text) 292 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
293 { 293
294 World.SimChat(Helpers.StringToField(text), 294 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
295 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 295 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text);
296 296 }
297 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 297
298 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text); 298 public int llListen(int channelID, string name, string ID, string msg)
299 } 299 {
300 300 if (ID == "")
301 public void llShout(int channelID, string text) 301 {
302 { 302 ID = LLUUID.Zero.ToString();
303 World.SimChat(Helpers.StringToField(text), 303 }
304 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 304 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
305 305 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg);
306 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 306 }
307 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text); 307
308 } 308 public void llListenControl(int number, int active)
309 309 {
310 public int llListen(int channelID, string name, string ID, string msg) 310 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
311 { 311 wComm.ListenControl(number, active);
312 if (ID == "") 312 }
313 { 313
314 ID = LLUUID.Zero.ToString(); 314 public void llListenRemove(int number)
315 } 315 {
316 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 316 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
317 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg); 317 wComm.ListenRemove(number);
318 } 318 }
319 319
320 public void llListenControl(int number, int active) 320 public void llSensor(string name, string id, int type, double range, double arc)
321 { 321 {
322 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 322 NotImplemented("llSensor");
323 wComm.ListenControl(number, active); 323 return;
324 } 324 }
325 325
326 public void llListenRemove(int number) 326 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
327 { 327 {
328 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 328 NotImplemented("llSensorRepeat");
329 wComm.ListenRemove(number); 329 return;
330 } 330 }
331 331
332 public void llSensor(string name, string id, int type, double range, double arc) 332 public void llSensorRemove()
333 { 333 {
334 NotImplemented("llSensor"); 334 NotImplemented("llSensorRemove");
335 return; 335 return;
336 } 336 }
337 337
338 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) 338 public string llDetectedName(int number)
339 { 339 {
340 NotImplemented("llSensorRepeat"); 340 NotImplemented("llDetectedName");
341 return; 341 return "";
342 } 342 }
343 343
344 public void llSensorRemove() 344 public string llDetectedKey(int number)
345 { 345 {
346 NotImplemented("llSensorRemove"); 346 NotImplemented("llDetectedKey");
347 return; 347 return "";
348 } 348 }
349 349
350 public string llDetectedName(int number) 350 public string llDetectedOwner(int number)
351 { 351 {
352 NotImplemented("llDetectedName"); 352 NotImplemented("llDetectedOwner");
353 return ""; 353 return "";
354 } 354 }
355 355
356 public string llDetectedKey(int number) 356 public int llDetectedType(int number)
357 { 357 {
358 NotImplemented("llDetectedKey"); 358 NotImplemented("llDetectedType");
359 return ""; 359 return 0;
360 } 360 }
361 361
362 public string llDetectedOwner(int number) 362 public LSL_Types.Vector3 llDetectedPos(int number)
363 { 363 {
364 NotImplemented("llDetectedOwner"); 364 NotImplemented("llDetectedPos");
365 return ""; 365 return new LSL_Types.Vector3();
366 } 366 }
367 367
368 public int llDetectedType(int number) 368 public LSL_Types.Vector3 llDetectedVel(int number)
369 { 369 {
370 NotImplemented("llDetectedType"); 370 NotImplemented("llDetectedVel");
371 return 0; 371 return new LSL_Types.Vector3();
372 } 372 }
373 373
374 public LSL_Types.Vector3 llDetectedPos(int number) 374 public LSL_Types.Vector3 llDetectedGrab(int number)
375 { 375 {
376 NotImplemented("llDetectedPos"); 376 NotImplemented("llDetectedGrab");
377 return new LSL_Types.Vector3(); 377 return new LSL_Types.Vector3();
378 } 378 }
379 379
380 public LSL_Types.Vector3 llDetectedVel(int number) 380 public LSL_Types.Quaternion llDetectedRot(int number)
381 { 381 {
382 NotImplemented("llDetectedVel"); 382 NotImplemented("llDetectedRot");
383 return new LSL_Types.Vector3(); 383 return new LSL_Types.Quaternion();
384 } 384 }
385 385
386 public LSL_Types.Vector3 llDetectedGrab(int number) 386 public int llDetectedGroup(int number)
387 { 387 {
388 NotImplemented("llDetectedGrab"); 388 NotImplemented("llDetectedGroup");
389 return new LSL_Types.Vector3(); 389 return 0;
390 } 390 }
391 391
392 public LSL_Types.Quaternion llDetectedRot(int number) 392 public int llDetectedLinkNumber(int number)
393 { 393 {
394 NotImplemented("llDetectedRot"); 394 NotImplemented("llDetectedLinkNumber");
395 return new LSL_Types.Quaternion(); 395 return 0;
396 } 396 }
397 397
398 public int llDetectedGroup(int number) 398 public void llDie()
399 { 399 {
400 NotImplemented("llDetectedGroup"); 400 World.DeleteSceneObjectGroup(m_host.ParentGroup);
401 return 0; 401 return;
402 } 402 }
403 403
404 public int llDetectedLinkNumber(int number) 404 public double llGround(LSL_Types.Vector3 offset)
405 { 405 {
406 NotImplemented("llDetectedLinkNumber"); 406 int x = (int)(m_host.AbsolutePosition.X + offset.x);
407 return 0; 407 int y = (int)(m_host.AbsolutePosition.Y + offset.y);
408 } 408 return World.GetLandHeight(x, y);
409 409 }
410 public void llDie() 410
411 { 411 public double llCloud(LSL_Types.Vector3 offset)
412 World.DeleteSceneObjectGroup(m_host.ParentGroup); 412 {
413 return; 413 NotImplemented("llCloud");
414 } 414 return 0;
415 415 }
416 public double llGround(LSL_Types.Vector3 offset) 416
417 { 417 public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset)
418 int x = (int)(m_host.AbsolutePosition.X + offset.x); 418 {
419 int y = (int)(m_host.AbsolutePosition.Y + offset.y); 419 NotImplemented("llWind");
420 return World.GetLandHeight(x, y); 420 return new LSL_Types.Vector3();
421 } 421 }
422 422
423 public double llCloud(LSL_Types.Vector3 offset) 423 public void llSetStatus(int status, int value)
424 { 424 {
425 NotImplemented("llCloud"); 425 NotImplemented("llSetStatus");
426 return 0; 426 return;
427 } 427 }
428 428
429 public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) 429 public int llGetStatus(int status)
430 { 430 {
431 NotImplemented("llWind"); 431 NotImplemented("llGetStatus");
432 return new LSL_Types.Vector3(); 432 return 0;
433 } 433 }
434 434
435 public void llSetStatus(int status, int value) 435 public void llSetScale(LSL_Types.Vector3 scale)
436 { 436 {
437 NotImplemented("llSetStatus"); 437 // TODO: this needs to trigger a persistance save as well
438 return; 438 LLVector3 tmp = m_host.Scale;
439 } 439 tmp.X = (float)scale.x;
440 440 tmp.Y = (float)scale.y;
441 public int llGetStatus(int status) 441 tmp.Z = (float)scale.z;
442 { 442 m_host.Scale = tmp;
443 NotImplemented("llGetStatus"); 443 m_host.SendFullUpdateToAllClients();
444 return 0; 444 return;
445 } 445 }
446 446
447 public void llSetScale(LSL_Types.Vector3 scale) 447 public LSL_Types.Vector3 llGetScale()
448 { 448 {
449 // TODO: this needs to trigger a persistance save as well 449 return new LSL_Types.Vector3(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z);
450 LLVector3 tmp = m_host.Scale; 450 }
451 tmp.X = (float)scale.x; 451
452 tmp.Y = (float)scale.y; 452 public void llSetColor(LSL_Types.Vector3 color, int face)
453 tmp.Z = (float)scale.z; 453 {
454 m_host.Scale = tmp; 454 LLObject.TextureEntry tex = m_host.Shape.Textures;
455 m_host.SendFullUpdateToAllClients(); 455 LLColor texcolor;
456 return; 456 if (face > -1)
457 } 457 {
458 458 texcolor = tex.CreateFace((uint)face).RGBA;
459 public LSL_Types.Vector3 llGetScale() 459 texcolor.R = (float)Math.Abs(color.x - 1);
460 { 460 texcolor.G = (float)Math.Abs(color.y - 1);
461 return new LSL_Types.Vector3(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z); 461 texcolor.B = (float)Math.Abs(color.z - 1);
462 } 462 tex.FaceTextures[face].RGBA = texcolor;
463 463 m_host.UpdateTexture(tex);
464 public void llSetColor(LSL_Types.Vector3 color, int face) 464 return;
465 { 465 }
466 LLObject.TextureEntry tex = m_host.Shape.Textures; 466 else if (face == -1)
467 LLColor texcolor; 467 {
468 if (face > -1) 468 for (uint i = 0; i < 32; i++)
469 { 469 {
470 texcolor = tex.CreateFace((uint)face).RGBA; 470 if (tex.FaceTextures[i] != null)
471 texcolor.R = (float)Math.Abs(color.x - 1); 471 {
472 texcolor.G = (float)Math.Abs(color.y - 1); 472 texcolor = tex.FaceTextures[i].RGBA;
473 texcolor.B = (float)Math.Abs(color.z - 1); 473 texcolor.R = (float)Math.Abs(color.x - 1);
474 tex.FaceTextures[face].RGBA = texcolor; 474 texcolor.G = (float)Math.Abs(color.y - 1);
475 m_host.UpdateTexture(tex); 475 texcolor.B = (float)Math.Abs(color.z - 1);
476 return; 476 tex.FaceTextures[i].RGBA = texcolor;
477 } 477 }
478 else if (face == -1) 478 texcolor = tex.DefaultTexture.RGBA;
479 { 479 texcolor.R = (float)Math.Abs(color.x - 1);
480 for (uint i = 0; i < 32; i++) 480 texcolor.G = (float)Math.Abs(color.y - 1);
481 { 481 texcolor.B = (float)Math.Abs(color.z - 1);
482 if (tex.FaceTextures[i] != null) 482 tex.DefaultTexture.RGBA = texcolor;
483 { 483 }
484 texcolor = tex.FaceTextures[i].RGBA; 484 m_host.UpdateTexture(tex);
485 texcolor.R = (float)Math.Abs(color.x - 1); 485 return;
486 texcolor.G = (float)Math.Abs(color.y - 1); 486 }
487 texcolor.B = (float)Math.Abs(color.z - 1); 487 NotImplemented("llSetColor");
488 tex.FaceTextures[i].RGBA = texcolor; 488 return;
489 } 489 }
490 texcolor = tex.DefaultTexture.RGBA; 490
491 texcolor.R = (float)Math.Abs(color.x - 1); 491 public double llGetAlpha(int face)
492 texcolor.G = (float)Math.Abs(color.y - 1); 492 {
493 texcolor.B = (float)Math.Abs(color.z - 1); 493 LLObject.TextureEntry tex = m_host.Shape.Textures;
494 tex.DefaultTexture.RGBA = texcolor; 494 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
495 } 495 {
496 m_host.UpdateTexture(tex); 496 return (double)((tex.DefaultTexture.RGBA.A * 255) / 255);
497 return; 497 }
498 } 498 if (face > -1)
499 NotImplemented("llSetColor"); 499 {
500 return; 500 return (double)((tex.GetFace((uint)face).RGBA.A * 255) / 255);
501 } 501 }
502 502 return 0;
503 public double llGetAlpha(int face) 503 }
504 { 504
505 LLObject.TextureEntry tex = m_host.Shape.Textures; 505 public void llSetAlpha(double alpha, int face)
506 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 506 {
507 { 507 LLObject.TextureEntry tex = m_host.Shape.Textures;
508 return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); 508 LLColor texcolor;
509 } 509 if (face > -1)
510 if (face > -1) 510 {
511 { 511 texcolor = tex.CreateFace((uint)face).RGBA;
512 return (double)((tex.GetFace((uint)face).RGBA.A * 255) / 255); 512 texcolor.A = (float)Math.Abs(alpha - 1);
513 } 513 tex.FaceTextures[face].RGBA = texcolor;
514 return 0; 514 m_host.UpdateTexture(tex);
515 } 515 return;
516 516 }
517 public void llSetAlpha(double alpha, int face) 517 else if (face == -1)
518 { 518 {
519 LLObject.TextureEntry tex = m_host.Shape.Textures; 519 for (int i = 0; i < 32; i++)
520 LLColor texcolor; 520 {
521 if (face > -1) 521 if (tex.FaceTextures[i] != null)
522 { 522 {
523 texcolor = tex.CreateFace((uint)face).RGBA; 523 texcolor = tex.FaceTextures[i].RGBA;
524 texcolor.A = (float)Math.Abs(alpha - 1); 524 texcolor.A = (float)Math.Abs(alpha - 1);
525 tex.FaceTextures[face].RGBA = texcolor; 525 tex.FaceTextures[i].RGBA = texcolor;
526 m_host.UpdateTexture(tex); 526 }
527 return; 527 }
528 } 528 texcolor = tex.DefaultTexture.RGBA;
529 else if (face == -1) 529 texcolor.A = (float)Math.Abs(alpha - 1);
530 { 530 tex.DefaultTexture.RGBA = texcolor;
531 for (int i = 0; i < 32; i++) 531 m_host.UpdateTexture(tex);
532 { 532 return;
533 if (tex.FaceTextures[i] != null) 533 }
534 { 534 NotImplemented("llSetAlpha");
535 texcolor = tex.FaceTextures[i].RGBA; 535 return;
536 texcolor.A = (float)Math.Abs(alpha - 1); 536 }
537 tex.FaceTextures[i].RGBA = texcolor; 537
538 } 538 public LSL_Types.Vector3 llGetColor(int face)
539 } 539 {
540 texcolor = tex.DefaultTexture.RGBA; 540 LLObject.TextureEntry tex = m_host.Shape.Textures;
541 texcolor.A = (float)Math.Abs(alpha - 1); 541 LLColor texcolor;
542 tex.DefaultTexture.RGBA = texcolor; 542 LSL_Types.Vector3 rgb;
543 m_host.UpdateTexture(tex); 543 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
544 return; 544 {
545 } 545 texcolor = tex.DefaultTexture.RGBA;
546 NotImplemented("llSetAlpha"); 546 rgb.x = (255 - (texcolor.R * 255)) / 255;
547 return; 547 rgb.y = (255 - (texcolor.G * 255)) / 255;
548 } 548 rgb.z = (255 - (texcolor.B * 255)) / 255;
549 549 return rgb;
550 public LSL_Types.Vector3 llGetColor(int face) 550 }
551 { 551 if (face > -1)
552 LLObject.TextureEntry tex = m_host.Shape.Textures; 552 {
553 LLColor texcolor; 553 texcolor = tex.GetFace((uint)face).RGBA;
554 LSL_Types.Vector3 rgb; 554 rgb.x = (255 - (texcolor.R * 255)) / 255;
555 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 555 rgb.y = (255 - (texcolor.G * 255)) / 255;
556 { 556 rgb.z = (255 - (texcolor.B * 255)) / 255;
557 texcolor = tex.DefaultTexture.RGBA; 557 return rgb;
558 rgb.x = (255 - (texcolor.R * 255)) / 255; 558 }
559 rgb.y = (255 - (texcolor.G * 255)) / 255; 559 NotImplemented("llGetColor");
560 rgb.z = (255 - (texcolor.B * 255)) / 255; 560 return new LSL_Types.Vector3();
561 return rgb; 561 }
562 } 562
563 if (face > -1) 563 public void llSetTexture(string texture, int face)
564 { 564 {
565 texcolor = tex.GetFace((uint)face).RGBA; 565 LLObject.TextureEntry tex = m_host.Shape.Textures;
566 rgb.x = (255 - (texcolor.R * 255)) / 255; 566
567 rgb.y = (255 - (texcolor.G * 255)) / 255; 567 if (face > -1)
568 rgb.z = (255 - (texcolor.B * 255)) / 255; 568 {
569 return rgb; 569 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
570 } 570 texface.TextureID = new LLUUID(texture);
571 NotImplemented("llGetColor"); 571 tex.FaceTextures[face] = texface;
572 return new LSL_Types.Vector3(); 572 m_host.UpdateTexture(tex);
573 } 573 return;
574 574 }
575 public void llSetTexture(string texture, int face) 575 else if (face == -1)
576 { 576 {
577 LLObject.TextureEntry tex = m_host.Shape.Textures; 577 for (uint i = 0; i < 32; i++)
578 578 {
579 if (face > -1) 579 if (tex.FaceTextures[i] != null)
580 { 580 {
581 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 581 tex.FaceTextures[i].TextureID = new LLUUID(texture);
582 texface.TextureID = new LLUUID(texture); 582 }
583 tex.FaceTextures[face] = texface; 583 }
584 m_host.UpdateTexture(tex); 584 tex.DefaultTexture.TextureID = new LLUUID(texture);
585 return; 585 m_host.UpdateTexture(tex);
586 } 586 return;
587 else if (face == -1) 587 }
588 { 588 NotImplemented("llSetTexture");
589 for (uint i = 0; i < 32; i++) 589 return;
590 { 590 }
591 if (tex.FaceTextures[i] != null) 591
592 { 592 public void llScaleTexture(double u, double v, int face)
593 tex.FaceTextures[i].TextureID = new LLUUID(texture); 593 {
594 } 594 LLObject.TextureEntry tex = m_host.Shape.Textures;
595 } 595 if (face > -1)
596 tex.DefaultTexture.TextureID = new LLUUID(texture); 596 {
597 m_host.UpdateTexture(tex); 597 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
598 return; 598 texface.RepeatU = (float)u;
599 } 599 texface.RepeatV = (float)v;
600 NotImplemented("llSetTexture"); 600 tex.FaceTextures[face] = texface;
601 return; 601 m_host.UpdateTexture(tex);
602 } 602 return;
603 603 }
604 public void llScaleTexture(double u, double v, int face) 604 if (face == -1)
605 { 605 {
606 LLObject.TextureEntry tex = m_host.Shape.Textures; 606 for (int i = 0; i < 32; i++)
607 if (face > -1) 607 {
608 { 608 if (tex.FaceTextures[i] != null)
609 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 609 {
610 texface.RepeatU = (float)u; 610 tex.FaceTextures[i].RepeatU = (float)u;
611 texface.RepeatV = (float)v; 611 tex.FaceTextures[i].RepeatV = (float)v;
612 tex.FaceTextures[face] = texface; 612 }
613 m_host.UpdateTexture(tex); 613 }
614 return; 614 tex.DefaultTexture.RepeatU = (float)u;
615 } 615 tex.DefaultTexture.RepeatV = (float)v;
616 if (face == -1) 616 m_host.UpdateTexture(tex);
617 { 617 return;
618 for (int i = 0; i < 32; i++) 618 }
619 { 619 NotImplemented("llScaleTexture");
620 if (tex.FaceTextures[i] != null) 620 return;
621 { 621 }
622 tex.FaceTextures[i].RepeatU = (float)u; 622
623 tex.FaceTextures[i].RepeatV = (float)v; 623 public void llOffsetTexture(double u, double v, int face)
624 } 624 {
625 } 625 LLObject.TextureEntry tex = m_host.Shape.Textures;
626 tex.DefaultTexture.RepeatU = (float)u; 626 if (face > -1)
627 tex.DefaultTexture.RepeatV = (float)v; 627 {
628 m_host.UpdateTexture(tex); 628 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
629 return; 629 texface.OffsetU = (float)u;
630 } 630 texface.OffsetV = (float)v;
631 NotImplemented("llScaleTexture"); 631 tex.FaceTextures[face] = texface;
632 return; 632 m_host.UpdateTexture(tex);
633 } 633 return;
634 634 }
635 public void llOffsetTexture(double u, double v, int face) 635 if (face == -1)
636 { 636 {
637 LLObject.TextureEntry tex = m_host.Shape.Textures; 637 for (int i = 0; i < 32; i++)
638 if (face > -1) 638 {
639 { 639 if (tex.FaceTextures[i] != null)
640 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 640 {
641 texface.OffsetU = (float)u; 641 tex.FaceTextures[i].OffsetU = (float)u;
642 texface.OffsetV = (float)v; 642 tex.FaceTextures[i].OffsetV = (float)v;
643 tex.FaceTextures[face] = texface; 643 }
644 m_host.UpdateTexture(tex); 644 }
645 return; 645 tex.DefaultTexture.OffsetU = (float)u;
646 } 646 tex.DefaultTexture.OffsetV = (float)v;
647 if (face == -1) 647 m_host.UpdateTexture(tex);
648 { 648 return;
649 for (int i = 0; i < 32; i++) 649 }
650 { 650 NotImplemented("llOffsetTexture");
651 if (tex.FaceTextures[i] != null) 651 return;
652 { 652 }
653 tex.FaceTextures[i].OffsetU = (float)u; 653
654 tex.FaceTextures[i].OffsetV = (float)v; 654 public void llRotateTexture(double rotation, int face)
655 } 655 {
656 } 656 LLObject.TextureEntry tex = m_host.Shape.Textures;
657 tex.DefaultTexture.OffsetU = (float)u; 657 if (face > -1)
658 tex.DefaultTexture.OffsetV = (float)v; 658 {
659 m_host.UpdateTexture(tex); 659 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
660 return; 660 texface.Rotation = (float)rotation;
661 } 661 tex.FaceTextures[face] = texface;
662 NotImplemented("llOffsetTexture"); 662 m_host.UpdateTexture(tex);
663 return; 663 return;
664 } 664 }
665 665 if (face == -1)
666 public void llRotateTexture(double rotation, int face) 666 {
667 { 667 for (int i = 0; i < 32; i++)
668 LLObject.TextureEntry tex = m_host.Shape.Textures; 668 {
669 if (face > -1) 669 if (tex.FaceTextures[i] != null)
670 { 670 {
671 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 671 tex.FaceTextures[i].Rotation = (float)rotation;
672 texface.Rotation = (float)rotation; 672 }
673 tex.FaceTextures[face] = texface; 673 }
674 m_host.UpdateTexture(tex); 674 tex.DefaultTexture.Rotation = (float)rotation;
675 return; 675 m_host.UpdateTexture(tex);
676 } 676 return;
677 if (face == -1) 677 }
678 { 678 NotImplemented("llRotateTexture");
679 for (int i = 0; i < 32; i++) 679 return;
680 { 680 }
681 if (tex.FaceTextures[i] != null) 681
682 { 682 public string llGetTexture(int face)
683 tex.FaceTextures[i].Rotation = (float)rotation; 683 {
684 } 684 LLObject.TextureEntry tex = m_host.Shape.Textures;
685 } 685 if (face == -1)
686 tex.DefaultTexture.Rotation = (float)rotation; 686 {
687 m_host.UpdateTexture(tex); 687 face = 0;
688 return; 688 }
689 } 689 if (face > -1)
690 NotImplemented("llRotateTexture"); 690 {
691 return; 691 LLObject.TextureEntryFace texface;
692 } 692 texface = tex.GetFace((uint)face);
693 693 return texface.TextureID.ToString();
694 public string llGetTexture(int face) 694 }
695 { 695 NotImplemented("llGetTexture");
696 LLObject.TextureEntry tex = m_host.Shape.Textures; 696 return "";
697 if (face == -1) 697 }
698 { 698
699 face = 0; 699 public void llSetPos(LSL_Types.Vector3 pos)
700 } 700 {
701 if (face > -1) 701 if (m_host.ParentID != 0)
702 { 702 {
703 LLObject.TextureEntryFace texface; 703 m_host.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z));
704 texface = tex.GetFace((uint)face); 704 }
705 return texface.TextureID.ToString(); 705 else
706 } 706 {
707 NotImplemented("llGetTexture"); 707 m_host.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z));
708 return ""; 708 }
709 } 709 }
710 710
711 public void llSetPos(LSL_Types.Vector3 pos) 711 public LSL_Types.Vector3 llGetPos()
712 { 712 {
713 if (m_host.ParentID != 0) 713 return new LSL_Types.Vector3(m_host.AbsolutePosition.X,
714 { 714 m_host.AbsolutePosition.Y,
715 m_host.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 715 m_host.AbsolutePosition.Z);
716 } 716 }
717 else 717
718 { 718 public LSL_Types.Vector3 llGetLocalPos()
719 m_host.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 719 {
720 } 720 if (m_host.ParentID != 0)
721 } 721 {
722 722 return new LSL_Types.Vector3(m_host.OffsetPosition.X,
723 public LSL_Types.Vector3 llGetPos() 723 m_host.OffsetPosition.Y,
724 { 724 m_host.OffsetPosition.Z);
725 return new LSL_Types.Vector3(m_host.AbsolutePosition.X, 725 }
726 m_host.AbsolutePosition.Y, 726 else
727 m_host.AbsolutePosition.Z); 727 {
728 } 728 return new LSL_Types.Vector3(m_host.AbsolutePosition.X,
729 729 m_host.AbsolutePosition.Y,
730 public LSL_Types.Vector3 llGetLocalPos() 730 m_host.AbsolutePosition.Z);
731 { 731 }
732 if (m_host.ParentID != 0) 732 }
733 { 733
734 return new LSL_Types.Vector3(m_host.OffsetPosition.X, 734 public void llSetRot(LSL_Types.Quaternion rot)
735 m_host.OffsetPosition.Y, 735 {
736 m_host.OffsetPosition.Z); 736 m_host.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s));
737 } 737 }
738 else 738
739 { 739 public LSL_Types.Quaternion llGetRot()
740 return new LSL_Types.Vector3(m_host.AbsolutePosition.X, 740 {
741 m_host.AbsolutePosition.Y, 741 LLQuaternion q = m_host.RotationOffset;
742 m_host.AbsolutePosition.Z); 742 return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
743 } 743 }
744 } 744
745 745 public LSL_Types.Quaternion llGetLocalRot()
746 public void llSetRot(LSL_Types.Quaternion rot) 746 {
747 { 747 return new LSL_Types.Quaternion(m_host.RotationOffset.X, m_host.RotationOffset.Y, m_host.RotationOffset.Z, m_host.RotationOffset.W);
748 m_host.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); 748 }
749 } 749
750 750 public void llSetForce(LSL_Types.Vector3 force, int local)
751 public LSL_Types.Quaternion llGetRot() 751 {
752 { 752 NotImplemented("llSetForce");
753 LLQuaternion q = m_host.RotationOffset; 753 }
754 return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 754
755 } 755 public LSL_Types.Vector3 llGetForce()
756 756 {
757 public LSL_Types.Quaternion llGetLocalRot() 757 NotImplemented("llGetForce");
758 { 758 return new LSL_Types.Vector3();
759 return new LSL_Types.Quaternion(m_host.RotationOffset.X, m_host.RotationOffset.Y, m_host.RotationOffset.Z, m_host.RotationOffset.W); 759 }
760 } 760
761 761 public int llTarget(LSL_Types.Vector3 position, double range)
762 public void llSetForce(LSL_Types.Vector3 force, int local) 762 {
763 { 763 NotImplemented("llTarget");
764 NotImplemented("llSetForce"); 764 return 0;
765 } 765 }
766 766
767 public LSL_Types.Vector3 llGetForce() 767 public void llTargetRemove(int number)
768 { 768 {
769 NotImplemented("llGetForce"); 769 NotImplemented("llTargetRemove");
770 return new LSL_Types.Vector3(); 770 }
771 } 771
772 772 public int llRotTarget(LSL_Types.Quaternion rot, double error)
773 public int llTarget(LSL_Types.Vector3 position, double range) 773 {
774 { 774 NotImplemented("llRotTarget");
775 NotImplemented("llTarget"); 775 return 0;
776 return 0; 776 }
777 } 777
778 778 public void llRotTargetRemove(int number)
779 public void llTargetRemove(int number) 779 {
780 { 780 NotImplemented("llRotTargetRemove");
781 NotImplemented("llTargetRemove"); 781 }
782 } 782
783 783 public void llMoveToTarget(LSL_Types.Vector3 target, double tau)
784 public int llRotTarget(LSL_Types.Quaternion rot, double error) 784 {
785 { 785 NotImplemented("llMoveToTarget");
786 NotImplemented("llRotTarget"); 786 }
787 return 0; 787
788 } 788 public void llStopMoveToTarget()
789 789 {
790 public void llRotTargetRemove(int number) 790 NotImplemented("llStopMoveToTarget");
791 { 791 }
792 NotImplemented("llRotTargetRemove"); 792
793 } 793 public void llApplyImpulse(LSL_Types.Vector3 force, int local)
794 794 {
795 public void llMoveToTarget(LSL_Types.Vector3 target, double tau) 795 NotImplemented("llApplyImpulse");
796 { 796 }
797 NotImplemented("llMoveToTarget"); 797
798 } 798 public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local)
799 799 {
800 public void llStopMoveToTarget() 800 NotImplemented("llApplyRotationalImpulse");
801 { 801 }
802 NotImplemented("llStopMoveToTarget"); 802
803 } 803 public void llSetTorque(LSL_Types.Vector3 torque, int local)
804 804 {
805 public void llApplyImpulse(LSL_Types.Vector3 force, int local) 805 NotImplemented("llSetTorque");
806 { 806 }
807 NotImplemented("llApplyImpulse"); 807
808 } 808 public LSL_Types.Vector3 llGetTorque()
809 809 {
810 public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) 810 NotImplemented("llGetTorque");
811 { 811 return new LSL_Types.Vector3();
812 NotImplemented("llApplyRotationalImpulse"); 812 }
813 } 813
814 814 public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local)
815 public void llSetTorque(LSL_Types.Vector3 torque, int local) 815 {
816 { 816 NotImplemented("llSetForceAndTorque");
817 NotImplemented("llSetTorque"); 817 }
818 } 818
819 819 public LSL_Types.Vector3 llGetVel()
820 public LSL_Types.Vector3 llGetTorque() 820 {
821 { 821 return new LSL_Types.Vector3(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z);
822 NotImplemented("llGetTorque"); 822 }
823 return new LSL_Types.Vector3(); 823
824 } 824 public LSL_Types.Vector3 llGetAccel()
825 825 {
826 public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) 826 return new LSL_Types.Vector3(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z);
827 { 827 }
828 NotImplemented("llSetForceAndTorque"); 828
829 } 829 public LSL_Types.Vector3 llGetOmega()
830 830 {
831 public LSL_Types.Vector3 llGetVel() 831 NotImplemented("llGetOmega");
832 { 832 return new LSL_Types.Vector3();
833 return new LSL_Types.Vector3(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z); 833 }
834 } 834
835 835 public double llGetTimeOfDay()
836 public LSL_Types.Vector3 llGetAccel() 836 {
837 { 837 NotImplemented("llGetTimeOfDay");
838 return new LSL_Types.Vector3(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z); 838 return 0;
839 } 839 }
840 840
841 public LSL_Types.Vector3 llGetOmega() 841 public double llGetWallclock()
842 { 842 {
843 NotImplemented("llGetOmega"); 843 return DateTime.Now.TimeOfDay.TotalSeconds;
844 return new LSL_Types.Vector3(); 844 }
845 } 845
846 846 public double llGetTime()
847 public double llGetTimeOfDay() 847 {
848 { 848 TimeSpan ScriptTime = DateTime.Now - m_timer;
849 NotImplemented("llGetTimeOfDay"); 849 return (double)(ScriptTime.TotalMilliseconds / 1000);
850 return 0; 850 }
851 } 851
852 852 public void llResetTime()
853 public double llGetWallclock() 853 {
854 { 854 m_timer = DateTime.Now;
855 return DateTime.Now.TimeOfDay.TotalSeconds; 855 }
856 } 856
857 857 public double llGetAndResetTime()
858 public double llGetTime() 858 {
859 { 859 TimeSpan ScriptTime = DateTime.Now - m_timer;
860 TimeSpan ScriptTime = DateTime.Now - m_timer; 860 m_timer = DateTime.Now;
861 return (double)(ScriptTime.TotalMilliseconds / 1000); 861 return (double)(ScriptTime.TotalMilliseconds / 1000);
862 } 862 }
863 863
864 public void llResetTime() 864 public void llSound()
865 { 865 {
866 m_timer = DateTime.Now; 866 NotImplemented("llSound");
867 } 867 }
868 868
869 public double llGetAndResetTime() 869 public void llPlaySound(string sound, double volume)
870 { 870 {
871 TimeSpan ScriptTime = DateTime.Now - m_timer; 871 NotImplemented("llPlaySound");
872 m_timer = DateTime.Now; 872 }
873 return (double)(ScriptTime.TotalMilliseconds / 1000); 873
874 } 874 public void llLoopSound(string sound, double volume)
875 875 {
876 public void llSound() 876 NotImplemented("llLoopSound");
877 { 877 }
878 NotImplemented("llSound"); 878
879 } 879 public void llLoopSoundMaster(string sound, double volume)
880 880 {
881 public void llPlaySound(string sound, double volume) 881 NotImplemented("llLoopSoundMaster");
882 { 882 }
883 NotImplemented("llPlaySound"); 883
884 } 884 public void llLoopSoundSlave(string sound, double volume)
885 885 {
886 public void llLoopSound(string sound, double volume) 886 NotImplemented("llLoopSoundSlave");
887 { 887 }
888 NotImplemented("llLoopSound"); 888
889 } 889 public void llPlaySoundSlave(string sound, double volume)
890 890 {
891 public void llLoopSoundMaster(string sound, double volume) 891 NotImplemented("llPlaySoundSlave");
892 { 892 }
893 NotImplemented("llLoopSoundMaster"); 893
894 } 894 public void llTriggerSound(string sound, double volume)
895 895 {
896 public void llLoopSoundSlave(string sound, double volume) 896 NotImplemented("llTriggerSound");
897 { 897 }
898 NotImplemented("llLoopSoundSlave"); 898
899 } 899 public void llStopSound()
900 900 {
901 public void llPlaySoundSlave(string sound, double volume) 901 NotImplemented("llStopSound");
902 { 902 }
903 NotImplemented("llPlaySoundSlave"); 903
904 } 904 public void llPreloadSound(string sound)
905 905 {
906 public void llTriggerSound(string sound, double volume) 906 NotImplemented("llPreloadSound");
907 { 907 }
908 NotImplemented("llTriggerSound"); 908
909 } 909 public string llGetSubString(string src, int start, int end)
910 910 {
911 public void llStopSound() 911 return src.Substring(start, end);
912 { 912 }
913 NotImplemented("llStopSound"); 913
914 } 914 public string llDeleteSubString(string src, int start, int end)
915 915 {
916 public void llPreloadSound(string sound) 916 return src.Remove(start, end - start);
917 { 917 }
918 NotImplemented("llPreloadSound"); 918
919 } 919 public string llInsertString(string dst, int position, string src)
920 920 {
921 public string llGetSubString(string src, int start, int end) 921 return dst.Insert(position, src);
922 { 922 }
923 return src.Substring(start, end); 923
924 } 924 public string llToUpper(string src)
925 925 {
926 public string llDeleteSubString(string src, int start, int end) 926 return src.ToUpper();
927 { 927 }
928 return src.Remove(start, end - start); 928
929 } 929 public string llToLower(string src)
930 930 {
931 public string llInsertString(string dst, int position, string src) 931 return src.ToLower();
932 { 932 }
933 return dst.Insert(position, src); 933
934 } 934 public int llGiveMoney(string destination, int amount)
935 935 {
936 public string llToUpper(string src) 936 NotImplemented("llGiveMoney");
937 { 937 return 0;
938 return src.ToUpper(); 938 }
939 } 939
940 940 public void llMakeExplosion()
941 public string llToLower(string src) 941 {
942 { 942 NotImplemented("llMakeExplosion");
943 return src.ToLower(); 943 }
944 } 944
945 945 public void llMakeFountain()
946 public int llGiveMoney(string destination, int amount) 946 {
947 { 947 NotImplemented("llMakeFountain");
948 NotImplemented("llGiveMoney"); 948 }
949 return 0; 949
950 } 950 public void llMakeSmoke()
951 951 {
952 public void llMakeExplosion() 952 NotImplemented("llMakeSmoke");
953 { 953 }
954 NotImplemented("llMakeExplosion"); 954
955 } 955 public void llMakeFire()
956 956 {
957 public void llMakeFountain() 957 NotImplemented("llMakeFire");
958 { 958 }
959 NotImplemented("llMakeFountain"); 959
960 } 960 public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param)
961 961 {
962 public void llMakeSmoke() 962 NotImplemented("llRezObject");
963 { 963 }
964 NotImplemented("llMakeSmoke"); 964
965 } 965 public void llLookAt(LSL_Types.Vector3 target, double strength, double damping)
966 966 {
967 public void llMakeFire() 967 NotImplemented("llLookAt");
968 { 968 }
969 NotImplemented("llMakeFire"); 969
970 } 970 public void llStopLookAt()
971 971 {
972 public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) 972 NotImplemented("llStopLookAt");
973 { 973 }
974 NotImplemented("llRezObject"); 974
975 } 975 public void llSetTimerEvent(double sec)
976 976 {
977 public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) 977 // Setting timer repeat
978 { 978 m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec);
979 NotImplemented("llLookAt"); 979 }
980 } 980
981 981 public void llSleep(double sec)
982 public void llStopLookAt() 982 {
983 { 983 Thread.Sleep((int)(sec * 1000));
984 NotImplemented("llStopLookAt"); 984 }
985 } 985
986 986 public double llGetMass()
987 public void llSetTimerEvent(double sec) 987 {
988 { 988 return m_host.GetMass();
989 // Setting timer repeat 989 }
990 m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec); 990
991 } 991 public void llCollisionFilter(string name, string id, int accept)
992 992 {
993 public void llSleep(double sec) 993 NotImplemented("llCollisionFilter");
994 { 994 }
995 Thread.Sleep((int)(sec * 1000)); 995
996 } 996 public void llTakeControls(int controls, int accept, int pass_on)
997 997 {
998 public double llGetMass() 998 NotImplemented("llTakeControls");
999 { 999 }
1000 return m_host.GetMass(); 1000
1001 } 1001 public void llReleaseControls()
1002 1002 {
1003 public void llCollisionFilter(string name, string id, int accept) 1003 NotImplemented("llReleaseControls");
1004 { 1004 }
1005 NotImplemented("llCollisionFilter"); 1005
1006 } 1006 public void llAttachToAvatar(int attachment)
1007 1007 {
1008 public void llTakeControls(int controls, int accept, int pass_on) 1008 NotImplemented("llAttachToAvatar");
1009 { 1009 }
1010 NotImplemented("llTakeControls"); 1010
1011 } 1011 public void llDetachFromAvatar()
1012 1012 {
1013 public void llReleaseControls() 1013 NotImplemented("llDetachFromAvatar");
1014 { 1014 }
1015 NotImplemented("llReleaseControls"); 1015
1016 } 1016 public void llTakeCamera()
1017 1017 {
1018 public void llAttachToAvatar(int attachment) 1018 NotImplemented("llTakeCamera");
1019 { 1019 }
1020 NotImplemented("llAttachToAvatar"); 1020
1021 } 1021 public void llReleaseCamera()
1022 1022 {
1023 public void llDetachFromAvatar() 1023 NotImplemented("llReleaseCamera");
1024 { 1024 }
1025 NotImplemented("llDetachFromAvatar"); 1025
1026 } 1026 public string llGetOwner()
1027 1027 {
1028 public void llTakeCamera() 1028 return m_host.ObjectOwner.ToString();
1029 { 1029 }
1030 NotImplemented("llTakeCamera"); 1030
1031 } 1031 public void llInstantMessage(string user, string message)
1032 1032 {
1033 public void llReleaseCamera() 1033 NotImplemented("llInstantMessage");
1034 { 1034
1035 NotImplemented("llReleaseCamera"); 1035 // We may be able to use ClientView.SendInstantMessage here, but we need a client instance.
1036 } 1036 // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent,
1037 1037 // but I don't think we have a list of scenes available from here.
1038 public string llGetOwner() 1038 // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.)
1039 { 1039
1040 return m_host.ObjectOwner.ToString(); 1040 // TODO: figure out values for client, fromSession, and imSessionID
1041 } 1041 // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch());
1042 1042 }
1043 public void llInstantMessage(string user, string message) 1043
1044 { 1044 public void llEmail(string address, string subject, string message)
1045 NotImplemented("llInstantMessage"); 1045 {
1046 1046 NotImplemented("llEmail");
1047 // We may be able to use ClientView.SendInstantMessage here, but we need a client instance. 1047 }
1048 // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent, 1048
1049 // but I don't think we have a list of scenes available from here. 1049 public void llGetNextEmail(string address, string subject)
1050 // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.) 1050 {
1051 1051 NotImplemented("llGetNextEmail");
1052 // TODO: figure out values for client, fromSession, and imSessionID 1052 }
1053 // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch()); 1053
1054 } 1054 public string llGetKey()
1055 1055 {
1056 public void llEmail(string address, string subject, string message) 1056 return m_host.UUID.ToString();
1057 { 1057 }
1058 NotImplemented("llEmail"); 1058
1059 } 1059 public void llSetBuoyancy(double buoyancy)
1060 1060 {
1061 public void llGetNextEmail(string address, string subject) 1061 NotImplemented("llSetBuoyancy");
1062 { 1062 }
1063 NotImplemented("llGetNextEmail"); 1063
1064 } 1064 public void llSetHoverHeight(double height, int water, double tau)
1065 1065 {
1066 public string llGetKey() 1066 NotImplemented("llSetHoverHeight");
1067 { 1067 }
1068 return m_host.UUID.ToString(); 1068
1069 } 1069 public void llStopHover()
1070 1070 {
1071 public void llSetBuoyancy(double buoyancy) 1071 NotImplemented("llStopHover");
1072 { 1072 }
1073 NotImplemented("llSetBuoyancy"); 1073
1074 } 1074 public void llMinEventDelay(double delay)
1075 1075 {
1076 public void llSetHoverHeight(double height, int water, double tau) 1076 NotImplemented("llMinEventDelay");
1077 { 1077 }
1078 NotImplemented("llSetHoverHeight"); 1078
1079 } 1079 public void llSoundPreload()
1080 1080 {
1081 public void llStopHover() 1081 NotImplemented("llSoundPreload");
1082 { 1082 }
1083 NotImplemented("llStopHover"); 1083
1084 } 1084 public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping)
1085 1085 {
1086 public void llMinEventDelay(double delay) 1086 NotImplemented("llRotLookAt");
1087 { 1087 }
1088 NotImplemented("llMinEventDelay"); 1088
1089 } 1089 public int llStringLength(string str)
1090 1090 {
1091 public void llSoundPreload() 1091 if (str.Length > 0)
1092 { 1092 {
1093 NotImplemented("llSoundPreload"); 1093 return str.Length;
1094 } 1094 }
1095 1095 else
1096 public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) 1096 {
1097 { 1097 return 0;
1098 NotImplemented("llRotLookAt"); 1098 }
1099 } 1099 }
1100 1100
1101 public int llStringLength(string str) 1101 public void llStartAnimation(string anim)
1102 { 1102 {
1103 if (str.Length > 0) 1103 NotImplemented("llStartAnimation");
1104 { 1104 }
1105 return str.Length; 1105
1106 } 1106 public void llStopAnimation(string anim)
1107 else 1107 {
1108 { 1108 NotImplemented("llStopAnimation");
1109 return 0; 1109 }
1110 } 1110
1111 } 1111 public void llPointAt()
1112 1112 {
1113 public void llStartAnimation(string anim) 1113 NotImplemented("llPointAt");
1114 { 1114 }
1115 NotImplemented("llStartAnimation"); 1115
1116 } 1116 public void llStopPointAt()
1117 1117 {
1118 public void llStopAnimation(string anim) 1118 NotImplemented("llStopPointAt");
1119 { 1119 }
1120 NotImplemented("llStopAnimation"); 1120
1121 } 1121 public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain)
1122 1122 {
1123 public void llPointAt() 1123 m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
1124 { 1124 m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
1125 NotImplemented("llPointAt"); 1125 m_host.ScheduleTerseUpdate();
1126 } 1126 m_host.SendTerseUpdateToAllClients();
1127 1127 //NotImplemented("llTargetOmega");
1128 public void llStopPointAt() 1128 }
1129 { 1129
1130 NotImplemented("llStopPointAt"); 1130 public int llGetStartParameter()
1131 } 1131 {
1132 1132 NotImplemented("llGetStartParameter");
1133 public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) 1133 return 0;
1134 { 1134 }
1135 m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 1135
1136 m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 1136 public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
1137 m_host.ScheduleTerseUpdate(); 1137 {
1138 m_host.SendTerseUpdateToAllClients(); 1138 NotImplemented("llGodLikeRezObject");
1139 //NotImplemented("llTargetOmega"); 1139 }
1140 } 1140
1141 1141 public void llRequestPermissions(string agent, int perm)
1142 public int llGetStartParameter() 1142 {
1143 { 1143 NotImplemented("llRequestPermissions");
1144 NotImplemented("llGetStartParameter"); 1144 }
1145 return 0; 1145
1146 } 1146 public string llGetPermissionsKey()
1147 1147 {
1148 public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) 1148 NotImplemented("llGetPermissionsKey");
1149 { 1149 return "";
1150 NotImplemented("llGodLikeRezObject"); 1150 }
1151 } 1151
1152 1152 public int llGetPermissions()
1153 public void llRequestPermissions(string agent, int perm) 1153 {
1154 { 1154 NotImplemented("llGetPermissions");
1155 NotImplemented("llRequestPermissions"); 1155 return 0;
1156 } 1156 }
1157 1157
1158 public string llGetPermissionsKey() 1158 public int llGetLinkNumber()
1159 { 1159 {
1160 NotImplemented("llGetPermissionsKey"); 1160 return m_host.LinkNum;
1161 return ""; 1161 }
1162 } 1162
1163 1163 public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face)
1164 public int llGetPermissions() 1164 {
1165 { 1165 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber);
1166 NotImplemented("llGetPermissions"); 1166 if (linknumber > -1)
1167 return 0; 1167 {
1168 } 1168 LLObject.TextureEntry tex = part.Shape.Textures;
1169 1169 LLColor texcolor;
1170 public int llGetLinkNumber() 1170 if (face > -1)
1171 { 1171 {
1172 return m_host.LinkNum; 1172 texcolor = tex.CreateFace((uint)face).RGBA;
1173 } 1173 texcolor.R = (float)Math.Abs(color.x - 1);
1174 1174 texcolor.G = (float)Math.Abs(color.y - 1);
1175 public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) 1175 texcolor.B = (float)Math.Abs(color.z - 1);
1176 { 1176 tex.FaceTextures[face].RGBA = texcolor;
1177 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); 1177 part.UpdateTexture(tex);
1178 if (linknumber > -1) 1178 return;
1179 { 1179 }
1180 LLObject.TextureEntry tex = part.Shape.Textures; 1180 else if (face == -1)
1181 LLColor texcolor; 1181 {
1182 if (face > -1) 1182 texcolor = tex.DefaultTexture.RGBA;
1183 { 1183 texcolor.R = (float)Math.Abs(color.x - 1);
1184 texcolor = tex.CreateFace((uint)face).RGBA; 1184 texcolor.G = (float)Math.Abs(color.y - 1);
1185 texcolor.R = (float)Math.Abs(color.x - 1); 1185 texcolor.B = (float)Math.Abs(color.z - 1);
1186 texcolor.G = (float)Math.Abs(color.y - 1); 1186 tex.DefaultTexture.RGBA = texcolor;
1187 texcolor.B = (float)Math.Abs(color.z - 1); 1187 for (uint i = 0; i < 32; i++)
1188 tex.FaceTextures[face].RGBA = texcolor; 1188 {
1189 part.UpdateTexture(tex); 1189 if (tex.FaceTextures[i] != null)
1190 return; 1190 {
1191 } 1191 texcolor = tex.FaceTextures[i].RGBA;
1192 else if (face == -1) 1192 texcolor.R = (float)Math.Abs(color.x - 1);
1193 { 1193 texcolor.G = (float)Math.Abs(color.y - 1);
1194 texcolor = tex.DefaultTexture.RGBA; 1194 texcolor.B = (float)Math.Abs(color.z - 1);
1195 texcolor.R = (float)Math.Abs(color.x - 1); 1195 tex.FaceTextures[i].RGBA = texcolor;
1196 texcolor.G = (float)Math.Abs(color.y - 1); 1196 }
1197 texcolor.B = (float)Math.Abs(color.z - 1); 1197 }
1198 tex.DefaultTexture.RGBA = texcolor; 1198 texcolor = tex.DefaultTexture.RGBA;
1199 for (uint i = 0; i < 32; i++) 1199 texcolor.R = (float)Math.Abs(color.x - 1);
1200 { 1200 texcolor.G = (float)Math.Abs(color.y - 1);
1201 if (tex.FaceTextures[i] != null) 1201 texcolor.B = (float)Math.Abs(color.z - 1);
1202 { 1202 tex.DefaultTexture.RGBA = texcolor;
1203 texcolor = tex.FaceTextures[i].RGBA; 1203 part.UpdateTexture(tex);
1204 texcolor.R = (float)Math.Abs(color.x - 1); 1204 return;
1205 texcolor.G = (float)Math.Abs(color.y - 1); 1205 }
1206 texcolor.B = (float)Math.Abs(color.z - 1); 1206 return;
1207 tex.FaceTextures[i].RGBA = texcolor; 1207 }
1208 } 1208 else if (linknumber == -1)
1209 } 1209 {
1210 texcolor = tex.DefaultTexture.RGBA; 1210 int num = m_host.ParentGroup.PrimCount;
1211 texcolor.R = (float)Math.Abs(color.x - 1); 1211 for (int w = 0; w < num; w++)
1212 texcolor.G = (float)Math.Abs(color.y - 1); 1212 {
1213 texcolor.B = (float)Math.Abs(color.z - 1); 1213 linknumber = w;
1214 tex.DefaultTexture.RGBA = texcolor; 1214 part = m_host.ParentGroup.GetLinkNumPart(linknumber);
1215 part.UpdateTexture(tex); 1215 LLObject.TextureEntry tex = part.Shape.Textures;
1216 return; 1216 LLColor texcolor;
1217 } 1217 if (face > -1)
1218 return; 1218 {
1219 } 1219 texcolor = tex.CreateFace((uint)face).RGBA;
1220 else if (linknumber == -1) 1220 texcolor.R = (float)Math.Abs(color.x - 1);
1221 { 1221 texcolor.G = (float)Math.Abs(color.y - 1);
1222 int num = m_host.ParentGroup.PrimCount; 1222 texcolor.B = (float)Math.Abs(color.z - 1);
1223 for (int w = 0; w < num; w++) 1223 tex.FaceTextures[face].RGBA = texcolor;
1224 { 1224 part.UpdateTexture(tex);
1225 linknumber = w; 1225 }
1226 part = m_host.ParentGroup.GetLinkNumPart(linknumber); 1226 else if (face == -1)
1227 LLObject.TextureEntry tex = part.Shape.Textures; 1227 {
1228 LLColor texcolor; 1228 texcolor = tex.DefaultTexture.RGBA;
1229 if (face > -1) 1229 texcolor.R = (float)Math.Abs(color.x - 1);
1230 { 1230 texcolor.G = (float)Math.Abs(color.y - 1);
1231 texcolor = tex.CreateFace((uint)face).RGBA; 1231 texcolor.B = (float)Math.Abs(color.z - 1);
1232 texcolor.R = (float)Math.Abs(color.x - 1); 1232 tex.DefaultTexture.RGBA = texcolor;
1233 texcolor.G = (float)Math.Abs(color.y - 1); 1233 for (uint i = 0; i < 32; i++)
1234 texcolor.B = (float)Math.Abs(color.z - 1); 1234 {
1235 tex.FaceTextures[face].RGBA = texcolor; 1235 if (tex.FaceTextures[i] != null)
1236 part.UpdateTexture(tex); 1236 {
1237 } 1237 texcolor = tex.FaceTextures[i].RGBA;
1238 else if (face == -1) 1238 texcolor.R = (float)Math.Abs(color.x - 1);
1239 { 1239 texcolor.G = (float)Math.Abs(color.y - 1);
1240 texcolor = tex.DefaultTexture.RGBA; 1240 texcolor.B = (float)Math.Abs(color.z - 1);
1241 texcolor.R = (float)Math.Abs(color.x - 1); 1241 tex.FaceTextures[i].RGBA = texcolor;
1242 texcolor.G = (float)Math.Abs(color.y - 1); 1242 }
1243 texcolor.B = (float)Math.Abs(color.z - 1); 1243 }
1244 tex.DefaultTexture.RGBA = texcolor; 1244 texcolor = tex.DefaultTexture.RGBA;
1245 for (uint i = 0; i < 32; i++) 1245 texcolor.R = (float)Math.Abs(color.x - 1);
1246 { 1246 texcolor.G = (float)Math.Abs(color.y - 1);
1247 if (tex.FaceTextures[i] != null) 1247 texcolor.B = (float)Math.Abs(color.z - 1);
1248 { 1248 tex.DefaultTexture.RGBA = texcolor;
1249 texcolor = tex.FaceTextures[i].RGBA; 1249 part.UpdateTexture(tex);
1250 texcolor.R = (float)Math.Abs(color.x - 1); 1250 }
1251 texcolor.G = (float)Math.Abs(color.y - 1); 1251 }
1252 texcolor.B = (float)Math.Abs(color.z - 1); 1252 return;
1253 tex.FaceTextures[i].RGBA = texcolor; 1253 }
1254 } 1254 else
1255 } 1255 {
1256 texcolor = tex.DefaultTexture.RGBA; 1256 NotImplemented("llSetLinkColor");
1257 texcolor.R = (float)Math.Abs(color.x - 1); 1257 }
1258 texcolor.G = (float)Math.Abs(color.y - 1); 1258 }
1259 texcolor.B = (float)Math.Abs(color.z - 1); 1259
1260 tex.DefaultTexture.RGBA = texcolor; 1260 public void llCreateLink(string target, int parent)
1261 part.UpdateTexture(tex); 1261 {
1262 } 1262 NotImplemented("llCreateLink");
1263 } 1263 }
1264 return; 1264
1265 } 1265 public void llBreakLink(int linknum)
1266 else 1266 {
1267 { 1267 NotImplemented("llBreakLink");
1268 NotImplemented("llSetLinkColor"); 1268 }
1269 } 1269
1270 } 1270 public void llBreakAllLinks()
1271 1271 {
1272 public void llCreateLink(string target, int parent) 1272 NotImplemented("llBreakAllLinks");
1273 { 1273 }
1274 NotImplemented("llCreateLink"); 1274
1275 } 1275 public string llGetLinkKey(int linknum)
1276 1276 {
1277 public void llBreakLink(int linknum) 1277 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum);
1278 { 1278 if (part != null)
1279 NotImplemented("llBreakLink"); 1279 {
1280 } 1280 return part.UUID.ToString();
1281 1281 }
1282 public void llBreakAllLinks() 1282 else
1283 { 1283 {
1284 NotImplemented("llBreakAllLinks"); 1284 return "00000000-0000-0000-0000-000000000000";
1285 } 1285 }
1286 1286 }
1287 public string llGetLinkKey(int linknum) 1287
1288 { 1288 public string llGetLinkName(int linknum)
1289 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); 1289 {
1290 if (part != null) 1290 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum);
1291 { 1291 if (part != null)
1292 return part.UUID.ToString(); 1292 {
1293 } 1293 return part.Name;
1294 else 1294 }
1295 { 1295 else
1296 return "00000000-0000-0000-0000-000000000000"; 1296 {
1297 } 1297 return "00000000-0000-0000-0000-000000000000";
1298 } 1298 }
1299 1299 }
1300 public string llGetLinkName(int linknum) 1300
1301 { 1301 public int llGetInventoryNumber(int type)
1302 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); 1302 {
1303 if (part != null) 1303 NotImplemented("llGetInventoryNumber");
1304 { 1304 return 0;
1305 return part.Name; 1305 }
1306 } 1306
1307 else 1307 public string llGetInventoryName(int type, int number)
1308 { 1308 {
1309 return "00000000-0000-0000-0000-000000000000"; 1309 NotImplemented("llGetInventoryName");
1310 } 1310 return "";
1311 } 1311 }
1312 1312
1313 public int llGetInventoryNumber(int type) 1313 public void llSetScriptState(string name, int run)
1314 { 1314 {
1315 NotImplemented("llGetInventoryNumber"); 1315 NotImplemented("llSetScriptState");
1316 return 0; 1316 }
1317 } 1317
1318 1318 public double llGetEnergy()
1319 public string llGetInventoryName(int type, int number) 1319 {
1320 { 1320 return 1.0f;
1321 NotImplemented("llGetInventoryName"); 1321 }
1322 return ""; 1322
1323 } 1323 public void llGiveInventory(string destination, string inventory)
1324 1324 {
1325 public void llSetScriptState(string name, int run) 1325 NotImplemented("llGiveInventory");
1326 { 1326 }
1327 NotImplemented("llSetScriptState"); 1327
1328 } 1328 public void llRemoveInventory(string item)
1329 1329 {
1330 public double llGetEnergy() 1330 NotImplemented("llRemoveInventory");
1331 { 1331 }
1332 return 1.0f; 1332
1333 } 1333 public void llSetText(string text, LSL_Types.Vector3 color, double alpha)
1334 1334 {
1335 public void llGiveInventory(string destination, string inventory) 1335 Vector3 av3 = new Vector3((float)color.x, (float)color.y, (float)color.z);
1336 { 1336 m_host.SetText(text, av3, alpha);
1337 NotImplemented("llGiveInventory"); 1337 }
1338 } 1338
1339 1339 public double llWater(LSL_Types.Vector3 offset)
1340 public void llRemoveInventory(string item) 1340 {
1341 { 1341 return World.RegionInfo.EstateSettings.waterHeight;
1342 NotImplemented("llRemoveInventory"); 1342 }
1343 } 1343
1344 1344 public void llPassTouches(int pass)
1345 public void llSetText(string text, LSL_Types.Vector3 color, double alpha) 1345 {
1346 { 1346 NotImplemented("llPassTouches");
1347 Vector3 av3 = new Vector3((float)color.x, (float)color.y, (float)color.z); 1347 }
1348 m_host.SetText(text, av3, alpha); 1348
1349 } 1349 public string llRequestAgentData(string id, int data)
1350 1350 {
1351 public double llWater(LSL_Types.Vector3 offset) 1351 NotImplemented("llRequestAgentData");
1352 { 1352 return "";
1353 return World.RegionInfo.EstateSettings.waterHeight; 1353 }
1354 } 1354
1355 1355 public string llRequestInventoryData(string name)
1356 public void llPassTouches(int pass) 1356 {
1357 { 1357 NotImplemented("llRequestInventoryData");
1358 NotImplemented("llPassTouches"); 1358 return "";
1359 } 1359 }
1360 1360
1361 public string llRequestAgentData(string id, int data) 1361 public void llSetDamage(double damage)
1362 { 1362 {
1363 NotImplemented("llRequestAgentData"); 1363 NotImplemented("llSetDamage");
1364 return ""; 1364 }
1365 } 1365
1366 1366 public void llTeleportAgentHome(string agent)
1367 public string llRequestInventoryData(string name) 1367 {
1368 { 1368 NotImplemented("llTeleportAgentHome");
1369 NotImplemented("llRequestInventoryData"); 1369 }
1370 return ""; 1370
1371 } 1371 public void llModifyLand(int action, int brush)
1372 1372 {
1373 public void llSetDamage(double damage) 1373 double dsize;
1374 { 1374 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)))
1375 NotImplemented("llSetDamage"); 1375 {
1376 } 1376 switch (brush)
1377 1377 {
1378 public void llTeleportAgentHome(string agent) 1378 case 1:
1379 { 1379 dsize = 2;
1380 NotImplemented("llTeleportAgentHome"); 1380 break;
1381 } 1381 case 2:
1382 1382 dsize = 4;
1383 public void llModifyLand(int action, int brush) 1383 break;
1384 { 1384 case 3:
1385 double dsize; 1385 dsize = 8;
1386 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0))) 1386 break;
1387 { 1387 default:
1388 switch (brush) 1388 if (brush < 0)
1389 { 1389 {
1390 case 1: 1390 dsize = (double)(-1 * brush);
1391 dsize = 2; 1391 }
1392 break; 1392 else
1393 case 2: 1393 {
1394 dsize = 4; 1394 LSLError("Invalid brush size");
1395 break; 1395 dsize = 0; // Should cease execution, but get unassigned local variable dsize on compile.
1396 case 3: 1396 }
1397 dsize = 8; 1397 break;
1398 break; 1398 }
1399 default: 1399 switch (action)
1400 if (brush < 0) 1400 {
1401 { 1401 case 0:
1402 dsize = (double)(-1 * brush); 1402 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < m_host.AbsolutePosition.Z)
1403 } 1403 {
1404 else 1404 World.Terrain.FlattenTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1405 { 1405 }
1406 LSLError("Invalid brush size"); 1406 break;
1407 dsize = 0; // Should cease execution, but get unassigned local variable dsize on compile. 1407 case 1:
1408 } 1408 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < (double)m_host.AbsolutePosition.Z)
1409 break; 1409 {
1410 } 1410 World.Terrain.RaiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 0.1);
1411 switch (action) 1411 }
1412 { 1412 break;
1413 case 0: 1413 case 2:
1414 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < m_host.AbsolutePosition.Z) 1414 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) > 0)
1415 { 1415 {
1416 World.Terrain.FlattenTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1416 World.Terrain.LowerTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1417 } 1417 }
1418 break; 1418 break;
1419 case 1: 1419 case 3:
1420 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < (double)m_host.AbsolutePosition.Z) 1420 World.Terrain.SmoothTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1421 { 1421 break;
1422 World.Terrain.RaiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 0.1); 1422 case 4:
1423 } 1423 World.Terrain.NoiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1424 break; 1424 break;
1425 case 2: 1425 case 5:
1426 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) > 0) 1426 World.Terrain.RevertTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1427 { 1427 break;
1428 World.Terrain.LowerTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1428 default:
1429 } 1429 break;
1430 break; 1430 }
1431 case 3: 1431 }
1432 World.Terrain.SmoothTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1432 }
1433 break; 1433
1434 case 4: 1434 public void llCollisionSound(string impact_sound, double impact_volume)
1435 World.Terrain.NoiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1435 {
1436 break; 1436 NotImplemented("llCollisionSound");
1437 case 5: 1437 }
1438 World.Terrain.RevertTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1438
1439 break; 1439 public void llCollisionSprite(string impact_sprite)
1440 default: 1440 {
1441 break; 1441 NotImplemented("llCollisionSprite");
1442 } 1442 }
1443 } 1443
1444 } 1444 public string llGetAnimation(string id)
1445 1445 {
1446 public void llCollisionSound(string impact_sound, double impact_volume) 1446 NotImplemented("llGetAnimation");
1447 { 1447 return "";
1448 NotImplemented("llCollisionSound"); 1448 }
1449 } 1449
1450 1450 public void llResetScript()
1451 public void llCollisionSprite(string impact_sprite) 1451 {
1452 { 1452 m_ScriptEngine.m_ScriptManager.ResetScript(m_localID, m_itemID);
1453 NotImplemented("llCollisionSprite"); 1453 }
1454 } 1454
1455 1455 public void llMessageLinked(int linknum, int num, string str, string id)
1456 public string llGetAnimation(string id) 1456 {
1457 { 1457 }
1458 NotImplemented("llGetAnimation"); 1458
1459 return ""; 1459 public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local)
1460 } 1460 {
1461 1461 }
1462 public void llResetScript() 1462
1463 { 1463 public void llPassCollisions(int pass)
1464 m_ScriptEngine.m_ScriptManager.ResetScript(m_localID, m_itemID); 1464 {
1465 } 1465 }
1466 1466
1467 public void llMessageLinked(int linknum, int num, string str, string id) 1467 public string llGetScriptName()
1468 { 1468 {
1469 } 1469 return "";
1470 1470 }
1471 public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) 1471
1472 { 1472 public int llGetNumberOfSides()
1473 } 1473 {
1474 1474 return 0;
1475 public void llPassCollisions(int pass) 1475 }
1476 { 1476
1477 } 1477 public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle)
1478 1478 {
1479 public string llGetScriptName() 1479 return new LSL_Types.Quaternion();
1480 { 1480 }
1481 return ""; 1481
1482 } 1482 public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot)
1483 1483 {
1484 public int llGetNumberOfSides() 1484 return new LSL_Types.Vector3();
1485 { 1485 }
1486 return 0; 1486
1487 } 1487 public void llRot2Angle()
1488 1488 {
1489 public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) 1489 }
1490 { 1490
1491 return new LSL_Types.Quaternion(); 1491 public double llAcos(double val)
1492 } 1492 {
1493 1493 return (double)Math.Acos(val);
1494 public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) 1494 }
1495 { 1495
1496 return new LSL_Types.Vector3(); 1496 public double llAsin(double val)
1497 } 1497 {
1498 1498 return (double)Math.Asin(val);
1499 public void llRot2Angle() 1499 }
1500 { 1500
1501 } 1501 public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b)
1502 1502 {
1503 public double llAcos(double val) 1503 return 0;
1504 { 1504 }
1505 return (double)Math.Acos(val); 1505
1506 } 1506 public string llGetInventoryKey(string name)
1507 1507 {
1508 public double llAsin(double val) 1508 return "";
1509 { 1509 }
1510 return (double)Math.Asin(val); 1510
1511 } 1511 public void llAllowInventoryDrop(int add)
1512 1512 {
1513 public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) 1513 }
1514 { 1514
1515 return 0; 1515 public LSL_Types.Vector3 llGetSunDirection()
1516 } 1516 {
1517 1517 return new LSL_Types.Vector3();
1518 public string llGetInventoryKey(string name) 1518 }
1519 { 1519
1520 return ""; 1520 public LSL_Types.Vector3 llGetTextureOffset(int face)
1521 } 1521 {
1522 1522 LLObject.TextureEntry tex = m_host.Shape.Textures;
1523 public void llAllowInventoryDrop(int add) 1523 LSL_Types.Vector3 offset;
1524 { 1524 if (face == -1)
1525 } 1525 {
1526 1526 face = 0;
1527 public LSL_Types.Vector3 llGetSunDirection() 1527 }
1528 { 1528 offset.x = tex.GetFace((uint)face).OffsetU;
1529 return new LSL_Types.Vector3(); 1529 offset.y = tex.GetFace((uint)face).OffsetV;
1530 } 1530 offset.z = 0.0;
1531 1531 return offset;
1532 public LSL_Types.Vector3 llGetTextureOffset(int face) 1532 }
1533 { 1533
1534 LLObject.TextureEntry tex = m_host.Shape.Textures; 1534 public LSL_Types.Vector3 llGetTextureScale(int side)
1535 LSL_Types.Vector3 offset; 1535 {
1536 if (face == -1) 1536 LLObject.TextureEntry tex = m_host.Shape.Textures;
1537 { 1537 LSL_Types.Vector3 scale;
1538 face = 0; 1538 if (side == -1)
1539 } 1539 {
1540 offset.x = tex.GetFace((uint)face).OffsetU; 1540 side = 0;
1541 offset.y = tex.GetFace((uint)face).OffsetV; 1541 }
1542 offset.z = 0.0; 1542 scale.x = tex.GetFace((uint)side).RepeatU;
1543 return offset; 1543 scale.y = tex.GetFace((uint)side).RepeatV;
1544 } 1544 scale.z = 0.0;
1545 1545 return scale;
1546 public LSL_Types.Vector3 llGetTextureScale(int side) 1546 }
1547 { 1547
1548 LLObject.TextureEntry tex = m_host.Shape.Textures; 1548 public double llGetTextureRot(int face)
1549 LSL_Types.Vector3 scale; 1549 {
1550 if (side == -1) 1550 LLObject.TextureEntry tex = m_host.Shape.Textures;
1551 { 1551 if (face == -1)
1552 side = 0; 1552 {
1553 } 1553 face = 0;
1554 scale.x = tex.GetFace((uint)side).RepeatU; 1554 }
1555 scale.y = tex.GetFace((uint)side).RepeatV; 1555 return tex.GetFace((uint)face).Rotation;
1556 scale.z = 0.0; 1556 }
1557 return scale; 1557
1558 } 1558 public int llSubStringIndex(string source, string pattern)
1559 1559 {
1560 public double llGetTextureRot(int face) 1560 return source.IndexOf(pattern);
1561 { 1561 }
1562 LLObject.TextureEntry tex = m_host.Shape.Textures; 1562
1563 if (face == -1) 1563 public string llGetOwnerKey(string id)
1564 { 1564 {
1565 face = 0; 1565 NotImplemented("llGetOwnerKey");
1566 } 1566 return "";
1567 return tex.GetFace((uint)face).Rotation; 1567 }
1568 } 1568
1569 1569 public LSL_Types.Vector3 llGetCenterOfMass()
1570 public int llSubStringIndex(string source, string pattern) 1570 {
1571 { 1571 NotImplemented("llGetCenterOfMass");
1572 return source.IndexOf(pattern); 1572 return new LSL_Types.Vector3();
1573 } 1573 }
1574 1574
1575 public string llGetOwnerKey(string id) 1575 public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending)
1576 { 1576 {
1577 NotImplemented("llGetOwnerKey"); 1577 // SortedList<string, LSL_Types.list> sorted = new SortedList<string, LSL_Types.list>();
1578 return ""; 1578 // Add chunks to an array
1579 } 1579 //int s = stride;
1580 1580 //if (s < 1)
1581 public LSL_Types.Vector3 llGetCenterOfMass() 1581 // s = 1;
1582 { 1582 //int c = 0;
1583 NotImplemented("llGetCenterOfMass"); 1583 //LSL_Types.list chunk = new LSL_Types.list();
1584 return new LSL_Types.Vector3(); 1584 //string chunkString = "";
1585 } 1585 //foreach (string element in src)
1586 1586 //{
1587 public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) 1587 // c++;
1588 { 1588 // if (c > s)
1589 // SortedList<string, LSL_Types.list> sorted = new SortedList<string, LSL_Types.list>(); 1589 // {
1590 // Add chunks to an array 1590 // sorted.Add(chunkString, chunk);
1591 //int s = stride; 1591 // chunkString = "";
1592 //if (s < 1) 1592 // chunk = new LSL_Types.list();
1593 // s = 1; 1593 // c = 0;
1594 //int c = 0; 1594 // }
1595 //LSL_Types.list chunk = new LSL_Types.list(); 1595 // chunk.Add(element);
1596 //string chunkString = ""; 1596 // chunkString += element.ToString();
1597 //foreach (string element in src) 1597 //}
1598 //{ 1598 //if (chunk.Count > 0)
1599 // c++; 1599 // sorted.Add(chunkString, chunk);
1600 // if (c > s) 1600
1601 // { 1601 //LSL_Types.list ret = new LSL_Types.list();
1602 // sorted.Add(chunkString, chunk); 1602 //foreach (LSL_Types.list ls in sorted.Values)
1603 // chunkString = ""; 1603 //{
1604 // chunk = new LSL_Types.list(); 1604 // ret.AddRange(ls);
1605 // c = 0; 1605 //}
1606 // } 1606
1607 // chunk.Add(element); 1607 //if (ascending == LSL_BaseClass.TRUE)
1608 // chunkString += element.ToString(); 1608 // return ret;
1609 //} 1609 //ret.Reverse();
1610 //if (chunk.Count > 0) 1610 //return ret;
1611 // sorted.Add(chunkString, chunk); 1611 NotImplemented("llListSort");
1612 1612 return new LSL_Types.list();
1613 //LSL_Types.list ret = new LSL_Types.list(); 1613 }
1614 //foreach (LSL_Types.list ls in sorted.Values) 1614
1615 //{ 1615 public int llGetListLength(LSL_Types.list src)
1616 // ret.AddRange(ls); 1616 {
1617 //} 1617 return src.Length;
1618 1618 }
1619 //if (ascending == LSL_BaseClass.TRUE) 1619
1620 // return ret; 1620 public int llList2Integer(LSL_Types.list src, int index)
1621 //ret.Reverse(); 1621 {
1622 //return ret; 1622 if (index < 0)
1623 NotImplemented("llListSort"); 1623 {
1624 return new LSL_Types.list(); 1624 index = src.Length + index;
1625 } 1625 }
1626 1626 if (index >= src.Length)
1627 public int llGetListLength(LSL_Types.list src) 1627 {
1628 { 1628 return 0;
1629 return src.Length; 1629 }
1630 } 1630 return Convert.ToInt32(src.Data[index]);
1631 1631 }
1632 public int llList2Integer(LSL_Types.list src, int index) 1632
1633 { 1633 public double osList2Double(LSL_Types.list src, int index)
1634 if (index < 0) 1634 {
1635 { 1635 if (index < 0)
1636 index = src.Length + index; 1636 {
1637 } 1637 index = src.Length + index;
1638 if (index >= src.Length) 1638 }
1639 { 1639 if (index >= src.Length)
1640 return 0; 1640 {
1641 } 1641 return 0.0;
1642 return Convert.ToInt32(src.Data[index]); 1642 }
1643 } 1643 return Convert.ToDouble(src.Data[index]);
1644 1644 }
1645 public double osList2Double(LSL_Types.list src, int index) 1645
1646 { 1646 public double llList2Float(LSL_Types.list src, int index)
1647 if (index < 0) 1647 {
1648 { 1648 if (index < 0)
1649 index = src.Length + index; 1649 {
1650 } 1650 index = src.Length + index;
1651 if (index >= src.Length) 1651 }
1652 { 1652 if (index >= src.Length)
1653 return 0.0; 1653 {
1654 } 1654 return 0.0;
1655 return Convert.ToDouble(src.Data[index]); 1655 }
1656 } 1656 return Convert.ToSingle(src.Data[index]);
1657 1657 }
1658 public double llList2Float(LSL_Types.list src, int index) 1658
1659 { 1659 public string llList2String(LSL_Types.list src, int index)
1660 if (index < 0) 1660 {
1661 { 1661 if (index < 0)
1662 index = src.Length + index; 1662 {
1663 } 1663 index = src.Length + index;
1664 if (index >= src.Length) 1664 }
1665 { 1665 if (index >= src.Length)
1666 return 0.0; 1666 {
1667 } 1667 return "";
1668 return Convert.ToSingle(src.Data[index]); 1668 }
1669 } 1669 return src.Data[index].ToString();
1670 1670 }
1671 public string llList2String(LSL_Types.list src, int index) 1671
1672 { 1672 public string llList2Key(LSL_Types.list src, int index)
1673 if (index < 0) 1673 {
1674 { 1674 if (index < 0)
1675 index = src.Length + index; 1675 {
1676 } 1676 index = src.Length + index;
1677 if (index >= src.Length) 1677 }
1678 { 1678 if (index >= src.Length)
1679 return ""; 1679 {
1680 } 1680 return "00000000-0000-0000-0000-000000000000";
1681 return src.Data[index].ToString(); 1681 }
1682 } 1682 //return OpenSim.Framework.ToString(src[index]);
1683 1683 LLUUID tmpkey;
1684 public string llList2Key(LSL_Types.list src, int index) 1684 if (LLUUID.TryParse(src.Data[index].ToString(), out tmpkey))
1685 { 1685 {
1686 if (index < 0) 1686 return tmpkey.ToString();
1687 { 1687 }
1688 index = src.Length + index; 1688 else
1689 } 1689 {
1690 if (index >= src.Length) 1690 return "00000000-0000-0000-0000-000000000000";
1691 { 1691 }
1692 return "00000000-0000-0000-0000-000000000000"; 1692 }
1693 } 1693
1694 //return OpenSim.Framework.ToString(src[index]); 1694 public LSL_Types.Vector3 llList2Vector(LSL_Types.list src, int index)
1695 LLUUID tmpkey; 1695 {
1696 if (LLUUID.TryParse(src.Data[index].ToString(), out tmpkey)) 1696 if (index < 0)
1697 { 1697 {
1698 return tmpkey.ToString(); 1698 index = src.Length + index;
1699 } 1699 }
1700 else 1700 if (index >= src.Length)
1701 { 1701 {
1702 return "00000000-0000-0000-0000-000000000000"; 1702 return new LSL_Types.Vector3(0, 0, 0);
1703 } 1703 }
1704 } 1704 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3))
1705 1705 {
1706 public LSL_Types.Vector3 llList2Vector(LSL_Types.list src, int index) 1706 return (LSL_Types.Vector3)src.Data[index];
1707 { 1707 }
1708 if (index < 0) 1708 else
1709 { 1709 {
1710 index = src.Length + index; 1710 return new LSL_Types.Vector3(0, 0, 0);
1711 } 1711 }
1712 if (index >= src.Length) 1712 }
1713 { 1713
1714 return new LSL_Types.Vector3(0, 0, 0); 1714 public LSL_Types.Quaternion llList2Rot(LSL_Types.list src, int index)
1715 } 1715 {
1716 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3)) 1716 if (index < 0)
1717 { 1717 {
1718 return (LSL_Types.Vector3)src.Data[index]; 1718 index = src.Length + index;
1719 } 1719 }
1720 else 1720 if (index >= src.Length)
1721 { 1721 {
1722 return new LSL_Types.Vector3(0, 0, 0); 1722 return new LSL_Types.Quaternion(0, 0, 0, 1);
1723 } 1723 }
1724 } 1724 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion))
1725 1725 {
1726 public LSL_Types.Quaternion llList2Rot(LSL_Types.list src, int index) 1726 return (LSL_Types.Quaternion)src.Data[index];
1727 { 1727 }
1728 if (index < 0) 1728 else
1729 { 1729 {
1730 index = src.Length + index; 1730 return new LSL_Types.Quaternion(0, 0, 0, 1);
1731 } 1731 }
1732 if (index >= src.Length) 1732 }
1733 { 1733
1734 return new LSL_Types.Quaternion(0, 0, 0, 1); 1734 public LSL_Types.list llList2List(LSL_Types.list src, int start, int end)
1735 } 1735 {
1736 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion)) 1736 return src.GetSublist(start, end);
1737 { 1737 }
1738 return (LSL_Types.Quaternion)src.Data[index]; 1738
1739 } 1739 public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end)
1740 else 1740 {
1741 { 1741 //LSL_Types.list ret = new LSL_Types.list(src);
1742 return new LSL_Types.Quaternion(0, 0, 0, 1); 1742 //ret.RemoveRange(start, end - start);
1743 } 1743 //return ret;
1744 } 1744
1745 1745 // Just a hunch - needs testing
1746 public LSL_Types.list llList2List(LSL_Types.list src, int start, int end) 1746 return src.GetSublist(end, start);
1747 { 1747 }
1748 return src.GetSublist(start, end); 1748
1749 } 1749 public int llGetListEntryType(LSL_Types.list src, int index)
1750 1750 {
1751 public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end) 1751 if (index < 0)
1752 { 1752 {
1753 //LSL_Types.list ret = new LSL_Types.list(src); 1753 index = src.Length + index;
1754 //ret.RemoveRange(start, end - start); 1754 }
1755 //return ret; 1755 if (index >= src.Length)
1756 1756 {
1757 // Just a hunch - needs testing 1757 return 0;
1758 return src.GetSublist(end, start); 1758 }
1759 } 1759
1760 1760 if (src.Data[index] is System.Int32)
1761 public int llGetListEntryType(LSL_Types.list src, int index) 1761 return 1;
1762 { 1762 if (src.Data[index] is System.Double)
1763 if (index < 0) 1763 return 2;
1764 { 1764 if (src.Data[index] is System.String)
1765 index = src.Length + index; 1765 {
1766 } 1766 LLUUID tuuid;
1767 if (index >= src.Length) 1767 if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid))
1768 { 1768 {
1769 return 0; 1769 return 3;
1770 } 1770 }
1771 1771 else
1772 if (src.Data[index] is System.Int32) 1772 {
1773 return 1; 1773 return 4;
1774 if (src.Data[index] is System.Double) 1774 }
1775 return 2; 1775 }
1776 if (src.Data[index] is System.String) 1776 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3)
1777 { 1777 return 5;
1778 LLUUID tuuid; 1778 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion)
1779 if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid)) 1779 return 6;
1780 { 1780 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.list)
1781 return 3; 1781 return 7;
1782 } 1782 return 0;
1783 else 1783
1784 { 1784 }
1785 return 4; 1785
1786 } 1786 public string llList2CSV(LSL_Types.list src)
1787 } 1787 {
1788 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3) 1788 string ret = "";
1789 return 5; 1789 foreach (object o in src.Data)
1790 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion) 1790 {
1791 return 6; 1791 ret = ret + o.ToString() + ",";
1792 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.list) 1792 }
1793 return 7; 1793 ret = ret.Substring(0, ret.Length - 2);
1794 return 0; 1794 return ret;
1795 1795 }
1796 } 1796
1797 1797 public LSL_Types.list llCSV2List(string src)
1798 public string llList2CSV(LSL_Types.list src) 1798 {
1799 { 1799 return new LSL_Types.list(src.Split(",".ToCharArray()));
1800 string ret = ""; 1800 }
1801 foreach (object o in src.Data) 1801
1802 { 1802 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride)
1803 ret = ret + o.ToString() + ","; 1803 {
1804 } 1804 //int s = stride;
1805 ret = ret.Substring(0, ret.Length - 2); 1805 //if (s < 1)
1806 return ret; 1806 // s = 1;
1807 } 1807
1808 1808 // This is a cowardly way of doing it ;)
1809 public LSL_Types.list llCSV2List(string src) 1809 // TODO: Instead, randomize and check if random is mod stride or if it can not be, then array.removerange
1810 { 1810 //List<LSL_Types.list> tmp = new List<LSL_Types.list>();
1811 return new LSL_Types.list(src.Split(",".ToCharArray())); 1811
1812 } 1812 // Add chunks to an array
1813 1813 //int c = 0;
1814 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) 1814 //LSL_Types.list chunk = new LSL_Types.list();
1815 { 1815 //foreach (string element in src)
1816 //int s = stride; 1816 //{
1817 //if (s < 1) 1817 // c++;
1818 // s = 1; 1818 // if (c > s)
1819 1819 // {
1820 // This is a cowardly way of doing it ;) 1820 // tmp.Add(chunk);
1821 // TODO: Instead, randomize and check if random is mod stride or if it can not be, then array.removerange 1821 // chunk = new LSL_Types.list();
1822 //List<LSL_Types.list> tmp = new List<LSL_Types.list>(); 1822 // c = 0;
1823 1823 // }
1824 // Add chunks to an array 1824 // chunk.Add(element);
1825 //int c = 0; 1825 //}
1826 //LSL_Types.list chunk = new LSL_Types.list(); 1826 //if (chunk.Count > 0)
1827 //foreach (string element in src) 1827 // tmp.Add(chunk);
1828 //{ 1828
1829 // c++; 1829 // Decreate (<- what kind of word is that? :D ) array back into a list
1830 // if (c > s) 1830 //int rnd;
1831 // { 1831 //LSL_Types.list ret = new LSL_Types.list();
1832 // tmp.Add(chunk); 1832 //while (tmp.Count > 0)
1833 // chunk = new LSL_Types.list(); 1833 //{
1834 // c = 0; 1834 // rnd = Util.RandomClass.Next(tmp.Count);
1835 // } 1835 // foreach (string str in tmp[rnd])
1836 // chunk.Add(element); 1836 // {
1837 //} 1837 // ret.Add(str);
1838 //if (chunk.Count > 0) 1838 // }
1839 // tmp.Add(chunk); 1839 // tmp.RemoveAt(rnd);
1840 1840 //}
1841 // Decreate (<- what kind of word is that? :D ) array back into a list 1841
1842 //int rnd; 1842 //return ret;
1843 //LSL_Types.list ret = new LSL_Types.list(); 1843 NotImplemented("llListRandomize");
1844 //while (tmp.Count > 0) 1844 return new LSL_Types.list();
1845 //{ 1845 }
1846 // rnd = Util.RandomClass.Next(tmp.Count); 1846
1847 // foreach (string str in tmp[rnd]) 1847 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride)
1848 // { 1848 {
1849 // ret.Add(str); 1849 LSL_Types.list ret = new LSL_Types.list();
1850 // } 1850 //int s = stride;
1851 // tmp.RemoveAt(rnd); 1851 //if (s < 1)
1852 //} 1852 // s = 1;
1853 1853
1854 //return ret; 1854 //int sc = s;
1855 NotImplemented("llListRandomize"); 1855 //for (int i = start; i < src.Count; i++)
1856 return new LSL_Types.list(); 1856 //{
1857 } 1857 // sc--;
1858 1858 // if (sc == 0)
1859 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) 1859 // {
1860 { 1860 // sc = s;
1861 LSL_Types.list ret = new LSL_Types.list(); 1861 // // Addthis
1862 //int s = stride; 1862 // ret.Add(src[i]);
1863 //if (s < 1) 1863 // }
1864 // s = 1; 1864 // if (i == end)
1865 1865 // break;
1866 //int sc = s; 1866 //}
1867 //for (int i = start; i < src.Count; i++) 1867 NotImplemented("llList2ListStrided");
1868 //{ 1868 return ret;
1869 // sc--; 1869 }
1870 // if (sc == 0) 1870
1871 // { 1871 public LSL_Types.Vector3 llGetRegionCorner()
1872 // sc = s; 1872 {
1873 // // Addthis 1873 return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0);
1874 // ret.Add(src[i]); 1874 }
1875 // } 1875
1876 // if (i == end) 1876 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start)
1877 // break; 1877 {
1878 //} 1878 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(start, -1);
1879 NotImplemented("llList2ListStrided"); 1879 }
1880 return ret; 1880
1881 } 1881 public int llListFindList(LSL_Types.list src, LSL_Types.list test)
1882 1882 {
1883 public LSL_Types.Vector3 llGetRegionCorner() 1883 //foreach (string s in test)
1884 { 1884 //{
1885 return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0); 1885 // for (int ci = 0; ci < src.Count; ci++)
1886 } 1886 // {
1887 1887 // if (s == src[ci])
1888 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start) 1888 // return ci;
1889 { 1889 // }
1890 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(start, -1); 1890 //}
1891 } 1891 NotImplemented("llListFindList");
1892 1892 return -1;
1893 public int llListFindList(LSL_Types.list src, LSL_Types.list test) 1893 }
1894 { 1894
1895 //foreach (string s in test) 1895 public string llGetObjectName()
1896 //{ 1896 {
1897 // for (int ci = 0; ci < src.Count; ci++) 1897 return m_host.Name;
1898 // { 1898 }
1899 // if (s == src[ci]) 1899
1900 // return ci; 1900 public void llSetObjectName(string name)
1901 // } 1901 {
1902 //} 1902 m_host.Name = name;
1903 NotImplemented("llListFindList"); 1903 }
1904 return -1; 1904
1905 } 1905 public string llGetDate()
1906 1906 {
1907 public string llGetObjectName() 1907 DateTime date = DateTime.Now.ToUniversalTime();
1908 { 1908 string result = date.ToString("yyyy-MM-dd");
1909 return m_host.Name; 1909 return result;
1910 } 1910 }
1911 1911
1912 public void llSetObjectName(string name) 1912 public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir)
1913 { 1913 {
1914 m_host.Name = name; 1914 NotImplemented("llEdgeOfWorld");
1915 } 1915 return 0;
1916 1916 }
1917 public string llGetDate() 1917
1918 { 1918 public int llGetAgentInfo(string id)
1919 DateTime date = DateTime.Now.ToUniversalTime(); 1919 {
1920 string result = date.ToString("yyyy-MM-dd"); 1920 NotImplemented("llGetAgentInfo");
1921 return result; 1921 return 0;
1922 } 1922 }
1923 1923
1924 public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) 1924 public void llAdjustSoundVolume(double volume)
1925 { 1925 {
1926 NotImplemented("llEdgeOfWorld"); 1926 NotImplemented("llAdjustSoundVolume");
1927 return 0; 1927 }
1928 } 1928
1929 1929 public void llSetSoundQueueing(int queue)
1930 public int llGetAgentInfo(string id) 1930 {
1931 { 1931 NotImplemented("llSetSoundQueueing");
1932 NotImplemented("llGetAgentInfo"); 1932 }
1933 return 0; 1933
1934 } 1934 public void llSetSoundRadius(double radius)
1935 1935 {
1936 public void llAdjustSoundVolume(double volume) 1936 NotImplemented("llSetSoundRadius");
1937 { 1937 }
1938 NotImplemented("llAdjustSoundVolume"); 1938
1939 } 1939 public string llKey2Name(string id)
1940 1940 {
1941 public void llSetSoundQueueing(int queue) 1941 NotImplemented("llKey2Name");
1942 { 1942 return "";
1943 NotImplemented("llSetSoundQueueing"); 1943 }
1944 } 1944
1945 1945 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
1946 public void llSetSoundRadius(double radius) 1946 {
1947 { 1947 NotImplemented("llSetTextureAnim");
1948 NotImplemented("llSetSoundRadius"); 1948 }
1949 } 1949
1950 1950 public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east,
1951 public string llKey2Name(string id) 1951 LSL_Types.Vector3 bottom_south_west)
1952 { 1952 {
1953 NotImplemented("llKey2Name"); 1953 NotImplemented("llTriggerSoundLimited");
1954 return ""; 1954 }
1955 } 1955
1956 1956 public void llEjectFromLand(string pest)
1957 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) 1957 {
1958 { 1958 NotImplemented("llEjectFromLand");
1959 NotImplemented("llSetTextureAnim"); 1959 }
1960 } 1960
1961 1961 public void llParseString2List()
1962 public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, 1962 {
1963 LSL_Types.Vector3 bottom_south_west) 1963 NotImplemented("llParseString2List");
1964 { 1964 }
1965 NotImplemented("llTriggerSoundLimited"); 1965
1966 } 1966 public int llOverMyLand(string id)
1967 1967 {
1968 public void llEjectFromLand(string pest) 1968 NotImplemented("llOverMyLand");
1969 { 1969 return 0;
1970 NotImplemented("llEjectFromLand"); 1970 }
1971 } 1971
1972 1972 public string llGetLandOwnerAt(LSL_Types.Vector3 pos)
1973 public void llParseString2List() 1973 {
1974 { 1974 return World.GetLandOwner((float)pos.x, (float)pos.y).ToString();
1975 NotImplemented("llParseString2List"); 1975 }
1976 } 1976
1977 1977 public string llGetNotecardLine(string name, int line)
1978 public int llOverMyLand(string id) 1978 {
1979 { 1979 NotImplemented("llGetNotecardLine");
1980 NotImplemented("llOverMyLand"); 1980 return "";
1981 return 0; 1981 }
1982 } 1982
1983 1983 public LSL_Types.Vector3 llGetAgentSize(string id)
1984 public string llGetLandOwnerAt(LSL_Types.Vector3 pos) 1984 {
1985 { 1985 NotImplemented("llGetAgentSize");
1986 return World.GetLandOwner((float)pos.x, (float)pos.y).ToString(); 1986 return new LSL_Types.Vector3();
1987 } 1987 }
1988 1988
1989 public string llGetNotecardLine(string name, int line) 1989 public int llSameGroup(string agent)
1990 { 1990 {
1991 NotImplemented("llGetNotecardLine"); 1991 NotImplemented("llSameGroup");
1992 return ""; 1992 return 0;
1993 } 1993 }
1994 1994
1995 public LSL_Types.Vector3 llGetAgentSize(string id) 1995 public void llUnSit(string id)
1996 { 1996 {
1997 NotImplemented("llGetAgentSize"); 1997 NotImplemented("llUnSit");
1998 return new LSL_Types.Vector3(); 1998 }
1999 } 1999
2000 2000 public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset)
2001 public int llSameGroup(string agent) 2001 {
2002 { 2002 NotImplemented("llGroundSlope");
2003 NotImplemented("llSameGroup"); 2003 return new LSL_Types.Vector3();
2004 return 0; 2004 }
2005 } 2005
2006 2006 public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset)
2007 public void llUnSit(string id) 2007 {
2008 { 2008 NotImplemented("llGroundNormal");
2009 NotImplemented("llUnSit"); 2009 return new LSL_Types.Vector3();
2010 } 2010 }
2011 2011
2012 public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) 2012 public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset)
2013 { 2013 {
2014 NotImplemented("llGroundSlope"); 2014 NotImplemented("llGroundContour");
2015 return new LSL_Types.Vector3(); 2015 return new LSL_Types.Vector3();
2016 } 2016 }
2017 2017
2018 public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) 2018 public int llGetAttached()
2019 { 2019 {
2020 NotImplemented("llGroundNormal"); 2020 NotImplemented("llGetAttached");
2021 return new LSL_Types.Vector3(); 2021 return 0;
2022 } 2022 }
2023 2023
2024 public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) 2024 public int llGetFreeMemory()
2025 { 2025 {
2026 NotImplemented("llGroundContour"); 2026 NotImplemented("llGetFreeMemory");
2027 return new LSL_Types.Vector3(); 2027 return 0;
2028 } 2028 }
2029 2029
2030 public int llGetAttached() 2030 public string llGetRegionName()
2031 { 2031 {
2032 NotImplemented("llGetAttached"); 2032 return World.RegionInfo.RegionName;
2033 return 0; 2033 }
2034 } 2034
2035 2035 public double llGetRegionTimeDilation()
2036 public int llGetFreeMemory() 2036 {
2037 { 2037 return (double)World.TimeDilation;
2038 NotImplemented("llGetFreeMemory"); 2038 }
2039 return 0; 2039
2040 } 2040 public double llGetRegionFPS()
2041 2041 {
2042 public string llGetRegionName() 2042 return 10.0f;
2043 { 2043 }
2044 return World.RegionInfo.RegionName; 2044
2045 } 2045 /* particle system rules should be coming into this routine as doubles, that is
2046 2046 rule[0] should be an integer from this list and rule[1] should be the arg
2047 public double llGetRegionTimeDilation() 2047 for the same integer. wiki.secondlife.com has most of this mapping, but some
2048 { 2048 came from http://www.caligari-designs.com/p4u2
2049 return (double)World.TimeDilation; 2049
2050 } 2050 We iterate through the list for 'Count' elements, incrementing by two for each
2051 2051 iteration and set the members of Primitive.ParticleSystem, one at a time.
2052 public double llGetRegionFPS() 2052 */
2053 { 2053
2054 return 10.0f; 2054 public enum PrimitiveRule : int
2055 } 2055 {
2056 2056 PSYS_PART_FLAGS = 0,
2057 /* particle system rules should be coming into this routine as doubles, that is 2057 PSYS_PART_START_COLOR = 1,
2058 rule[0] should be an integer from this list and rule[1] should be the arg 2058 PSYS_PART_START_ALPHA = 2,
2059 for the same integer. wiki.secondlife.com has most of this mapping, but some 2059 PSYS_PART_END_COLOR = 3,
2060 came from http://www.caligari-designs.com/p4u2 2060 PSYS_PART_END_ALPHA = 4,
2061 2061 PSYS_PART_START_SCALE = 5,
2062 We iterate through the list for 'Count' elements, incrementing by two for each 2062 PSYS_PART_END_SCALE = 6,
2063 iteration and set the members of Primitive.ParticleSystem, one at a time. 2063 PSYS_PART_MAX_AGE = 7,
2064 */ 2064 PSYS_SRC_ACCEL = 8,
2065 2065 PSYS_SRC_PATTERN = 9,
2066 public enum PrimitiveRule : int 2066 PSYS_SRC_TEXTURE = 12,
2067 { 2067 PSYS_SRC_BURST_RATE = 13,
2068 PSYS_PART_FLAGS = 0, 2068 PSYS_SRC_BURST_PART_COUNT = 15,
2069 PSYS_PART_START_COLOR = 1, 2069 PSYS_SRC_BURST_RADIUS = 16,
2070 PSYS_PART_START_ALPHA = 2, 2070 PSYS_SRC_BURST_SPEED_MIN = 17,
2071 PSYS_PART_END_COLOR = 3, 2071 PSYS_SRC_BURST_SPEED_MAX = 18,
2072 PSYS_PART_END_ALPHA = 4, 2072 PSYS_SRC_MAX_AGE = 19,
2073 PSYS_PART_START_SCALE = 5, 2073 PSYS_SRC_TARGET_KEY = 20,
2074 PSYS_PART_END_SCALE = 6, 2074 PSYS_SRC_OMEGA = 21,
2075 PSYS_PART_MAX_AGE = 7, 2075 PSYS_SRC_ANGLE_BEGIN = 22,
2076 PSYS_SRC_ACCEL = 8, 2076 PSYS_SRC_ANGLE_END = 23
2077 PSYS_SRC_PATTERN = 9, 2077 }
2078 PSYS_SRC_TEXTURE = 12, 2078
2079 PSYS_SRC_BURST_RATE = 13, 2079 public void llParticleSystem(List<Object> rules)
2080 PSYS_SRC_BURST_PART_COUNT = 15, 2080 {
2081 PSYS_SRC_BURST_RADIUS = 16, 2081 Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
2082 PSYS_SRC_BURST_SPEED_MIN = 17, 2082 for (int i = 0; i < rules.Count; i += 2)
2083 PSYS_SRC_BURST_SPEED_MAX = 18, 2083 {
2084 PSYS_SRC_MAX_AGE = 19, 2084 switch ((int)rules[i])
2085 PSYS_SRC_TARGET_KEY = 20, 2085 {
2086 PSYS_SRC_OMEGA = 21, 2086 case (int)LSL_BaseClass.PSYS_PART_FLAGS:
2087 PSYS_SRC_ANGLE_BEGIN = 22, 2087 prules.PartFlags = (uint)rules[i + 1];
2088 PSYS_SRC_ANGLE_END = 23 2088 break;
2089 } 2089
2090 2090 case (int)LSL_BaseClass.PSYS_PART_START_COLOR:
2091 public void llParticleSystem(List<Object> rules) 2091 prules.PartStartColor = (LLColor)rules[i + 1];
2092 { 2092 break;
2093 Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); 2093
2094 for (int i = 0; i < rules.Count; i += 2) 2094 case (int)LSL_BaseClass.PSYS_PART_START_ALPHA:
2095 { 2095 //what is the cast? prules.PartStartColor = (LSL_Types.Vec)rules[i + 1];
2096 switch ((int)rules[i]) 2096 break;
2097 { 2097
2098 case (int)LSL_BaseClass.PSYS_PART_FLAGS: 2098 case (int)LSL_BaseClass.PSYS_PART_END_COLOR:
2099 prules.PartFlags = (uint)rules[i + 1]; 2099 prules.PartEndColor = (LLColor)rules[i + 1];
2100 break; 2100 break;
2101 2101
2102 case (int)LSL_BaseClass.PSYS_PART_START_COLOR: 2102 case (int)LSL_BaseClass.PSYS_PART_END_ALPHA:
2103 prules.PartStartColor = (LLColor)rules[i + 1]; 2103 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2104 break; 2104 break;
2105 2105
2106 case (int)LSL_BaseClass.PSYS_PART_START_ALPHA: 2106 case (int)LSL_BaseClass.PSYS_PART_START_SCALE:
2107 //what is the cast? prules.PartStartColor = (LSL_Types.Vec)rules[i + 1]; 2107 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2108 break; 2108 break;
2109 2109
2110 case (int)LSL_BaseClass.PSYS_PART_END_COLOR: 2110 case (int)LSL_BaseClass.PSYS_PART_END_SCALE:
2111 prules.PartEndColor = (LLColor)rules[i + 1]; 2111 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2112 break; 2112 break;
2113 2113
2114 case (int)LSL_BaseClass.PSYS_PART_END_ALPHA: 2114 case (int)LSL_BaseClass.PSYS_PART_MAX_AGE:
2115 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2115 prules.MaxAge = (float)rules[i + 1];
2116 break; 2116 break;
2117 2117
2118 case (int)LSL_BaseClass.PSYS_PART_START_SCALE: 2118 case (int)LSL_BaseClass.PSYS_SRC_ACCEL:
2119 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2119 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2120 break; 2120 break;
2121 2121
2122 case (int)LSL_BaseClass.PSYS_PART_END_SCALE: 2122 case (int)LSL_BaseClass.PSYS_SRC_PATTERN:
2123 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2123 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2124 break; 2124 break;
2125 2125
2126 case (int)LSL_BaseClass.PSYS_PART_MAX_AGE: 2126 case (int)LSL_BaseClass.PSYS_SRC_TEXTURE:
2127 prules.MaxAge = (float)rules[i + 1]; 2127 prules.Texture = (LLUUID)rules[i + 1];
2128 break; 2128 break;
2129 2129
2130 case (int)LSL_BaseClass.PSYS_SRC_ACCEL: 2130 case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE:
2131 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2131 prules.BurstRate = (float)rules[i + 1];
2132 break; 2132 break;
2133 2133
2134 case (int)LSL_BaseClass.PSYS_SRC_PATTERN: 2134 case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT:
2135 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2135 prules.BurstPartCount = (byte)rules[i + 1];
2136 break; 2136 break;
2137 2137
2138 case (int)LSL_BaseClass.PSYS_SRC_TEXTURE: 2138 case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS:
2139 prules.Texture = (LLUUID)rules[i + 1]; 2139 prules.BurstRadius = (float)rules[i + 1];
2140 break; 2140 break;
2141 2141
2142 case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE: 2142 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN:
2143 prules.BurstRate = (float)rules[i + 1]; 2143 prules.BurstSpeedMin = (float)rules[i + 1];
2144 break; 2144 break;
2145 2145
2146 case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT: 2146 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX:
2147 prules.BurstPartCount = (byte)rules[i + 1]; 2147 prules.BurstSpeedMax = (float)rules[i + 1];
2148 break; 2148 break;
2149 2149
2150 case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS: 2150 case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE:
2151 prules.BurstRadius = (float)rules[i + 1]; 2151 prules.MaxAge = (float)rules[i + 1];
2152 break; 2152 break;
2153 2153
2154 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN: 2154 case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY:
2155 prules.BurstSpeedMin = (float)rules[i + 1]; 2155 prules.Target = (LLUUID)rules[i + 1];
2156 break; 2156 break;
2157 2157
2158 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX: 2158 case (int)LSL_BaseClass.PSYS_SRC_OMEGA:
2159 prules.BurstSpeedMax = (float)rules[i + 1]; 2159 //cast?? prules.MaxAge = (float)rules[i + 1];
2160 break; 2160 break;
2161 2161
2162 case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE: 2162 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN:
2163 prules.MaxAge = (float)rules[i + 1]; 2163 prules.InnerAngle = (float)rules[i + 1];
2164 break; 2164 break;
2165 2165
2166 case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY: 2166 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END:
2167 prules.Target = (LLUUID)rules[i + 1]; 2167 prules.OuterAngle = (float)rules[i + 1];
2168 break; 2168 break;
2169 2169 }
2170 case (int)LSL_BaseClass.PSYS_SRC_OMEGA: 2170 }
2171 //cast?? prules.MaxAge = (float)rules[i + 1]; 2171
2172 break; 2172 m_host.AddNewParticleSystem(prules);
2173 2173 }
2174 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN: 2174
2175 prules.InnerAngle = (float)rules[i + 1]; 2175 public void llGroundRepel(double height, int water, double tau)
2176 break; 2176 {
2177 2177 NotImplemented("llGroundRepel");
2178 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END: 2178 }
2179 prules.OuterAngle = (float)rules[i + 1]; 2179
2180 break; 2180 public void llGiveInventoryList()
2181 } 2181 {
2182 } 2182 NotImplemented("llGiveInventoryList");
2183 2183 }
2184 m_host.AddNewParticleSystem(prules); 2184
2185 } 2185 public void llSetVehicleType(int type)
2186 2186 {
2187 public void llGroundRepel(double height, int water, double tau) 2187 NotImplemented("llSetVehicleType");
2188 { 2188 }
2189 NotImplemented("llGroundRepel"); 2189
2190 } 2190 public void llSetVehicledoubleParam(int param, double value)
2191 2191 {
2192 public void llGiveInventoryList() 2192 NotImplemented("llSetVehicledoubleParam");
2193 { 2193 }
2194 NotImplemented("llGiveInventoryList"); 2194
2195 } 2195 public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec)
2196 2196 {
2197 public void llSetVehicleType(int type) 2197 NotImplemented("llSetVehicleVectorParam");
2198 { 2198 }
2199 NotImplemented("llSetVehicleType"); 2199
2200 } 2200 public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot)
2201 2201 {
2202 public void llSetVehicledoubleParam(int param, double value) 2202 NotImplemented("llSetVehicleRotationParam");
2203 { 2203 }
2204 NotImplemented("llSetVehicledoubleParam"); 2204
2205 } 2205 public void llSetVehicleFlags(int flags)
2206 2206 {
2207 public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) 2207 NotImplemented("llSetVehicleFlags");
2208 { 2208 }
2209 NotImplemented("llSetVehicleVectorParam"); 2209
2210 } 2210 public void llRemoveVehicleFlags(int flags)
2211 2211 {
2212 public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) 2212 NotImplemented("llRemoveVehicleFlags");
2213 { 2213 }
2214 NotImplemented("llSetVehicleRotationParam"); 2214
2215 } 2215 public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot)
2216 2216 {
2217 public void llSetVehicleFlags(int flags) 2217 // LSL quaternions can normalize to 0, normal Quaternions can't.
2218 { 2218 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
2219 NotImplemented("llSetVehicleFlags"); 2219 rot.z = 1; // ZERO_ROTATION = 0,0,0,1
2220 } 2220
2221 2221 m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z));
2222 public void llRemoveVehicleFlags(int flags) 2222 }
2223 { 2223
2224 NotImplemented("llRemoveVehicleFlags"); 2224 public string llAvatarOnSitTarget()
2225 } 2225 {
2226 2226 LLUUID AVID = m_host.GetAvatarOnSitTarget();
2227 public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) 2227
2228 { 2228 if (AVID != LLUUID.Zero)
2229 // LSL quaternions can normalize to 0, normal Quaternions can't. 2229 return AVID.ToString();
2230 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) 2230 else
2231 rot.z = 1; // ZERO_ROTATION = 0,0,0,1 2231 return "";
2232 2232 }
2233 m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z)); 2233
2234 } 2234 public void llAddToLandPassList(string avatar, double hours)
2235 2235 {
2236 public string llAvatarOnSitTarget() 2236 NotImplemented("llAddToLandPassList");
2237 { 2237 }
2238 LLUUID AVID = m_host.GetAvatarOnSitTarget(); 2238
2239 2239 public void llSetTouchText(string text)
2240 if (AVID != LLUUID.Zero) 2240 {
2241 return AVID.ToString(); 2241 m_host.TouchName = text;
2242 else 2242 }
2243 return ""; 2243
2244 } 2244 public void llSetSitText(string text)
2245 2245 {
2246 public void llAddToLandPassList(string avatar, double hours) 2246 m_host.SitName = text;
2247 { 2247 }
2248 NotImplemented("llAddToLandPassList"); 2248
2249 } 2249 public void llSetCameraEyeOffset(LSL_Types.Vector3 offset)
2250 2250 {
2251 public void llSetTouchText(string text) 2251 NotImplemented("llSetCameraEyeOffset");
2252 { 2252 }
2253 m_host.TouchName = text; 2253
2254 } 2254 public void llSetCameraAtOffset(LSL_Types.Vector3 offset)
2255 2255 {
2256 public void llSetSitText(string text) 2256 NotImplemented("llSetCameraAtOffset");
2257 { 2257 }
2258 m_host.SitName = text; 2258
2259 } 2259 public string llDumpList2String(LSL_Types.list src, string seperator)
2260 2260 {
2261 public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) 2261 if (src.Length == 0)
2262 { 2262 {
2263 NotImplemented("llSetCameraEyeOffset"); 2263 return "";
2264 } 2264 }
2265 2265 string ret = "";
2266 public void llSetCameraAtOffset(LSL_Types.Vector3 offset) 2266 foreach (object o in src.Data)
2267 { 2267 {
2268 NotImplemented("llSetCameraAtOffset"); 2268 ret = ret + o.ToString() + seperator;
2269 } 2269 }
2270 2270 ret = ret.Substring(0, ret.Length - seperator.Length);
2271 public string llDumpList2String(LSL_Types.list src, string seperator) 2271 return ret;
2272 { 2272 }
2273 if (src.Length == 0) 2273
2274 { 2274 public void llScriptDanger(LSL_Types.Vector3 pos)
2275 return ""; 2275 {
2276 } 2276 NotImplemented("llScriptDanger");
2277 string ret = ""; 2277 }
2278 foreach (object o in src.Data) 2278
2279 { 2279 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel)
2280 ret = ret + o.ToString() + seperator; 2280 {
2281 } 2281 NotImplemented("llDialog");
2282 ret = ret.Substring(0, ret.Length - seperator.Length); 2282 }
2283 return ret; 2283
2284 } 2284 public void llVolumeDetect(int detect)
2285 2285 {
2286 public void llScriptDanger(LSL_Types.Vector3 pos) 2286 NotImplemented("llVolumeDetect");
2287 { 2287 }
2288 NotImplemented("llScriptDanger"); 2288
2289 } 2289 public void llResetOtherScript(string name)
2290 2290 {
2291 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) 2291 NotImplemented("llResetOtherScript");
2292 { 2292 }
2293 NotImplemented("llDialog"); 2293
2294 } 2294 public int llGetScriptState(string name)
2295 2295 {
2296 public void llVolumeDetect(int detect) 2296 NotImplemented("llGetScriptState");
2297 { 2297 return 0;
2298 NotImplemented("llVolumeDetect"); 2298 }
2299 } 2299
2300 2300 public void llRemoteLoadScript()
2301 public void llResetOtherScript(string name) 2301 {
2302 { 2302 NotImplemented("llRemoteLoadScript");
2303 NotImplemented("llResetOtherScript"); 2303 }
2304 } 2304
2305 2305 public void llSetRemoteScriptAccessPin(int pin)
2306 public int llGetScriptState(string name) 2306 {
2307 { 2307 NotImplemented("llSetRemoteScriptAccessPin");
2308 NotImplemented("llGetScriptState"); 2308 }
2309 return 0; 2309
2310 } 2310 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param)
2311 2311 {
2312 public void llRemoteLoadScript() 2312 NotImplemented("llRemoteLoadScriptPin");
2313 { 2313 }
2314 NotImplemented("llRemoteLoadScript"); 2314
2315 } 2315 // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
2316 2316 // Not sure where these constants should live:
2317 public void llSetRemoteScriptAccessPin(int pin) 2317 // REMOTE_DATA_CHANNEL = 1
2318 { 2318 // REMOTE_DATA_REQUEST = 2
2319 NotImplemented("llSetRemoteScriptAccessPin"); 2319 // REMOTE_DATA_REPLY = 3
2320 } 2320 public void llOpenRemoteDataChannel()
2321 2321 {
2322 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) 2322 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
2323 { 2323 if (xmlrpcMod.IsEnabled())
2324 NotImplemented("llRemoteLoadScriptPin"); 2324 {
2325 } 2325 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID);
2326 2326 object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), "", 0, "" };
2327 // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) 2327 m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", resobj);
2328 // Not sure where these constants should live: 2328 }
2329 // REMOTE_DATA_CHANNEL = 1 2329 }
2330 // REMOTE_DATA_REQUEST = 2 2330
2331 // REMOTE_DATA_REPLY = 3 2331 public string llSendRemoteData(string channel, string dest, int idata, string sdata)
2332 public void llOpenRemoteDataChannel() 2332 {
2333 { 2333 NotImplemented("llSendRemoteData");
2334 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 2334 return "";
2335 if (xmlrpcMod.IsEnabled()) 2335 }
2336 { 2336
2337 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID); 2337 public void llRemoteDataReply(string channel, string message_id, string sdata, int idata)
2338 object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), "", 0, "" }; 2338 {
2339 m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", resobj); 2339 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
2340 } 2340 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
2341 } 2341 }
2342 2342
2343 public string llSendRemoteData(string channel, string dest, int idata, string sdata) 2343 public void llCloseRemoteDataChannel(string channel)
2344 { 2344 {
2345 NotImplemented("llSendRemoteData"); 2345 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
2346 return ""; 2346 xmlrpcMod.CloseXMLRPCChannel(channel);
2347 } 2347 }
2348 2348
2349 public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) 2349 public string llMD5String(string src, int nonce)
2350 { 2350 {
2351 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 2351 return Util.Md5Hash(src + ":" + nonce.ToString());
2352 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata); 2352 }
2353 } 2353
2354 2354 public void llSetPrimitiveParams(LSL_Types.list rules)
2355 public void llCloseRemoteDataChannel(string channel) 2355 {
2356 { 2356 NotImplemented("llSetPrimitiveParams");
2357 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 2357 }
2358 xmlrpcMod.CloseXMLRPCChannel(channel); 2358
2359 } 2359 public string llStringToBase64(string str)
2360 2360 {
2361 public string llMD5String(string src, int nonce) 2361 try
2362 { 2362 {
2363 return Util.Md5Hash(src + ":" + nonce.ToString()); 2363 byte[] encData_byte = new byte[str.Length];
2364 } 2364 encData_byte = Encoding.UTF8.GetBytes(str);
2365 2365 string encodedData = Convert.ToBase64String(encData_byte);
2366 public void llSetPrimitiveParams(LSL_Types.list rules) 2366 return encodedData;
2367 { 2367 }
2368 NotImplemented("llSetPrimitiveParams"); 2368 catch (Exception e)
2369 } 2369 {
2370 2370 throw new Exception("Error in base64Encode" + e.Message);
2371 public string llStringToBase64(string str) 2371 }
2372 { 2372 }
2373 try 2373
2374 { 2374 public string llBase64ToString(string str)
2375 byte[] encData_byte = new byte[str.Length]; 2375 {
2376 encData_byte = Encoding.UTF8.GetBytes(str); 2376 UTF8Encoding encoder = new UTF8Encoding();
2377 string encodedData = Convert.ToBase64String(encData_byte); 2377 Decoder utf8Decode = encoder.GetDecoder();
2378 return encodedData; 2378 try
2379 } 2379 {
2380 catch (Exception e) 2380 byte[] todecode_byte = Convert.FromBase64String(str);
2381 { 2381 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
2382 throw new Exception("Error in base64Encode" + e.Message); 2382 char[] decoded_char = new char[charCount];
2383 } 2383 utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
2384 } 2384 string result = new String(decoded_char);
2385 2385 return result;
2386 public string llBase64ToString(string str) 2386 }
2387 { 2387 catch (Exception e)
2388 UTF8Encoding encoder = new UTF8Encoding(); 2388 {
2389 Decoder utf8Decode = encoder.GetDecoder(); 2389 throw new Exception("Error in base64Decode" + e.Message);
2390 try 2390 }
2391 { 2391 }
2392 byte[] todecode_byte = Convert.FromBase64String(str); 2392
2393 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); 2393 public void llXorBase64Strings()
2394 char[] decoded_char = new char[charCount]; 2394 {
2395 utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0); 2395 throw new Exception("Command deprecated! Use llXorBase64StringsCorrect instead.");
2396 string result = new String(decoded_char); 2396 }
2397 return result; 2397
2398 } 2398 public void llRemoteDataSetRegion()
2399 catch (Exception e) 2399 {
2400 { 2400 NotImplemented("llRemoteDataSetRegion");
2401 throw new Exception("Error in base64Decode" + e.Message); 2401 }
2402 } 2402
2403 } 2403 public double llLog10(double val)
2404 2404 {
2405 public void llXorBase64Strings() 2405 return (double)Math.Log10(val);
2406 { 2406 }
2407 throw new Exception("Command deprecated! Use llXorBase64StringsCorrect instead."); 2407
2408 } 2408 public double llLog(double val)
2409 2409 {
2410 public void llRemoteDataSetRegion() 2410 return (double)Math.Log(val);
2411 { 2411 }
2412 NotImplemented("llRemoteDataSetRegion"); 2412
2413 } 2413 public LSL_Types.list llGetAnimationList(string id)
2414 2414 {
2415 public double llLog10(double val) 2415 NotImplemented("llGetAnimationList");
2416 { 2416 return new LSL_Types.list();
2417 return (double)Math.Log10(val); 2417 }
2418 } 2418
2419 2419 public void llSetParcelMusicURL(string url)
2420 public double llLog(double val) 2420 {
2421 { 2421 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
2422 return (double)Math.Log(val); 2422 if (landowner.Equals(null))
2423 } 2423 {
2424 2424 return;
2425 public LSL_Types.list llGetAnimationList(string id) 2425 }
2426 { 2426 if (landowner != m_host.ObjectOwner)
2427 NotImplemented("llGetAnimationList"); 2427 {
2428 return new LSL_Types.list(); 2428 return;
2429 } 2429 }
2430 2430 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url);
2431 public void llSetParcelMusicURL(string url) 2431 }
2432 { 2432
2433 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 2433 public LSL_Types.Vector3 llGetRootPosition()
2434 if (landowner.Equals(null)) 2434 {
2435 { 2435 return new LSL_Types.Vector3(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z);
2436 return; 2436 }
2437 } 2437
2438 if (landowner != m_host.ObjectOwner) 2438 public LSL_Types.Quaternion llGetRootRotation()
2439 { 2439 {
2440 return; 2440 return new LSL_Types.Quaternion(m_host.ParentGroup.GroupRotation.X, m_host.ParentGroup.GroupRotation.Y, m_host.ParentGroup.GroupRotation.Z, m_host.ParentGroup.GroupRotation.W);
2441 } 2441 }
2442 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); 2442
2443 } 2443 public string llGetObjectDesc()
2444 2444 {
2445 public LSL_Types.Vector3 llGetRootPosition() 2445 return m_host.Description;
2446 { 2446 }
2447 return new LSL_Types.Vector3(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z); 2447
2448 } 2448 public void llSetObjectDesc(string desc)
2449 2449 {
2450 public LSL_Types.Quaternion llGetRootRotation() 2450 m_host.Description = desc;
2451 { 2451 }
2452 return new LSL_Types.Quaternion(m_host.ParentGroup.GroupRotation.X, m_host.ParentGroup.GroupRotation.Y, m_host.ParentGroup.GroupRotation.Z, m_host.ParentGroup.GroupRotation.W); 2452
2453 } 2453 public string llGetCreator()
2454 2454 {
2455 public string llGetObjectDesc() 2455 return m_host.ObjectCreator.ToString();
2456 { 2456 }
2457 return m_host.Description; 2457
2458 } 2458 public string llGetTimestamp()
2459 2459 {
2460 public void llSetObjectDesc(string desc) 2460 return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
2461 { 2461 }
2462 m_host.Description = desc; 2462
2463 } 2463 public void llSetLinkAlpha(int linknumber, double alpha, int face)
2464 2464 {
2465 public string llGetCreator() 2465 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber);
2466 { 2466 if (linknumber > -1)
2467 return m_host.ObjectCreator.ToString(); 2467 {
2468 } 2468 LLObject.TextureEntry tex = part.Shape.Textures;
2469 2469 LLColor texcolor;
2470 public string llGetTimestamp() 2470 if (face > -1)
2471 { 2471 {
2472 return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); 2472 texcolor = tex.CreateFace((uint)face).RGBA;
2473 } 2473 texcolor.A = (float)Math.Abs(alpha - 1);
2474 2474 tex.FaceTextures[face].RGBA = texcolor;
2475 public void llSetLinkAlpha(int linknumber, double alpha, int face) 2475 part.UpdateTexture(tex);
2476 { 2476 return;
2477 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); 2477 }
2478 if (linknumber > -1) 2478 else if (face == -1)
2479 { 2479 {
2480 LLObject.TextureEntry tex = part.Shape.Textures; 2480 texcolor = tex.DefaultTexture.RGBA;
2481 LLColor texcolor; 2481 texcolor.A = (float)Math.Abs(alpha - 1);
2482 if (face > -1) 2482 tex.DefaultTexture.RGBA = texcolor;
2483 { 2483 for (uint i = 0; i < 32; i++)
2484 texcolor = tex.CreateFace((uint)face).RGBA; 2484 {
2485 texcolor.A = (float)Math.Abs(alpha - 1); 2485 if (tex.FaceTextures[i] != null)
2486 tex.FaceTextures[face].RGBA = texcolor; 2486 {
2487 part.UpdateTexture(tex); 2487 texcolor = tex.FaceTextures[i].RGBA;
2488 return; 2488 texcolor.A = (float)Math.Abs(alpha - 1);
2489 } 2489 tex.FaceTextures[i].RGBA = texcolor;
2490 else if (face == -1) 2490 }
2491 { 2491 }
2492 texcolor = tex.DefaultTexture.RGBA; 2492 texcolor = tex.DefaultTexture.RGBA;
2493 texcolor.A = (float)Math.Abs(alpha - 1); 2493 texcolor.A = (float)Math.Abs(alpha - 1);
2494 tex.DefaultTexture.RGBA = texcolor; 2494 tex.DefaultTexture.RGBA = texcolor;
2495 for (uint i = 0; i < 32; i++) 2495 part.UpdateTexture(tex);
2496 { 2496 return;
2497 if (tex.FaceTextures[i] != null) 2497 }
2498 { 2498 return;
2499 texcolor = tex.FaceTextures[i].RGBA; 2499 }
2500 texcolor.A = (float)Math.Abs(alpha - 1); 2500 else if (linknumber == -1)
2501 tex.FaceTextures[i].RGBA = texcolor; 2501 {
2502 } 2502 int num = m_host.ParentGroup.PrimCount;
2503 } 2503 for (int w = 0; w < num; w++)
2504 texcolor = tex.DefaultTexture.RGBA; 2504 {
2505 texcolor.A = (float)Math.Abs(alpha - 1); 2505 linknumber = w;
2506 tex.DefaultTexture.RGBA = texcolor; 2506 part = m_host.ParentGroup.GetLinkNumPart(linknumber);
2507 part.UpdateTexture(tex); 2507 LLObject.TextureEntry tex = part.Shape.Textures;
2508 return; 2508 LLColor texcolor;
2509 } 2509 if (face > -1)
2510 return; 2510 {
2511 } 2511 texcolor = tex.CreateFace((uint)face).RGBA;
2512 else if (linknumber == -1) 2512 texcolor.A = (float)Math.Abs(alpha - 1);
2513 { 2513 tex.FaceTextures[face].RGBA = texcolor;
2514 int num = m_host.ParentGroup.PrimCount; 2514 part.UpdateTexture(tex);
2515 for (int w = 0; w < num; w++) 2515 }
2516 { 2516 else if (face == -1)
2517 linknumber = w; 2517 {
2518 part = m_host.ParentGroup.GetLinkNumPart(linknumber); 2518 texcolor = tex.DefaultTexture.RGBA;
2519 LLObject.TextureEntry tex = part.Shape.Textures; 2519 texcolor.A = (float)Math.Abs(alpha - 1);
2520 LLColor texcolor; 2520 tex.DefaultTexture.RGBA = texcolor;
2521 if (face > -1) 2521 for (uint i = 0; i < 32; i++)
2522 { 2522 {
2523 texcolor = tex.CreateFace((uint)face).RGBA; 2523 if (tex.FaceTextures[i] != null)
2524 texcolor.A = (float)Math.Abs(alpha - 1); 2524 {
2525 tex.FaceTextures[face].RGBA = texcolor; 2525 texcolor = tex.FaceTextures[i].RGBA;
2526 part.UpdateTexture(tex); 2526 texcolor.A = (float)Math.Abs(alpha - 1);
2527 } 2527 tex.FaceTextures[i].RGBA = texcolor;
2528 else if (face == -1) 2528 }
2529 { 2529 }
2530 texcolor = tex.DefaultTexture.RGBA; 2530 texcolor = tex.DefaultTexture.RGBA;
2531 texcolor.A = (float)Math.Abs(alpha - 1); 2531 texcolor.A = (float)Math.Abs(alpha - 1);
2532 tex.DefaultTexture.RGBA = texcolor; 2532 tex.DefaultTexture.RGBA = texcolor;
2533 for (uint i = 0; i < 32; i++) 2533 part.UpdateTexture(tex);
2534 { 2534 }
2535 if (tex.FaceTextures[i] != null) 2535 }
2536 { 2536 return;
2537 texcolor = tex.FaceTextures[i].RGBA; 2537 }
2538 texcolor.A = (float)Math.Abs(alpha - 1); 2538 else
2539 tex.FaceTextures[i].RGBA = texcolor; 2539 {
2540 } 2540 NotImplemented("llSetLinkAlpha");
2541 } 2541 }
2542 texcolor = tex.DefaultTexture.RGBA; 2542 }
2543 texcolor.A = (float)Math.Abs(alpha - 1); 2543
2544 tex.DefaultTexture.RGBA = texcolor; 2544 public int llGetNumberOfPrims()
2545 part.UpdateTexture(tex); 2545 {
2546 } 2546 return m_host.ParentGroup.PrimCount;
2547 } 2547 }
2548 return; 2548
2549 } 2549 public string llGetNumberOfNotecardLines(string name)
2550 else 2550 {
2551 { 2551 NotImplemented("llGetNumberOfNotecardLines");
2552 NotImplemented("llSetLinkAlpha"); 2552 return "";
2553 } 2553 }
2554 } 2554
2555 2555 public LSL_Types.list llGetBoundingBox(string obj)
2556 public int llGetNumberOfPrims() 2556 {
2557 { 2557 NotImplemented("llGetBoundingBox");
2558 return m_host.ParentGroup.PrimCount; 2558 return new LSL_Types.list();
2559 } 2559 }
2560 2560
2561 public string llGetNumberOfNotecardLines(string name) 2561 public LSL_Types.Vector3 llGetGeometricCenter()
2562 { 2562 {
2563 NotImplemented("llGetNumberOfNotecardLines"); 2563 return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z);
2564 return ""; 2564 }
2565 } 2565
2566 2566 public void llGetPrimitiveParams()
2567 public LSL_Types.list llGetBoundingBox(string obj) 2567 {
2568 { 2568 NotImplemented("llGetPrimitiveParams");
2569 NotImplemented("llGetBoundingBox"); 2569 }
2570 return new LSL_Types.list(); 2570
2571 } 2571 public string llIntegerToBase64(int number)
2572 2572 {
2573 public LSL_Types.Vector3 llGetGeometricCenter() 2573 NotImplemented("llIntegerToBase64");
2574 { 2574 return "";
2575 return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); 2575 }
2576 } 2576
2577 2577 public int llBase64ToInteger(string str)
2578 public void llGetPrimitiveParams() 2578 {
2579 { 2579 NotImplemented("llBase64ToInteger");
2580 NotImplemented("llGetPrimitiveParams"); 2580 return 0;
2581 } 2581 }
2582 2582
2583 public string llIntegerToBase64(int number) 2583 public double llGetGMTclock()
2584 { 2584 {
2585 NotImplemented("llIntegerToBase64"); 2585 return DateTime.UtcNow.TimeOfDay.TotalSeconds;
2586 return ""; 2586 }
2587 } 2587
2588 2588 public string llGetSimulatorHostname()
2589 public int llBase64ToInteger(string str) 2589 {
2590 { 2590 return System.Environment.MachineName;
2591 NotImplemented("llBase64ToInteger"); 2591 }
2592 return 0; 2592
2593 } 2593 public void llSetLocalRot(LSL_Types.Quaternion rot)
2594 2594 {
2595 public double llGetGMTclock() 2595 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
2596 { 2596 }
2597 return DateTime.UtcNow.TimeOfDay.TotalSeconds; 2597
2598 } 2598 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers)
2599 2599 {
2600 public string llGetSimulatorHostname() 2600 NotImplemented("llParseStringKeepNulls");
2601 { 2601 return new LSL_Types.list();
2602 return System.Environment.MachineName; 2602 }
2603 } 2603
2604 2604 public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity,
2605 public void llSetLocalRot(LSL_Types.Quaternion rot) 2605 LSL_Types.Quaternion rot, int param)
2606 { 2606 {
2607 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); 2607 NotImplemented("llRezAtRoot");
2608 } 2608 }
2609 2609
2610 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers) 2610 public int llGetObjectPermMask(int mask)
2611 { 2611 {
2612 NotImplemented("llParseStringKeepNulls"); 2612 NotImplemented("llGetObjectPermMask");
2613 return new LSL_Types.list(); 2613 return 0;
2614 } 2614 }
2615 2615
2616 public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, 2616 public void llSetObjectPermMask(int mask, int value)
2617 LSL_Types.Quaternion rot, int param) 2617 {
2618 { 2618 NotImplemented("llSetObjectPermMask");
2619 NotImplemented("llRezAtRoot"); 2619 }
2620 } 2620
2621 2621 public void llGetInventoryPermMask(string item, int mask)
2622 public int llGetObjectPermMask(int mask) 2622 {
2623 { 2623 NotImplemented("llGetInventoryPermMask");
2624 NotImplemented("llGetObjectPermMask"); 2624 }
2625 return 0; 2625
2626 } 2626 public void llSetInventoryPermMask(string item, int mask, int value)
2627 2627 {
2628 public void llSetObjectPermMask(int mask, int value) 2628 NotImplemented("llSetInventoryPermMask");
2629 { 2629 }
2630 NotImplemented("llSetObjectPermMask"); 2630
2631 } 2631 public string llGetInventoryCreator(string item)
2632 2632 {
2633 public void llGetInventoryPermMask(string item, int mask) 2633 NotImplemented("llGetInventoryCreator");
2634 { 2634 return "";
2635 NotImplemented("llGetInventoryPermMask"); 2635 }
2636 } 2636
2637 2637 public void llOwnerSay(string msg)
2638 public void llSetInventoryPermMask(string item, int mask, int value) 2638 {
2639 { 2639 //temp fix so that lsl wiki examples aren't annoying to use to test other functions
2640 NotImplemented("llSetInventoryPermMask"); 2640 World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
2641 } 2641 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
2642 2642 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg);
2643 public string llGetInventoryCreator(string item) 2643 }
2644 { 2644
2645 NotImplemented("llGetInventoryCreator"); 2645 public void llRequestSimulatorData(string simulator, int data)
2646 return ""; 2646 {
2647 } 2647 NotImplemented("llRequestSimulatorData");
2648 2648 }
2649 public void llOwnerSay(string msg) 2649
2650 { 2650 public void llForceMouselook(int mouselook)
2651 //temp fix so that lsl wiki examples aren't annoying to use to test other functions 2651 {
2652 World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 2652 NotImplemented("llForceMouselook");
2653 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 2653 }
2654 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg); 2654
2655 } 2655 public double llGetObjectMass(string id)
2656 2656 {
2657 public void llRequestSimulatorData(string simulator, int data) 2657 NotImplemented("llGetObjectMass");
2658 { 2658 return 0;
2659 NotImplemented("llRequestSimulatorData"); 2659 }
2660 } 2660
2661 2661 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
2662 public void llForceMouselook(int mouselook) 2662 {
2663 { 2663 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1);
2664 NotImplemented("llForceMouselook"); 2664 }
2665 } 2665
2666 2666 public void llLoadURL(string avatar_id, string message, string url)
2667 public double llGetObjectMass(string id) 2667 {
2668 { 2668 LLUUID avatarId = new LLUUID(avatar_id);
2669 NotImplemented("llGetObjectMass"); 2669 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message,
2670 return 0; 2670 url);
2671 } 2671 }
2672 2672
2673 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) 2673 public void llParcelMediaCommandList(LSL_Types.list commandList)
2674 { 2674 {
2675 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1); 2675 NotImplemented("llParcelMediaCommandList");
2676 } 2676 }
2677 2677
2678 public void llLoadURL(string avatar_id, string message, string url) 2678 public void llParcelMediaQuery()
2679 { 2679 {
2680 LLUUID avatarId = new LLUUID(avatar_id); 2680 NotImplemented("llParcelMediaQuery");
2681 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, 2681 }
2682 url); 2682
2683 } 2683 public int llModPow(int a, int b, int c)
2684 2684 {
2685 public void llParcelMediaCommandList(LSL_Types.list commandList) 2685 Int64 tmp = 0;
2686 { 2686 Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp);
2687 NotImplemented("llParcelMediaCommandList"); 2687 return Convert.ToInt32(tmp);
2688 } 2688 }
2689 2689
2690 public void llParcelMediaQuery() 2690 public int llGetInventoryType(string name)
2691 { 2691 {
2692 NotImplemented("llParcelMediaQuery"); 2692 NotImplemented("llGetInventoryType");
2693 } 2693 return 0;
2694 2694 }
2695 public int llModPow(int a, int b, int c) 2695
2696 { 2696 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons)
2697 Int64 tmp = 0; 2697 {
2698 Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); 2698 NotImplemented("llSetPayPrice");
2699 return Convert.ToInt32(tmp); 2699 }
2700 } 2700
2701 2701 public LSL_Types.Vector3 llGetCameraPos()
2702 public int llGetInventoryType(string name) 2702 {
2703 { 2703 NotImplemented("llGetCameraPos");
2704 NotImplemented("llGetInventoryType"); 2704 return new LSL_Types.Vector3();
2705 return 0; 2705 }
2706 } 2706
2707 2707 public LSL_Types.Quaternion llGetCameraRot()
2708 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons) 2708 {
2709 { 2709 NotImplemented("llGetCameraRot");
2710 NotImplemented("llSetPayPrice"); 2710 return new LSL_Types.Quaternion();
2711 } 2711 }
2712 2712
2713 public LSL_Types.Vector3 llGetCameraPos() 2713 public void llSetPrimURL()
2714 { 2714 {
2715 NotImplemented("llGetCameraPos"); 2715 NotImplemented("llSetPrimURL");
2716 return new LSL_Types.Vector3(); 2716 }
2717 } 2717
2718 2718 public void llRefreshPrimURL()
2719 public LSL_Types.Quaternion llGetCameraRot() 2719 {
2720 { 2720 NotImplemented("llRefreshPrimURL");
2721 NotImplemented("llGetCameraRot"); 2721 }
2722 return new LSL_Types.Quaternion(); 2722
2723 } 2723 public string llEscapeURL(string url)
2724 2724 {
2725 public void llSetPrimURL() 2725 try
2726 { 2726 {
2727 NotImplemented("llSetPrimURL"); 2727 return Uri.EscapeUriString(url);
2728 } 2728 }
2729 2729 catch (Exception ex)
2730 public void llRefreshPrimURL() 2730 {
2731 { 2731 return "llEscapeURL: " + ex.ToString();
2732 NotImplemented("llRefreshPrimURL"); 2732 }
2733 } 2733 }
2734 2734
2735 public string llEscapeURL(string url) 2735 public string llUnescapeURL(string url)
2736 { 2736 {
2737 try 2737 try
2738 { 2738 {
2739 return Uri.EscapeUriString(url); 2739 return Uri.UnescapeDataString(url);
2740 } 2740 }
2741 catch (Exception ex) 2741 catch (Exception ex)
2742 { 2742 {
2743 return "llEscapeURL: " + ex.ToString(); 2743 return "llUnescapeURL: " + ex.ToString();
2744 } 2744 }
2745 } 2745 }
2746 2746
2747 public string llUnescapeURL(string url) 2747 public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at)
2748 { 2748 {
2749 try 2749 NotImplemented("llMapDestination");
2750 { 2750 }
2751 return Uri.UnescapeDataString(url); 2751
2752 } 2752 public void llAddToLandBanList(string avatar, double hours)
2753 catch (Exception ex) 2753 {
2754 { 2754 NotImplemented("llAddToLandBanList");
2755 return "llUnescapeURL: " + ex.ToString(); 2755 }
2756 } 2756
2757 } 2757 public void llRemoveFromLandPassList(string avatar)
2758 2758 {
2759 public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) 2759 NotImplemented("llRemoveFromLandPassList");
2760 { 2760 }
2761 NotImplemented("llMapDestination"); 2761
2762 } 2762 public void llRemoveFromLandBanList(string avatar)
2763 2763 {
2764 public void llAddToLandBanList(string avatar, double hours) 2764 NotImplemented("llRemoveFromLandBanList");
2765 { 2765 }
2766 NotImplemented("llAddToLandBanList"); 2766
2767 } 2767 public void llSetCameraParams(LSL_Types.list rules)
2768 2768 {
2769 public void llRemoveFromLandPassList(string avatar) 2769 NotImplemented("llSetCameraParams");
2770 { 2770 }
2771 NotImplemented("llRemoveFromLandPassList"); 2771
2772 } 2772 public void llClearCameraParams()
2773 2773 {
2774 public void llRemoveFromLandBanList(string avatar) 2774 NotImplemented("llClearCameraParams");
2775 { 2775 }
2776 NotImplemented("llRemoveFromLandBanList"); 2776
2777 } 2777 public double llListStatistics(int operation, LSL_Types.list src)
2778 2778 {
2779 public void llSetCameraParams(LSL_Types.list rules) 2779 NotImplemented("llListStatistics");
2780 { 2780 return 0;
2781 NotImplemented("llSetCameraParams"); 2781 }
2782 } 2782
2783 2783 public int llGetUnixTime()
2784 public void llClearCameraParams() 2784 {
2785 { 2785 return Util.UnixTimeSinceEpoch();
2786 NotImplemented("llClearCameraParams"); 2786 }
2787 } 2787
2788 2788 public int llGetParcelFlags(LSL_Types.Vector3 pos)
2789 public double llListStatistics(int operation, LSL_Types.list src) 2789 {
2790 { 2790 NotImplemented("llGetParcelFlags");
2791 NotImplemented("llListStatistics"); 2791 return 0;
2792 return 0; 2792 }
2793 } 2793
2794 2794 public int llGetRegionFlags()
2795 public int llGetUnixTime() 2795 {
2796 { 2796 NotImplemented("llGetRegionFlags");
2797 return Util.UnixTimeSinceEpoch(); 2797 return 0;
2798 } 2798 }
2799 2799
2800 public int llGetParcelFlags(LSL_Types.Vector3 pos) 2800 public string llXorBase64StringsCorrect(string str1, string str2)
2801 { 2801 {
2802 NotImplemented("llGetParcelFlags"); 2802 string ret = "";
2803 return 0; 2803 string src1 = llBase64ToString(str1);
2804 } 2804 string src2 = llBase64ToString(str2);
2805 2805 int c = 0;
2806 public int llGetRegionFlags() 2806 for (int i = 0; i < src1.Length; i++)
2807 { 2807 {
2808 NotImplemented("llGetRegionFlags"); 2808 ret += src1[i] ^ src2[c];
2809 return 0; 2809
2810 } 2810 c++;
2811 2811 if (c > src2.Length)
2812 public string llXorBase64StringsCorrect(string str1, string str2) 2812 c = 0;
2813 { 2813 }
2814 string ret = ""; 2814 return llStringToBase64(ret);
2815 string src1 = llBase64ToString(str1); 2815 }
2816 string src2 = llBase64ToString(str2); 2816
2817 int c = 0; 2817 public string llHTTPRequest(string url, LSL_Types.list parameters, string body)
2818 for (int i = 0; i < src1.Length; i++) 2818 {
2819 { 2819 IHttpRequests httpScriptMod =
2820 ret += src1[i] ^ src2[c]; 2820 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>();
2821 2821 List<string> param = new List<string>();
2822 c++; 2822 foreach (object o in parameters.Data)
2823 if (c > src2.Length) 2823 {
2824 c = 0; 2824 param.Add(o.ToString());
2825 } 2825 }
2826 return llStringToBase64(ret); 2826 LLUUID reqID = httpScriptMod.
2827 } 2827 StartHttpRequest(m_localID, m_itemID, url, param, body);
2828 2828
2829 public string llHTTPRequest(string url, LSL_Types.list parameters, string body) 2829 if (!reqID.Equals(null))
2830 { 2830 return reqID.ToString();
2831 IHttpRequests httpScriptMod = 2831 else
2832 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); 2832 return null;
2833 List<string> param = new List<string>(); 2833 }
2834 foreach (object o in parameters.Data) 2834
2835 { 2835 public void llResetLandBanList()
2836 param.Add(o.ToString()); 2836 {
2837 } 2837 NotImplemented("llResetLandBanList");
2838 LLUUID reqID = httpScriptMod. 2838 }
2839 StartHttpRequest(m_localID, m_itemID, url, param, body); 2839
2840 2840 public void llResetLandPassList()
2841 if (!reqID.Equals(null)) 2841 {
2842 return reqID.ToString(); 2842 NotImplemented("llResetLandPassList");
2843 else 2843 }
2844 return null; 2844
2845 } 2845 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide)
2846 2846 {
2847 public void llResetLandBanList() 2847 NotImplemented("llGetParcelPrimCount");
2848 { 2848 return 0;
2849 NotImplemented("llResetLandBanList"); 2849 }
2850 } 2850
2851 2851 public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos)
2852 public void llResetLandPassList() 2852 {
2853 { 2853 NotImplemented("llGetParcelPrimOwners");
2854 NotImplemented("llResetLandPassList"); 2854 return new LSL_Types.list();
2855 } 2855 }
2856 2856
2857 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) 2857 public int llGetObjectPrimCount(string object_id)
2858 { 2858 {
2859 NotImplemented("llGetParcelPrimCount"); 2859 SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id));
2860 return 0; 2860 if (part == null)
2861 } 2861 {
2862 2862 return 0;
2863 public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos) 2863 }
2864 { 2864 else
2865 NotImplemented("llGetParcelPrimOwners"); 2865 {
2866 return new LSL_Types.list(); 2866 return part.ParentGroup.Children.Count;
2867 } 2867 }
2868 2868 }
2869 public int llGetObjectPrimCount(string object_id) 2869
2870 { 2870 public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide)
2871 SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id)); 2871 {
2872 if (part == null) 2872 // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation
2873 { 2873 // Which probably will be irrelevent in OpenSim....
2874 return 0; 2874 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
2875 } 2875 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor;
2876 else 2876 if (land == null)
2877 { 2877 {
2878 return part.ParentGroup.Children.Count; 2878 return 0;
2879 } 2879 }
2880 } 2880 if (sim_wide == 1)
2881 2881 {
2882 public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) 2882 decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor;
2883 { 2883 return (int)v;
2884 // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation 2884 }
2885 // Which probably will be irrelevent in OpenSim.... 2885 else
2886 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 2886 {
2887 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; 2887 decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor;
2888 if (land == null) 2888 return (int)v;
2889 { 2889 }
2890 return 0; 2890
2891 } 2891 }
2892 if (sim_wide == 1) 2892
2893 { 2893 public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param)
2894 decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor; 2894 {
2895 return (int)v; 2895 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
2896 } 2896 if (land == null)
2897 else 2897 {
2898 { 2898 return new LSL_Types.list(0);
2899 decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; 2899 }
2900 return (int)v; 2900 LSL_Types.list ret = new LSL_Types.list();
2901 } 2901 foreach (object o in param.Data)
2902 2902 {
2903 } 2903 switch (o.ToString())
2904 2904 {
2905 public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param) 2905 case "0":
2906 { 2906 ret = ret + new LSL_Types.list(land.landName);
2907 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 2907 break;
2908 if (land == null) 2908 case "1":
2909 { 2909 ret = ret + new LSL_Types.list(land.landDesc);
2910 return new LSL_Types.list(0); 2910 break;
2911 } 2911 case "2":
2912 LSL_Types.list ret = new LSL_Types.list(); 2912 ret = ret + new LSL_Types.list(land.ownerID.ToString());
2913 foreach (object o in param.Data) 2913 break;
2914 { 2914 case "3":
2915 switch (o.ToString()) 2915 ret = ret + new LSL_Types.list(land.groupID.ToString());
2916 { 2916 break;
2917 case "0": 2917 case "4":
2918 ret = ret + new LSL_Types.list(land.landName); 2918 ret = ret + new LSL_Types.list(land.area);
2919 break; 2919 break;
2920 case "1": 2920 default:
2921 ret = ret + new LSL_Types.list(land.landDesc); 2921 ret = ret + new LSL_Types.list(0);
2922 break; 2922 break;
2923 case "2": 2923 }
2924 ret = ret + new LSL_Types.list(land.ownerID.ToString()); 2924 }
2925 break; 2925 return ret;
2926 case "3": 2926 }
2927 ret = ret + new LSL_Types.list(land.groupID.ToString()); 2927
2928 break; 2928 //
2929 case "4": 2929 // OpenSim functions
2930 ret = ret + new LSL_Types.list(land.area); 2930 //
2931 break; 2931 public int osTerrainSetHeight(int x, int y, double val)
2932 default: 2932 {
2933 ret = ret + new LSL_Types.list(0); 2933 if (x > 255 || x < 0 || y > 255 || y < 0)
2934 break; 2934 LSLError("osTerrainSetHeight: Coordinate out of bounds");
2935 } 2935
2936 } 2936 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0)))
2937 return ret; 2937 {
2938 } 2938 World.Terrain.Set(x, y, val);
2939 2939 return 1;
2940 // 2940 }
2941 // OpenSim functions 2941 else
2942 // 2942 {
2943 public int osTerrainSetHeight(int x, int y, double val) 2943 return 0;
2944 { 2944 }
2945 if (x > 255 || x < 0 || y > 255 || y < 0) 2945 }
2946 LSLError("osTerrainSetHeight: Coordinate out of bounds"); 2946
2947 2947 public double osTerrainGetHeight(int x, int y)
2948 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0))) 2948 {
2949 { 2949 if (x > 255 || x < 0 || y > 255 || y < 0)
2950 World.Terrain.Set(x, y, val); 2950 LSLError("osTerrainGetHeight: Coordinate out of bounds");
2951 return 1; 2951
2952 } 2952 return World.Terrain.GetHeight(x, y);
2953 else 2953 }
2954 { 2954
2955 return 0; 2955 public int osRegionRestart(double seconds)
2956 } 2956 {
2957 } 2957 if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID))
2958 2958 {
2959 public double osTerrainGetHeight(int x, int y) 2959 World.Restart((float)seconds);
2960 { 2960 return 1;
2961 if (x > 255 || x < 0 || y > 255 || y < 0) 2961 }
2962 LSLError("osTerrainGetHeight: Coordinate out of bounds"); 2962 else
2963 2963 {
2964 return World.Terrain.GetHeight(x, y); 2964 return 0;
2965 } 2965 }
2966 2966 }
2967 public int osRegionRestart(double seconds) 2967
2968 { 2968 public void osRegionNotice(string msg)
2969 if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID)) 2969 {
2970 { 2970 World.SendGeneralAlert(msg);
2971 World.Restart((float)seconds); 2971 }
2972 return 1; 2972
2973 } 2973 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
2974 else 2974 int timer)
2975 { 2975 {
2976 return 0; 2976 if (dynamicID == "")
2977 } 2977 {
2978 } 2978 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
2979 2979 LLUUID createdTexture =
2980 public void osRegionNotice(string msg) 2980 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
2981 { 2981 extraParams, timer);
2982 World.SendGeneralAlert(msg); 2982 return createdTexture.ToString();
2983 } 2983 }
2984 2984 else
2985 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, 2985 {
2986 int timer) 2986 //TODO update existing dynamic textures
2987 { 2987 }
2988 if (dynamicID == "") 2988
2989 { 2989 return LLUUID.Zero.ToString();
2990 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 2990 }
2991 LLUUID createdTexture = 2991
2992 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, 2992 private void NotImplemented(string Command)
2993 extraParams, timer); 2993 {
2994 return createdTexture.ToString(); 2994 if (throwErrorOnNotImplemented)
2995 } 2995 throw new NotImplementedException("Command not implemented: " + Command);
2996 else 2996 }
2997 { 2997
2998 //TODO update existing dynamic textures 2998 private void LSLError(string msg)
2999 } 2999 {
3000 3000 throw new Exception("LSL Runtime Error: " + msg);
3001 return LLUUID.Zero.ToString(); 3001 }
3002 } 3002 }
3003 3003} \ No newline at end of file
3004 private void NotImplemented(string Command)
3005 {
3006 if (throwErrorOnNotImplemented)
3007 throw new NotImplementedException("Command not implemented: " + Command);
3008 }
3009
3010 private void LSLError(string msg)
3011 {
3012 throw new Exception("LSL Runtime Error: " + msg);
3013 }
3014 }
3015}