diff options
author | UbitUmarov | 2017-01-07 16:55:03 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-07 16:55:03 +0000 |
commit | add27a503e2558b7ddeb951d3e42e09b1c04fb36 (patch) | |
tree | 888ab5919cb52f1e0201fc4ab60987a0df022f1f /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Merge branch 'master' into httptests (diff) | |
parent | update permissions module with the new options (diff) | |
download | opensim-SC-add27a503e2558b7ddeb951d3e42e09b1c04fb36.zip opensim-SC-add27a503e2558b7ddeb951d3e42e09b1c04fb36.tar.gz opensim-SC-add27a503e2558b7ddeb951d3e42e09b1c04fb36.tar.bz2 opensim-SC-add27a503e2558b7ddeb951d3e42e09b1c04fb36.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 257 |
1 files changed, 112 insertions, 145 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 339f1b1..dbca68b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -92,6 +92,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
92 | 92 | ||
93 | public bool isNPC { get; private set; } | 93 | public bool isNPC { get; private set; } |
94 | 94 | ||
95 | // simple yes or no isGOD from god level >= 200 | ||
96 | // should only be set by GodController | ||
97 | // we have two to suport legacy behaviour | ||
98 | // isLegacyGod was controlled by viewer in older versions | ||
99 | // isGod may now be also controled by viewer acording to options | ||
100 | public bool isLegacyGod { get; set; } | ||
101 | public bool isGod { get; set; } | ||
102 | |||
95 | private PresenceType m_presenceType; | 103 | private PresenceType m_presenceType; |
96 | public PresenceType PresenceType { | 104 | public PresenceType PresenceType { |
97 | get {return m_presenceType;} | 105 | get {return m_presenceType;} |
@@ -155,7 +163,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
155 | public static readonly float MOVEMENT = .25f; | 163 | public static readonly float MOVEMENT = .25f; |
156 | public static readonly float SIGNIFICANT_MOVEMENT = 16.0f; | 164 | public static readonly float SIGNIFICANT_MOVEMENT = 16.0f; |
157 | public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; | 165 | public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; |
158 | public static readonly float CHILDUPDATES_TIME = 10000f; // min time between child updates (ms) | 166 | public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms) |
159 | 167 | ||
160 | private UUID m_previusParcelUUID = UUID.Zero; | 168 | private UUID m_previusParcelUUID = UUID.Zero; |
161 | private UUID m_currentParcelUUID = UUID.Zero; | 169 | private UUID m_currentParcelUUID = UUID.Zero; |
@@ -186,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
186 | m_currentParcelHide = true; | 194 | m_currentParcelHide = true; |
187 | 195 | ||
188 | if (m_previusParcelUUID != UUID.Zero || checksame) | 196 | if (m_previusParcelUUID != UUID.Zero || checksame) |
189 | ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,checksame); | 197 | ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, m_currentParcelHide, m_previusParcelHide, oldhide,checksame); |
190 | } | 198 | } |
191 | } | 199 | } |
192 | } | 200 | } |
@@ -267,8 +275,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
267 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; | 275 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; |
268 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; | 276 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; |
269 | private bool MouseDown = false; | 277 | private bool MouseDown = false; |
270 | // private SceneObjectGroup proxyObjectGroup; | ||
271 | //private SceneObjectPart proxyObjectPart = null; | ||
272 | public Vector3 lastKnownAllowedPosition; | 278 | public Vector3 lastKnownAllowedPosition; |
273 | public bool sentMessageAboutRestrictedParcelFlyingDown; | 279 | public bool sentMessageAboutRestrictedParcelFlyingDown; |
274 | public Vector4 CollisionPlane = Vector4.UnitW; | 280 | public Vector4 CollisionPlane = Vector4.UnitW; |
@@ -281,9 +287,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
281 | 287 | ||
282 | private bool m_followCamAuto = false; | 288 | private bool m_followCamAuto = false; |
283 | 289 | ||
284 | // private object m_forceToApplyLock = new object(); | ||
285 | // private bool m_forceToApplyValid; | ||
286 | // private Vector3 m_forceToApply; | ||
287 | private int m_userFlags; | 290 | private int m_userFlags; |
288 | public int UserFlags | 291 | public int UserFlags |
289 | { | 292 | { |
@@ -304,9 +307,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
304 | set { PhysicsActor.IsColliding = value; } | 307 | set { PhysicsActor.IsColliding = value; } |
305 | } | 308 | } |
306 | 309 | ||
307 | // private int m_lastColCount = -1; //KF: Look for Collision chnages | ||
308 | // private int m_updateCount = 0; //KF: Update Anims for a while | ||
309 | // private static readonly int UPDATE_COUNT = 10; // how many frames to update for | ||
310 | private List<uint> m_lastColliders = new List<uint>(); | 310 | private List<uint> m_lastColliders = new List<uint>(); |
311 | 311 | ||
312 | private TeleportFlags m_teleportFlags; | 312 | private TeleportFlags m_teleportFlags; |
@@ -332,8 +332,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
332 | 332 | ||
333 | private float m_sitAvatarHeight = 2.0f; | 333 | private float m_sitAvatarHeight = 2.0f; |
334 | 334 | ||
335 | private bool childUpdatesBusy = false; | 335 | private bool m_childUpdatesBusy = false; |
336 | private int lastChildUpdatesTime; | 336 | private int m_lastChildUpdatesTime; |
337 | private int m_lastChildAgentUpdateGodLevel; | ||
338 | private float m_lastChildAgentUpdateDrawDistance; | ||
337 | private Vector3 m_lastChildAgentUpdatePosition; | 339 | private Vector3 m_lastChildAgentUpdatePosition; |
338 | // private Vector3 m_lastChildAgentUpdateCamPosition; | 340 | // private Vector3 m_lastChildAgentUpdateCamPosition; |
339 | 341 | ||
@@ -348,8 +350,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
348 | private float m_healRate = 1f; | 350 | private float m_healRate = 1f; |
349 | private float m_healRatePerFrame = 0.05f; | 351 | private float m_healRatePerFrame = 0.05f; |
350 | 352 | ||
351 | // protected ulong crossingFromRegion; | ||
352 | |||
353 | private readonly Vector3[] Dir_Vectors = new Vector3[12]; | 353 | private readonly Vector3[] Dir_Vectors = new Vector3[12]; |
354 | 354 | ||
355 | protected int m_reprioritizationLastTime; | 355 | protected int m_reprioritizationLastTime; |
@@ -372,10 +372,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
372 | private const int NumMovementsBetweenRayCast = 5; | 372 | private const int NumMovementsBetweenRayCast = 5; |
373 | 373 | ||
374 | private bool CameraConstraintActive; | 374 | private bool CameraConstraintActive; |
375 | //private int m_moveToPositionStateStatus; | ||
376 | //***************************************************** | ||
377 | 375 | ||
378 | //private bool m_collisionEventFlag = false; | ||
379 | private object m_collisionEventLock = new Object(); | 376 | private object m_collisionEventLock = new Object(); |
380 | 377 | ||
381 | private int m_movementAnimationUpdateCounter = 0; | 378 | private int m_movementAnimationUpdateCounter = 0; |
@@ -529,7 +526,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
529 | private bool m_doingCamRayCast = false; | 526 | private bool m_doingCamRayCast = false; |
530 | 527 | ||
531 | public Vector3 CameraPosition { get; set; } | 528 | public Vector3 CameraPosition { get; set; } |
532 | |||
533 | public Quaternion CameraRotation { get; private set; } | 529 | public Quaternion CameraRotation { get; private set; } |
534 | 530 | ||
535 | // Use these three vectors to figure out what the agent is looking at | 531 | // Use these three vectors to figure out what the agent is looking at |
@@ -589,7 +585,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
589 | public bool AllowMovement { get; set; } | 585 | public bool AllowMovement { get; set; } |
590 | 586 | ||
591 | private bool m_setAlwaysRun; | 587 | private bool m_setAlwaysRun; |
592 | |||
593 | public bool SetAlwaysRun | 588 | public bool SetAlwaysRun |
594 | { | 589 | { |
595 | get | 590 | get |
@@ -613,7 +608,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
613 | } | 608 | } |
614 | } | 609 | } |
615 | 610 | ||
616 | |||
617 | public byte State { get; set; } | 611 | public byte State { get; set; } |
618 | 612 | ||
619 | private AgentManager.ControlFlags m_AgentControlFlags; | 613 | private AgentManager.ControlFlags m_AgentControlFlags; |
@@ -935,27 +929,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | seeds = Scene.CapsModule.GetChildrenSeeds(UUID); | 929 | seeds = Scene.CapsModule.GetChildrenSeeds(UUID); |
936 | else | 930 | else |
937 | seeds = new Dictionary<ulong, string>(); | 931 | seeds = new Dictionary<ulong, string>(); |
938 | |||
939 | /* we can't do this anymore | ||
940 | List<ulong> old = new List<ulong>(); | ||
941 | foreach (ulong handle in seeds.Keys) | ||
942 | { | ||
943 | uint x, y; | ||
944 | Util.RegionHandleToRegionLoc(handle, out x, out y); | ||
945 | // if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY,)) | ||
946 | { | ||
947 | old.Add(handle); | ||
948 | } | ||
949 | } | ||
950 | |||
951 | DropOldNeighbours(old); | ||
952 | |||
953 | if (Scene.CapsModule != null) | ||
954 | Scene.CapsModule.SetChildrenSeed(UUID, seeds); | ||
955 | */ | ||
956 | KnownRegions = seeds; | 932 | KnownRegions = seeds; |
957 | //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); | ||
958 | //DumpKnownRegions(); | ||
959 | } | 933 | } |
960 | 934 | ||
961 | public void DumpKnownRegions() | 935 | public void DumpKnownRegions() |
@@ -1045,8 +1019,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1045 | public ScenePresence( | 1019 | public ScenePresence( |
1046 | IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) | 1020 | IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) |
1047 | { | 1021 | { |
1048 | GodController = new GodController(world, this); | ||
1049 | |||
1050 | m_scene = world; | 1022 | m_scene = world; |
1051 | AttachmentsSyncLock = new Object(); | 1023 | AttachmentsSyncLock = new Object(); |
1052 | AllowMovement = true; | 1024 | AllowMovement = true; |
@@ -1072,8 +1044,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1072 | else | 1044 | else |
1073 | m_userFlags = 0; | 1045 | m_userFlags = 0; |
1074 | 1046 | ||
1047 | int userlevel = 0; | ||
1075 | if (account != null) | 1048 | if (account != null) |
1076 | GodController.UserLevel = account.UserLevel; | 1049 | userlevel = account.UserLevel; |
1050 | |||
1051 | GodController = new GodController(world, this, userlevel); | ||
1077 | 1052 | ||
1078 | // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 1053 | // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
1079 | // if (gm != null) | 1054 | // if (gm != null) |
@@ -1087,7 +1062,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1087 | m_reprioritizationLastDrawDistance = DrawDistance; | 1062 | m_reprioritizationLastDrawDistance = DrawDistance; |
1088 | 1063 | ||
1089 | // disable updates workjobs for now | 1064 | // disable updates workjobs for now |
1090 | childUpdatesBusy = true; | 1065 | m_childUpdatesBusy = true; |
1091 | m_reprioritizationBusy = true; | 1066 | m_reprioritizationBusy = true; |
1092 | 1067 | ||
1093 | AdjustKnownSeeds(); | 1068 | AdjustKnownSeeds(); |
@@ -1289,7 +1264,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1289 | IsLoggingIn = false; | 1264 | IsLoggingIn = false; |
1290 | } | 1265 | } |
1291 | 1266 | ||
1292 | IsChildAgent = false; | 1267 | IsChildAgent = false; |
1293 | } | 1268 | } |
1294 | 1269 | ||
1295 | m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 1270 | m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -1299,7 +1274,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1299 | // Should not be needed if we are not trying to tell this region to close | 1274 | // Should not be needed if we are not trying to tell this region to close |
1300 | // DoNotCloseAfterTeleport = false; | 1275 | // DoNotCloseAfterTeleport = false; |
1301 | 1276 | ||
1302 | |||
1303 | RegionHandle = m_scene.RegionInfo.RegionHandle; | 1277 | RegionHandle = m_scene.RegionInfo.RegionHandle; |
1304 | 1278 | ||
1305 | m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); | 1279 | m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); |
@@ -1442,7 +1416,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1442 | } | 1416 | } |
1443 | } | 1417 | } |
1444 | 1418 | ||
1445 | |||
1446 | m_log.DebugFormat("[MakeRootAgent] position and physical: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 1419 | m_log.DebugFormat("[MakeRootAgent] position and physical: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
1447 | m_scene.SwapRootAgentCount(false); | 1420 | m_scene.SwapRootAgentCount(false); |
1448 | 1421 | ||
@@ -1777,17 +1750,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1777 | 1750 | ||
1778 | if (m_AngularVelocity.Z > 0) | 1751 | if (m_AngularVelocity.Z > 0) |
1779 | { | 1752 | { |
1780 | |||
1781 | float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; | 1753 | float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; |
1782 | if (amount > leftOverToMin) | 1754 | if (amount > leftOverToMin) |
1783 | return -leftOverToMin; | 1755 | return -leftOverToMin; |
1784 | else | 1756 | else |
1785 | return -amount; | 1757 | return -amount; |
1786 | |||
1787 | } | 1758 | } |
1788 | else | 1759 | else |
1789 | { | 1760 | { |
1790 | |||
1791 | float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; | 1761 | float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; |
1792 | if (amount > leftOverToMin) | 1762 | if (amount > leftOverToMin) |
1793 | return leftOverToMin; | 1763 | return leftOverToMin; |
@@ -1796,8 +1766,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1796 | } | 1766 | } |
1797 | } | 1767 | } |
1798 | 1768 | ||
1799 | |||
1800 | |||
1801 | // neighbouring regions we have enabled a child agent in | 1769 | // neighbouring regions we have enabled a child agent in |
1802 | // holds the seed cap for the child agent in that region | 1770 | // holds the seed cap for the child agent in that region |
1803 | private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>(); | 1771 | private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>(); |
@@ -1810,7 +1778,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1810 | 1778 | ||
1811 | private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>(); | 1779 | private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>(); |
1812 | 1780 | ||
1813 | |||
1814 | public void AddNeighbourRegionSizeInfo(GridRegion region) | 1781 | public void AddNeighbourRegionSizeInfo(GridRegion region) |
1815 | { | 1782 | { |
1816 | lock (m_knownChildRegions) | 1783 | lock (m_knownChildRegions) |
@@ -1941,7 +1908,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1941 | lock (m_originRegionIDAccessLock) | 1908 | lock (m_originRegionIDAccessLock) |
1942 | originID = m_originRegionID; | 1909 | originID = m_originRegionID; |
1943 | 1910 | ||
1944 | |||
1945 | while (originID.Equals(UUID.Zero) && count-- > 0) | 1911 | while (originID.Equals(UUID.Zero) && count-- > 0) |
1946 | { | 1912 | { |
1947 | lock (m_originRegionIDAccessLock) | 1913 | lock (m_originRegionIDAccessLock) |
@@ -2063,13 +2029,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2063 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2029 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2064 | } | 2030 | } |
2065 | 2031 | ||
2066 | |||
2067 | // Tell the client that we're totally ready | 2032 | // Tell the client that we're totally ready |
2068 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | 2033 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); |
2069 | 2034 | ||
2070 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2035 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2071 | 2036 | ||
2072 | |||
2073 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2037 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2074 | { | 2038 | { |
2075 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | 2039 | // We cannot sleep here since this would hold up the inbound packet processing thread, as |
@@ -2098,7 +2062,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2098 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); | 2062 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); |
2099 | // } | 2063 | // } |
2100 | 2064 | ||
2101 | |||
2102 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2065 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2103 | 2066 | ||
2104 | if(m_teleportFlags > 0) | 2067 | if(m_teleportFlags > 0) |
@@ -2118,17 +2081,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2118 | m_log.DebugFormat("[CompleteMovement] HG"); | 2081 | m_log.DebugFormat("[CompleteMovement] HG"); |
2119 | } | 2082 | } |
2120 | 2083 | ||
2121 | if(!IsChildAgent && !isNPC) | ||
2122 | |||
2123 | // start sending terrain patchs | ||
2124 | if (!gotCrossUpdate && !isNPC) | ||
2125 | Scene.SendLayerData(ControllingClient); | ||
2126 | |||
2127 | m_previusParcelHide = false; | 2084 | m_previusParcelHide = false; |
2128 | m_previusParcelUUID = UUID.Zero; | 2085 | m_previusParcelUUID = UUID.Zero; |
2129 | m_currentParcelHide = false; | 2086 | m_currentParcelHide = false; |
2130 | m_currentParcelUUID = UUID.Zero; | 2087 | m_currentParcelUUID = UUID.Zero; |
2131 | 2088 | ||
2089 | if(!isNPC) | ||
2090 | { | ||
2091 | GodController.SyncViewerState(); | ||
2092 | |||
2093 | // start sending terrain patchs | ||
2094 | if (!gotCrossUpdate) | ||
2095 | Scene.SendLayerData(ControllingClient); | ||
2096 | } | ||
2132 | // send initial land overlay and parcel | 2097 | // send initial land overlay and parcel |
2133 | ILandChannel landch = m_scene.LandChannel; | 2098 | ILandChannel landch = m_scene.LandChannel; |
2134 | if (landch != null) | 2099 | if (landch != null) |
@@ -2177,7 +2142,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2177 | if (haveAnims) | 2142 | if (haveAnims) |
2178 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); | 2143 | SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); |
2179 | 2144 | ||
2180 | |||
2181 | // we should be able to receive updates, etc | 2145 | // we should be able to receive updates, etc |
2182 | // so release them | 2146 | // so release them |
2183 | m_inTransit = false; | 2147 | m_inTransit = false; |
@@ -2192,7 +2156,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2192 | if (p == this) | 2156 | if (p == this) |
2193 | continue; | 2157 | continue; |
2194 | 2158 | ||
2195 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 2159 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
2196 | continue; | 2160 | continue; |
2197 | 2161 | ||
2198 | SendAppearanceToAgentNF(p); | 2162 | SendAppearanceToAgentNF(p); |
@@ -2242,7 +2206,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2242 | continue; | 2206 | continue; |
2243 | } | 2207 | } |
2244 | 2208 | ||
2245 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 2209 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
2246 | continue; | 2210 | continue; |
2247 | 2211 | ||
2248 | SendAttachmentsToAgentNF(p); | 2212 | SendAttachmentsToAgentNF(p); |
@@ -2259,10 +2223,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2259 | { | 2223 | { |
2260 | m_agentTransfer.EnableChildAgents(this); | 2224 | m_agentTransfer.EnableChildAgents(this); |
2261 | } | 2225 | } |
2262 | // let updates be sent, with some delay | ||
2263 | lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; | ||
2264 | childUpdatesBusy = false; // allow them | ||
2265 | } | 2226 | } |
2227 | // let updates be sent, with some delay | ||
2228 | m_lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; | ||
2229 | m_lastChildAgentUpdateGodLevel = GodController.GodLevel; | ||
2230 | m_lastChildAgentUpdateDrawDistance = DrawDistance; | ||
2231 | m_lastChildAgentUpdatePosition = AbsolutePosition; | ||
2232 | m_childUpdatesBusy = false; // allow them | ||
2266 | } | 2233 | } |
2267 | 2234 | ||
2268 | m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2235 | m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -2292,7 +2259,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2292 | m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2259 | m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2293 | 2260 | ||
2294 | } | 2261 | } |
2295 | |||
2296 | } | 2262 | } |
2297 | finally | 2263 | finally |
2298 | { | 2264 | { |
@@ -2301,14 +2267,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2301 | crossingFlags = 0; | 2267 | crossingFlags = 0; |
2302 | m_inTransit = false; | 2268 | m_inTransit = false; |
2303 | } | 2269 | } |
2304 | // if hide force a check | 2270 | |
2305 | // if (!IsChildAgent && newhide) | ||
2306 | // { | ||
2307 | // ParcelLoginCheck(m_currentParcelUUID); | ||
2308 | // m_currentParcelHide = newhide; | ||
2309 | // } | ||
2310 | |||
2311 | |||
2312 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; | 2271 | m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; |
2313 | 2272 | ||
2314 | m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2273 | m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -3220,7 +3179,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3220 | if (part == null) | 3179 | if (part == null) |
3221 | return; | 3180 | return; |
3222 | 3181 | ||
3223 | |||
3224 | if (PhysicsActor != null) | 3182 | if (PhysicsActor != null) |
3225 | m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; | 3183 | m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; |
3226 | 3184 | ||
@@ -3249,7 +3207,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3249 | 3207 | ||
3250 | if (canSit) | 3208 | if (canSit) |
3251 | { | 3209 | { |
3252 | |||
3253 | if (PhysicsActor != null) | 3210 | if (PhysicsActor != null) |
3254 | { | 3211 | { |
3255 | // We can remove the physicsActor until they stand up. | 3212 | // We can remove the physicsActor until they stand up. |
@@ -3360,7 +3317,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3360 | return false; | 3317 | return false; |
3361 | } | 3318 | } |
3362 | 3319 | ||
3363 | |||
3364 | private bool CanEnterLandPosition(Vector3 testPos) | 3320 | private bool CanEnterLandPosition(Vector3 testPos) |
3365 | { | 3321 | { |
3366 | ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y); | 3322 | ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y); |
@@ -3440,7 +3396,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3440 | ControllingClient.SendSitResponse( | 3396 | ControllingClient.SendSitResponse( |
3441 | part.ParentGroup.UUID, offset, Orientation, true, cameraAtOffset, cameraEyeOffset, forceMouselook); | 3397 | part.ParentGroup.UUID, offset, Orientation, true, cameraAtOffset, cameraEyeOffset, forceMouselook); |
3442 | 3398 | ||
3443 | |||
3444 | SendAvatarDataToAllAgents(); | 3399 | SendAvatarDataToAllAgents(); |
3445 | 3400 | ||
3446 | if (status == 3) | 3401 | if (status == 3) |
@@ -3650,8 +3605,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3650 | Animator.avnChangeAnim(animID, addRemove, sendPack); | 3605 | Animator.avnChangeAnim(animID, addRemove, sendPack); |
3651 | } | 3606 | } |
3652 | 3607 | ||
3653 | |||
3654 | |||
3655 | /// <summary> | 3608 | /// <summary> |
3656 | /// Rotate the avatar to the given rotation and apply a movement in the given relative vector | 3609 | /// Rotate the avatar to the given rotation and apply a movement in the given relative vector |
3657 | /// </summary> | 3610 | /// </summary> |
@@ -3858,7 +3811,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3858 | if (!remoteClient.IsActive) | 3811 | if (!remoteClient.IsActive) |
3859 | return; | 3812 | return; |
3860 | 3813 | ||
3861 | if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && p.GodController.GodLevel < 200) | 3814 | if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.isLegacyGod) |
3862 | return; | 3815 | return; |
3863 | 3816 | ||
3864 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); | 3817 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); |
@@ -3968,7 +3921,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3968 | // get the avatar, then a kill if can't see it | 3921 | // get the avatar, then a kill if can't see it |
3969 | p.SendInitialAvatarDataToAgent(this); | 3922 | p.SendInitialAvatarDataToAgent(this); |
3970 | 3923 | ||
3971 | if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && GodController.GodLevel < 200) | 3924 | if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !isLegacyGod) |
3972 | return; | 3925 | return; |
3973 | 3926 | ||
3974 | p.SendAppearanceToAgentNF(this); | 3927 | p.SendAppearanceToAgentNF(this); |
@@ -4016,7 +3969,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4016 | foreach (ScenePresence p in presences) | 3969 | foreach (ScenePresence p in presences) |
4017 | { | 3970 | { |
4018 | p.ControllingClient.SendAvatarDataImmediate(this); | 3971 | p.ControllingClient.SendAvatarDataImmediate(this); |
4019 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 3972 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4020 | // either just kill the object | 3973 | // either just kill the object |
4021 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); | 3974 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); |
4022 | // or also attachments viewer may still know about | 3975 | // or also attachments viewer may still know about |
@@ -4029,7 +3982,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4029 | public void SendInitialAvatarDataToAgent(ScenePresence p) | 3982 | public void SendInitialAvatarDataToAgent(ScenePresence p) |
4030 | { | 3983 | { |
4031 | p.ControllingClient.SendAvatarDataImmediate(this); | 3984 | p.ControllingClient.SendAvatarDataImmediate(this); |
4032 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 3985 | if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4033 | // either just kill the object | 3986 | // either just kill the object |
4034 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); | 3987 | // p.ControllingClient.SendKillObject(new List<uint> {LocalId}); |
4035 | // or also attachments viewer may still know about | 3988 | // or also attachments viewer may still know about |
@@ -4043,7 +3996,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4043 | public void SendAvatarDataToAgent(ScenePresence avatar) | 3996 | public void SendAvatarDataToAgent(ScenePresence avatar) |
4044 | { | 3997 | { |
4045 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); | 3998 | //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); |
4046 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodController.GodLevel < 200) | 3999 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isLegacyGod) |
4047 | return; | 4000 | return; |
4048 | avatar.ControllingClient.SendAvatarDataImmediate(this); | 4001 | avatar.ControllingClient.SendAvatarDataImmediate(this); |
4049 | } | 4002 | } |
@@ -4088,7 +4041,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4088 | { | 4041 | { |
4089 | // m_log.DebugFormat( | 4042 | // m_log.DebugFormat( |
4090 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); | 4043 | // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); |
4091 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodController.GodLevel < 200) | 4044 | if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isLegacyGod) |
4092 | return; | 4045 | return; |
4093 | SendAppearanceToAgentNF(avatar); | 4046 | SendAppearanceToAgentNF(avatar); |
4094 | } | 4047 | } |
@@ -4104,7 +4057,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4104 | if (IsChildAgent || Animator == null) | 4057 | if (IsChildAgent || Animator == null) |
4105 | return; | 4058 | return; |
4106 | 4059 | ||
4107 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 4060 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4108 | return; | 4061 | return; |
4109 | 4062 | ||
4110 | Animator.SendAnimPackToClient(p.ControllingClient); | 4063 | Animator.SendAnimPackToClient(p.ControllingClient); |
@@ -4115,7 +4068,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4115 | if (IsChildAgent) | 4068 | if (IsChildAgent) |
4116 | return; | 4069 | return; |
4117 | 4070 | ||
4118 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 4071 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4119 | return; | 4072 | return; |
4120 | 4073 | ||
4121 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); | 4074 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); |
@@ -4140,7 +4093,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4140 | 4093 | ||
4141 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | 4094 | m_scene.ForEachScenePresence(delegate(ScenePresence p) |
4142 | { | 4095 | { |
4143 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 4096 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
4144 | return; | 4097 | return; |
4145 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); | 4098 | p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); |
4146 | }); | 4099 | }); |
@@ -4175,7 +4128,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4175 | if(DrawDistance > minregionSize && m_reprioritizationLastDrawDistance > minregionSize) | 4128 | if(DrawDistance > minregionSize && m_reprioritizationLastDrawDistance > minregionSize) |
4176 | byDrawdistance = false; | 4129 | byDrawdistance = false; |
4177 | else | 4130 | else |
4178 | byDrawdistance = (Math.Abs(DrawDistance-m_reprioritizationLastDrawDistance) > 0.5f * limit); | 4131 | byDrawdistance = (Math.Abs(DrawDistance - m_reprioritizationLastDrawDistance) > 0.5f * limit); |
4179 | } | 4132 | } |
4180 | 4133 | ||
4181 | int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); | 4134 | int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); |
@@ -4224,7 +4177,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4224 | // updates priority recalc | 4177 | // updates priority recalc |
4225 | checkRePrioritization(); | 4178 | checkRePrioritization(); |
4226 | 4179 | ||
4227 | if(childUpdatesBusy) | 4180 | if(m_childUpdatesBusy) |
4228 | return; | 4181 | return; |
4229 | 4182 | ||
4230 | //possible KnownRegionHandles always contains current region and this check is not needed | 4183 | //possible KnownRegionHandles always contains current region and this check is not needed |
@@ -4234,37 +4187,52 @@ namespace OpenSim.Region.Framework.Scenes | |||
4234 | 4187 | ||
4235 | if(KnownRegionHandles.Count > minhandles) | 4188 | if(KnownRegionHandles.Count > minhandles) |
4236 | { | 4189 | { |
4237 | int tdiff = Util.EnvironmentTickCountSubtract(lastChildUpdatesTime); | 4190 | int tdiff = Util.EnvironmentTickCountSubtract(m_lastChildUpdatesTime); |
4238 | if(tdiff > CHILDUPDATES_TIME) | 4191 | if(tdiff < CHILDUPDATES_TIME) |
4192 | return; | ||
4193 | |||
4194 | bool doUpdate = false; | ||
4195 | if(m_lastChildAgentUpdateGodLevel != GodController.GodLevel) | ||
4196 | doUpdate = true; | ||
4197 | |||
4198 | if(!doUpdate && Math.Abs(DrawDistance - m_lastChildAgentUpdateDrawDistance) > 32.0f) | ||
4199 | doUpdate = true; | ||
4200 | |||
4201 | if(!doUpdate) | ||
4239 | { | 4202 | { |
4240 | diff = pos - m_lastChildAgentUpdatePosition; | 4203 | diff = pos - m_lastChildAgentUpdatePosition; |
4241 | if (diff.LengthSquared() > CHILDUPDATES_MOVEMENT) | 4204 | if (diff.LengthSquared() > CHILDUPDATES_MOVEMENT) |
4242 | { | 4205 | doUpdate = true; |
4243 | childUpdatesBusy = true; | 4206 | } |
4244 | m_lastChildAgentUpdatePosition = pos; | 4207 | |
4208 | if(doUpdate) | ||
4209 | { | ||
4210 | m_childUpdatesBusy = true; | ||
4211 | m_lastChildAgentUpdatePosition = pos; | ||
4212 | m_lastChildAgentUpdateGodLevel = GodController.GodLevel; | ||
4213 | m_lastChildAgentUpdateDrawDistance = DrawDistance; | ||
4245 | // m_lastChildAgentUpdateCamPosition = CameraPosition; | 4214 | // m_lastChildAgentUpdateCamPosition = CameraPosition; |
4246 | 4215 | ||
4247 | AgentPosition agentpos = new AgentPosition(); | 4216 | AgentPosition agentpos = new AgentPosition(); |
4248 | agentpos.AgentID = new UUID(UUID.Guid); | 4217 | agentpos.AgentID = new UUID(UUID.Guid); |
4249 | agentpos.SessionID = ControllingClient.SessionId; | 4218 | agentpos.SessionID = ControllingClient.SessionId; |
4250 | agentpos.Size = Appearance.AvatarSize; | 4219 | agentpos.Size = Appearance.AvatarSize; |
4251 | agentpos.Center = CameraPosition; | 4220 | agentpos.Center = CameraPosition; |
4252 | agentpos.Far = DrawDistance; | 4221 | agentpos.Far = DrawDistance; |
4253 | agentpos.Position = AbsolutePosition; | 4222 | agentpos.Position = AbsolutePosition; |
4254 | agentpos.Velocity = Velocity; | 4223 | agentpos.Velocity = Velocity; |
4255 | agentpos.RegionHandle = RegionHandle; | 4224 | agentpos.RegionHandle = RegionHandle; |
4256 | agentpos.GodData = GodController.State(); | 4225 | agentpos.GodData = GodController.State(); |
4257 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); | 4226 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); |
4258 | 4227 | ||
4259 | // Let's get this out of the update loop | 4228 | // Let's get this out of the update loop |
4260 | Util.FireAndForget( | 4229 | Util.FireAndForget( |
4261 | o => | 4230 | o => |
4262 | { | 4231 | { |
4263 | m_scene.SendOutChildAgentUpdates(agentpos, this); | 4232 | m_scene.SendOutChildAgentUpdates(agentpos, this); |
4264 | lastChildUpdatesTime = Util.EnvironmentTickCount(); | 4233 | m_lastChildUpdatesTime = Util.EnvironmentTickCount(); |
4265 | childUpdatesBusy = false; | 4234 | m_childUpdatesBusy = false; |
4266 | }, null, "ScenePresence.SendOutChildAgentUpdates"); | 4235 | }, null, "ScenePresence.SendOutChildAgentUpdates"); |
4267 | } | ||
4268 | } | 4236 | } |
4269 | } | 4237 | } |
4270 | } | 4238 | } |
@@ -4505,9 +4473,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4505 | if (isNPC) | 4473 | if (isNPC) |
4506 | return; | 4474 | return; |
4507 | 4475 | ||
4508 | bool success = GodController.RequestGodMode(godStatus); | 4476 | bool wasgod = isLegacyGod; |
4509 | if (success && godStatus) | 4477 | GodController.RequestGodMode(godStatus); |
4510 | parcelGodCheck(m_currentParcelUUID, GodController.GodLevel >= 200); | 4478 | if (wasgod != isLegacyGod) |
4479 | parcelGodCheck(m_currentParcelUUID); | ||
4511 | } | 4480 | } |
4512 | 4481 | ||
4513 | #region Child Agent Updates | 4482 | #region Child Agent Updates |
@@ -4606,6 +4575,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4606 | cAgent.UpAxis = CameraUpAxis; | 4575 | cAgent.UpAxis = CameraUpAxis; |
4607 | 4576 | ||
4608 | cAgent.Far = DrawDistance; | 4577 | cAgent.Far = DrawDistance; |
4578 | cAgent.GodData = GodController.State(); | ||
4609 | 4579 | ||
4610 | // Throttles | 4580 | // Throttles |
4611 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); | 4581 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); |
@@ -4686,7 +4656,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4686 | Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis); | 4656 | Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis); |
4687 | CameraRotation = camRot; | 4657 | CameraRotation = camRot; |
4688 | 4658 | ||
4689 | |||
4690 | ParentUUID = cAgent.ParentPart; | 4659 | ParentUUID = cAgent.ParentPart; |
4691 | PrevSitOffset = cAgent.SitOffset; | 4660 | PrevSitOffset = cAgent.SitOffset; |
4692 | 4661 | ||
@@ -4872,7 +4841,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4872 | ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); | 4841 | ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); |
4873 | } | 4842 | } |
4874 | 4843 | ||
4875 | |||
4876 | /// <summary> | 4844 | /// <summary> |
4877 | /// Event called by the physics plugin to tell the avatar about a collision. | 4845 | /// Event called by the physics plugin to tell the avatar about a collision. |
4878 | /// </summary> | 4846 | /// </summary> |
@@ -4941,7 +4909,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4941 | RaiseCollisionScriptEvents(coldata); | 4909 | RaiseCollisionScriptEvents(coldata); |
4942 | 4910 | ||
4943 | // Gods do not take damage and Invulnerable is set depending on parcel/region flags | 4911 | // Gods do not take damage and Invulnerable is set depending on parcel/region flags |
4944 | if (Invulnerable || GodController.GodLevel > 0) | 4912 | if (Invulnerable || isLegacyGod) |
4945 | return; | 4913 | return; |
4946 | 4914 | ||
4947 | // The following may be better in the ICombatModule | 4915 | // The following may be better in the ICombatModule |
@@ -5226,7 +5194,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5226 | if (p != this && sog.HasPrivateAttachmentPoint) | 5194 | if (p != this && sog.HasPrivateAttachmentPoint) |
5227 | return; | 5195 | return; |
5228 | 5196 | ||
5229 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5197 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5230 | return; | 5198 | return; |
5231 | 5199 | ||
5232 | SendTerseUpdateToAgentNF(p); | 5200 | SendTerseUpdateToAgentNF(p); |
@@ -5340,7 +5308,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5340 | if (p == this) | 5308 | if (p == this) |
5341 | continue; | 5309 | continue; |
5342 | 5310 | ||
5343 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5311 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5344 | continue; | 5312 | continue; |
5345 | 5313 | ||
5346 | p.ControllingClient.SendEntityUpdate(rootpart, rootflag); | 5314 | p.ControllingClient.SendEntityUpdate(rootpart, rootflag); |
@@ -5392,14 +5360,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
5392 | if (sog.HasPrivateAttachmentPoint) | 5360 | if (sog.HasPrivateAttachmentPoint) |
5393 | return; | 5361 | return; |
5394 | 5362 | ||
5395 | |||
5396 | List<ScenePresence> allPresences = m_scene.GetScenePresences(); | 5363 | List<ScenePresence> allPresences = m_scene.GetScenePresences(); |
5397 | foreach (ScenePresence p in allPresences) | 5364 | foreach (ScenePresence p in allPresences) |
5398 | { | 5365 | { |
5399 | if (p == this) | 5366 | if (p == this) |
5400 | continue; | 5367 | continue; |
5401 | 5368 | ||
5402 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5369 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5403 | continue; | 5370 | continue; |
5404 | 5371 | ||
5405 | p.ControllingClient.SendEntityUpdate(rootpart, flag); | 5372 | p.ControllingClient.SendEntityUpdate(rootpart, flag); |
@@ -5449,7 +5416,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5449 | if (p == this) | 5416 | if (p == this) |
5450 | continue; | 5417 | continue; |
5451 | 5418 | ||
5452 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5419 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5453 | continue; | 5420 | continue; |
5454 | 5421 | ||
5455 | p.ControllingClient.SendEntityUpdate(part, flag); | 5422 | p.ControllingClient.SendEntityUpdate(part, flag); |
@@ -5490,7 +5457,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5490 | { | 5457 | { |
5491 | if (p == this) | 5458 | if (p == this) |
5492 | continue; | 5459 | continue; |
5493 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 5460 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) |
5494 | continue; | 5461 | continue; |
5495 | 5462 | ||
5496 | p.ControllingClient.SendEntityUpdate(part, flag); | 5463 | p.ControllingClient.SendEntityUpdate(part, flag); |
@@ -6128,7 +6095,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6128 | // the TP point. This behaviour mimics agni. | 6095 | // the TP point. This behaviour mimics agni. |
6129 | if (land.LandData.LandingType == (byte)LandingType.LandingPoint && | 6096 | if (land.LandData.LandingType == (byte)LandingType.LandingPoint && |
6130 | land.LandData.UserLocation != Vector3.Zero && | 6097 | land.LandData.UserLocation != Vector3.Zero && |
6131 | GodController.GodLevel < 200 && | 6098 | !isLegacyGod && |
6132 | ((land.LandData.OwnerID != m_uuid && | 6099 | ((land.LandData.OwnerID != m_uuid && |
6133 | !m_scene.Permissions.IsGod(m_uuid) && | 6100 | !m_scene.Permissions.IsGod(m_uuid) && |
6134 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || | 6101 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || |
@@ -6153,7 +6120,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6153 | string reason; | 6120 | string reason; |
6154 | 6121 | ||
6155 | // dont mess with gods | 6122 | // dont mess with gods |
6156 | if(GodController.GodLevel >= 200 || m_scene.Permissions.IsGod(m_uuid)) | 6123 | if(isLegacyGod || m_scene.Permissions.IsGod(m_uuid)) |
6157 | return true; | 6124 | return true; |
6158 | 6125 | ||
6159 | // respect region owner and managers | 6126 | // respect region owner and managers |
@@ -6439,7 +6406,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6439 | 6406 | ||
6440 | } | 6407 | } |
6441 | 6408 | ||
6442 | private void parcelGodCheck(UUID currentParcelID, bool isGod) | 6409 | private void parcelGodCheck(UUID currentParcelID) |
6443 | { | 6410 | { |
6444 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6411 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
6445 | 6412 | ||
@@ -6450,7 +6417,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6450 | 6417 | ||
6451 | if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) | 6418 | if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) |
6452 | { | 6419 | { |
6453 | if (isGod) | 6420 | if (isLegacyGod) |
6454 | p.SendViewTo(this); | 6421 | p.SendViewTo(this); |
6455 | else | 6422 | else |
6456 | p.SendKillTo(this); | 6423 | p.SendKillTo(this); |
@@ -6459,7 +6426,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6459 | } | 6426 | } |
6460 | 6427 | ||
6461 | private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, | 6428 | private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, |
6462 | bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) | 6429 | bool currentParcelHide, bool previusParcelHide, bool oldhide, bool check) |
6463 | { | 6430 | { |
6464 | List<ScenePresence> killsToSendto = new List<ScenePresence>(); | 6431 | List<ScenePresence> killsToSendto = new List<ScenePresence>(); |
6465 | List<ScenePresence> killsToSendme = new List<ScenePresence>(); | 6432 | List<ScenePresence> killsToSendme = new List<ScenePresence>(); |
@@ -6501,7 +6468,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6501 | continue; | 6468 | continue; |
6502 | 6469 | ||
6503 | // those not on parcel dont see me | 6470 | // those not on parcel dont see me |
6504 | if (currentParcelID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 6471 | if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) |
6505 | { | 6472 | { |
6506 | killsToSendto.Add(p); // they dont see me | 6473 | killsToSendto.Add(p); // they dont see me |
6507 | } | 6474 | } |
@@ -6527,9 +6494,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
6527 | // only those on previus parcel need receive kills | 6494 | // only those on previus parcel need receive kills |
6528 | if (previusParcelID == p.currentParcelUUID) | 6495 | if (previusParcelID == p.currentParcelUUID) |
6529 | { | 6496 | { |
6530 | if(p.GodController.GodLevel < 200) | 6497 | if(!p.isLegacyGod) |
6531 | killsToSendto.Add(p); // they dont see me | 6498 | killsToSendto.Add(p); // they dont see me |
6532 | if(GodController.GodLevel < 200) | 6499 | if(!isLegacyGod) |
6533 | killsToSendme.Add(p); // i dont see them | 6500 | killsToSendme.Add(p); // i dont see them |
6534 | } | 6501 | } |
6535 | // only those on new parcel need see | 6502 | // only those on new parcel need see |
@@ -6551,7 +6518,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6551 | continue; | 6518 | continue; |
6552 | 6519 | ||
6553 | // those not on new parcel dont see me | 6520 | // those not on new parcel dont see me |
6554 | if (currentParcelID != p.currentParcelUUID && p.GodController.GodLevel < 200) | 6521 | if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) |
6555 | { | 6522 | { |
6556 | killsToSendto.Add(p); // they dont see me | 6523 | killsToSendto.Add(p); // they dont see me |
6557 | } | 6524 | } |
@@ -6577,7 +6544,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6577 | if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) | 6544 | if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) |
6578 | continue; | 6545 | continue; |
6579 | // only those old parcel need kills | 6546 | // only those old parcel need kills |
6580 | if (previusParcelID == p.currentParcelUUID && GodController.GodLevel < 200) | 6547 | if (previusParcelID == p.currentParcelUUID && !isLegacyGod) |
6581 | { | 6548 | { |
6582 | killsToSendme.Add(p); // i dont see them | 6549 | killsToSendme.Add(p); // i dont see them |
6583 | } | 6550 | } |
@@ -6634,13 +6601,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
6634 | 6601 | ||
6635 | public void HasMovedAway(bool nearRegion) | 6602 | public void HasMovedAway(bool nearRegion) |
6636 | { | 6603 | { |
6637 | |||
6638 | if (nearRegion) | 6604 | if (nearRegion) |
6639 | { | 6605 | { |
6640 | if (Scene.AttachmentsModule != null) | 6606 | if (Scene.AttachmentsModule != null) |
6641 | Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); | 6607 | Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); |
6642 | 6608 | ||
6643 | if (!ParcelHideThisAvatar || GodController.GodLevel >= 200) | 6609 | if (!ParcelHideThisAvatar || isLegacyGod) |
6644 | return; | 6610 | return; |
6645 | 6611 | ||
6646 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6612 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
@@ -6657,6 +6623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6657 | } | 6623 | } |
6658 | else | 6624 | else |
6659 | { | 6625 | { |
6626 | GodController.HasMovedAway(); | ||
6660 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 6627 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
6661 | foreach (ScenePresence p in allpresences) | 6628 | foreach (ScenePresence p in allpresences) |
6662 | { | 6629 | { |