IOSSL_Api.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 osTerrainGetHeight(int x, int y);
  65. LSL_Integer osTerrainSetHeight(int x, int y, double val);
  66. void osTerrainFlush();
  67. int osRegionRestart(double seconds);
  68. void osRegionNotice(string msg);
  69. bool osConsoleCommand(string Command);
  70. void osSetParcelMediaURL(string url);
  71. void osSetPrimFloatOnWater(int floatYN);
  72. void osSetParcelSIPAddress(string SIPAddress);
  73. // Avatar Info Commands
  74. string osGetAgentIP(string agent);
  75. LSL_List osGetAgents();
  76. // Teleport commands
  77. void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  78. void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  79. void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  80. // Animation commands
  81. void osAvatarPlayAnimation(string avatar, string animation);
  82. void osAvatarStopAnimation(string avatar, string animation);
  83. //texture draw functions
  84. string osMovePen(string drawList, int x, int y);
  85. string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
  86. string osDrawLine(string drawList, int endX, int endY);
  87. string osDrawText(string drawList, string text);
  88. string osDrawEllipse(string drawList, int width, int height);
  89. string osDrawRectangle(string drawList, int width, int height);
  90. string osDrawFilledRectangle(string drawList, int width, int height);
  91. string osDrawPolygon(string drawList, LSL_List x, LSL_List y);
  92. string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y);
  93. string osSetFontName(string drawList, string fontName);
  94. string osSetFontSize(string drawList, int fontSize);
  95. string osSetPenSize(string drawList, int penSize);
  96. string osSetPenColour(string drawList, string colour);
  97. string osSetPenCap(string drawList, string direction, string type);
  98. string osDrawImage(string drawList, int width, int height, string imageUrl);
  99. vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
  100. void osSetStateEvents(int events);
  101. double osList2Double(LSL_Types.list src, int index);
  102. void osSetRegionWaterHeight(double height);
  103. void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
  104. void osSetEstateSunSettings(bool sunFixed, double sunHour);
  105. double osGetCurrentSunHour();
  106. double osSunGetParam(string param);
  107. void osSunSetParam(string param, double value);
  108. // Wind Module Functions
  109. string osWindActiveModelPluginName();
  110. void osWindParamSet(string plugin, string param, float value);
  111. float osWindParamGet(string plugin, string param);
  112. // Parcel commands
  113. void osParcelJoin(vector pos1, vector pos2);
  114. void osParcelSubdivide(vector pos1, vector pos2);
  115. void osParcelSetDetails(vector pos, LSL_List rules);
  116. string osGetScriptEngineName();
  117. string osGetSimulatorVersion();
  118. Hashtable osParseJSON(string JSON);
  119. void osMessageObject(key objectUUID,string message);
  120. void osMakeNotecard(string notecardName, LSL_Types.list contents);
  121. string osGetNotecardLine(string name, int line);
  122. string osGetNotecard(string name);
  123. int osGetNumberOfNotecardLines(string name);
  124. string osAvatarName2Key(string firstname, string lastname);
  125. string osKey2Name(string id);
  126. // Grid Info Functions
  127. string osGetGridNick();
  128. string osGetGridName();
  129. string osGetGridLoginURI();
  130. LSL_String osFormatString(string str, LSL_List strings);
  131. LSL_List osMatchString(string src, string pattern, int start);
  132. // Information about data loaded into the region
  133. string osLoadedCreationDate();
  134. string osLoadedCreationTime();
  135. string osLoadedCreationID();
  136. LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
  137. key osNpcCreate(string user, string name, vector position, key cloneFrom);
  138. void osNpcMoveTo(key npc, vector position);
  139. void osNpcSay(key npc, string message);
  140. void osNpcRemove(key npc);
  141. key osGetMapTexture();
  142. key osGetRegionMapTexture(string regionName);
  143. LSL_List osGetRegionStats();
  144. int osGetSimulatorMemory();
  145. void osKickAvatar(string FirstName,string SurName,string alert);
  146. void osSetSpeed(string UUID, float SpeedModifier);
  147. void osCauseHealing(string avatar, double healing);
  148. void osCauseDamage(string avatar, double damage);
  149. LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
  150. void osSetPrimitiveParams(LSL_Key prim, LSL_List rules);
  151. LSL_List osGetAvatarList();
  152. }
  153. }