OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IOSSL_Api.cs
Go to the documentation of this file.
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 
28 using System;
29 using System.Collections;
30 using OpenSim.Region.ScriptEngine.Interfaces;
31 
40 
41 namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
42 {
51  public enum ThreatLevel
52  {
53  // Not documented, presumably means permanently disabled ?
54  NoAccess = -1,
55 
60  None = 0,
61 
66  Nuisance = 1,
67 
73  VeryLow = 2,
74 
80  Low = 3,
81 
87  Moderate = 4,
88 
96  High = 5,
97 
104  VeryHigh = 6,
105 
112  Severe = 7
113  };
114 
115  public interface IOSSL_Api
116  {
117  void CheckThreatLevel(ThreatLevel level, string function);
118 
119  //OpenSim functions
120  string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
121  string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,
122  int timer, int alpha);
123  string osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams,
124  bool blend, int disp, int timer, int alpha, int face);
125  string osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer);
126  string osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams,
127  int timer, int alpha);
128  string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
129  bool blend, int disp, int timer, int alpha, int face);
130 
131  LSL_Float osGetTerrainHeight(int x, int y);
132  LSL_Float osTerrainGetHeight(int x, int y); // Deprecated
133  LSL_Integer osSetTerrainHeight(int x, int y, double val);
134  LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated
135  void osTerrainFlush();
136 
137  int osRegionRestart(double seconds);
138  void osRegionNotice(string msg);
139  bool osConsoleCommand(string Command);
140  void osSetParcelMediaURL(string url);
141  void osSetPrimFloatOnWater(int floatYN);
142  void osSetParcelSIPAddress(string SIPAddress);
143 
144  // Avatar Info Commands
145  string osGetAgentIP(string agent);
146  LSL_List osGetAgents();
147 
148  // Teleport commands
149  void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
150  void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
151  void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
152  void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
153  void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
154  void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
155 
156  // Animation commands
157  void osAvatarPlayAnimation(string avatar, string animation);
158  void osAvatarStopAnimation(string avatar, string animation);
159 
160  #region Attachment commands
161 
166  void osForceAttachToAvatar(int attachment);
167 
176  void osForceAttachToAvatarFromInventory(string itemName, int attachment);
177 
187  void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint);
188 
193  void osForceDetachFromAvatar();
194 
201  LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints);
202 
214  void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int flags);
215 
216  #endregion
217 
218  //texture draw functions
219  string osMovePen(string drawList, int x, int y);
220  string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
221  string osDrawLine(string drawList, int endX, int endY);
222  string osDrawText(string drawList, string text);
223  string osDrawEllipse(string drawList, int width, int height);
224  string osDrawRectangle(string drawList, int width, int height);
225  string osDrawFilledRectangle(string drawList, int width, int height);
226  string osDrawPolygon(string drawList, LSL_List x, LSL_List y);
227  string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y);
228  string osSetFontName(string drawList, string fontName);
229  string osSetFontSize(string drawList, int fontSize);
230  string osSetPenSize(string drawList, int penSize);
231  string osSetPenColor(string drawList, string color);
232  string osSetPenColour(string drawList, string colour); // Deprecated
233  string osSetPenCap(string drawList, string direction, string type);
234  string osDrawImage(string drawList, int width, int height, string imageUrl);
235  vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
236  void osSetStateEvents(int events);
237 
238  double osList2Double(LSL_Types.list src, int index);
239 
240  void osSetRegionWaterHeight(double height);
241  void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
242  void osSetEstateSunSettings(bool sunFixed, double sunHour);
243  double osGetCurrentSunHour();
244  double osGetSunParam(string param);
245  double osSunGetParam(string param); // Deprecated
246  void osSetSunParam(string param, double value);
247  void osSunSetParam(string param, double value); // Deprecated
248 
249  // Wind Module Functions
250  string osWindActiveModelPluginName();
251  void osSetWindParam(string plugin, string param, LSL_Float value);
252  LSL_Float osGetWindParam(string plugin, string param);
253 
254  // Parcel commands
255  void osParcelJoin(vector pos1, vector pos2);
256  void osParcelSubdivide(vector pos1, vector pos2);
257  void osSetParcelDetails(vector pos, LSL_List rules);
258  void osParcelSetDetails(vector pos, LSL_List rules); // Deprecated
259 
260  string osGetScriptEngineName();
261  string osGetSimulatorVersion();
262  LSL_Integer osCheckODE();
263  string osGetPhysicsEngineType();
264  Object osParseJSONNew(string JSON);
265  Hashtable osParseJSON(string JSON);
266 
267  void osMessageObject(key objectUUID,string message);
268 
269  void osMakeNotecard(string notecardName, LSL_Types.list contents);
270 
271  string osGetNotecardLine(string name, int line);
272  string osGetNotecard(string name);
273  int osGetNumberOfNotecardLines(string name);
274 
275  string osAvatarName2Key(string firstname, string lastname);
276  string osKey2Name(string id);
277 
278  // Grid Info Functions
279  string osGetGridNick();
280  string osGetGridName();
281  string osGetGridLoginURI();
282  string osGetGridHomeURI();
283  string osGetGridGatekeeperURI();
284  string osGetGridCustom(string key);
285 
286  string osGetAvatarHomeURI(string uuid);
287 
288  LSL_String osFormatString(string str, LSL_List strings);
289  LSL_List osMatchString(string src, string pattern, int start);
290  LSL_String osReplaceString(string src, string pattern, string replace, int count, int start);
291 
292  // Information about data loaded into the region
293  string osLoadedCreationDate();
294  string osLoadedCreationTime();
295  string osLoadedCreationID();
296 
297  LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
298 
304  void osForceCreateLink(string target, int parent);
305 
310  void osForceBreakLink(int linknum);
311 
315  void osForceBreakAllLinks();
316 
322  LSL_Integer osIsNpc(LSL_Key npc);
323 
324  key osNpcCreate(string user, string name, vector position, string notecard);
325  key osNpcCreate(string user, string name, vector position, string notecard, int options);
326  LSL_Key osNpcSaveAppearance(key npc, string notecard);
327  void osNpcLoadAppearance(key npc, string notecard);
328  vector osNpcGetPos(key npc);
329  void osNpcMoveTo(key npc, vector position);
330  void osNpcMoveToTarget(key npc, vector target, int options);
331 
339  LSL_Key osNpcGetOwner(key npc);
340 
341  rotation osNpcGetRot(key npc);
342  void osNpcSetRot(LSL_Key npc, rotation rot);
343  void osNpcStopMoveToTarget(LSL_Key npc);
344  void osNpcSay(key npc, string message);
345  void osNpcSay(key npc, int channel, string message);
346  void osNpcShout(key npc, int channel, string message);
347  void osNpcSit(key npc, key target, int options);
348  void osNpcStand(LSL_Key npc);
349  void osNpcRemove(key npc);
350  void osNpcPlayAnimation(LSL_Key npc, string animation);
351  void osNpcStopAnimation(LSL_Key npc, string animation);
352  void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num);
353  void osNpcWhisper(key npc, int channel, string message);
354 
355  LSL_Key osOwnerSaveAppearance(string notecard);
356  LSL_Key osAgentSaveAppearance(key agentId, string notecard);
357 
358  key osGetGender(LSL_Key rawAvatarId);
359  key osGetMapTexture();
360  key osGetRegionMapTexture(string regionName);
361  LSL_List osGetRegionStats();
362  vector osGetRegionSize();
363 
364  int osGetSimulatorMemory();
365  void osKickAvatar(string FirstName,string SurName,string alert);
366  void osSetSpeed(string UUID, LSL_Float SpeedModifier);
367  LSL_Float osGetHealth(string avatar);
368  void osCauseHealing(string avatar, double healing);
369  void osCauseDamage(string avatar, double damage);
370  void osForceOtherSit(string avatar);
371  void osForceOtherSit(string avatar, string target);
372  LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
373  void osSetPrimitiveParams(LSL_Key prim, LSL_List rules);
374  void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb);
375  void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb);
376 
377  LSL_List osGetAvatarList();
378 
379  LSL_String osUnixTimeToTimestamp(long time);
380 
381  LSL_String osGetInventoryDesc(string item);
382 
383  LSL_Integer osInviteToGroup(LSL_Key agentId);
384  LSL_Integer osEjectFromGroup(LSL_Key agentId);
385 
386  void osSetTerrainTexture(int level, LSL_Key texture);
387  void osSetTerrainTextureHeight(int corner, double low, double high);
388 
394  LSL_Integer osIsUUID(string thing);
395 
402  LSL_Float osMin(double a, double b);
403 
410  LSL_Float osMax(double a, double b);
411 
416  LSL_Key osGetRezzingObject();
417 
422  void osSetContentType(LSL_Key id, string type);
423 
427  void osDropAttachment();
428 
432  void osForceDropAttachment();
433 
439  void osDropAttachmentAt(vector pos, rotation rot);
440 
446  void osForceDropAttachmentAt(vector pos, rotation rot);
447 
461  LSL_Integer osListenRegex(int channelID, string name, string ID,
462  string msg, int regexBitfield);
463 
470  LSL_Integer osRegexIsMatch(string input, string pattern);
471 
472  LSL_String osRequestURL(LSL_List options);
473  LSL_String osRequestSecureURL(LSL_List options);
474  }
475 }
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat LSL_Float
Definition: CM_Api.cs:48
OpenSim.Region.ScriptEngine.Shared.LSL_Types.list LSL_List
Definition: CM_Api.cs:51
Even casual use is a danger to region stability, or function allows console or OS command execution...
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString LSL_Key
Definition: CM_Api.cs:50
ThreatLevel
To permit region owners to enable the extended scripting functionality of OSSL, without allowing mali...
Definition: IOSSL_Api.cs:51
Intentional abuse can cause denial of service and crashes with potential of data or state loss; or tr...
Even normal use may, depending on the number of instances, or frequency of use, result in severe serv...
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString key
Definition: ICM_Api.cs:31
OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion rotation
Definition: ICM_Api.cs:32
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger LSL_Integer
Definition: CM_Api.cs:49
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger LSLInteger
Definition: CM_Constants.cs:31
Abuse of this command can cause a nuisance to the region operator, such as log message spew...
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString LSL_String
Definition: CM_Api.cs:53
OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 vector
Definition: ICM_Api.cs:33