IOSSL_Api.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
  37. {
  38. public enum ThreatLevel
  39. {
  40. None = 0,
  41. Nuisance = 1,
  42. VeryLow = 2,
  43. Low = 3,
  44. Moderate = 4,
  45. High = 5,
  46. VeryHigh = 6,
  47. Severe = 7
  48. };
  49. public interface IOSSL_Api
  50. {
  51. void CheckThreatLevel(ThreatLevel level, string function);
  52. //OpenSim functions
  53. string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
  54. string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
  55. int timer, int alpha);
  56. string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
  57. bool blend, int disp, int timer, int alpha, int face);
  58. string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer);
  59. string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
  60. int timer, int alpha);
  61. string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
  62. bool blend, int disp, int timer, int alpha, int face);
  63. LSL_Float osTerrainGetHeight(int x, int y);
  64. LSL_Integer osTerrainSetHeight(int x, int y, double val);
  65. void osTerrainFlush();
  66. int osRegionRestart(double seconds);
  67. void osRegionNotice(string msg);
  68. bool osConsoleCommand(string Command);
  69. void osSetParcelMediaURL(string url);
  70. void osSetPrimFloatOnWater(int floatYN);
  71. void osSetParcelSIPAddress(string SIPAddress);
  72. // Avatar Info Commands
  73. string osGetAgentIP(string agent);
  74. LSL_List osGetAgents();
  75. // Teleport commands
  76. void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  77. void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  78. void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
  79. // Animation commands
  80. void osAvatarPlayAnimation(string avatar, string animation);
  81. void osAvatarStopAnimation(string avatar, string animation);
  82. //texture draw functions
  83. string osMovePen(string drawList, int x, int y);
  84. string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
  85. string osDrawLine(string drawList, int endX, int endY);
  86. string osDrawText(string drawList, string text);
  87. string osDrawEllipse(string drawList, int width, int height);
  88. string osDrawRectangle(string drawList, int width, int height);
  89. string osDrawFilledRectangle(string drawList, int width, int height);
  90. string osDrawPolygon(string drawList, LSL_List x, LSL_List y);
  91. string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y);
  92. string osSetFontName(string drawList, string fontName);
  93. string osSetFontSize(string drawList, int fontSize);
  94. string osSetPenSize(string drawList, int penSize);
  95. string osSetPenColour(string drawList, string colour);
  96. string osSetPenCap(string drawList, string direction, string type);
  97. string osDrawImage(string drawList, int width, int height, string imageUrl);
  98. vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
  99. void osSetStateEvents(int events);
  100. double osList2Double(LSL_Types.list src, int index);
  101. void osSetRegionWaterHeight(double height);
  102. void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
  103. void osSetEstateSunSettings(bool sunFixed, double sunHour);
  104. double osGetCurrentSunHour();
  105. double osSunGetParam(string param);
  106. void osSunSetParam(string param, double value);
  107. // Wind Module Functions
  108. string osWindActiveModelPluginName();
  109. void osWindParamSet(string plugin, string param, float value);
  110. float osWindParamGet(string plugin, string param);
  111. string osGetScriptEngineName();
  112. string osGetSimulatorVersion();
  113. Hashtable osParseJSON(string JSON);
  114. void osMessageObject(key objectUUID,string message);
  115. void osMakeNotecard(string notecardName, LSL_Types.list contents);
  116. string osGetNotecardLine(string name, int line);
  117. string osGetNotecard(string name);
  118. int osGetNumberOfNotecardLines(string name);
  119. string osAvatarName2Key(string firstname, string lastname);
  120. string osKey2Name(string id);
  121. // Grid Info Functions
  122. string osGetGridNick();
  123. string osGetGridName();
  124. string osGetGridLoginURI();
  125. LSL_String osFormatString(string str, LSL_List strings);
  126. LSL_List osMatchString(string src, string pattern, int start);
  127. // Information about data loaded into the region
  128. string osLoadedCreationDate();
  129. string osLoadedCreationTime();
  130. string osLoadedCreationID();
  131. LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
  132. key osNpcCreate(string user, string name, vector position, key cloneFrom);
  133. void osNpcMoveTo(key npc, vector position);
  134. void osNpcSay(key npc, string message);
  135. void osNpcRemove(key npc);
  136. }
  137. }