lllslconstants.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. /**
  2. * @file lllslconstants.h
  3. * @author James Cook
  4. * @brief Constants used in lsl.
  5. *
  6. * $LicenseInfo:firstyear=2006&license=viewergpl$
  7. *
  8. * Copyright (c) 2006-2009, Linden Research, Inc.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #ifndef LL_LLLSLCONSTANTS_H
  34. #define LL_LLLSLCONSTANTS_H
  35. // LSL: Return flags for llGetAgentInfo
  36. constexpr U32 AGENT_FLYING = 0x0001;
  37. constexpr U32 AGENT_ATTACHMENTS = 0x0002;
  38. constexpr U32 AGENT_SCRIPTED = 0x0004;
  39. constexpr U32 AGENT_MOUSELOOK = 0x0008;
  40. constexpr U32 AGENT_SITTING = 0x0010;
  41. constexpr U32 AGENT_ON_OBJECT = 0x0020;
  42. constexpr U32 AGENT_AWAY = 0x0040;
  43. constexpr U32 AGENT_WALKING = 0x0080;
  44. constexpr U32 AGENT_IN_AIR = 0x0100;
  45. constexpr U32 AGENT_TYPING = 0x0200;
  46. constexpr U32 AGENT_CROUCHING = 0x0400;
  47. constexpr U32 AGENT_BUSY = 0x0800;
  48. constexpr U32 AGENT_ALWAYS_RUN = 0x1000;
  49. constexpr U32 AGENT_AUTOPILOT = 0x2000;
  50. constexpr S32 LSL_REMOTE_DATA_CHANNEL = 1;
  51. constexpr S32 LSL_REMOTE_DATA_REQUEST = 2;
  52. constexpr S32 LSL_REMOTE_DATA_REPLY = 3;
  53. // Constants used in extended LSL primitive setter and getters
  54. constexpr S32 LSL_PRIM_TYPE_LEGACY = 1; // No longer supported.
  55. constexpr S32 LSL_PRIM_MATERIAL = 2;
  56. constexpr S32 LSL_PRIM_PHYSICS = 3;
  57. constexpr S32 LSL_PRIM_TEMP_ON_REZ = 4;
  58. constexpr S32 LSL_PRIM_PHANTOM = 5;
  59. constexpr S32 LSL_PRIM_POSITION = 6;
  60. constexpr S32 LSL_PRIM_SIZE = 7;
  61. constexpr S32 LSL_PRIM_ROTATION = 8;
  62. constexpr S32 LSL_PRIM_TYPE = 9; // Replacement for LSL_PRIM_TYPE_LEGACY
  63. constexpr S32 LSL_PRIM_TEXTURE = 17;
  64. constexpr S32 LSL_PRIM_COLOR = 18;
  65. constexpr S32 LSL_PRIM_BUMP_SHINY = 19;
  66. constexpr S32 LSL_PRIM_FULLBRIGHT = 20;
  67. constexpr S32 LSL_PRIM_FLEXIBLE = 21;
  68. constexpr S32 LSL_PRIM_TEXGEN = 22;
  69. constexpr S32 LSL_PRIM_POINT_LIGHT = 23;
  70. constexpr S32 LSL_PRIM_CAST_SHADOWS = 24;
  71. constexpr S32 LSL_PRIM_GLOW = 25;
  72. constexpr S32 LSL_PRIM_TEXT = 26;
  73. constexpr S32 LSL_PRIM_NAME = 27;
  74. constexpr S32 LSL_PRIM_DESC = 28;
  75. constexpr S32 LSL_PRIM_ROT_LOCAL = 29;
  76. constexpr S32 LSL_PRIM_PHYSICS_SHAPE_TYPE = 30;
  77. constexpr S32 LSL_PRIM_OMEGA = 32;
  78. constexpr S32 LSL_PRIM_POS_LOCAL = 33;
  79. constexpr S32 LSL_PRIM_LINK_TARGET = 34;
  80. constexpr S32 LSL_PRIM_SLICE = 35;
  81. constexpr S32 LSL_PRIM_SPECULAR = 36;
  82. constexpr S32 LSL_PRIM_NORMAL = 37;
  83. constexpr S32 LSL_PRIM_ALPHA_MODE = 38;
  84. constexpr S32 LSL_PRIM_TYPE_BOX = 0;
  85. constexpr S32 LSL_PRIM_TYPE_CYLINDER= 1;
  86. constexpr S32 LSL_PRIM_TYPE_PRISM = 2;
  87. constexpr S32 LSL_PRIM_TYPE_SPHERE = 3;
  88. constexpr S32 LSL_PRIM_TYPE_TORUS = 4;
  89. constexpr S32 LSL_PRIM_TYPE_TUBE = 5;
  90. constexpr S32 LSL_PRIM_TYPE_RING = 6;
  91. constexpr S32 LSL_PRIM_TYPE_SCULPT = 7;
  92. constexpr S32 LSL_PRIM_HOLE_DEFAULT = 0x00;
  93. constexpr S32 LSL_PRIM_HOLE_CIRCLE = 0x10;
  94. constexpr S32 LSL_PRIM_HOLE_SQUARE = 0x20;
  95. constexpr S32 LSL_PRIM_HOLE_TRIANGLE= 0x30;
  96. constexpr S32 LSL_PRIM_MATERIAL_STONE = 0;
  97. constexpr S32 LSL_PRIM_MATERIAL_METAL = 1;
  98. constexpr S32 LSL_PRIM_MATERIAL_GLASS = 2;
  99. constexpr S32 LSL_PRIM_MATERIAL_WOOD = 3;
  100. constexpr S32 LSL_PRIM_MATERIAL_FLESH = 4;
  101. constexpr S32 LSL_PRIM_MATERIAL_PLASTIC = 5;
  102. constexpr S32 LSL_PRIM_MATERIAL_RUBBER = 6;
  103. constexpr S32 LSL_PRIM_MATERIAL_LIGHT = 7;
  104. constexpr S32 LSL_PRIM_SHINY_NONE = 0;
  105. constexpr S32 LSL_PRIM_SHINY_LOW = 1;
  106. constexpr S32 LSL_PRIM_SHINY_MEDIUM = 2;
  107. constexpr S32 LSL_PRIM_SHINY_HIGH = 3;
  108. constexpr S32 LSL_PRIM_TEXGEN_DEFAULT = 0;
  109. constexpr S32 LSL_PRIM_TEXGEN_PLANAR = 1;
  110. constexpr S32 LSL_PRIM_BUMP_NONE = 0;
  111. constexpr S32 LSL_PRIM_BUMP_BRIGHT = 1;
  112. constexpr S32 LSL_PRIM_BUMP_DARK = 2;
  113. constexpr S32 LSL_PRIM_BUMP_WOOD = 3;
  114. constexpr S32 LSL_PRIM_BUMP_BARK = 4;
  115. constexpr S32 LSL_PRIM_BUMP_BRICKS = 5;
  116. constexpr S32 LSL_PRIM_BUMP_CHECKER = 6;
  117. constexpr S32 LSL_PRIM_BUMP_CONCRETE = 7;
  118. constexpr S32 LSL_PRIM_BUMP_TILE = 8;
  119. constexpr S32 LSL_PRIM_BUMP_STONE = 9;
  120. constexpr S32 LSL_PRIM_BUMP_DISKS = 10;
  121. constexpr S32 LSL_PRIM_BUMP_GRAVEL = 11;
  122. constexpr S32 LSL_PRIM_BUMP_BLOBS = 12;
  123. constexpr S32 LSL_PRIM_BUMP_SIDING = 13;
  124. constexpr S32 LSL_PRIM_BUMP_LARGETILE = 14;
  125. constexpr S32 LSL_PRIM_BUMP_STUCCO = 15;
  126. constexpr S32 LSL_PRIM_BUMP_SUCTION = 16;
  127. constexpr S32 LSL_PRIM_BUMP_WEAVE = 17;
  128. constexpr S32 LSL_PRIM_SCULPT_TYPE_SPHERE = 1;
  129. constexpr S32 LSL_PRIM_SCULPT_TYPE_TORUS = 2;
  130. constexpr S32 LSL_PRIM_SCULPT_TYPE_PLANE = 3;
  131. constexpr S32 LSL_PRIM_SCULPT_TYPE_CYLINDER = 4;
  132. constexpr S32 LSL_PRIM_SCULPT_TYPE_MASK = 7;
  133. constexpr S32 LSL_PRIM_SCULPT_FLAG_INVERT = 64;
  134. constexpr S32 LSL_PRIM_SCULPT_FLAG_MIRROR = 128;
  135. constexpr S32 LSL_PRIM_PHYSICS_SHAPE_PRIM = 0;
  136. constexpr S32 LSL_PRIM_PHYSICS_SHAPE_NONE = 1;
  137. constexpr S32 LSL_PRIM_PHYSICS_SHAPE_CONVEX = 2;
  138. constexpr S32 LSL_DENSITY = 1;
  139. constexpr S32 LSL_FRICTION = 2;
  140. constexpr S32 LSL_RESTITUTION = 4;
  141. constexpr S32 LSL_GRAVITY_MULTIPLIER = 8;
  142. constexpr S32 LSL_ALL_SIDES = -1;
  143. constexpr S32 LSL_LINK_ROOT = 1;
  144. constexpr S32 LSL_LINK_FIRST_CHILD = 2;
  145. constexpr S32 LSL_LINK_SET = -1;
  146. constexpr S32 LSL_LINK_ALL_OTHERS = -2;
  147. constexpr S32 LSL_LINK_ALL_CHILDREN = -3;
  148. constexpr S32 LSL_LINK_THIS = -4;
  149. // LSL constants for llSetForSell
  150. constexpr S32 SELL_NOT = 0;
  151. constexpr S32 SELL_ORIGINAL = 1;
  152. constexpr S32 SELL_COPY = 2;
  153. constexpr S32 SELL_CONTENTS = 3;
  154. // LSL constants for llSetPayPrice
  155. constexpr S32 PAY_PRICE_HIDE = -1;
  156. constexpr S32 PAY_PRICE_DEFAULT = -2;
  157. constexpr S32 MAX_PAY_BUTTONS = 4;
  158. constexpr S32 PAY_BUTTON_DEFAULT_0 = 1;
  159. constexpr S32 PAY_BUTTON_DEFAULT_1 = 5;
  160. constexpr S32 PAY_BUTTON_DEFAULT_2 = 10;
  161. constexpr S32 PAY_BUTTON_DEFAULT_3 = 20;
  162. // lsl email registration.
  163. constexpr S32 EMAIL_REG_SUBSCRIBE_OBJECT = 0x01;
  164. constexpr S32 EMAIL_REG_UNSUBSCRIBE_OBJECT = 0x02;
  165. constexpr S32 EMAIL_REG_UNSUBSCRIBE_SIM = 0x04;
  166. constexpr S32 LIST_STAT_RANGE = 0;
  167. constexpr S32 LIST_STAT_MIN = 1;
  168. constexpr S32 LIST_STAT_MAX = 2;
  169. constexpr S32 LIST_STAT_MEAN = 3;
  170. constexpr S32 LIST_STAT_MEDIAN = 4;
  171. constexpr S32 LIST_STAT_STD_DEV = 5;
  172. constexpr S32 LIST_STAT_SUM = 6;
  173. constexpr S32 LIST_STAT_SUM_SQUARES = 7;
  174. constexpr S32 LIST_STAT_NUM_COUNT = 8;
  175. constexpr S32 LIST_STAT_GEO_MEAN = 9;
  176. constexpr S32 STRING_TRIM_HEAD = 0x01;
  177. constexpr S32 STRING_TRIM_TAIL = 0x02;
  178. constexpr S32 STRING_TRIM = STRING_TRIM_HEAD | STRING_TRIM_TAIL;
  179. // llGetObjectDetails
  180. constexpr S32 OBJECT_UNKNOWN_DETAIL = -1;
  181. constexpr S32 OBJECT_NAME = 1;
  182. constexpr S32 OBJECT_DESC = 2;
  183. constexpr S32 OBJECT_POS = 3;
  184. constexpr S32 OBJECT_ROT = 4;
  185. constexpr S32 OBJECT_VELOCITY = 5;
  186. constexpr S32 OBJECT_OWNER = 6;
  187. constexpr S32 OBJECT_GROUP = 7;
  188. constexpr S32 OBJECT_CREATOR = 8;
  189. constexpr S32 OBJECT_RUNNING_SCRIPT_COUNT = 9;
  190. constexpr S32 OBJECT_TOTAL_SCRIPT_COUNT = 10;
  191. constexpr S32 OBJECT_SCRIPT_MEMORY = 11;
  192. constexpr S32 OBJECT_SCRIPT_TIME = 12;
  193. constexpr S32 OBJECT_PRIM_EQUIVALENCE = 13;
  194. constexpr S32 OBJECT_SERVER_COST = 14;
  195. constexpr S32 OBJECT_STREAMING_COST = 15;
  196. constexpr S32 OBJECT_PHYSICS_COST = 16;
  197. constexpr S32 OBJECT_CHARACTER_TIME = 17;
  198. constexpr S32 OBJECT_ROOT = 18;
  199. constexpr S32 OBJECT_ATTACHED_POINT = 19;
  200. constexpr S32 OBJECT_PATHFINDING_TYPE = 20;
  201. constexpr S32 OBJECT_PHYSICS = 21;
  202. constexpr S32 OBJECT_PHANTOM = 22;
  203. constexpr S32 OBJECT_TEMP_ON_REZ = 23;
  204. constexpr S32 OBJECT_RENDER_WEIGHT = 24;
  205. // Pathfinding prim types as returned by llGetObjectDetails
  206. constexpr S32 OPT_OTHER = -1;
  207. constexpr S32 OPT_LEGACY_LINKSET = 0;
  208. constexpr S32 OPT_AVATAR = 1;
  209. constexpr S32 OPT_CHARACTER = 2;
  210. constexpr S32 OPT_STATIC_OBSTACLE = 4;
  211. constexpr S32 OPT_MATERIAL_VOLUME = 5;
  212. constexpr S32 OPT_EXCLUSION_VOLUME = 6;
  213. // changed() event flags
  214. constexpr U32 CHANGED_NONE = 0x0;
  215. constexpr U32 CHANGED_INVENTORY = 0x1;
  216. constexpr U32 CHANGED_COLOR = 0x2;
  217. constexpr U32 CHANGED_SHAPE = 0x4;
  218. constexpr U32 CHANGED_SCALE = 0x8;
  219. constexpr U32 CHANGED_TEXTURE = 0x10;
  220. constexpr U32 CHANGED_LINK = 0x20;
  221. constexpr U32 CHANGED_ALLOWED_DROP = 0x40;
  222. constexpr U32 CHANGED_OWNER = 0x80;
  223. constexpr U32 CHANGED_REGION = 0x100;
  224. constexpr U32 CHANGED_TELEPORT = 0x200;
  225. constexpr U32 CHANGED_REGION_START = 0x400;
  226. constexpr U32 CHANGED_MEDIA = 0x800;
  227. // Possible error results
  228. constexpr U32 LSL_STATUS_OK = 0;
  229. constexpr U32 LSL_STATUS_MALFORMED_PARAMS = 1000;
  230. constexpr U32 LSL_STATUS_TYPE_MISMATCH = 1001;
  231. constexpr U32 LSL_STATUS_BOUNDS_ERROR = 1002;
  232. constexpr U32 LSL_STATUS_NOT_FOUND = 1003;
  233. constexpr U32 LSL_STATUS_NOT_SUPPORTED = 1004;
  234. constexpr U32 LSL_STATUS_INTERNAL_ERROR = 1999;
  235. // Start per-function errors below, starting at 2000:
  236. constexpr U32 LSL_STATUS_WHITELIST_FAILED = 2001;
  237. // Memory profiling support
  238. constexpr S32 LSL_PROFILE_SCRIPT_NONE = 0;
  239. constexpr S32 LSL_PROFILE_SCRIPT_MEMORY = 1;
  240. // HTTP responses contents type
  241. constexpr S32 LSL_CONTENT_TYPE_TEXT = 0;
  242. constexpr S32 LSL_CONTENT_TYPE_HTML = 1;
  243. constexpr S32 LSL_CONTENT_TYPE_XML = 2;
  244. constexpr S32 LSL_CONTENT_TYPE_XHTML = 3;
  245. constexpr S32 LSL_CONTENT_TYPE_ATOM = 4;
  246. constexpr S32 LSL_CONTENT_TYPE_JSON = 5;
  247. constexpr S32 LSL_CONTENT_TYPE_LLSD = 6;
  248. constexpr S32 LSL_CONTENT_TYPE_FORM = 7;
  249. constexpr S32 LSL_CONTENT_TYPE_RSS = 8;
  250. // Ray casting
  251. constexpr S32 LSL_RCERR_UNKNOWN = -1;
  252. constexpr S32 LSL_RCERR_SIM_PERF_LOW = -2;
  253. constexpr S32 LSL_RCERR_CAST_TIME_EXCEEDED = -3;
  254. constexpr S32 LSL_RC_REJECT_TYPES = 0;
  255. constexpr S32 LSL_RC_DETECT_PHANTOM = 1;
  256. constexpr S32 LSL_RC_DATA_FLAGS = 2;
  257. constexpr S32 LSL_RC_MAX_HITS = 3;
  258. constexpr S32 LSL_RC_REJECT_AGENTS = 1;
  259. constexpr S32 LSL_RC_REJECT_PHYSICAL = 2;
  260. constexpr S32 LSL_RC_REJECT_NONPHYSICAL = 4;
  261. constexpr S32 LSL_RC_REJECT_LAND = 8;
  262. constexpr S32 LSL_RC_GET_NORMAL = 1;
  263. constexpr S32 LSL_RC_GET_ROOT_KEY = 2;
  264. constexpr S32 LSL_RC_GET_LINK_NUM = 4;
  265. // Estate management
  266. constexpr S32 LSL_ESTATE_ACCESS_ALLOWED_AGENT_ADD = 4;
  267. constexpr S32 LSL_ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 8;
  268. constexpr S32 LSL_ESTATE_ACCESS_ALLOWED_GROUP_ADD = 16;
  269. constexpr S32 LSL_ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 32;
  270. constexpr S32 LSL_ESTATE_ACCESS_BANNED_AGENT_ADD = 64;
  271. constexpr S32 LSL_ESTATE_ACCESS_BANNED_AGENT_REMOVE = 128;
  272. // Key Frame Motion:
  273. constexpr S32 LSL_KFM_COMMAND = 0;
  274. constexpr S32 LSL_KFM_MODE = 1;
  275. constexpr S32 LSL_KFM_DATA = 2;
  276. constexpr S32 LSL_KFM_FORWARD = 0;
  277. constexpr S32 LSL_KFM_LOOP = 1;
  278. constexpr S32 LSL_KFM_PING_PONG = 2;
  279. constexpr S32 LSL_KFM_REVERSE = 3;
  280. constexpr S32 LSL_KFM_ROTATION = 1;
  281. constexpr S32 LSL_KFM_TRANSLATION = 2;
  282. constexpr S32 LSL_KFM_CMD_PLAY = 0;
  283. constexpr S32 LSL_KFM_CMD_STOP = 1;
  284. constexpr S32 LSL_KFM_CMD_PAUSE = 2;
  285. // Experience tools errors:
  286. constexpr S32 LSL_XP_ERROR_NONE = 0;
  287. constexpr S32 LSL_XP_ERROR_THROTTLED = 1;
  288. constexpr S32 LSL_XP_ERROR_EXPERIENCES_DISABLED = 2;
  289. constexpr S32 LSL_XP_ERROR_INVALID_PARAMETERS = 3;
  290. constexpr S32 LSL_XP_ERROR_NOT_PERMITTED = 4;
  291. constexpr S32 LSL_XP_ERROR_NO_EXPERIENCE = 5;
  292. constexpr S32 LSL_XP_ERROR_NOT_FOUND = 6;
  293. constexpr S32 LSL_XP_ERROR_INVALID_EXPERIENCE = 7;
  294. constexpr S32 LSL_XP_ERROR_EXPERIENCE_DISABLED = 8;
  295. constexpr S32 LSL_XP_ERROR_EXPERIENCE_SUSPENDED = 9;
  296. constexpr S32 LSL_XP_ERROR_UNKNOWN_ERROR = 10;
  297. constexpr S32 LSL_XP_ERROR_QUOTA_EXCEEDED = 11;
  298. constexpr S32 LSL_XP_ERROR_STORE_DISABLED = 12;
  299. constexpr S32 LSL_XP_ERROR_STORAGE_EXCEPTION = 13;
  300. constexpr S32 LSL_XP_ERROR_KEY_NOT_FOUND = 14;
  301. constexpr S32 LSL_XP_ERROR_RETRY_UPDATE = 15;
  302. constexpr S32 LSL_XP_ERROR_MATURITY_EXCEEDED = 16;
  303. #if 0 // Not used (any more ?) in the viewer code
  304. // This is used by the return to owner code to determine the reason
  305. // that this object is being returned.
  306. enum EReturnReason
  307. {
  308. RR_GENERIC = 0,
  309. RR_SANDBOX = 1,
  310. RR_PARCEL_OWNER = 2,
  311. RR_PARCEL_AUTO = 3,
  312. RR_PARCEL_FULL = 4,
  313. RR_OFF_WORLD = 5,
  314. RR_COUNT = 6
  315. };
  316. #endif
  317. #endif