OSSL_Stub.cs 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  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 OpenSimulator 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.Runtime.Remoting.Lifetime;
  29. using System.Threading;
  30. using System.Reflection;
  31. using System.Collections;
  32. using System.Collections.Generic;
  33. using OpenSim.Framework;
  34. using OpenSim.Region.Framework.Interfaces;
  35. using OpenSim.Region.ScriptEngine.Interfaces;
  36. using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
  37. using integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
  38. using vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
  39. using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
  40. using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
  41. using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
  42. using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
  43. using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
  44. using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
  45. using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
  46. namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
  47. {
  48. public partial class ScriptBaseClass : MarshalByRefObject
  49. {
  50. public IOSSL_Api m_OSSL_Functions;
  51. public void ApiTypeOSSL(IScriptApi api)
  52. {
  53. if (!(api is IOSSL_Api))
  54. return;
  55. m_OSSL_Functions = (IOSSL_Api)api;
  56. Prim = new OSSLPrim(this);
  57. }
  58. public void osSetRegionWaterHeight(double height)
  59. {
  60. m_OSSL_Functions.osSetRegionWaterHeight(height);
  61. }
  62. public void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour)
  63. {
  64. m_OSSL_Functions.osSetRegionSunSettings(useEstateSun, sunFixed, sunHour);
  65. }
  66. public void osSetEstateSunSettings(bool sunFixed, double sunHour)
  67. {
  68. m_OSSL_Functions.osSetEstateSunSettings(sunFixed, sunHour);
  69. }
  70. public double osGetCurrentSunHour()
  71. {
  72. return m_OSSL_Functions.osGetCurrentSunHour();
  73. }
  74. public double osGetSunParam(string param)
  75. {
  76. return m_OSSL_Functions.osGetSunParam(param);
  77. }
  78. // Deprecated
  79. public double osSunGetParam(string param)
  80. {
  81. return m_OSSL_Functions.osSunGetParam(param);
  82. }
  83. public void osSetSunParam(string param, double value)
  84. {
  85. m_OSSL_Functions.osSetSunParam(param, value);
  86. }
  87. // Deprecated
  88. public void osSunSetParam(string param, double value)
  89. {
  90. m_OSSL_Functions.osSunSetParam(param, value);
  91. }
  92. public string osWindActiveModelPluginName()
  93. {
  94. return m_OSSL_Functions.osWindActiveModelPluginName();
  95. }
  96. public void osSetWindParam(string plugin, string param, LSL_Float value)
  97. {
  98. m_OSSL_Functions.osSetWindParam(plugin, param, value);
  99. }
  100. public LSL_Float osGetWindParam(string plugin, string param)
  101. {
  102. return m_OSSL_Functions.osGetWindParam(plugin, param);
  103. }
  104. public void osParcelJoin(vector pos1, vector pos2)
  105. {
  106. m_OSSL_Functions.osParcelJoin(pos1,pos2);
  107. }
  108. public void osParcelSubdivide(vector pos1, vector pos2)
  109. {
  110. m_OSSL_Functions.osParcelSubdivide(pos1, pos2);
  111. }
  112. public void osSetParcelDetails(vector pos, LSL_List rules)
  113. {
  114. m_OSSL_Functions.osSetParcelDetails(pos, rules);
  115. }
  116. // Deprecated
  117. public void osParcelSetDetails(vector pos, LSL_List rules)
  118. {
  119. m_OSSL_Functions.osParcelSetDetails(pos,rules);
  120. }
  121. public double osList2Double(LSL_Types.list src, int index)
  122. {
  123. return m_OSSL_Functions.osList2Double(src, index);
  124. }
  125. public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
  126. int timer)
  127. {
  128. return m_OSSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer);
  129. }
  130. public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams,
  131. int timer)
  132. {
  133. return m_OSSL_Functions.osSetDynamicTextureData(dynamicID, contentType, data, extraParams, timer);
  134. }
  135. public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
  136. int timer, int alpha)
  137. {
  138. return m_OSSL_Functions.osSetDynamicTextureURLBlend(dynamicID, contentType, url, extraParams, timer, alpha);
  139. }
  140. public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
  141. int timer, int alpha)
  142. {
  143. return m_OSSL_Functions.osSetDynamicTextureDataBlend(dynamicID, contentType, data, extraParams, timer, alpha);
  144. }
  145. public string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
  146. bool blend, int disp, int timer, int alpha, int face)
  147. {
  148. return m_OSSL_Functions.osSetDynamicTextureURLBlendFace(dynamicID, contentType, url, extraParams,
  149. blend, disp, timer, alpha, face);
  150. }
  151. public string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
  152. bool blend, int disp, int timer, int alpha, int face)
  153. {
  154. return m_OSSL_Functions.osSetDynamicTextureDataBlendFace(dynamicID, contentType, data, extraParams,
  155. blend, disp, timer, alpha, face);
  156. }
  157. public LSL_Float osGetTerrainHeight(int x, int y)
  158. {
  159. return m_OSSL_Functions.osGetTerrainHeight(x, y);
  160. }
  161. // Deprecated
  162. public LSL_Float osTerrainGetHeight(int x, int y)
  163. {
  164. return m_OSSL_Functions.osTerrainGetHeight(x, y);
  165. }
  166. public LSL_Integer osSetTerrainHeight(int x, int y, double val)
  167. {
  168. return m_OSSL_Functions.osSetTerrainHeight(x, y, val);
  169. }
  170. // Deprecated
  171. public LSL_Integer osTerrainSetHeight(int x, int y, double val)
  172. {
  173. return m_OSSL_Functions.osTerrainSetHeight(x, y, val);
  174. }
  175. public void osTerrainFlush()
  176. {
  177. m_OSSL_Functions.osTerrainFlush();
  178. }
  179. public int osRegionRestart(double seconds)
  180. {
  181. return m_OSSL_Functions.osRegionRestart(seconds);
  182. }
  183. public void osRegionNotice(string msg)
  184. {
  185. m_OSSL_Functions.osRegionNotice(msg);
  186. }
  187. public bool osConsoleCommand(string Command)
  188. {
  189. return m_OSSL_Functions.osConsoleCommand(Command);
  190. }
  191. public void osSetParcelMediaURL(string url)
  192. {
  193. m_OSSL_Functions.osSetParcelMediaURL(url);
  194. }
  195. public void osSetParcelSIPAddress(string SIPAddress)
  196. {
  197. m_OSSL_Functions.osSetParcelSIPAddress(SIPAddress);
  198. }
  199. public void osSetPrimFloatOnWater(int floatYN)
  200. {
  201. m_OSSL_Functions.osSetPrimFloatOnWater(floatYN);
  202. }
  203. // Teleport Functions
  204. public void osTeleportAgent(string agent, string regionName, vector position, vector lookat)
  205. {
  206. m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat);
  207. }
  208. public void osTeleportAgent(string agent, int regionX, int regionY, vector position, vector lookat)
  209. {
  210. m_OSSL_Functions.osTeleportAgent(agent, regionX, regionY, position, lookat);
  211. }
  212. public void osTeleportAgent(string agent, vector position, vector lookat)
  213. {
  214. m_OSSL_Functions.osTeleportAgent(agent, position, lookat);
  215. }
  216. public void osTeleportOwner(string regionName, vector position, vector lookat)
  217. {
  218. m_OSSL_Functions.osTeleportOwner(regionName, position, lookat);
  219. }
  220. public void osTeleportOwner(int regionX, int regionY, vector position, vector lookat)
  221. {
  222. m_OSSL_Functions.osTeleportOwner(regionX, regionY, position, lookat);
  223. }
  224. public void osTeleportOwner(vector position, vector lookat)
  225. {
  226. m_OSSL_Functions.osTeleportOwner(position, lookat);
  227. }
  228. // Avatar info functions
  229. public string osGetAgentIP(string agent)
  230. {
  231. return m_OSSL_Functions.osGetAgentIP(agent);
  232. }
  233. public LSL_List osGetAgents()
  234. {
  235. return m_OSSL_Functions.osGetAgents();
  236. }
  237. // Animation Functions
  238. public void osAvatarPlayAnimation(string avatar, string animation)
  239. {
  240. m_OSSL_Functions.osAvatarPlayAnimation(avatar, animation);
  241. }
  242. public void osAvatarStopAnimation(string avatar, string animation)
  243. {
  244. m_OSSL_Functions.osAvatarStopAnimation(avatar, animation);
  245. }
  246. #region Attachment commands
  247. public void osForceAttachToAvatar(int attachmentPoint)
  248. {
  249. m_OSSL_Functions.osForceAttachToAvatar(attachmentPoint);
  250. }
  251. public void osForceAttachToAvatarFromInventory(string itemName, int attachmentPoint)
  252. {
  253. m_OSSL_Functions.osForceAttachToAvatarFromInventory(itemName, attachmentPoint);
  254. }
  255. public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint)
  256. {
  257. m_OSSL_Functions.osForceAttachToOtherAvatarFromInventory(rawAvatarId, itemName, attachmentPoint);
  258. }
  259. public void osForceDetachFromAvatar()
  260. {
  261. m_OSSL_Functions.osForceDetachFromAvatar();
  262. }
  263. public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints)
  264. {
  265. return m_OSSL_Functions.osGetNumberOfAttachments(avatar, attachmentPoints);
  266. }
  267. public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int flags)
  268. {
  269. m_OSSL_Functions.osMessageAttachments(avatar, message, attachmentPoints, flags);
  270. }
  271. #endregion
  272. // Texture Draw functions
  273. public string osMovePen(string drawList, int x, int y)
  274. {
  275. return m_OSSL_Functions.osMovePen(drawList, x, y);
  276. }
  277. public string osDrawLine(string drawList, int startX, int startY, int endX, int endY)
  278. {
  279. return m_OSSL_Functions.osDrawLine(drawList, startX, startY, endX, endY);
  280. }
  281. public string osDrawLine(string drawList, int endX, int endY)
  282. {
  283. return m_OSSL_Functions.osDrawLine(drawList, endX, endY);
  284. }
  285. public string osDrawText(string drawList, string text)
  286. {
  287. return m_OSSL_Functions.osDrawText(drawList, text);
  288. }
  289. public string osDrawEllipse(string drawList, int width, int height)
  290. {
  291. return m_OSSL_Functions.osDrawEllipse(drawList, width, height);
  292. }
  293. public string osDrawRectangle(string drawList, int width, int height)
  294. {
  295. return m_OSSL_Functions.osDrawRectangle(drawList, width, height);
  296. }
  297. public string osDrawFilledRectangle(string drawList, int width, int height)
  298. {
  299. return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height);
  300. }
  301. public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
  302. {
  303. return m_OSSL_Functions.osDrawPolygon(drawList, x, y);
  304. }
  305. public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y)
  306. {
  307. return m_OSSL_Functions.osDrawFilledPolygon(drawList, x, y);
  308. }
  309. public string osSetFontSize(string drawList, int fontSize)
  310. {
  311. return m_OSSL_Functions.osSetFontSize(drawList, fontSize);
  312. }
  313. public string osSetFontName(string drawList, string fontName)
  314. {
  315. return m_OSSL_Functions.osSetFontName(drawList, fontName);
  316. }
  317. public string osSetPenSize(string drawList, int penSize)
  318. {
  319. return m_OSSL_Functions.osSetPenSize(drawList, penSize);
  320. }
  321. public string osSetPenCap(string drawList, string direction, string type)
  322. {
  323. return m_OSSL_Functions.osSetPenCap(drawList, direction, type);
  324. }
  325. public string osSetPenColor(string drawList, string color)
  326. {
  327. return m_OSSL_Functions.osSetPenColor(drawList, color);
  328. }
  329. // Deprecated
  330. public string osSetPenColour(string drawList, string colour)
  331. {
  332. return m_OSSL_Functions.osSetPenColour(drawList, colour);
  333. }
  334. public string osDrawImage(string drawList, int width, int height, string imageUrl)
  335. {
  336. return m_OSSL_Functions.osDrawImage(drawList, width, height, imageUrl);
  337. }
  338. public vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize)
  339. {
  340. return m_OSSL_Functions.osGetDrawStringSize(contentType, text, fontName, fontSize);
  341. }
  342. public void osSetStateEvents(int events)
  343. {
  344. m_OSSL_Functions.osSetStateEvents(events);
  345. }
  346. public string osGetScriptEngineName()
  347. {
  348. return m_OSSL_Functions.osGetScriptEngineName();
  349. }
  350. public LSL_Integer osCheckODE()
  351. {
  352. return m_OSSL_Functions.osCheckODE();
  353. }
  354. public string osGetPhysicsEngineType()
  355. {
  356. return m_OSSL_Functions.osGetPhysicsEngineType();
  357. }
  358. public string osGetSimulatorVersion()
  359. {
  360. return m_OSSL_Functions.osGetSimulatorVersion();
  361. }
  362. public Hashtable osParseJSON(string JSON)
  363. {
  364. return m_OSSL_Functions.osParseJSON(JSON);
  365. }
  366. public Object osParseJSONNew(string JSON)
  367. {
  368. return m_OSSL_Functions.osParseJSONNew(JSON);
  369. }
  370. public void osMessageObject(key objectUUID,string message)
  371. {
  372. m_OSSL_Functions.osMessageObject(objectUUID,message);
  373. }
  374. public void osMakeNotecard(string notecardName, LSL_Types.list contents)
  375. {
  376. m_OSSL_Functions.osMakeNotecard(notecardName, contents);
  377. }
  378. public string osGetNotecardLine(string name, int line)
  379. {
  380. return m_OSSL_Functions.osGetNotecardLine(name, line);
  381. }
  382. public string osGetNotecard(string name)
  383. {
  384. return m_OSSL_Functions.osGetNotecard(name);
  385. }
  386. public int osGetNumberOfNotecardLines(string name)
  387. {
  388. return m_OSSL_Functions.osGetNumberOfNotecardLines(name);
  389. }
  390. public string osAvatarName2Key(string firstname, string lastname)
  391. {
  392. return m_OSSL_Functions.osAvatarName2Key(firstname, lastname);
  393. }
  394. public string osKey2Name(string id)
  395. {
  396. return m_OSSL_Functions.osKey2Name(id);
  397. }
  398. public string osGetGridNick()
  399. {
  400. return m_OSSL_Functions.osGetGridNick();
  401. }
  402. public string osGetGridName()
  403. {
  404. return m_OSSL_Functions.osGetGridName();
  405. }
  406. public string osGetGridLoginURI()
  407. {
  408. return m_OSSL_Functions.osGetGridLoginURI();
  409. }
  410. public string osGetGridHomeURI()
  411. {
  412. return m_OSSL_Functions.osGetGridHomeURI();
  413. }
  414. public string osGetGridGatekeeperURI()
  415. {
  416. return m_OSSL_Functions.osGetGridGatekeeperURI();
  417. }
  418. public string osGetGridCustom(string key)
  419. {
  420. return m_OSSL_Functions.osGetGridCustom(key);
  421. }
  422. public string osGetAvatarHomeURI(string uuid)
  423. {
  424. return m_OSSL_Functions.osGetAvatarHomeURI(uuid);
  425. }
  426. public LSL_String osFormatString(string str, LSL_List strings)
  427. {
  428. return m_OSSL_Functions.osFormatString(str, strings);
  429. }
  430. public LSL_List osMatchString(string src, string pattern, int start)
  431. {
  432. return m_OSSL_Functions.osMatchString(src, pattern, start);
  433. }
  434. public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
  435. {
  436. return m_OSSL_Functions.osReplaceString(src,pattern,replace,count,start);
  437. }
  438. // Information about data loaded into the region
  439. public string osLoadedCreationDate()
  440. {
  441. return m_OSSL_Functions.osLoadedCreationDate();
  442. }
  443. public string osLoadedCreationTime()
  444. {
  445. return m_OSSL_Functions.osLoadedCreationTime();
  446. }
  447. public string osLoadedCreationID()
  448. {
  449. return m_OSSL_Functions.osLoadedCreationID();
  450. }
  451. public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules)
  452. {
  453. return m_OSSL_Functions.osGetLinkPrimitiveParams(linknumber, rules);
  454. }
  455. public void osForceCreateLink(string target, int parent)
  456. {
  457. m_OSSL_Functions.osForceCreateLink(target, parent);
  458. }
  459. public void osForceBreakLink(int linknum)
  460. {
  461. m_OSSL_Functions.osForceBreakLink(linknum);
  462. }
  463. public void osForceBreakAllLinks()
  464. {
  465. m_OSSL_Functions.osForceBreakAllLinks();
  466. }
  467. public LSL_Integer osIsNpc(LSL_Key npc)
  468. {
  469. return m_OSSL_Functions.osIsNpc(npc);
  470. }
  471. public key osNpcCreate(string user, string name, vector position, key cloneFrom)
  472. {
  473. return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom);
  474. }
  475. public key osNpcCreate(string user, string name, vector position, key cloneFrom, int options)
  476. {
  477. return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom, options);
  478. }
  479. public key osNpcSaveAppearance(key npc, string notecard)
  480. {
  481. return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard);
  482. }
  483. public void osNpcLoadAppearance(key npc, string notecard)
  484. {
  485. m_OSSL_Functions.osNpcLoadAppearance(npc, notecard);
  486. }
  487. public LSL_Key osNpcGetOwner(LSL_Key npc)
  488. {
  489. return m_OSSL_Functions.osNpcGetOwner(npc);
  490. }
  491. public vector osNpcGetPos(LSL_Key npc)
  492. {
  493. return m_OSSL_Functions.osNpcGetPos(npc);
  494. }
  495. public void osNpcMoveTo(key npc, vector position)
  496. {
  497. m_OSSL_Functions.osNpcMoveTo(npc, position);
  498. }
  499. public void osNpcMoveToTarget(key npc, vector target, int options)
  500. {
  501. m_OSSL_Functions.osNpcMoveToTarget(npc, target, options);
  502. }
  503. public rotation osNpcGetRot(key npc)
  504. {
  505. return m_OSSL_Functions.osNpcGetRot(npc);
  506. }
  507. public void osNpcSetRot(key npc, rotation rot)
  508. {
  509. m_OSSL_Functions.osNpcSetRot(npc, rot);
  510. }
  511. public void osNpcStopMoveToTarget(LSL_Key npc)
  512. {
  513. m_OSSL_Functions.osNpcStopMoveToTarget(npc);
  514. }
  515. public void osNpcSay(key npc, string message)
  516. {
  517. m_OSSL_Functions.osNpcSay(npc, message);
  518. }
  519. public void osNpcSay(key npc, int channel, string message)
  520. {
  521. m_OSSL_Functions.osNpcSay(npc, channel, message);
  522. }
  523. public void osNpcShout(key npc, int channel, string message)
  524. {
  525. m_OSSL_Functions.osNpcShout(npc, channel, message);
  526. }
  527. public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
  528. {
  529. m_OSSL_Functions.osNpcSit(npc, target, options);
  530. }
  531. public void osNpcStand(LSL_Key npc)
  532. {
  533. m_OSSL_Functions.osNpcStand(npc);
  534. }
  535. public void osNpcRemove(key npc)
  536. {
  537. m_OSSL_Functions.osNpcRemove(npc);
  538. }
  539. public void osNpcPlayAnimation(LSL_Key npc, string animation)
  540. {
  541. m_OSSL_Functions.osNpcPlayAnimation(npc, animation);
  542. }
  543. public void osNpcStopAnimation(LSL_Key npc, string animation)
  544. {
  545. m_OSSL_Functions.osNpcStopAnimation(npc, animation);
  546. }
  547. public void osNpcWhisper(key npc, int channel, string message)
  548. {
  549. m_OSSL_Functions.osNpcWhisper(npc, channel, message);
  550. }
  551. public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
  552. {
  553. m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
  554. }
  555. public LSL_Key osOwnerSaveAppearance(string notecard)
  556. {
  557. return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
  558. }
  559. public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecard)
  560. {
  561. return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard);
  562. }
  563. public OSSLPrim Prim;
  564. [Serializable]
  565. public class OSSLPrim
  566. {
  567. internal ScriptBaseClass OSSL;
  568. public OSSLPrim(ScriptBaseClass bc)
  569. {
  570. OSSL = bc;
  571. Position = new OSSLPrim_Position(this);
  572. Rotation = new OSSLPrim_Rotation(this);
  573. }
  574. public OSSLPrim_Position Position;
  575. public OSSLPrim_Rotation Rotation;
  576. private TextStruct _text;
  577. public TextStruct Text
  578. {
  579. get { return _text; }
  580. set
  581. {
  582. _text = value;
  583. OSSL.llSetText(_text.Text, _text.color, _text.alpha);
  584. }
  585. }
  586. [Serializable]
  587. public struct TextStruct
  588. {
  589. public string Text;
  590. public LSL_Types.Vector3 color;
  591. public double alpha;
  592. }
  593. }
  594. [Serializable]
  595. public class OSSLPrim_Position
  596. {
  597. private OSSLPrim prim;
  598. private LSL_Types.Vector3 Position;
  599. public OSSLPrim_Position(OSSLPrim _prim)
  600. {
  601. prim = _prim;
  602. }
  603. private void Load()
  604. {
  605. Position = prim.OSSL.llGetPos();
  606. }
  607. private void Save()
  608. {
  609. /* Remove temporarily until we have a handle to the region size
  610. if (Position.x > ((int)Constants.RegionSize - 1))
  611. Position.x = ((int)Constants.RegionSize - 1);
  612. if (Position.y > ((int)Constants.RegionSize - 1))
  613. Position.y = ((int)Constants.RegionSize - 1);
  614. */
  615. if (Position.z > Constants.RegionHeight)
  616. Position.z = Constants.RegionHeight;
  617. if (Position.x < 0)
  618. Position.x = 0;
  619. if (Position.y < 0)
  620. Position.y = 0;
  621. if (Position.z < 0)
  622. Position.z = 0;
  623. prim.OSSL.llSetPos(Position);
  624. }
  625. public double x
  626. {
  627. get
  628. {
  629. Load();
  630. return Position.x;
  631. }
  632. set
  633. {
  634. Load();
  635. Position.x = value;
  636. Save();
  637. }
  638. }
  639. public double y
  640. {
  641. get
  642. {
  643. Load();
  644. return Position.y;
  645. }
  646. set
  647. {
  648. Load();
  649. Position.y = value;
  650. Save();
  651. }
  652. }
  653. public double z
  654. {
  655. get
  656. {
  657. Load();
  658. return Position.z;
  659. }
  660. set
  661. {
  662. Load();
  663. Position.z = value;
  664. Save();
  665. }
  666. }
  667. }
  668. [Serializable]
  669. public class OSSLPrim_Rotation
  670. {
  671. private OSSLPrim prim;
  672. private LSL_Types.Quaternion Rotation;
  673. public OSSLPrim_Rotation(OSSLPrim _prim)
  674. {
  675. prim = _prim;
  676. }
  677. private void Load()
  678. {
  679. Rotation = prim.OSSL.llGetRot();
  680. }
  681. private void Save()
  682. {
  683. prim.OSSL.llSetRot(Rotation);
  684. }
  685. public double x
  686. {
  687. get
  688. {
  689. Load();
  690. return Rotation.x;
  691. }
  692. set
  693. {
  694. Load();
  695. Rotation.x = value;
  696. Save();
  697. }
  698. }
  699. public double y
  700. {
  701. get
  702. {
  703. Load();
  704. return Rotation.y;
  705. }
  706. set
  707. {
  708. Load();
  709. Rotation.y = value;
  710. Save();
  711. }
  712. }
  713. public double z
  714. {
  715. get
  716. {
  717. Load();
  718. return Rotation.z;
  719. }
  720. set
  721. {
  722. Load();
  723. Rotation.z = value;
  724. Save();
  725. }
  726. }
  727. public double s
  728. {
  729. get
  730. {
  731. Load();
  732. return Rotation.s;
  733. }
  734. set
  735. {
  736. Load();
  737. Rotation.s = value;
  738. Save();
  739. }
  740. }
  741. }
  742. public string osGetGender(LSL_Key rawAvatarId)
  743. {
  744. return m_OSSL_Functions.osGetGender(rawAvatarId);
  745. }
  746. public key osGetMapTexture()
  747. {
  748. return m_OSSL_Functions.osGetMapTexture();
  749. }
  750. public key osGetRegionMapTexture(string regionName)
  751. {
  752. return m_OSSL_Functions.osGetRegionMapTexture(regionName);
  753. }
  754. public LSL_List osGetRegionStats()
  755. {
  756. return m_OSSL_Functions.osGetRegionStats();
  757. }
  758. public vector osGetRegionSize()
  759. {
  760. return m_OSSL_Functions.osGetRegionSize();
  761. }
  762. /// <summary>
  763. /// Returns the amount of memory in use by the Simulator Daemon.
  764. /// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)
  765. /// </summary>
  766. /// <returns></returns>
  767. public LSL_Integer osGetSimulatorMemory()
  768. {
  769. return m_OSSL_Functions.osGetSimulatorMemory();
  770. }
  771. public void osKickAvatar(string FirstName,string SurName,string alert)
  772. {
  773. m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
  774. }
  775. public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
  776. {
  777. m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
  778. }
  779. public LSL_Float osGetHealth(string avatar)
  780. {
  781. return m_OSSL_Functions.osGetHealth(avatar);
  782. }
  783. public void osCauseDamage(string avatar, double damage)
  784. {
  785. m_OSSL_Functions.osCauseDamage(avatar, damage);
  786. }
  787. public void osCauseHealing(string avatar, double healing)
  788. {
  789. m_OSSL_Functions.osCauseHealing(avatar, healing);
  790. }
  791. public void osForceOtherSit(string avatar)
  792. {
  793. m_OSSL_Functions.osForceOtherSit(avatar);
  794. }
  795. public void osForceOtherSit(string avatar, string target)
  796. {
  797. m_OSSL_Functions.osForceOtherSit(avatar, target);
  798. }
  799. public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
  800. {
  801. return m_OSSL_Functions.osGetPrimitiveParams(prim, rules);
  802. }
  803. public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
  804. {
  805. m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
  806. }
  807. public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb)
  808. {
  809. m_OSSL_Functions.osSetProjectionParams(projection, texture, fov, focus, amb);
  810. }
  811. public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb)
  812. {
  813. m_OSSL_Functions.osSetProjectionParams(prim, projection, texture, fov, focus, amb);
  814. }
  815. public LSL_List osGetAvatarList()
  816. {
  817. return m_OSSL_Functions.osGetAvatarList();
  818. }
  819. public LSL_String osUnixTimeToTimestamp(long time)
  820. {
  821. return m_OSSL_Functions.osUnixTimeToTimestamp(time);
  822. }
  823. public LSL_String osGetInventoryDesc(string item)
  824. {
  825. return m_OSSL_Functions.osGetInventoryDesc(item);
  826. }
  827. public LSL_Integer osInviteToGroup(LSL_Key agentId)
  828. {
  829. return m_OSSL_Functions.osInviteToGroup(agentId);
  830. }
  831. public LSL_Integer osEjectFromGroup(LSL_Key agentId)
  832. {
  833. return m_OSSL_Functions.osEjectFromGroup(agentId);
  834. }
  835. public void osSetTerrainTexture(int level, LSL_Key texture)
  836. {
  837. m_OSSL_Functions.osSetTerrainTexture(level, texture);
  838. }
  839. public void osSetTerrainTextureHeight(int corner, double low, double high)
  840. {
  841. m_OSSL_Functions.osSetTerrainTextureHeight(corner, low, high);
  842. }
  843. public LSL_Integer osIsUUID(string thing)
  844. {
  845. return m_OSSL_Functions.osIsUUID(thing);
  846. }
  847. public LSL_Float osMin(double a, double b)
  848. {
  849. return m_OSSL_Functions.osMin(a, b);
  850. }
  851. public LSL_Float osMax(double a, double b)
  852. {
  853. return m_OSSL_Functions.osMax(a, b);
  854. }
  855. public LSL_Key osGetRezzingObject()
  856. {
  857. return m_OSSL_Functions.osGetRezzingObject();
  858. }
  859. public void osSetContentType(LSL_Key id, string type)
  860. {
  861. m_OSSL_Functions.osSetContentType(id,type);
  862. }
  863. public void osDropAttachment()
  864. {
  865. m_OSSL_Functions.osDropAttachment();
  866. }
  867. public void osForceDropAttachment()
  868. {
  869. m_OSSL_Functions.osForceDropAttachment();
  870. }
  871. public void osDropAttachmentAt(vector pos, rotation rot)
  872. {
  873. m_OSSL_Functions.osDropAttachmentAt(pos, rot);
  874. }
  875. public void osForceDropAttachmentAt(vector pos, rotation rot)
  876. {
  877. m_OSSL_Functions.osForceDropAttachmentAt(pos, rot);
  878. }
  879. public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield)
  880. {
  881. return m_OSSL_Functions.osListenRegex(channelID, name, ID, msg, regexBitfield);
  882. }
  883. public LSL_Integer osRegexIsMatch(string input, string pattern)
  884. {
  885. return m_OSSL_Functions.osRegexIsMatch(input, pattern);
  886. }
  887. }
  888. }