LSL_BuiltIn_Commands.cs 64 KB

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