OSSL_Stub.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 OpenSim 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.Region.Environment.Interfaces;
  34. using OpenSim.Region.ScriptEngine.Interfaces;
  35. using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
  36. using integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
  37. using key = System.String;
  38. using vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
  39. using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
  40. namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
  41. {
  42. public partial class ScriptBaseClass : MarshalByRefObject
  43. {
  44. public IOSSL_Api m_OSSL_Functions;
  45. public void ApiTypeOSSL(IScriptApi api)
  46. {
  47. if (!(api is IOSSL_Api))
  48. return;
  49. m_OSSL_Functions = (IOSSL_Api)api;
  50. }
  51. public void osSetRegionWaterHeight(double height)
  52. {
  53. m_OSSL_Functions.osSetRegionWaterHeight(height);
  54. }
  55. public double osList2Double(LSL_Types.list src, int index)
  56. {
  57. return m_OSSL_Functions.osList2Double(src, index);
  58. }
  59. public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
  60. int timer)
  61. {
  62. return m_OSSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer);
  63. }
  64. public string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams,
  65. int timer)
  66. {
  67. return m_OSSL_Functions.osSetDynamicTextureData(dynamicID, contentType, data, extraParams, timer);
  68. }
  69. public string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
  70. int timer, int alpha)
  71. {
  72. return m_OSSL_Functions.osSetDynamicTextureURLBlend(dynamicID, contentType, url, extraParams, timer, alpha);
  73. }
  74. public string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
  75. int timer, int alpha)
  76. {
  77. return m_OSSL_Functions.osSetDynamicTextureDataBlend(dynamicID, contentType, data, extraParams, timer, alpha);
  78. }
  79. public double osTerrainGetHeight(int x, int y)
  80. {
  81. return m_OSSL_Functions.osTerrainGetHeight(x, y);
  82. }
  83. public int osTerrainSetHeight(int x, int y, double val)
  84. {
  85. return m_OSSL_Functions.osTerrainSetHeight(x, y, val);
  86. }
  87. public int osRegionRestart(double seconds)
  88. {
  89. return m_OSSL_Functions.osRegionRestart(seconds);
  90. }
  91. public void osRegionNotice(string msg)
  92. {
  93. m_OSSL_Functions.osRegionNotice(msg);
  94. }
  95. public bool osConsoleCommand(string Command)
  96. {
  97. return m_OSSL_Functions.osConsoleCommand(Command);
  98. }
  99. public void osSetParcelMediaURL(string url)
  100. {
  101. m_OSSL_Functions.osSetParcelMediaURL(url);
  102. }
  103. public void osSetPrimFloatOnWater(int floatYN)
  104. {
  105. m_OSSL_Functions.osSetPrimFloatOnWater(floatYN);
  106. }
  107. // Animation Functions
  108. public void osAvatarPlayAnimation(string avatar, string animation)
  109. {
  110. m_OSSL_Functions.osAvatarPlayAnimation(avatar, animation);
  111. }
  112. public void osAvatarStopAnimation(string avatar, string animation)
  113. {
  114. m_OSSL_Functions.osAvatarStopAnimation(avatar, animation);
  115. }
  116. //Texture Draw functions
  117. public string osMovePen(string drawList, int x, int y)
  118. {
  119. return m_OSSL_Functions.osMovePen(drawList, x, y);
  120. }
  121. public string osDrawLine(string drawList, int startX, int startY, int endX, int endY)
  122. {
  123. return m_OSSL_Functions.osDrawLine(drawList, startX, startY, endX, endY);
  124. }
  125. public string osDrawLine(string drawList, int endX, int endY)
  126. {
  127. return m_OSSL_Functions.osDrawLine(drawList, endX, endY);
  128. }
  129. public string osDrawText(string drawList, string text)
  130. {
  131. return m_OSSL_Functions.osDrawText(drawList, text);
  132. }
  133. public string osDrawEllipse(string drawList, int width, int height)
  134. {
  135. return m_OSSL_Functions.osDrawEllipse(drawList, width, height);
  136. }
  137. public string osDrawRectangle(string drawList, int width, int height)
  138. {
  139. return m_OSSL_Functions.osDrawRectangle(drawList, width, height);
  140. }
  141. public string osDrawFilledRectangle(string drawList, int width, int height)
  142. {
  143. return m_OSSL_Functions.osDrawFilledRectangle(drawList, width, height);
  144. }
  145. public string osSetFontSize(string drawList, int fontSize)
  146. {
  147. return m_OSSL_Functions.osSetFontSize(drawList, fontSize);
  148. }
  149. public string osSetPenSize(string drawList, int penSize)
  150. {
  151. return m_OSSL_Functions.osSetPenSize(drawList, penSize);
  152. }
  153. public string osSetPenColour(string drawList, string colour)
  154. {
  155. return m_OSSL_Functions.osSetPenColour(drawList, colour);
  156. }
  157. public string osDrawImage(string drawList, int width, int height, string imageUrl)
  158. {
  159. return m_OSSL_Functions.osDrawImage(drawList, width, height, imageUrl);
  160. }
  161. public void osSetStateEvents(int events)
  162. {
  163. m_OSSL_Functions.osSetStateEvents(events);
  164. }
  165. public string osGetScriptEngineName()
  166. {
  167. return m_OSSL_Functions.osGetScriptEngineName();
  168. }
  169. //for testing purposes only
  170. public void osSetParcelMediaTime(double time)
  171. {
  172. m_OSSL_Functions.osSetParcelMediaTime(time);
  173. }
  174. }
  175. }