LSL_BuiltIn_Commands.cs 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  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
  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
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Runtime.Remoting.Lifetime;
  30. using System.Text;
  31. using System.Threading;
  32. using Axiom.Math;
  33. using libsecondlife;
  34. using OpenSim.Framework;
  35. using OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSL;
  36. using OpenSim.Region.Environment.Interfaces;
  37. using OpenSim.Region.Environment.Scenes;
  38. using OpenSim.Region.ScriptEngine.Common;
  39. namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler
  40. {
  41. //
  42. // !!!IMPORTANT!!!
  43. //
  44. // REMEMBER TO UPDATE http://opensimulator.org/wiki/LlFunction_implementation_status
  45. //
  46. /// <summary>
  47. /// Contains all LSL ll-functions. This class will be in Default AppDomain.
  48. /// </summary>
  49. public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
  50. {
  51. private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  52. private ASCIIEncoding enc = new ASCIIEncoding();
  53. private ScriptEngine m_ScriptEngine;
  54. private SceneObjectPart m_host;
  55. private uint m_localID;
  56. private LLUUID m_itemID;
  57. private bool throwErrorOnNotImplemented = true;
  58. public LSL_BuiltIn_Commands(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
  59. {
  60. m_ScriptEngine = ScriptEngine;
  61. m_host = host;
  62. m_localID = localID;
  63. m_itemID = itemID;
  64. //m_log.Info("[ScriptEngine]: LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
  65. }
  66. private string m_state = "default";
  67. public string State()
  68. {
  69. return m_state;
  70. }
  71. // Object never expires
  72. public override Object InitializeLifetimeService()
  73. {
  74. //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()");
  75. // return null;
  76. ILease lease = (ILease) base.InitializeLifetimeService();
  77. if (lease.CurrentState == LeaseState.Initial)
  78. {
  79. lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1);
  80. // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
  81. // lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
  82. }
  83. return lease;
  84. }
  85. public Scene World
  86. {
  87. get { return m_ScriptEngine.World; }
  88. }
  89. //These are the implementations of the various ll-functions used by the LSL scripts.
  90. //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07
  91. public double llSin(double f)
  92. {
  93. return (double) Math.Sin(f);
  94. }
  95. public double llCos(double f)
  96. {
  97. return (double) Math.Cos(f);
  98. }
  99. public double llTan(double f)
  100. {
  101. return (double) Math.Tan(f);
  102. }
  103. public double llAtan2(double x, double y)
  104. {
  105. return (double) Math.Atan2(y, x);
  106. }
  107. public double llSqrt(double f)
  108. {
  109. return (double) Math.Sqrt(f);
  110. }
  111. public double llPow(double fbase, double fexponent)
  112. {
  113. return (double) Math.Pow(fbase, fexponent);
  114. }
  115. public int llAbs(int i)
  116. {
  117. return (int) Math.Abs(i);
  118. }
  119. public double llFabs(double f)
  120. {
  121. return (double) Math.Abs(f);
  122. }
  123. public double llFrand(double mag)
  124. {
  125. lock (Util.RandomClass)
  126. {
  127. return Util.RandomClass.Next((int) mag);
  128. }
  129. }
  130. public int llFloor(double f)
  131. {
  132. return (int) Math.Floor(f);
  133. }
  134. public int llCeil(double f)
  135. {
  136. return (int) Math.Ceiling(f);
  137. }
  138. public int llRound(double f)
  139. {
  140. return (int) Math.Round(f, 3);
  141. }
  142. //This next group are vector operations involving squaring and square root. ckrinke
  143. public double llVecMag(LSL_Types.Vector3 v)
  144. {
  145. return (v.X*v.X + v.Y*v.Y + v.Z*v.Z);
  146. }
  147. public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v)
  148. {
  149. double mag = v.X*v.X + v.Y*v.Y + v.Z*v.Z;
  150. LSL_Types.Vector3 nor = new LSL_Types.Vector3();
  151. nor.X = v.X/mag;
  152. nor.Y = v.Y/mag;
  153. nor.Z = v.Z/mag;
  154. return nor;
  155. }
  156. public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
  157. {
  158. double dx = a.X - b.X;
  159. double dy = a.Y - b.Y;
  160. double dz = a.Z - b.Z;
  161. return Math.Sqrt(dx*dx + dy*dy + dz*dz);
  162. }
  163. //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke
  164. public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r)
  165. {
  166. //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke
  167. LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.X*r.X, r.Y*r.Y, r.Z*r.Z, r.R*r.R);
  168. double m = (t.X + t.Y + t.Z + t.R);
  169. if (m == 0) return new LSL_Types.Vector3();
  170. double n = 2*(r.Y*r.R + r.X*r.Z);
  171. double p = m*m - n*n;
  172. if (p > 0)
  173. return new LSL_Types.Vector3(Math.Atan2(2.0*(r.X*r.R - r.Y*r.Z), (-t.X - t.Y + t.Z + t.R)),
  174. Math.Atan2(n, Math.Sqrt(p)),
  175. Math.Atan2(2.0*(r.Z*r.R - r.X*r.Y), (t.X - t.Y - t.Z + t.R)));
  176. else if (n > 0)
  177. return new LSL_Types.Vector3(0.0, Math.PI/2, Math.Atan2((r.Z*r.R + r.X*r.Y), 0.5 - t.X - t.Z));
  178. else
  179. return new LSL_Types.Vector3(0.0, -Math.PI/2, Math.Atan2((r.Z*r.R + r.X*r.Y), 0.5 - t.X - t.Z));
  180. }
  181. public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v)
  182. {
  183. //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07
  184. float err = 0.00001f;
  185. double ax = Math.Sin(v.X/2);
  186. double aw = Math.Cos(v.X/2);
  187. double by = Math.Sin(v.Y/2);
  188. double bw = Math.Cos(v.Y/2);
  189. double cz = Math.Sin(v.Z/2);
  190. double cw = Math.Cos(v.Z/2);
  191. LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw);
  192. LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw);
  193. LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw);
  194. LSL_Types.Quaternion a = new LSL_Types.Quaternion();
  195. //This multiplication doesnt compile, yet. a = a1 * a2 * a3;
  196. LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax*bw*cw + aw*by*cz,
  197. aw*by*cw - ax*bw*cz, aw*bw*cz + ax*by*cw,
  198. aw*bw*cw - ax*by*cz);
  199. LSL_Types.Quaternion c = new LSL_Types.Quaternion();
  200. //This addition doesnt compile yet c = a + b;
  201. LSL_Types.Quaternion d = new LSL_Types.Quaternion();
  202. //This addition doesnt compile yet d = a - b;
  203. if ((Math.Abs(c.X) > err && Math.Abs(d.X) > err) ||
  204. (Math.Abs(c.Y) > err && Math.Abs(d.Y) > err) ||
  205. (Math.Abs(c.Z) > err && Math.Abs(d.Z) > err) ||
  206. (Math.Abs(c.R) > err && Math.Abs(d.R) > err))
  207. {
  208. //return a new Quaternion that is null until I figure this out
  209. // return b;
  210. // return a;
  211. }
  212. return new LSL_Types.Quaternion();
  213. }
  214. public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
  215. {
  216. return new LSL_Types.Quaternion();
  217. }
  218. public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r)
  219. {
  220. return new LSL_Types.Vector3();
  221. }
  222. public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r)
  223. {
  224. return new LSL_Types.Vector3();
  225. }
  226. public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r)
  227. {
  228. return new LSL_Types.Vector3();
  229. }
  230. public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 start, LSL_Types.Vector3 end)
  231. {
  232. return new LSL_Types.Quaternion();
  233. }
  234. public void llWhisper(int channelID, string text)
  235. {
  236. World.SimChat(Helpers.StringToField(text),
  237. ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
  238. }
  239. public void llSay(int channelID, string text)
  240. {
  241. World.SimChat(Helpers.StringToField(text),
  242. ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
  243. }
  244. public void llShout(int channelID, string text)
  245. {
  246. World.SimChat(Helpers.StringToField(text),
  247. ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
  248. }
  249. public int llListen(int channelID, string name, string ID, string msg)
  250. {
  251. NotImplemented("llListen");
  252. return 0;
  253. }
  254. public void llListenControl(int number, int active)
  255. {
  256. NotImplemented("llListenControl");
  257. return;
  258. }
  259. public void llListenRemove(int number)
  260. {
  261. NotImplemented("llListenRemove");
  262. return;
  263. }
  264. public void llSensor(string name, string id, int type, double range, double arc)
  265. {
  266. NotImplemented("llSensor");
  267. return;
  268. }
  269. public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
  270. {
  271. NotImplemented("llSensorRepeat");
  272. return;
  273. }
  274. public void llSensorRemove()
  275. {
  276. NotImplemented("llSensorRemove");
  277. return;
  278. }
  279. public string llDetectedName(int number)
  280. {
  281. NotImplemented("llDetectedName");
  282. return "";
  283. }
  284. public string llDetectedKey(int number)
  285. {
  286. NotImplemented("llDetectedKey");
  287. return "";
  288. }
  289. public string llDetectedOwner(int number)
  290. {
  291. NotImplemented("llDetectedOwner");
  292. return "";
  293. }
  294. public int llDetectedType(int number)
  295. {
  296. NotImplemented("llDetectedType");
  297. return 0;
  298. }
  299. public LSL_Types.Vector3 llDetectedPos(int number)
  300. {
  301. NotImplemented("llDetectedPos");
  302. return new LSL_Types.Vector3();
  303. }
  304. public LSL_Types.Vector3 llDetectedVel(int number)
  305. {
  306. NotImplemented("llDetectedVel");
  307. return new LSL_Types.Vector3();
  308. }
  309. public LSL_Types.Vector3 llDetectedGrab(int number)
  310. {
  311. NotImplemented("llDetectedGrab");
  312. return new LSL_Types.Vector3();
  313. }
  314. public LSL_Types.Quaternion llDetectedRot(int number)
  315. {
  316. NotImplemented("llDetectedRot");
  317. return new LSL_Types.Quaternion();
  318. }
  319. public int llDetectedGroup(int number)
  320. {
  321. NotImplemented("llDetectedGroup");
  322. return 0;
  323. }
  324. public int llDetectedLinkNumber(int number)
  325. {
  326. NotImplemented("llDetectedLinkNumber");
  327. return 0;
  328. }
  329. public void llDie()
  330. {
  331. NotImplemented("llDie");
  332. return;
  333. }
  334. public double llGround(LSL_Types.Vector3 offset)
  335. {
  336. NotImplemented("llGround");
  337. return 0;
  338. }
  339. public double llCloud(LSL_Types.Vector3 offset)
  340. {
  341. NotImplemented("llCloud");
  342. return 0;
  343. }
  344. public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset)
  345. {
  346. NotImplemented("llWind");
  347. return new LSL_Types.Vector3();
  348. }
  349. public void llSetStatus(int status, int value)
  350. {
  351. NotImplemented("llSetStatus");
  352. return;
  353. }
  354. public int llGetStatus(int status)
  355. {
  356. NotImplemented("llGetStatus");
  357. return 0;
  358. }
  359. public void llSetScale(LSL_Types.Vector3 scale)
  360. {
  361. // TODO: this needs to trigger a persistance save as well
  362. LLVector3 tmp = m_host.Scale;
  363. tmp.X = (float) scale.X;
  364. tmp.Y = (float) scale.Y;
  365. tmp.Z = (float) scale.Z;
  366. m_host.Scale = tmp;
  367. return;
  368. }
  369. public LSL_Types.Vector3 llGetScale()
  370. {
  371. return new LSL_Types.Vector3(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z);
  372. }
  373. public void llSetColor(LSL_Types.Vector3 color, int face)
  374. {
  375. NotImplemented("llSetColor");
  376. return;
  377. }
  378. public double llGetAlpha(int face)
  379. {
  380. NotImplemented("llGetAlpha");
  381. return 0;
  382. }
  383. public void llSetAlpha(double alpha, int face)
  384. {
  385. NotImplemented("llSetAlpha");
  386. return;
  387. }
  388. public LSL_Types.Vector3 llGetColor(int face)
  389. {
  390. NotImplemented("llGetColor");
  391. return new LSL_Types.Vector3();
  392. }
  393. public void llSetTexture(string texture, int face)
  394. {
  395. NotImplemented("llSetTexture");
  396. return;
  397. }
  398. public void llScaleTexture(double u, double v, int face)
  399. {
  400. NotImplemented("llScaleTexture");
  401. return;
  402. }
  403. public void llOffsetTexture(double u, double v, int face)
  404. {
  405. NotImplemented("llOffsetTexture");
  406. return;
  407. }
  408. public void llRotateTexture(double rotation, int face)
  409. {
  410. NotImplemented("llRotateTexture");
  411. return;
  412. }
  413. public string llGetTexture(int face)
  414. {
  415. NotImplemented("llGetTexture");
  416. return "";
  417. }
  418. public void llSetPos(LSL_Types.Vector3 pos)
  419. {
  420. if (m_host.ParentID != 0)
  421. {
  422. m_host.UpdateOffSet(new LLVector3((float) pos.X, (float) pos.Y, (float) pos.Z));
  423. }
  424. else
  425. {
  426. m_host.UpdateGroupPosition(new LLVector3((float) pos.X, (float) pos.Y, (float) pos.Z));
  427. }
  428. }
  429. public LSL_Types.Vector3 llGetPos()
  430. {
  431. return new LSL_Types.Vector3(m_host.AbsolutePosition.X,
  432. m_host.AbsolutePosition.Y,
  433. m_host.AbsolutePosition.Z);
  434. }
  435. public LSL_Types.Vector3 llGetLocalPos()
  436. {
  437. if (m_host.ParentID != 0)
  438. {
  439. return new LSL_Types.Vector3(m_host.OffsetPosition.X,
  440. m_host.OffsetPosition.Y,
  441. m_host.OffsetPosition.Z);
  442. }
  443. else
  444. {
  445. return new LSL_Types.Vector3(m_host.AbsolutePosition.X,
  446. m_host.AbsolutePosition.Y,
  447. m_host.AbsolutePosition.Z);
  448. }
  449. }
  450. public void llSetRot(LSL_Types.Quaternion rot)
  451. {
  452. m_host.UpdateRotation(new LLQuaternion((float) rot.X, (float) rot.Y, (float) rot.Z, (float) rot.R));
  453. }
  454. public LSL_Types.Quaternion llGetRot()
  455. {
  456. LLQuaternion q = m_host.RotationOffset;
  457. return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
  458. }
  459. public LSL_Types.Quaternion llGetLocalRot()
  460. {
  461. NotImplemented("llGetLocalRot");
  462. return new LSL_Types.Quaternion();
  463. }
  464. public void llSetForce(LSL_Types.Vector3 force, int local)
  465. {
  466. NotImplemented("llSetForce");
  467. }
  468. public LSL_Types.Vector3 llGetForce()
  469. {
  470. NotImplemented("llGetForce");
  471. return new LSL_Types.Vector3();
  472. }
  473. public int llTarget(LSL_Types.Vector3 position, double range)
  474. {
  475. NotImplemented("llTarget");
  476. return 0;
  477. }
  478. public void llTargetRemove(int number)
  479. {
  480. NotImplemented("llTargetRemove");
  481. }
  482. public int llRotTarget(LSL_Types.Quaternion rot, double error)
  483. {
  484. NotImplemented("llRotTarget");
  485. return 0;
  486. }
  487. public void llRotTargetRemove(int number)
  488. {
  489. NotImplemented("llRotTargetRemove");
  490. }
  491. public void llMoveToTarget(LSL_Types.Vector3 target, double tau)
  492. {
  493. NotImplemented("llMoveToTarget");
  494. }
  495. public void llStopMoveToTarget()
  496. {
  497. NotImplemented("llStopMoveToTarget");
  498. }
  499. public void llApplyImpulse(LSL_Types.Vector3 force, int local)
  500. {
  501. NotImplemented("llApplyImpulse");
  502. }
  503. public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local)
  504. {
  505. NotImplemented("llApplyRotationalImpulse");
  506. }
  507. public void llSetTorque(LSL_Types.Vector3 torque, int local)
  508. {
  509. NotImplemented("llSetTorque");
  510. }
  511. public LSL_Types.Vector3 llGetTorque()
  512. {
  513. NotImplemented("llGetTorque");
  514. return new LSL_Types.Vector3();
  515. }
  516. public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local)
  517. {
  518. NotImplemented("llSetForceAndTorque");
  519. }
  520. public LSL_Types.Vector3 llGetVel()
  521. {
  522. NotImplemented("llGetVel");
  523. return new LSL_Types.Vector3();
  524. }
  525. public LSL_Types.Vector3 llGetAccel()
  526. {
  527. NotImplemented("llGetAccel");
  528. return new LSL_Types.Vector3();
  529. }
  530. public LSL_Types.Vector3 llGetOmega()
  531. {
  532. NotImplemented("llGetOmega");
  533. return new LSL_Types.Vector3();
  534. }
  535. public double llGetTimeOfDay()
  536. {
  537. NotImplemented("llGetTimeOfDay");
  538. return 0;
  539. }
  540. public double llGetWallclock()
  541. {
  542. return DateTime.Now.TimeOfDay.TotalSeconds;
  543. }
  544. public double llGetTime()
  545. {
  546. NotImplemented("llGetTime");
  547. return 0;
  548. }
  549. public void llResetTime()
  550. {
  551. NotImplemented("llResetTime");
  552. }
  553. public double llGetAndResetTime()
  554. {
  555. NotImplemented("llGetAndResetTime");
  556. return 0;
  557. }
  558. public void llSound()
  559. {
  560. NotImplemented("llSound");
  561. }
  562. public void llPlaySound(string sound, double volume)
  563. {
  564. NotImplemented("llPlaySound");
  565. }
  566. public void llLoopSound(string sound, double volume)
  567. {
  568. NotImplemented("llLoopSound");
  569. }
  570. public void llLoopSoundMaster(string sound, double volume)
  571. {
  572. NotImplemented("llLoopSoundMaster");
  573. }
  574. public void llLoopSoundSlave(string sound, double volume)
  575. {
  576. NotImplemented("llLoopSoundSlave");
  577. }
  578. public void llPlaySoundSlave(string sound, double volume)
  579. {
  580. NotImplemented("llPlaySoundSlave");
  581. }
  582. public void llTriggerSound(string sound, double volume)
  583. {
  584. NotImplemented("llTriggerSound");
  585. }
  586. public void llStopSound()
  587. {
  588. NotImplemented("llStopSound");
  589. }
  590. public void llPreloadSound(string sound)
  591. {
  592. NotImplemented("llPreloadSound");
  593. }
  594. public string llGetSubString(string src, int start, int end)
  595. {
  596. return src.Substring(start, end);
  597. }
  598. public string llDeleteSubString(string src, int start, int end)
  599. {
  600. return src.Remove(start, end - start);
  601. }
  602. public string llInsertString(string dst, int position, string src)
  603. {
  604. return dst.Insert(position, src);
  605. }
  606. public string llToUpper(string src)
  607. {
  608. return src.ToUpper();
  609. }
  610. public string llToLower(string src)
  611. {
  612. return src.ToLower();
  613. }
  614. public int llGiveMoney(string destination, int amount)
  615. {
  616. NotImplemented("llGiveMoney");
  617. return 0;
  618. }
  619. public void llMakeExplosion()
  620. {
  621. NotImplemented("llMakeExplosion");
  622. }
  623. public void llMakeFountain()
  624. {
  625. NotImplemented("llMakeFountain");
  626. }
  627. public void llMakeSmoke()
  628. {
  629. NotImplemented("llMakeSmoke");
  630. }
  631. public void llMakeFire()
  632. {
  633. NotImplemented("llMakeFire");
  634. }
  635. public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param)
  636. {
  637. NotImplemented("llRezObject");
  638. }
  639. public void llLookAt(LSL_Types.Vector3 target, double strength, double damping)
  640. {
  641. NotImplemented("llLookAt");
  642. }
  643. public void llStopLookAt()
  644. {
  645. NotImplemented("llStopLookAt");
  646. }
  647. public void llSetTimerEvent(double sec)
  648. {
  649. // Setting timer repeat
  650. m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec);
  651. }
  652. public void llSleep(double sec)
  653. {
  654. Thread.Sleep((int) (sec*1000));
  655. }
  656. public double llGetMass()
  657. {
  658. NotImplemented("llGetMass");
  659. return 0;
  660. }
  661. public void llCollisionFilter(string name, string id, int accept)
  662. {
  663. NotImplemented("llCollisionFilter");
  664. }
  665. public void llTakeControls(int controls, int accept, int pass_on)
  666. {
  667. NotImplemented("llTakeControls");
  668. }
  669. public void llReleaseControls()
  670. {
  671. NotImplemented("llReleaseControls");
  672. }
  673. public void llAttachToAvatar(int attachment)
  674. {
  675. NotImplemented("llAttachToAvatar");
  676. }
  677. public void llDetachFromAvatar()
  678. {
  679. NotImplemented("llDetachFromAvatar");
  680. }
  681. public void llTakeCamera()
  682. {
  683. NotImplemented("llTakeCamera");
  684. }
  685. public void llReleaseCamera()
  686. {
  687. NotImplemented("llReleaseCamera");
  688. }
  689. public string llGetOwner()
  690. {
  691. return m_host.ObjectOwner.ToString();
  692. }
  693. public void llInstantMessage(string user, string message)
  694. {
  695. NotImplemented("llInstantMessage");
  696. }
  697. public void llEmail(string address, string subject, string message)
  698. {
  699. NotImplemented("llEmail");
  700. }
  701. public void llGetNextEmail(string address, string subject)
  702. {
  703. NotImplemented("llGetNextEmail");
  704. }
  705. public string llGetKey()
  706. {
  707. return m_host.UUID.ToString();
  708. }
  709. public void llSetBuoyancy(double buoyancy)
  710. {
  711. NotImplemented("llSetBuoyancy");
  712. }
  713. public void llSetHoverHeight(double height, int water, double tau)
  714. {
  715. NotImplemented("llSetHoverHeight");
  716. }
  717. public void llStopHover()
  718. {
  719. NotImplemented("llStopHover");
  720. }
  721. public void llMinEventDelay(double delay)
  722. {
  723. NotImplemented("llMinEventDelay");
  724. }
  725. public void llSoundPreload()
  726. {
  727. NotImplemented("llSoundPreload");
  728. }
  729. public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping)
  730. {
  731. NotImplemented("llRotLookAt");
  732. }
  733. public int llStringLength(string str)
  734. {
  735. if (str.Length > 0)
  736. {
  737. return str.Length;
  738. }
  739. else
  740. {
  741. return 0;
  742. }
  743. }
  744. public void llStartAnimation(string anim)
  745. {
  746. NotImplemented("llStartAnimation");
  747. }
  748. public void llStopAnimation(string anim)
  749. {
  750. NotImplemented("llStopAnimation");
  751. }
  752. public void llPointAt()
  753. {
  754. NotImplemented("llPointAt");
  755. }
  756. public void llStopPointAt()
  757. {
  758. NotImplemented("llStopPointAt");
  759. }
  760. public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain)
  761. {
  762. NotImplemented("llTargetOmega");
  763. }
  764. public int llGetStartParameter()
  765. {
  766. NotImplemented("llGetStartParameter");
  767. return 0;
  768. }
  769. public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
  770. {
  771. NotImplemented("llGodLikeRezObject");
  772. }
  773. public void llRequestPermissions(string agent, int perm)
  774. {
  775. NotImplemented("llRequestPermissions");
  776. }
  777. public string llGetPermissionsKey()
  778. {
  779. NotImplemented("llGetPermissionsKey");
  780. return "";
  781. }
  782. public int llGetPermissions()
  783. {
  784. NotImplemented("llGetPermissions");
  785. return 0;
  786. }
  787. public int llGetLinkNumber()
  788. {
  789. NotImplemented("llGetLinkNumber");
  790. return 0;
  791. }
  792. public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face)
  793. {
  794. NotImplemented("llSetLinkColor");
  795. }
  796. public void llCreateLink(string target, int parent)
  797. {
  798. NotImplemented("llCreateLink");
  799. }
  800. public void llBreakLink(int linknum)
  801. {
  802. NotImplemented("llBreakLink");
  803. }
  804. public void llBreakAllLinks()
  805. {
  806. NotImplemented("llBreakAllLinks");
  807. }
  808. public string llGetLinkKey(int linknum)
  809. {
  810. NotImplemented("llGetLinkKey");
  811. return "";
  812. }
  813. public void llGetLinkName(int linknum)
  814. {
  815. NotImplemented("llGetLinkName");
  816. }
  817. public int llGetInventoryNumber(int type)
  818. {
  819. NotImplemented("llGetInventoryNumber");
  820. return 0;
  821. }
  822. public string llGetInventoryName(int type, int number)
  823. {
  824. NotImplemented("llGetInventoryName");
  825. return "";
  826. }
  827. public void llSetScriptState(string name, int run)
  828. {
  829. NotImplemented("llSetScriptState");
  830. }
  831. public double llGetEnergy()
  832. {
  833. return 1.0f;
  834. }
  835. public void llGiveInventory(string destination, string inventory)
  836. {
  837. NotImplemented("llGiveInventory");
  838. }
  839. public void llRemoveInventory(string item)
  840. {
  841. NotImplemented("llRemoveInventory");
  842. }
  843. public void llSetText(string text, LSL_Types.Vector3 color, double alpha)
  844. {
  845. Vector3 av3 = new Vector3((float) color.X, (float) color.Y, (float) color.Z);
  846. m_host.SetText(text, av3, alpha);
  847. }
  848. public double llWater(LSL_Types.Vector3 offset)
  849. {
  850. NotImplemented("llWater");
  851. return 0;
  852. }
  853. public void llPassTouches(int pass)
  854. {
  855. NotImplemented("llPassTouches");
  856. }
  857. public string llRequestAgentData(string id, int data)
  858. {
  859. NotImplemented("llRequestAgentData");
  860. return "";
  861. }
  862. public string llRequestInventoryData(string name)
  863. {
  864. NotImplemented("llRequestInventoryData");
  865. return "";
  866. }
  867. public void llSetDamage(double damage)
  868. {
  869. NotImplemented("llSetDamage");
  870. }
  871. public void llTeleportAgentHome(string agent)
  872. {
  873. NotImplemented("llTeleportAgentHome");
  874. }
  875. public void llModifyLand(int action, int brush)
  876. {
  877. }
  878. public void llCollisionSound(string impact_sound, double impact_volume)
  879. {
  880. NotImplemented("llCollisionSound");
  881. }
  882. public void llCollisionSprite(string impact_sprite)
  883. {
  884. NotImplemented("llCollisionSprite");
  885. }
  886. public string llGetAnimation(string id)
  887. {
  888. NotImplemented("llGetAnimation");
  889. return "";
  890. }
  891. public void llResetScript()
  892. {
  893. m_ScriptEngine.m_ScriptManager.ResetScript(m_localID, m_itemID);
  894. }
  895. public void llMessageLinked(int linknum, int num, string str, string id)
  896. {
  897. }
  898. public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local)
  899. {
  900. }
  901. public void llPassCollisions(int pass)
  902. {
  903. }
  904. public string llGetScriptName()
  905. {
  906. return "";
  907. }
  908. public int llGetNumberOfSides()
  909. {
  910. return 0;
  911. }
  912. public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle)
  913. {
  914. return new LSL_Types.Quaternion();
  915. }
  916. public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot)
  917. {
  918. return new LSL_Types.Vector3();
  919. }
  920. public void llRot2Angle()
  921. {
  922. }
  923. public double llAcos(double val)
  924. {
  925. return (double) Math.Acos(val);
  926. }
  927. public double llAsin(double val)
  928. {
  929. return (double) Math.Asin(val);
  930. }
  931. public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b)
  932. {
  933. return 0;
  934. }
  935. public string llGetInventoryKey(string name)
  936. {
  937. return "";
  938. }
  939. public void llAllowInventoryDrop(int add)
  940. {
  941. }
  942. public LSL_Types.Vector3 llGetSunDirection()
  943. {
  944. return new LSL_Types.Vector3();
  945. }
  946. public LSL_Types.Vector3 llGetTextureOffset(int face)
  947. {
  948. return new LSL_Types.Vector3();
  949. }
  950. public LSL_Types.Vector3 llGetTextureScale(int side)
  951. {
  952. return new LSL_Types.Vector3();
  953. }
  954. public double llGetTextureRot(int side)
  955. {
  956. return 0;
  957. }
  958. public int llSubStringIndex(string source, string pattern)
  959. {
  960. return source.IndexOf(pattern);
  961. }
  962. public string llGetOwnerKey(string id)
  963. {
  964. NotImplemented("llGetOwnerKey");
  965. return "";
  966. }
  967. public LSL_Types.Vector3 llGetCenterOfMass()
  968. {
  969. NotImplemented("llGetCenterOfMass");
  970. return new LSL_Types.Vector3();
  971. }
  972. public List<string> llListSort(List<string> src, int stride, int ascending)
  973. {
  974. SortedList<string, List<string>> sorted = new SortedList<string, List<string>>();
  975. // Add chunks to an array
  976. int s = stride;
  977. if (s < 1)
  978. s = 1;
  979. int c = 0;
  980. List<string> chunk = new List<string>();
  981. string chunkString = "";
  982. foreach (string element in src)
  983. {
  984. c++;
  985. if (c > s)
  986. {
  987. sorted.Add(chunkString, chunk);
  988. chunkString = "";
  989. chunk = new List<string>();
  990. c = 0;
  991. }
  992. chunk.Add(element);
  993. chunkString += element.ToString();
  994. }
  995. if (chunk.Count > 0)
  996. sorted.Add(chunkString, chunk);
  997. List<string> ret = new List<string>();
  998. foreach (List<string> ls in sorted.Values)
  999. {
  1000. ret.AddRange(ls);
  1001. }
  1002. if (ascending == LSL_BaseClass.TRUE)
  1003. return ret;
  1004. ret.Reverse();
  1005. return ret;
  1006. }
  1007. public int llGetListLength(List<string> src)
  1008. {
  1009. return src.Count;
  1010. }
  1011. public int llList2Integer(List<string> src, int index)
  1012. {
  1013. return Convert.ToInt32(src[index]);
  1014. }
  1015. public double llList2double(List<string> src, int index)
  1016. {
  1017. return Convert.ToDouble(src[index]);
  1018. }
  1019. public float llList2Float(List<string> src, int index)
  1020. {
  1021. return Convert.ToSingle(src[index]);
  1022. }
  1023. public string llList2String(List<string> src, int index)
  1024. {
  1025. return src[index];
  1026. }
  1027. public string llList2Key(List<string> src, int index)
  1028. {
  1029. //return OpenSim.Framework.ToString(src[index]);
  1030. return src[index].ToString();
  1031. }
  1032. public LSL_Types.Vector3 llList2Vector(List<string> src, int index)
  1033. {
  1034. return
  1035. new LSL_Types.Vector3(double.Parse(src[index]), double.Parse(src[index + 1]),
  1036. double.Parse(src[index + 2]));
  1037. }
  1038. public LSL_Types.Quaternion llList2Rot(List<string> src, int index)
  1039. {
  1040. return
  1041. new LSL_Types.Quaternion(double.Parse(src[index]), double.Parse(src[index + 1]),
  1042. double.Parse(src[index + 2]), double.Parse(src[index + 3]));
  1043. }
  1044. public List<string> llList2List(List<string> src, int start, int end)
  1045. {
  1046. if (end > start)
  1047. {
  1048. // Simple straight forward chunk
  1049. return src.GetRange(start, end - start);
  1050. }
  1051. else
  1052. {
  1053. // Some of the end + some of the beginning
  1054. // First chunk
  1055. List<string> ret = new List<string>();
  1056. ret.AddRange(src.GetRange(start, src.Count - start));
  1057. ret.AddRange(src.GetRange(0, end));
  1058. return ret;
  1059. }
  1060. }
  1061. public List<string> llDeleteSubList(List<string> src, int start, int end)
  1062. {
  1063. List<string> ret = new List<string>(src);
  1064. ret.RemoveRange(start, end - start);
  1065. return ret;
  1066. }
  1067. public int llGetListEntryType(List<string> src, int index)
  1068. {
  1069. NotImplemented("llGetListEntryType");
  1070. return 0;
  1071. }
  1072. public string llList2CSV(List<string> src)
  1073. {
  1074. string ret = "";
  1075. foreach (string s in src)
  1076. {
  1077. if (s.Length > 0)
  1078. ret += ",";
  1079. ret += s;
  1080. }
  1081. return ret;
  1082. }
  1083. public List<string> llCSV2List(string src)
  1084. {
  1085. List<string> ret = new List<string>();
  1086. foreach (string s in src.Split(",".ToCharArray()))
  1087. {
  1088. ret.Add(s);
  1089. }
  1090. return ret;
  1091. }
  1092. public List<string> llListRandomize(List<string> src, int stride)
  1093. {
  1094. int s = stride;
  1095. if (s < 1)
  1096. s = 1;
  1097. // This is a cowardly way of doing it ;)
  1098. // TODO: Instead, randomize and check if random is mod stride or if it can not be, then array.removerange
  1099. List<List<string>> tmp = new List<List<string>>();
  1100. // Add chunks to an array
  1101. int c = 0;
  1102. List<string> chunk = new List<string>();
  1103. foreach (string element in src)
  1104. {
  1105. c++;
  1106. if (c > s)
  1107. {
  1108. tmp.Add(chunk);
  1109. chunk = new List<string>();
  1110. c = 0;
  1111. }
  1112. chunk.Add(element);
  1113. }
  1114. if (chunk.Count > 0)
  1115. tmp.Add(chunk);
  1116. // Decreate (<- what kind of word is that? :D ) array back into a list
  1117. int rnd;
  1118. List<string> ret = new List<string>();
  1119. while (tmp.Count > 0)
  1120. {
  1121. rnd = Util.RandomClass.Next(tmp.Count);
  1122. foreach (string str in tmp[rnd])
  1123. {
  1124. ret.Add(str);
  1125. }
  1126. tmp.RemoveAt(rnd);
  1127. }
  1128. return ret;
  1129. }
  1130. public List<string> llList2ListStrided(List<string> src, int start, int end, int stride)
  1131. {
  1132. List<string> ret = new List<string>();
  1133. int s = stride;
  1134. if (s < 1)
  1135. s = 1;
  1136. int sc = s;
  1137. for (int i = start; i < src.Count; i++)
  1138. {
  1139. sc--;
  1140. if (sc == 0)
  1141. {
  1142. sc = s;
  1143. // Addthis
  1144. ret.Add(src[i]);
  1145. }
  1146. if (i == end)
  1147. break;
  1148. }
  1149. return ret;
  1150. }
  1151. public LSL_Types.Vector3 llGetRegionCorner()
  1152. {
  1153. return new LSL_Types.Vector3(World.RegionInfo.RegionLocX*256, World.RegionInfo.RegionLocY*256, 0);
  1154. }
  1155. public List<string> llListInsertList(List<string> dest, List<string> src, int start)
  1156. {
  1157. List<string> ret = new List<string>(dest);
  1158. //foreach (string s in src.Reverse())
  1159. for (int ci = src.Count - 1; ci > -1; ci--)
  1160. {
  1161. ret.Insert(start, src[ci]);
  1162. }
  1163. return ret;
  1164. }
  1165. public int llListFindList(List<string> src, List<string> test)
  1166. {
  1167. foreach (string s in test)
  1168. {
  1169. for (int ci = 0; ci < src.Count; ci++)
  1170. {
  1171. if (s == src[ci])
  1172. return ci;
  1173. }
  1174. }
  1175. return -1;
  1176. }
  1177. public string llGetObjectName()
  1178. {
  1179. return m_host.Name;
  1180. }
  1181. public void llSetObjectName(string name)
  1182. {
  1183. m_host.Name = name;
  1184. }
  1185. public string llGetDate()
  1186. {
  1187. DateTime date = DateTime.Now.ToUniversalTime();
  1188. string result = date.ToString("yyyy-MM-dd");
  1189. return result;
  1190. }
  1191. public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir)
  1192. {
  1193. NotImplemented("llEdgeOfWorld");
  1194. return 0;
  1195. }
  1196. public int llGetAgentInfo(string id)
  1197. {
  1198. NotImplemented("llGetAgentInfo");
  1199. return 0;
  1200. }
  1201. public void llAdjustSoundVolume(double volume)
  1202. {
  1203. NotImplemented("llAdjustSoundVolume");
  1204. }
  1205. public void llSetSoundQueueing(int queue)
  1206. {
  1207. NotImplemented("llSetSoundQueueing");
  1208. }
  1209. public void llSetSoundRadius(double radius)
  1210. {
  1211. NotImplemented("llSetSoundRadius");
  1212. }
  1213. public string llKey2Name(string id)
  1214. {
  1215. NotImplemented("llKey2Name");
  1216. return "";
  1217. }
  1218. public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
  1219. {
  1220. NotImplemented("llSetTextureAnim");
  1221. }
  1222. public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east,
  1223. LSL_Types.Vector3 bottom_south_west)
  1224. {
  1225. NotImplemented("llTriggerSoundLimited");
  1226. }
  1227. public void llEjectFromLand(string pest)
  1228. {
  1229. NotImplemented("llEjectFromLand");
  1230. }
  1231. public void llParseString2List()
  1232. {
  1233. NotImplemented("llParseString2List");
  1234. }
  1235. public int llOverMyLand(string id)
  1236. {
  1237. NotImplemented("llOverMyLand");
  1238. return 0;
  1239. }
  1240. public string llGetLandOwnerAt(LSL_Types.Vector3 pos)
  1241. {
  1242. NotImplemented("llGetLandOwnerAt");
  1243. return "";
  1244. }
  1245. public string llGetNotecardLine(string name, int line)
  1246. {
  1247. NotImplemented("llGetNotecardLine");
  1248. return "";
  1249. }
  1250. public LSL_Types.Vector3 llGetAgentSize(string id)
  1251. {
  1252. NotImplemented("llGetAgentSize");
  1253. return new LSL_Types.Vector3();
  1254. }
  1255. public int llSameGroup(string agent)
  1256. {
  1257. NotImplemented("llSameGroup");
  1258. return 0;
  1259. }
  1260. public void llUnSit(string id)
  1261. {
  1262. NotImplemented("llUnSit");
  1263. }
  1264. public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset)
  1265. {
  1266. NotImplemented("llGroundSlope");
  1267. return new LSL_Types.Vector3();
  1268. }
  1269. public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset)
  1270. {
  1271. NotImplemented("llGroundNormal");
  1272. return new LSL_Types.Vector3();
  1273. }
  1274. public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset)
  1275. {
  1276. NotImplemented("llGroundContour");
  1277. return new LSL_Types.Vector3();
  1278. }
  1279. public int llGetAttached()
  1280. {
  1281. NotImplemented("llGetAttached");
  1282. return 0;
  1283. }
  1284. public int llGetFreeMemory()
  1285. {
  1286. NotImplemented("llGetFreeMemory");
  1287. return 0;
  1288. }
  1289. public string llGetRegionName()
  1290. {
  1291. return World.RegionInfo.RegionName;
  1292. }
  1293. public double llGetRegionTimeDilation()
  1294. {
  1295. return 1.0f;
  1296. }
  1297. public double llGetRegionFPS()
  1298. {
  1299. return 10.0f;
  1300. }
  1301. /* particle system rules should be coming into this routine as doubles, that is
  1302. rule[0] should be an integer from this list and rule[1] should be the arg
  1303. for the same integer. wiki.secondlife.com has most of this mapping, but some
  1304. came from http://www.caligari-designs.com/p4u2
  1305. We iterate through the list for 'Count' elements, incrementing by two for each
  1306. iteration and set the members of Primitive.ParticleSystem, one at a time.
  1307. */
  1308. public enum PrimitiveRule : int
  1309. {
  1310. PSYS_PART_FLAGS = 0,
  1311. PSYS_PART_START_COLOR = 1,
  1312. PSYS_PART_START_ALPHA = 2,
  1313. PSYS_PART_END_COLOR = 3,
  1314. PSYS_PART_END_ALPHA = 4,
  1315. PSYS_PART_START_SCALE = 5,
  1316. PSYS_PART_END_SCALE = 6,
  1317. PSYS_PART_MAX_AGE = 7,
  1318. PSYS_SRC_ACCEL = 8,
  1319. PSYS_SRC_PATTERN = 9,
  1320. PSYS_SRC_TEXTURE = 12,
  1321. PSYS_SRC_BURST_RATE = 13,
  1322. PSYS_SRC_BURST_PART_COUNT = 15,
  1323. PSYS_SRC_BURST_RADIUS = 16,
  1324. PSYS_SRC_BURST_SPEED_MIN = 17,
  1325. PSYS_SRC_BURST_SPEED_MAX = 18,
  1326. PSYS_SRC_MAX_AGE = 19,
  1327. PSYS_SRC_TARGET_KEY = 20,
  1328. PSYS_SRC_OMEGA = 21,
  1329. PSYS_SRC_ANGLE_BEGIN = 22,
  1330. PSYS_SRC_ANGLE_END = 23
  1331. }
  1332. public void llParticleSystem(List<Object> rules)
  1333. {
  1334. Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
  1335. for (int i = 0; i < rules.Count; i += 2)
  1336. {
  1337. switch ((int) rules[i])
  1338. {
  1339. case (int) PrimitiveRule.PSYS_PART_FLAGS:
  1340. prules.PartFlags = (uint) rules[i + 1];
  1341. break;
  1342. case (int) PrimitiveRule.PSYS_PART_START_COLOR:
  1343. prules.PartStartColor = (LLColor) rules[i + 1];
  1344. break;
  1345. case (int) PrimitiveRule.PSYS_PART_START_ALPHA:
  1346. //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
  1347. break;
  1348. case (int) PrimitiveRule.PSYS_PART_END_COLOR:
  1349. prules.PartEndColor = (LLColor) rules[i + 1];
  1350. break;
  1351. case (int) PrimitiveRule.PSYS_PART_END_ALPHA:
  1352. //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
  1353. break;
  1354. case (int) PrimitiveRule.PSYS_PART_START_SCALE:
  1355. //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
  1356. break;
  1357. case (int) PrimitiveRule.PSYS_PART_END_SCALE:
  1358. //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
  1359. break;
  1360. case (int) PrimitiveRule.PSYS_PART_MAX_AGE:
  1361. prules.MaxAge = (float) rules[i + 1];
  1362. break;
  1363. case (int) PrimitiveRule.PSYS_SRC_ACCEL:
  1364. //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
  1365. break;
  1366. case (int) PrimitiveRule.PSYS_SRC_PATTERN:
  1367. //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
  1368. break;
  1369. case (int) PrimitiveRule.PSYS_SRC_TEXTURE:
  1370. prules.Texture = (LLUUID) rules[i + 1];
  1371. break;
  1372. case (int) PrimitiveRule.PSYS_SRC_BURST_RATE:
  1373. prules.BurstRate = (float) rules[i + 1];
  1374. break;
  1375. case (int) PrimitiveRule.PSYS_SRC_BURST_PART_COUNT:
  1376. prules.BurstPartCount = (byte) rules[i + 1];
  1377. break;
  1378. case (int) PrimitiveRule.PSYS_SRC_BURST_RADIUS:
  1379. prules.BurstRadius = (float) rules[i + 1];
  1380. break;
  1381. case (int) PrimitiveRule.PSYS_SRC_BURST_SPEED_MIN:
  1382. prules.BurstSpeedMin = (float) rules[i + 1];
  1383. break;
  1384. case (int) PrimitiveRule.PSYS_SRC_BURST_SPEED_MAX:
  1385. prules.BurstSpeedMax = (float) rules[i + 1];
  1386. break;
  1387. case (int) PrimitiveRule.PSYS_SRC_MAX_AGE:
  1388. prules.MaxAge = (float) rules[i + 1];
  1389. break;
  1390. case (int) PrimitiveRule.PSYS_SRC_TARGET_KEY:
  1391. prules.Target = (LLUUID) rules[i + 1];
  1392. break;
  1393. case (int) PrimitiveRule.PSYS_SRC_OMEGA:
  1394. //cast?? prules.MaxAge = (float)rules[i + 1];
  1395. break;
  1396. case (int) PrimitiveRule.PSYS_SRC_ANGLE_BEGIN:
  1397. prules.InnerAngle = (float) rules[i + 1];
  1398. break;
  1399. case (int) PrimitiveRule.PSYS_SRC_ANGLE_END:
  1400. prules.OuterAngle = (float) rules[i + 1];
  1401. break;
  1402. }
  1403. }
  1404. m_host.AddNewParticleSystem(prules);
  1405. }
  1406. public void llGroundRepel(double height, int water, double tau)
  1407. {
  1408. NotImplemented("llGroundRepel");
  1409. }
  1410. public void llGiveInventoryList()
  1411. {
  1412. NotImplemented("llGiveInventoryList");
  1413. }
  1414. public void llSetVehicleType(int type)
  1415. {
  1416. NotImplemented("llSetVehicleType");
  1417. }
  1418. public void llSetVehicledoubleParam(int param, double value)
  1419. {
  1420. NotImplemented("llSetVehicledoubleParam");
  1421. }
  1422. public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec)
  1423. {
  1424. NotImplemented("llSetVehicleVectorParam");
  1425. }
  1426. public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot)
  1427. {
  1428. NotImplemented("llSetVehicleRotationParam");
  1429. }
  1430. public void llSetVehicleFlags(int flags)
  1431. {
  1432. NotImplemented("llSetVehicleFlags");
  1433. }
  1434. public void llRemoveVehicleFlags(int flags)
  1435. {
  1436. NotImplemented("llRemoveVehicleFlags");
  1437. }
  1438. public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot)
  1439. {
  1440. NotImplemented("llSitTarget");
  1441. }
  1442. public string llAvatarOnSitTarget()
  1443. {
  1444. NotImplemented("llAvatarOnSitTarget");
  1445. return "";
  1446. }
  1447. public void llAddToLandPassList(string avatar, double hours)
  1448. {
  1449. NotImplemented("llAddToLandPassList");
  1450. }
  1451. public void llSetTouchText(string text)
  1452. {
  1453. m_host.TouchName = text;
  1454. }
  1455. public void llSetSitText(string text)
  1456. {
  1457. m_host.SitName = text;
  1458. }
  1459. public void llSetCameraEyeOffset(LSL_Types.Vector3 offset)
  1460. {
  1461. NotImplemented("llSetCameraEyeOffset");
  1462. }
  1463. public void llSetCameraAtOffset(LSL_Types.Vector3 offset)
  1464. {
  1465. NotImplemented("llSetCameraAtOffset");
  1466. }
  1467. public void llDumpList2String()
  1468. {
  1469. NotImplemented("llDumpList2String");
  1470. }
  1471. public void llScriptDanger(LSL_Types.Vector3 pos)
  1472. {
  1473. NotImplemented("llScriptDanger");
  1474. }
  1475. public void llDialog(string avatar, string message, List<string> buttons, int chat_channel)
  1476. {
  1477. NotImplemented("llDialog");
  1478. }
  1479. public void llVolumeDetect(int detect)
  1480. {
  1481. NotImplemented("llVolumeDetect");
  1482. }
  1483. public void llResetOtherScript(string name)
  1484. {
  1485. NotImplemented("llResetOtherScript");
  1486. }
  1487. public int llGetScriptState(string name)
  1488. {
  1489. NotImplemented("llGetScriptState");
  1490. return 0;
  1491. }
  1492. public void llRemoteLoadScript()
  1493. {
  1494. NotImplemented("llRemoteLoadScript");
  1495. }
  1496. public void llSetRemoteScriptAccessPin(int pin)
  1497. {
  1498. NotImplemented("llSetRemoteScriptAccessPin");
  1499. }
  1500. public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param)
  1501. {
  1502. NotImplemented("llRemoteLoadScriptPin");
  1503. }
  1504. public void llOpenRemoteDataChannel()
  1505. {
  1506. NotImplemented("llOpenRemoteDataChannel");
  1507. }
  1508. public string llSendRemoteData(string channel, string dest, int idata, string sdata)
  1509. {
  1510. NotImplemented("llSendRemoteData");
  1511. return "";
  1512. }
  1513. public void llRemoteDataReply(string channel, string message_id, string sdata, int idata)
  1514. {
  1515. NotImplemented("llRemoteDataReply");
  1516. }
  1517. public void llCloseRemoteDataChannel(string channel)
  1518. {
  1519. NotImplemented("llCloseRemoteDataChannel");
  1520. }
  1521. public string llMD5String(string src, int nonce)
  1522. {
  1523. return Util.Md5Hash(src + ":" + nonce.ToString());
  1524. }
  1525. public void llSetPrimitiveParams(List<string> rules)
  1526. {
  1527. NotImplemented("llSetPrimitiveParams");
  1528. }
  1529. public string llStringToBase64(string str)
  1530. {
  1531. try
  1532. {
  1533. byte[] encData_byte = new byte[str.Length];
  1534. encData_byte = Encoding.UTF8.GetBytes(str);
  1535. string encodedData = Convert.ToBase64String(encData_byte);
  1536. return encodedData;
  1537. }
  1538. catch (Exception e)
  1539. {
  1540. throw new Exception("Error in base64Encode" + e.Message);
  1541. }
  1542. }
  1543. public string llBase64ToString(string str)
  1544. {
  1545. UTF8Encoding encoder = new UTF8Encoding();
  1546. Decoder utf8Decode = encoder.GetDecoder();
  1547. try
  1548. {
  1549. byte[] todecode_byte = Convert.FromBase64String(str);
  1550. int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
  1551. char[] decoded_char = new char[charCount];
  1552. utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
  1553. string result = new String(decoded_char);
  1554. return result;
  1555. }
  1556. catch (Exception e)
  1557. {
  1558. throw new Exception("Error in base64Decode" + e.Message);
  1559. }
  1560. }
  1561. public void llXorBase64Strings()
  1562. {
  1563. throw new Exception("Command deprecated! Use llXorBase64StringsCorrect instead.");
  1564. }
  1565. public void llRemoteDataSetRegion()
  1566. {
  1567. NotImplemented("llRemoteDataSetRegion");
  1568. }
  1569. public double llLog10(double val)
  1570. {
  1571. return (double) Math.Log10(val);
  1572. }
  1573. public double llLog(double val)
  1574. {
  1575. return (double) Math.Log(val);
  1576. }
  1577. public List<string> llGetAnimationList(string id)
  1578. {
  1579. NotImplemented("llGetAnimationList");
  1580. return new List<string>();
  1581. }
  1582. public void llSetParcelMusicURL(string url)
  1583. {
  1584. NotImplemented("llSetParcelMusicURL");
  1585. }
  1586. public LSL_Types.Vector3 llGetRootPosition()
  1587. {
  1588. NotImplemented("llGetRootPosition");
  1589. return new LSL_Types.Vector3();
  1590. }
  1591. public LSL_Types.Quaternion llGetRootRotation()
  1592. {
  1593. NotImplemented("llGetRootRotation");
  1594. return new LSL_Types.Quaternion();
  1595. }
  1596. public string llGetObjectDesc()
  1597. {
  1598. return m_host.Description;
  1599. }
  1600. public void llSetObjectDesc(string desc)
  1601. {
  1602. m_host.Description = desc;
  1603. }
  1604. public string llGetCreator()
  1605. {
  1606. return m_host.ObjectCreator.ToString();
  1607. }
  1608. public string llGetTimestamp()
  1609. {
  1610. return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
  1611. }
  1612. public void llSetLinkAlpha(int linknumber, double alpha, int face)
  1613. {
  1614. NotImplemented("llSetLinkAlpha");
  1615. }
  1616. public int llGetNumberOfPrims()
  1617. {
  1618. NotImplemented("llGetNumberOfPrims");
  1619. return 0;
  1620. }
  1621. public string llGetNumberOfNotecardLines(string name)
  1622. {
  1623. NotImplemented("llGetNumberOfNotecardLines");
  1624. return "";
  1625. }
  1626. public List<string> llGetBoundingBox(string obj)
  1627. {
  1628. NotImplemented("llGetBoundingBox");
  1629. return new List<string>();
  1630. }
  1631. public LSL_Types.Vector3 llGetGeometricCenter()
  1632. {
  1633. NotImplemented("llGetGeometricCenter");
  1634. return new LSL_Types.Vector3();
  1635. }
  1636. public void llGetPrimitiveParams()
  1637. {
  1638. NotImplemented("llGetPrimitiveParams");
  1639. }
  1640. public string llIntegerToBase64(int number)
  1641. {
  1642. NotImplemented("llIntegerToBase64");
  1643. return "";
  1644. }
  1645. public int llBase64ToInteger(string str)
  1646. {
  1647. NotImplemented("llBase64ToInteger");
  1648. return 0;
  1649. }
  1650. public double llGetGMTclock()
  1651. {
  1652. return DateTime.UtcNow.TimeOfDay.TotalSeconds;
  1653. }
  1654. public string llGetSimulatorHostname()
  1655. {
  1656. return Environment.MachineName;
  1657. }
  1658. public void llSetLocalRot(LSL_Types.Quaternion rot)
  1659. {
  1660. NotImplemented("llSetLocalRot");
  1661. }
  1662. public List<string> llParseStringKeepNulls(string src, List<string> seperators, List<string> spacers)
  1663. {
  1664. NotImplemented("llParseStringKeepNulls");
  1665. return new List<string>();
  1666. }
  1667. public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity,
  1668. LSL_Types.Quaternion rot, int param)
  1669. {
  1670. NotImplemented("llRezAtRoot");
  1671. }
  1672. public int llGetObjectPermMask(int mask)
  1673. {
  1674. NotImplemented("llGetObjectPermMask");
  1675. return 0;
  1676. }
  1677. public void llSetObjectPermMask(int mask, int value)
  1678. {
  1679. NotImplemented("llSetObjectPermMask");
  1680. }
  1681. public void llGetInventoryPermMask(string item, int mask)
  1682. {
  1683. NotImplemented("llGetInventoryPermMask");
  1684. }
  1685. public void llSetInventoryPermMask(string item, int mask, int value)
  1686. {
  1687. NotImplemented("llSetInventoryPermMask");
  1688. }
  1689. public string llGetInventoryCreator(string item)
  1690. {
  1691. NotImplemented("llGetInventoryCreator");
  1692. return "";
  1693. }
  1694. public void llOwnerSay(string msg)
  1695. {
  1696. NotImplemented("llOwnerSay");
  1697. }
  1698. public void llRequestSimulatorData(string simulator, int data)
  1699. {
  1700. NotImplemented("llRequestSimulatorData");
  1701. }
  1702. public void llForceMouselook(int mouselook)
  1703. {
  1704. NotImplemented("llForceMouselook");
  1705. }
  1706. public double llGetObjectMass(string id)
  1707. {
  1708. NotImplemented("llGetObjectMass");
  1709. return 0;
  1710. }
  1711. public void llListReplaceList()
  1712. {
  1713. NotImplemented("llListReplaceList");
  1714. }
  1715. public void llLoadURL(string avatar_id, string message, string url)
  1716. {
  1717. LLUUID avatarId = new LLUUID(avatar_id);
  1718. m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message,
  1719. url);
  1720. }
  1721. public void llParcelMediaCommandList(List<string> commandList)
  1722. {
  1723. NotImplemented("llParcelMediaCommandList");
  1724. }
  1725. public void llParcelMediaQuery()
  1726. {
  1727. NotImplemented("llParcelMediaQuery");
  1728. }
  1729. public int llModPow(int a, int b, int c)
  1730. {
  1731. Int64 tmp = 0;
  1732. Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp);
  1733. return Convert.ToInt32(tmp);
  1734. }
  1735. public int llGetInventoryType(string name)
  1736. {
  1737. NotImplemented("llGetInventoryType");
  1738. return 0;
  1739. }
  1740. public void llSetPayPrice(int price, List<string> quick_pay_buttons)
  1741. {
  1742. NotImplemented("llSetPayPrice");
  1743. }
  1744. public LSL_Types.Vector3 llGetCameraPos()
  1745. {
  1746. NotImplemented("llGetCameraPos");
  1747. return new LSL_Types.Vector3();
  1748. }
  1749. public LSL_Types.Quaternion llGetCameraRot()
  1750. {
  1751. NotImplemented("llGetCameraRot");
  1752. return new LSL_Types.Quaternion();
  1753. }
  1754. public void llSetPrimURL()
  1755. {
  1756. NotImplemented("llSetPrimURL");
  1757. }
  1758. public void llRefreshPrimURL()
  1759. {
  1760. NotImplemented("llRefreshPrimURL");
  1761. }
  1762. public string llEscapeURL(string url)
  1763. {
  1764. try
  1765. {
  1766. return Uri.EscapeUriString(url);
  1767. }
  1768. catch (Exception ex)
  1769. {
  1770. return "llEscapeURL: " + ex.ToString();
  1771. }
  1772. }
  1773. public string llUnescapeURL(string url)
  1774. {
  1775. try
  1776. {
  1777. return Uri.UnescapeDataString(url);
  1778. }
  1779. catch (Exception ex)
  1780. {
  1781. return "llUnescapeURL: " + ex.ToString();
  1782. }
  1783. }
  1784. public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at)
  1785. {
  1786. NotImplemented("llMapDestination");
  1787. }
  1788. public void llAddToLandBanList(string avatar, double hours)
  1789. {
  1790. NotImplemented("llAddToLandBanList");
  1791. }
  1792. public void llRemoveFromLandPassList(string avatar)
  1793. {
  1794. NotImplemented("llRemoveFromLandPassList");
  1795. }
  1796. public void llRemoveFromLandBanList(string avatar)
  1797. {
  1798. NotImplemented("llRemoveFromLandBanList");
  1799. }
  1800. public void llSetCameraParams(List<string> rules)
  1801. {
  1802. NotImplemented("llSetCameraParams");
  1803. }
  1804. public void llClearCameraParams()
  1805. {
  1806. NotImplemented("llClearCameraParams");
  1807. }
  1808. public double llListStatistics(int operation, List<string> src)
  1809. {
  1810. NotImplemented("llListStatistics");
  1811. return 0;
  1812. }
  1813. public int llGetUnixTime()
  1814. {
  1815. return Util.UnixTimeSinceEpoch();
  1816. }
  1817. public int llGetParcelFlags(LSL_Types.Vector3 pos)
  1818. {
  1819. NotImplemented("llGetParcelFlags");
  1820. return 0;
  1821. }
  1822. public int llGetRegionFlags()
  1823. {
  1824. NotImplemented("llGetRegionFlags");
  1825. return 0;
  1826. }
  1827. public string llXorBase64StringsCorrect(string str1, string str2)
  1828. {
  1829. string ret = "";
  1830. string src1 = llBase64ToString(str1);
  1831. string src2 = llBase64ToString(str2);
  1832. int c = 0;
  1833. for (int i = 0; i < src1.Length; i++)
  1834. {
  1835. ret += src1[i] ^ src2[c];
  1836. c++;
  1837. if (c > src2.Length)
  1838. c = 0;
  1839. }
  1840. return llStringToBase64(ret);
  1841. }
  1842. public void llHTTPRequest(string url, List<string> parameters, string body)
  1843. {
  1844. m_ScriptEngine.m_LSLLongCmdHandler.StartHttpRequest(m_localID, m_itemID, url, parameters, body);
  1845. }
  1846. public void llResetLandBanList()
  1847. {
  1848. NotImplemented("llResetLandBanList");
  1849. }
  1850. public void llResetLandPassList()
  1851. {
  1852. NotImplemented("llResetLandPassList");
  1853. }
  1854. public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide)
  1855. {
  1856. NotImplemented("llGetParcelPrimCount");
  1857. return 0;
  1858. }
  1859. public List<string> llGetParcelPrimOwners(LSL_Types.Vector3 pos)
  1860. {
  1861. NotImplemented("llGetParcelPrimOwners");
  1862. return new List<string>();
  1863. }
  1864. public int llGetObjectPrimCount(string object_id)
  1865. {
  1866. NotImplemented("llGetObjectPrimCount");
  1867. return 0;
  1868. }
  1869. public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide)
  1870. {
  1871. NotImplemented("llGetParcelMaxPrims");
  1872. return 0;
  1873. }
  1874. public List<string> llGetParcelDetails(LSL_Types.Vector3 pos, List<string> param)
  1875. {
  1876. NotImplemented("llGetParcelDetails");
  1877. return new List<string>();
  1878. }
  1879. //
  1880. // OpenSim functions
  1881. //
  1882. public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
  1883. int timer)
  1884. {
  1885. if (dynamicID == "")
  1886. {
  1887. IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
  1888. LLUUID createdTexture =
  1889. textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
  1890. extraParams, timer);
  1891. return createdTexture.ToString();
  1892. }
  1893. else
  1894. {
  1895. //TODO update existing dynamic textures
  1896. }
  1897. return LLUUID.Zero.ToString();
  1898. }
  1899. private void NotImplemented(string Command)
  1900. {
  1901. if (throwErrorOnNotImplemented)
  1902. throw new NotImplementedException("Command not implemented: " + Command);
  1903. }
  1904. }
  1905. }