IOSSL_Api.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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.Collections;
  28. using OpenSim.Region.ScriptEngine.Interfaces;
  29. using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
  30. using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
  31. using vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
  32. using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
  33. using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
  34. using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
  35. using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
  36. using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
  37. namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
  38. {
  39. public enum ThreatLevel
  40. {
  41. None = 0,
  42. Nuisance = 1,
  43. VeryLow = 2,
  44. Low = 3,
  45. Moderate = 4,
  46. High = 5,
  47. VeryHigh = 6,
  48. Severe = 7
  49. };
  50. public interface IOSSL_Api
  51. {
  52. void CheckThreatLevel(ThreatLevel level, string function);
  53. //OpenSim functions
  54. string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
  55. string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
  56. int timer, int alpha);
  57. string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
  58. bool blend, int disp, int timer, int alpha, int face);
  59. string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer);
  60. string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
  61. int timer, int alpha);
  62. string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
  63. bool blend, int disp, int timer, int alpha, int face);
  64. LSL_Float osGetTerrainHeight(int x, int y);
  65. LSL_Float osTerrainGetHeight(int x, int y); // Deprecated
  66. LSL_Integer osSetTerrainHeight(int x, int y, double val);
  67. LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated
  68. void osTerrainFlush();
  69. int osRegionRestart(double seconds);
  70. void osRegionNotice(string msg);
  71. bool osConsoleCommand(string Command);
  72. void osSetParcelMediaURL(string url);
  73. void osSetPrimFloatOnWater(int floatYN);
  74. void osSetParcelSIPAddress(string SIPAddress);
  75. // Avatar Info Commands
  76. string osGetAgentIP(string agent);
  77. LSL_List osGetAgents();
  78. // Teleport commands
  79. void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  80. void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  81. void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  82. void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  83. void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  84. void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  85. // Animation commands
  86. void osAvatarPlayAnimation(string avatar, string animation);
  87. void osAvatarStopAnimation(string avatar, string animation);
  88. //texture draw functions
  89. string osMovePen(string drawList, int x, int y);
  90. string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
  91. string osDrawLine(string drawList, int endX, int endY);
  92. string osDrawText(string drawList, string text);
  93. string osDrawEllipse(string drawList, int width, int height);
  94. string osDrawRectangle(string drawList, int width, int height);
  95. string osDrawFilledRectangle(string drawList, int width, int height);
  96. string osDrawPolygon(string drawList, LSL_List x, LSL_List y);
  97. string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y);
  98. string osSetFontName(string drawList, string fontName);
  99. string osSetFontSize(string drawList, int fontSize);
  100. string osSetPenSize(string drawList, int penSize);
  101. string osSetPenColor(string drawList, string color);
  102. string osSetPenColour(string drawList, string colour); // Deprecated
  103. string osSetPenCap(string drawList, string direction, string type);
  104. string osDrawImage(string drawList, int width, int height, string imageUrl);
  105. vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
  106. void osSetStateEvents(int events);
  107. double osList2Double(LSL_Types.list src, int index);
  108. void osSetRegionWaterHeight(double height);
  109. void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
  110. void osSetEstateSunSettings(bool sunFixed, double sunHour);
  111. double osGetCurrentSunHour();
  112. double osGetSunParam(string param);
  113. double osSunGetParam(string param); // Deprecated
  114. void osSetSunParam(string param, double value);
  115. void osSunSetParam(string param, double value); // Deprecated
  116. // Wind Module Functions
  117. string osWindActiveModelPluginName();
  118. void osSetWindParam(string plugin, string param, LSL_Float value);
  119. LSL_Float osGetWindParam(string plugin, string param);
  120. // Parcel commands
  121. void osParcelJoin(vector pos1, vector pos2);
  122. void osParcelSubdivide(vector pos1, vector pos2);
  123. void osSetParcelDetails(vector pos, LSL_List rules);
  124. void osParcelSetDetails(vector pos, LSL_List rules); // Deprecated
  125. string osGetScriptEngineName();
  126. string osGetSimulatorVersion();
  127. Hashtable osParseJSON(string JSON);
  128. void osMessageObject(key objectUUID,string message);
  129. void osMakeNotecard(string notecardName, LSL_Types.list contents);
  130. string osGetNotecardLine(string name, int line);
  131. string osGetNotecard(string name);
  132. int osGetNumberOfNotecardLines(string name);
  133. string osAvatarName2Key(string firstname, string lastname);
  134. string osKey2Name(string id);
  135. // Grid Info Functions
  136. string osGetGridNick();
  137. string osGetGridName();
  138. string osGetGridLoginURI();
  139. LSL_String osFormatString(string str, LSL_List strings);
  140. LSL_List osMatchString(string src, string pattern, int start);
  141. // Information about data loaded into the region
  142. string osLoadedCreationDate();
  143. string osLoadedCreationTime();
  144. string osLoadedCreationID();
  145. LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
  146. key osNpcCreate(string user, string name, vector position, string notecard);
  147. LSL_Key osNpcSaveAppearance(key npc, string notecard);
  148. void osNpcLoadAppearance(key npc, string notecard);
  149. vector osNpcGetPos(key npc);
  150. void osNpcMoveTo(key npc, vector position);
  151. void osNpcMoveToTarget(key npc, vector target, int options);
  152. rotation osNpcGetRot(key npc);
  153. void osNpcSetRot(LSL_Key npc, rotation rot);
  154. void osNpcStopMoveToTarget(LSL_Key npc);
  155. void osNpcSay(key npc, string message);
  156. void osNpcRemove(key npc);
  157. LSL_Key osOwnerSaveAppearance(string notecard);
  158. LSL_Key osAgentSaveAppearance(key agentId, string notecard);
  159. key osGetMapTexture();
  160. key osGetRegionMapTexture(string regionName);
  161. LSL_List osGetRegionStats();
  162. int osGetSimulatorMemory();
  163. void osKickAvatar(string FirstName,string SurName,string alert);
  164. void osSetSpeed(string UUID, LSL_Float SpeedModifier);
  165. void osCauseHealing(string avatar, double healing);
  166. void osCauseDamage(string avatar, double damage);
  167. LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
  168. void osSetPrimitiveParams(LSL_Key prim, LSL_List rules);
  169. void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb);
  170. void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb);
  171. LSL_List osGetAvatarList();
  172. LSL_String osUnixTimeToTimestamp(long time);
  173. }
  174. }