LSL_BuiltIn_Commands.cs 67 KB

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