llregionflags.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /**
  2. * @file llregionflags.h
  3. * @brief Flags that are sent in the statistics message region_flags field.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLREGIONFLAGS_H
  33. #define LL_LLREGIONFLAGS_H
  34. #include "llpreprocessor.h"
  35. // Can you be hurt here ? Should health be on ?
  36. constexpr U64 REGION_FLAGS_ALLOW_DAMAGE = (1 << 0);
  37. // Can you make landmarks here ?
  38. constexpr U64 REGION_FLAGS_ALLOW_LANDMARK = (1 << 1);
  39. // Do we reset the home position when someone teleports away from here ?
  40. constexpr U64 REGION_FLAGS_ALLOW_SET_HOME = (1 << 2);
  41. // Do we reset the home position when someone teleports away from here ?
  42. constexpr U64 REGION_FLAGS_RESET_HOME_ON_TELEPORT = (1 << 3);
  43. // Does the sun move ? Deprecated in SL.
  44. constexpr U64 REGION_FLAGS_SUN_FIXED = (1 << 4);
  45. // Does the estate owner allow private parcels ?
  46. constexpr U64 REGION_FLAGS_ALLOW_ACCESS_OVERRIDE = (1 << 5);
  47. // Cannot change the terrain heightfield, even on owned parcels, but can plant
  48. // trees and grass.
  49. constexpr U64 REGION_FLAGS_BLOCK_TERRAFORM = (1 << 6);
  50. // Can't release, sell, or buy land.
  51. constexpr U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
  52. // All content wiped once per night
  53. constexpr U64 REGION_FLAGS_SANDBOX = (1 << 8);
  54. #if 0 // REGION_FLAGS_NULL_LAYER is deprecated in SL...
  55. constexpr U64 REGION_FLAGS_NULL_LAYER = (1 << 9);
  56. #else // ..and reused by REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE
  57. constexpr U64 REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE = (1 << 9);
  58. #endif
  59. constexpr U64 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
  60. constexpr U64 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
  61. constexpr U64 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
  62. constexpr U64 REGION_FLAGS_EXTERNALLY_VISIBLE = (1 << 15);
  63. constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT = (1 << 16);
  64. constexpr U64 REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT = (1 << 17);
  65. constexpr U64 REGION_FLAGS_BLOCK_DWELL = (1 << 18);
  66. // Is flight allowed ?
  67. constexpr U64 REGION_FLAGS_BLOCK_FLY = (1 << 19);
  68. // Is direct teleport (p2p) allowed ?
  69. constexpr U64 REGION_FLAGS_ALLOW_DIRECT_TELEPORT = (1 << 20);
  70. // Is there an administrative override on scripts in the region at the
  71. // moment. This is the similar skip scripts, except this flag is
  72. // presisted in the database on an estate level.
  73. constexpr U64 REGION_FLAGS_ESTATE_SKIP_SCRIPTS = (1 << 21);
  74. constexpr U64 REGION_FLAGS_RESTRICT_PUSHOBJECT = (1 << 22);
  75. constexpr U64 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
  76. constexpr U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
  77. // Used to be: REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER
  78. constexpr U64 REGION_FLAGS_BLOCK_FLYOVER = (1 << 27);
  79. constexpr U64 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
  80. constexpr U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
  81. constexpr U64 REGION_FLAGS_DENY_AGEUNVERIFIED = (1 << 30);
  82. constexpr U64 REGION_FLAGS_DENY_BOTS = (1 << 31);
  83. constexpr U64 REGION_FLAGS_ENABLE_ANIMATION_TRACKING = (1ULL << 33);
  84. constexpr U64 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
  85. REGION_FLAGS_ALLOW_SET_HOME |
  86. REGION_FLAGS_ALLOW_PARCEL_CHANGES |
  87. REGION_FLAGS_ALLOW_VOICE;
  88. constexpr U64 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
  89. constexpr U64 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK
  90. | REGION_FLAGS_ALLOW_SET_HOME;
  91. constexpr U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE
  92. | REGION_FLAGS_SUN_FIXED
  93. | REGION_FLAGS_DENY_ANONYMOUS
  94. | REGION_FLAGS_DENY_AGEUNVERIFIED;
  95. LL_INLINE bool is_prelude(U64 flags)
  96. {
  97. // definition of prelude does not depend on fixed-sun
  98. return (flags & REGION_FLAGS_PRELUDE_UNSET) == 0 &&
  99. (flags & REGION_FLAGS_PRELUDE_SET) != 0;
  100. }
  101. LL_INLINE U32 set_prelude_flags(U64 flags)
  102. {
  103. // also set the sun-fixed flag
  104. return ((flags & ~REGION_FLAGS_PRELUDE_UNSET) |
  105. (REGION_FLAGS_PRELUDE_SET | REGION_FLAGS_SUN_FIXED));
  106. }
  107. LL_INLINE U32 unset_prelude_flags(U64 flags)
  108. {
  109. // also unset the fixed-sun flag
  110. return ((flags | REGION_FLAGS_PRELUDE_UNSET) &
  111. ~(REGION_FLAGS_PRELUDE_SET | REGION_FLAGS_SUN_FIXED));
  112. }
  113. // Region protocols
  114. constexpr U64 REGION_PROTOCOLS_AGENT_APPEARANCE_SERVICE = (1 << 0);
  115. // Estate constants. Need to match first few etries in indra.estate table.
  116. constexpr U32 ESTATE_ALL = 0; // will not match in db, reserved key for logic
  117. constexpr U32 ESTATE_MAINLAND = 1;
  118. constexpr U32 ESTATE_ORIENTATION = 2;
  119. constexpr U32 ESTATE_INTERNAL = 3;
  120. constexpr U32 ESTATE_SHOWCASE = 4;
  121. constexpr U32 ESTATE_TEEN = 5;
  122. constexpr U32 ESTATE_LAST_LINDEN = 5; // last linden owned/managed estate
  123. // For EstateOwnerRequest, setaccess message
  124. constexpr U32 ESTATE_ACCESS_ALLOWED_AGENTS = 1 << 0;
  125. constexpr U32 ESTATE_ACCESS_ALLOWED_GROUPS = 1 << 1;
  126. constexpr U32 ESTATE_ACCESS_BANNED_AGENTS = 1 << 2;
  127. constexpr U32 ESTATE_ACCESS_MANAGERS = 1 << 3;
  128. // Maximum number of access list entries we can fit in one packet
  129. constexpr S32 ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET = 63;
  130. // For reply to "getinfo", don't need to forward to all sims in estate
  131. constexpr U32 ESTATE_ACCESS_SEND_TO_AGENT_ONLY = 1 << 4;
  132. constexpr U32 ESTATE_ACCESS_ALL = ESTATE_ACCESS_ALLOWED_AGENTS
  133. | ESTATE_ACCESS_ALLOWED_GROUPS
  134. | ESTATE_ACCESS_BANNED_AGENTS
  135. | ESTATE_ACCESS_MANAGERS;
  136. // For EstateOwnerRequest, estateaccessdelta message
  137. constexpr U32 ESTATE_ACCESS_APPLY_TO_ALL_ESTATES = 1U << 0;
  138. constexpr U32 ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES = 1U << 1;
  139. constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_ADD = 1U << 2;
  140. constexpr U32 ESTATE_ACCESS_ALLOWED_AGENT_REMOVE = 1U << 3;
  141. constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_ADD = 1U << 4;
  142. constexpr U32 ESTATE_ACCESS_ALLOWED_GROUP_REMOVE = 1U << 5;
  143. constexpr U32 ESTATE_ACCESS_BANNED_AGENT_ADD = 1U << 6;
  144. constexpr U32 ESTATE_ACCESS_BANNED_AGENT_REMOVE = 1U << 7;
  145. constexpr U32 ESTATE_ACCESS_MANAGER_ADD = 1U << 8;
  146. constexpr U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9;
  147. constexpr U32 ESTATE_ACCESS_NO_REPLY = 1U << 10;
  148. constexpr U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11;
  149. constexpr S32 ESTATE_MAX_MANAGERS = 20;
  150. constexpr S32 ESTATE_MAX_ACCESS_IDS = 500;
  151. constexpr S32 ESTATE_MAX_BANNED_IDS = 750;
  152. constexpr S32 ESTATE_MAX_GROUP_IDS = (S32)ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET;
  153. // 'Sim Wide Delete' flags
  154. constexpr U32 SWD_OTHERS_LAND_ONLY = (1 << 0);
  155. constexpr U32 SWD_ALWAYS_RETURN_OBJECTS = (1 << 1);
  156. constexpr U32 SWD_SCRIPTED_ONLY = (1 << 2);
  157. // Controls experience key validity in the estate
  158. constexpr U32 EXPERIENCE_KEY_TYPE_NONE = 0;
  159. constexpr U32 EXPERIENCE_KEY_TYPE_BLOCKED = 1;
  160. constexpr U32 EXPERIENCE_KEY_TYPE_ALLOWED = 2;
  161. constexpr U32 EXPERIENCE_KEY_TYPE_TRUSTED = 3;
  162. constexpr U32 EXPERIENCE_KEY_TYPE_FIRST = EXPERIENCE_KEY_TYPE_BLOCKED;
  163. constexpr U32 EXPERIENCE_KEY_TYPE_LAST = EXPERIENCE_KEY_TYPE_TRUSTED;
  164. constexpr U32 ESTATE_EXPERIENCE_TRUSTED_ADD = 1U << 2;
  165. constexpr U32 ESTATE_EXPERIENCE_TRUSTED_REMOVE = 1U << 3;
  166. constexpr U32 ESTATE_EXPERIENCE_ALLOWED_ADD = 1U << 4;
  167. constexpr U32 ESTATE_EXPERIENCE_ALLOWED_REMOVE = 1U << 5;
  168. constexpr U32 ESTATE_EXPERIENCE_BLOCKED_ADD = 1U << 6;
  169. constexpr U32 ESTATE_EXPERIENCE_BLOCKED_REMOVE = 1U << 7;
  170. constexpr S32 ESTATE_MAX_EXPERIENCE_IDS = 8;
  171. #endif // LL_LLREGIONFLAGS_H