OSSL_Stub.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  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 string osGetPhysicsEngineType()
  351. {
  352. return m_OSSL_Functions.osGetPhysicsEngineType();
  353. }
  354. public string osGetSimulatorVersion()
  355. {
  356. return m_OSSL_Functions.osGetSimulatorVersion();
  357. }
  358. public Hashtable osParseJSON(string JSON)
  359. {
  360. return m_OSSL_Functions.osParseJSON(JSON);
  361. }
  362. public Object osParseJSONNew(string JSON)
  363. {
  364. return m_OSSL_Functions.osParseJSONNew(JSON);
  365. }
  366. public void osMessageObject(key objectUUID,string message)
  367. {
  368. m_OSSL_Functions.osMessageObject(objectUUID,message);
  369. }
  370. public void osMakeNotecard(string notecardName, LSL_Types.list contents)
  371. {
  372. m_OSSL_Functions.osMakeNotecard(notecardName, contents);
  373. }
  374. public string osGetNotecardLine(string name, int line)
  375. {
  376. return m_OSSL_Functions.osGetNotecardLine(name, line);
  377. }
  378. public string osGetNotecard(string name)
  379. {
  380. return m_OSSL_Functions.osGetNotecard(name);
  381. }
  382. public int osGetNumberOfNotecardLines(string name)
  383. {
  384. return m_OSSL_Functions.osGetNumberOfNotecardLines(name);
  385. }
  386. public string osAvatarName2Key(string firstname, string lastname)
  387. {
  388. return m_OSSL_Functions.osAvatarName2Key(firstname, lastname);
  389. }
  390. public string osKey2Name(string id)
  391. {
  392. return m_OSSL_Functions.osKey2Name(id);
  393. }
  394. public string osGetGridNick()
  395. {
  396. return m_OSSL_Functions.osGetGridNick();
  397. }
  398. public string osGetGridName()
  399. {
  400. return m_OSSL_Functions.osGetGridName();
  401. }
  402. public string osGetGridLoginURI()
  403. {
  404. return m_OSSL_Functions.osGetGridLoginURI();
  405. }
  406. public string osGetGridHomeURI()
  407. {
  408. return m_OSSL_Functions.osGetGridHomeURI();
  409. }
  410. public string osGetGridGatekeeperURI()
  411. {
  412. return m_OSSL_Functions.osGetGridGatekeeperURI();
  413. }
  414. public string osGetGridCustom(string key)
  415. {
  416. return m_OSSL_Functions.osGetGridCustom(key);
  417. }
  418. public LSL_String osFormatString(string str, LSL_List strings)
  419. {
  420. return m_OSSL_Functions.osFormatString(str, strings);
  421. }
  422. public LSL_List osMatchString(string src, string pattern, int start)
  423. {
  424. return m_OSSL_Functions.osMatchString(src, pattern, start);
  425. }
  426. public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
  427. {
  428. return m_OSSL_Functions.osReplaceString(src,pattern,replace,count,start);
  429. }
  430. // Information about data loaded into the region
  431. public string osLoadedCreationDate()
  432. {
  433. return m_OSSL_Functions.osLoadedCreationDate();
  434. }
  435. public string osLoadedCreationTime()
  436. {
  437. return m_OSSL_Functions.osLoadedCreationTime();
  438. }
  439. public string osLoadedCreationID()
  440. {
  441. return m_OSSL_Functions.osLoadedCreationID();
  442. }
  443. public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules)
  444. {
  445. return m_OSSL_Functions.osGetLinkPrimitiveParams(linknumber, rules);
  446. }
  447. public LSL_Integer osIsNpc(LSL_Key npc)
  448. {
  449. return m_OSSL_Functions.osIsNpc(npc);
  450. }
  451. public key osNpcCreate(string user, string name, vector position, key cloneFrom)
  452. {
  453. return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom);
  454. }
  455. public key osNpcCreate(string user, string name, vector position, key cloneFrom, int options)
  456. {
  457. return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom, options);
  458. }
  459. public key osNpcSaveAppearance(key npc, string notecard)
  460. {
  461. return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard);
  462. }
  463. public void osNpcLoadAppearance(key npc, string notecard)
  464. {
  465. m_OSSL_Functions.osNpcLoadAppearance(npc, notecard);
  466. }
  467. public LSL_Key osNpcGetOwner(LSL_Key npc)
  468. {
  469. return m_OSSL_Functions.osNpcGetOwner(npc);
  470. }
  471. public vector osNpcGetPos(LSL_Key npc)
  472. {
  473. return m_OSSL_Functions.osNpcGetPos(npc);
  474. }
  475. public void osNpcMoveTo(key npc, vector position)
  476. {
  477. m_OSSL_Functions.osNpcMoveTo(npc, position);
  478. }
  479. public void osNpcMoveToTarget(key npc, vector target, int options)
  480. {
  481. m_OSSL_Functions.osNpcMoveToTarget(npc, target, options);
  482. }
  483. public rotation osNpcGetRot(key npc)
  484. {
  485. return m_OSSL_Functions.osNpcGetRot(npc);
  486. }
  487. public void osNpcSetRot(key npc, rotation rot)
  488. {
  489. m_OSSL_Functions.osNpcSetRot(npc, rot);
  490. }
  491. public void osNpcStopMoveToTarget(LSL_Key npc)
  492. {
  493. m_OSSL_Functions.osNpcStopMoveToTarget(npc);
  494. }
  495. public void osNpcSay(key npc, string message)
  496. {
  497. m_OSSL_Functions.osNpcSay(npc, message);
  498. }
  499. public void osNpcSay(key npc, int channel, string message)
  500. {
  501. m_OSSL_Functions.osNpcSay(npc, channel, message);
  502. }
  503. public void osNpcShout(key npc, int channel, string message)
  504. {
  505. m_OSSL_Functions.osNpcShout(npc, channel, message);
  506. }
  507. public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
  508. {
  509. m_OSSL_Functions.osNpcSit(npc, target, options);
  510. }
  511. public void osNpcStand(LSL_Key npc)
  512. {
  513. m_OSSL_Functions.osNpcStand(npc);
  514. }
  515. public void osNpcRemove(key npc)
  516. {
  517. m_OSSL_Functions.osNpcRemove(npc);
  518. }
  519. public void osNpcPlayAnimation(LSL_Key npc, string animation)
  520. {
  521. m_OSSL_Functions.osNpcPlayAnimation(npc, animation);
  522. }
  523. public void osNpcStopAnimation(LSL_Key npc, string animation)
  524. {
  525. m_OSSL_Functions.osNpcStopAnimation(npc, animation);
  526. }
  527. public void osNpcWhisper(key npc, int channel, string message)
  528. {
  529. m_OSSL_Functions.osNpcWhisper(npc, channel, message);
  530. }
  531. public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
  532. {
  533. m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
  534. }
  535. public LSL_Key osOwnerSaveAppearance(string notecard)
  536. {
  537. return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
  538. }
  539. public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecard)
  540. {
  541. return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard);
  542. }
  543. public OSSLPrim Prim;
  544. [Serializable]
  545. public class OSSLPrim
  546. {
  547. internal ScriptBaseClass OSSL;
  548. public OSSLPrim(ScriptBaseClass bc)
  549. {
  550. OSSL = bc;
  551. Position = new OSSLPrim_Position(this);
  552. Rotation = new OSSLPrim_Rotation(this);
  553. }
  554. public OSSLPrim_Position Position;
  555. public OSSLPrim_Rotation Rotation;
  556. private TextStruct _text;
  557. public TextStruct Text
  558. {
  559. get { return _text; }
  560. set
  561. {
  562. _text = value;
  563. OSSL.llSetText(_text.Text, _text.color, _text.alpha);
  564. }
  565. }
  566. [Serializable]
  567. public struct TextStruct
  568. {
  569. public string Text;
  570. public LSL_Types.Vector3 color;
  571. public double alpha;
  572. }
  573. }
  574. [Serializable]
  575. public class OSSLPrim_Position
  576. {
  577. private OSSLPrim prim;
  578. private LSL_Types.Vector3 Position;
  579. public OSSLPrim_Position(OSSLPrim _prim)
  580. {
  581. prim = _prim;
  582. }
  583. private void Load()
  584. {
  585. Position = prim.OSSL.llGetPos();
  586. }
  587. private void Save()
  588. {
  589. if (Position.x > ((int)Constants.RegionSize - 1))
  590. Position.x = ((int)Constants.RegionSize - 1);
  591. if (Position.x < 0)
  592. Position.x = 0;
  593. if (Position.y > ((int)Constants.RegionSize - 1))
  594. Position.y = ((int)Constants.RegionSize - 1);
  595. if (Position.y < 0)
  596. Position.y = 0;
  597. if (Position.z > 768)
  598. Position.z = 768;
  599. if (Position.z < 0)
  600. Position.z = 0;
  601. prim.OSSL.llSetPos(Position);
  602. }
  603. public double x
  604. {
  605. get
  606. {
  607. Load();
  608. return Position.x;
  609. }
  610. set
  611. {
  612. Load();
  613. Position.x = value;
  614. Save();
  615. }
  616. }
  617. public double y
  618. {
  619. get
  620. {
  621. Load();
  622. return Position.y;
  623. }
  624. set
  625. {
  626. Load();
  627. Position.y = value;
  628. Save();
  629. }
  630. }
  631. public double z
  632. {
  633. get
  634. {
  635. Load();
  636. return Position.z;
  637. }
  638. set
  639. {
  640. Load();
  641. Position.z = value;
  642. Save();
  643. }
  644. }
  645. }
  646. [Serializable]
  647. public class OSSLPrim_Rotation
  648. {
  649. private OSSLPrim prim;
  650. private LSL_Types.Quaternion Rotation;
  651. public OSSLPrim_Rotation(OSSLPrim _prim)
  652. {
  653. prim = _prim;
  654. }
  655. private void Load()
  656. {
  657. Rotation = prim.OSSL.llGetRot();
  658. }
  659. private void Save()
  660. {
  661. prim.OSSL.llSetRot(Rotation);
  662. }
  663. public double x
  664. {
  665. get
  666. {
  667. Load();
  668. return Rotation.x;
  669. }
  670. set
  671. {
  672. Load();
  673. Rotation.x = value;
  674. Save();
  675. }
  676. }
  677. public double y
  678. {
  679. get
  680. {
  681. Load();
  682. return Rotation.y;
  683. }
  684. set
  685. {
  686. Load();
  687. Rotation.y = value;
  688. Save();
  689. }
  690. }
  691. public double z
  692. {
  693. get
  694. {
  695. Load();
  696. return Rotation.z;
  697. }
  698. set
  699. {
  700. Load();
  701. Rotation.z = value;
  702. Save();
  703. }
  704. }
  705. public double s
  706. {
  707. get
  708. {
  709. Load();
  710. return Rotation.s;
  711. }
  712. set
  713. {
  714. Load();
  715. Rotation.s = value;
  716. Save();
  717. }
  718. }
  719. }
  720. public key osGetMapTexture()
  721. {
  722. return m_OSSL_Functions.osGetMapTexture();
  723. }
  724. public key osGetRegionMapTexture(string regionName)
  725. {
  726. return m_OSSL_Functions.osGetRegionMapTexture(regionName);
  727. }
  728. public LSL_List osGetRegionStats()
  729. {
  730. return m_OSSL_Functions.osGetRegionStats();
  731. }
  732. /// <summary>
  733. /// Returns the amount of memory in use by the Simulator Daemon.
  734. /// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)
  735. /// </summary>
  736. /// <returns></returns>
  737. public LSL_Integer osGetSimulatorMemory()
  738. {
  739. return m_OSSL_Functions.osGetSimulatorMemory();
  740. }
  741. public void osKickAvatar(string FirstName,string SurName,string alert)
  742. {
  743. m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
  744. }
  745. public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
  746. {
  747. m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
  748. }
  749. public LSL_Float osGetHealth(string avatar)
  750. {
  751. return m_OSSL_Functions.osGetHealth(avatar);
  752. }
  753. public void osCauseDamage(string avatar, double damage)
  754. {
  755. m_OSSL_Functions.osCauseDamage(avatar, damage);
  756. }
  757. public void osCauseHealing(string avatar, double healing)
  758. {
  759. m_OSSL_Functions.osCauseHealing(avatar, healing);
  760. }
  761. public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
  762. {
  763. return m_OSSL_Functions.osGetPrimitiveParams(prim, rules);
  764. }
  765. public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
  766. {
  767. m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
  768. }
  769. public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb)
  770. {
  771. m_OSSL_Functions.osSetProjectionParams(projection, texture, fov, focus, amb);
  772. }
  773. public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb)
  774. {
  775. m_OSSL_Functions.osSetProjectionParams(prim, projection, texture, fov, focus, amb);
  776. }
  777. public LSL_List osGetAvatarList()
  778. {
  779. return m_OSSL_Functions.osGetAvatarList();
  780. }
  781. public LSL_String osUnixTimeToTimestamp(long time)
  782. {
  783. return m_OSSL_Functions.osUnixTimeToTimestamp(time);
  784. }
  785. public LSL_String osGetInventoryDesc(string item)
  786. {
  787. return m_OSSL_Functions.osGetInventoryDesc(item);
  788. }
  789. public LSL_Integer osInviteToGroup(LSL_Key agentId)
  790. {
  791. return m_OSSL_Functions.osInviteToGroup(agentId);
  792. }
  793. public LSL_Integer osEjectFromGroup(LSL_Key agentId)
  794. {
  795. return m_OSSL_Functions.osEjectFromGroup(agentId);
  796. }
  797. public void osSetTerrainTexture(int level, LSL_Key texture)
  798. {
  799. m_OSSL_Functions.osSetTerrainTexture(level, texture);
  800. }
  801. public void osSetTerrainTextureHeight(int corner, double low, double high)
  802. {
  803. m_OSSL_Functions.osSetTerrainTextureHeight(corner, low, high);
  804. }
  805. public LSL_Integer osIsUUID(string thing)
  806. {
  807. return m_OSSL_Functions.osIsUUID(thing);
  808. }
  809. public LSL_Float osMin(double a, double b)
  810. {
  811. return m_OSSL_Functions.osMin(a, b);
  812. }
  813. public LSL_Float osMax(double a, double b)
  814. {
  815. return m_OSSL_Functions.osMax(a, b);
  816. }
  817. public LSL_Key osGetRezzingObject()
  818. {
  819. return m_OSSL_Functions.osGetRezzingObject();
  820. }
  821. public void osSetContentType(LSL_Key id, string type)
  822. {
  823. m_OSSL_Functions.osSetContentType(id,type);
  824. }
  825. public void osDropAttachment()
  826. {
  827. m_OSSL_Functions.osDropAttachment();
  828. }
  829. public void osForceDropAttachment()
  830. {
  831. m_OSSL_Functions.osForceDropAttachment();
  832. }
  833. public void osDropAttachmentAt(vector pos, rotation rot)
  834. {
  835. m_OSSL_Functions.osDropAttachmentAt(pos, rot);
  836. }
  837. public void osForceDropAttachmentAt(vector pos, rotation rot)
  838. {
  839. m_OSSL_Functions.osForceDropAttachmentAt(pos, rot);
  840. }
  841. public LSL_Integer osListenRegex(int channelID, string name, string ID, string msg, int regexBitfield)
  842. {
  843. return m_OSSL_Functions.osListenRegex(channelID, name, ID, msg, regexBitfield);
  844. }
  845. public LSL_Integer osRegexIsMatch(string input, string pattern)
  846. {
  847. return m_OSSL_Functions.osRegexIsMatch(input, pattern);
  848. }
  849. }
  850. }