LSL_BuiltIn_Commands.cs 65 KB

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