diff options
Diffstat (limited to 'OpenSim/Region')
10 files changed, 154 insertions, 37 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index 626932f..b3b0b8a 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs | |||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
76 | } | 76 | } |
77 | 77 | ||
78 | [Test] | 78 | [Test] |
79 | public void AddForClient() | 79 | public void TestAddForClient() |
80 | { | 80 | { |
81 | TestHelpers.InMethod(); | 81 | TestHelpers.InMethod(); |
82 | // log4net.Config.XmlConfigurator.Configure(); | 82 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests | |||
88 | } | 88 | } |
89 | 89 | ||
90 | [Test] | 90 | [Test] |
91 | public void RemoveForClient() | 91 | public void TestRemoveForClient() |
92 | { | 92 | { |
93 | TestHelpers.InMethod(); | 93 | TestHelpers.InMethod(); |
94 | // TestHelpers.EnableLogging(); | 94 | // TestHelpers.EnableLogging(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 174642d..917f164 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -372,21 +372,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
372 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, | 372 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, |
373 | string message, ChatSourceType src, bool ignoreDistance) | 373 | string message, ChatSourceType src, bool ignoreDistance) |
374 | { | 374 | { |
375 | // don't send chat to child agents | 375 | if (presence.LifecycleState != ScenePresenceState.Running) |
376 | if (presence.IsChildAgent) return false; | 376 | return false; |
377 | |||
378 | Vector3 fromRegionPos = fromPos + regionPos; | ||
379 | Vector3 toRegionPos = presence.AbsolutePosition + | ||
380 | new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, | ||
381 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
382 | 377 | ||
383 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | 378 | if (!ignoreDistance) |
384 | |||
385 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || | ||
386 | type == ChatTypeEnum.Say && dis > m_saydistance || | ||
387 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | ||
388 | { | 379 | { |
389 | return false; | 380 | Vector3 fromRegionPos = fromPos + regionPos; |
381 | Vector3 toRegionPos = presence.AbsolutePosition + | ||
382 | new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, | ||
383 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
384 | |||
385 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | ||
386 | |||
387 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || | ||
388 | type == ChatTypeEnum.Say && dis > m_saydistance || | ||
389 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | ||
390 | { | ||
391 | return false; | ||
392 | } | ||
390 | } | 393 | } |
391 | 394 | ||
392 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 395 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index bf1cffb..56ff2bd 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -1212,7 +1212,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1212 | json.Add("jsonrpc", OSD.FromString("2.0")); | 1212 | json.Add("jsonrpc", OSD.FromString("2.0")); |
1213 | json.Add("id", OSD.FromString(jsonId)); | 1213 | json.Add("id", OSD.FromString(jsonId)); |
1214 | json.Add("method", OSD.FromString(method)); | 1214 | json.Add("method", OSD.FromString(method)); |
1215 | // Experiment | 1215 | |
1216 | json.Add("params", OSD.SerializeMembers(parameters)); | 1216 | json.Add("params", OSD.SerializeMembers(parameters)); |
1217 | 1217 | ||
1218 | string jsonRequestData = OSDParser.SerializeJsonString(json); | 1218 | string jsonRequestData = OSDParser.SerializeJsonString(json); |
@@ -1240,8 +1240,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | Stream rstream = webResponse.GetResponseStream(); | 1242 | Stream rstream = webResponse.GetResponseStream(); |
1243 | if (rstream.Length < 1) | ||
1244 | return false; | ||
1245 | 1243 | ||
1246 | OSDMap mret = new OSDMap(); | 1244 | OSDMap mret = new OSDMap(); |
1247 | try | 1245 | try |
@@ -1318,8 +1316,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1318 | } | 1316 | } |
1319 | 1317 | ||
1320 | Stream rstream = webResponse.GetResponseStream(); | 1318 | Stream rstream = webResponse.GetResponseStream(); |
1321 | if (rstream.Length < 1) | ||
1322 | return false; | ||
1323 | 1319 | ||
1324 | OSDMap response = new OSDMap(); | 1320 | OSDMap response = new OSDMap(); |
1325 | try | 1321 | try |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 1f3e7a1..ed14c12 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -925,6 +925,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
925 | 925 | ||
926 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 926 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
927 | { | 927 | { |
928 | if (!sp.Scene.IncomingPreCloseAgent(sp)) | ||
929 | return; | ||
930 | |||
928 | // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before | 931 | // We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before |
929 | // they regard the new region as the current region after receiving the AgentMovementComplete | 932 | // they regard the new region as the current region after receiving the AgentMovementComplete |
930 | // response. If close is sent before then, it will cause the viewer to quit instead. | 933 | // response. If close is sent before then, it will cause the viewer to quit instead. |
@@ -1087,6 +1090,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1087 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 1090 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
1088 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 1091 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
1089 | { | 1092 | { |
1093 | if (!sp.Scene.IncomingPreCloseAgent(sp)) | ||
1094 | return; | ||
1095 | |||
1090 | // RED ALERT!!!! | 1096 | // RED ALERT!!!! |
1091 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. | 1097 | // PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES. |
1092 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion | 1098 | // THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion |
@@ -1100,6 +1106,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1100 | // then this will be handled in IncomingCloseAgent under lock conditions | 1106 | // then this will be handled in IncomingCloseAgent under lock conditions |
1101 | m_log.DebugFormat( | 1107 | m_log.DebugFormat( |
1102 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); | 1108 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); |
1109 | |||
1103 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 1110 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
1104 | } | 1111 | } |
1105 | else | 1112 | else |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 7adb203..8c983e6 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -481,14 +481,20 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
481 | 481 | ||
482 | public string GetUserUUI(UUID userID) | 482 | public string GetUserUUI(UUID userID) |
483 | { | 483 | { |
484 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID); | ||
485 | if (account != null) | ||
486 | return userID.ToString(); | ||
487 | |||
488 | UserData ud; | 484 | UserData ud; |
489 | lock (m_UserCache) | 485 | lock (m_UserCache) |
490 | m_UserCache.TryGetValue(userID, out ud); | 486 | m_UserCache.TryGetValue(userID, out ud); |
491 | 487 | ||
488 | if (ud == null) // It's not in the cache | ||
489 | { | ||
490 | string[] names = new string[2]; | ||
491 | // This will pull the data from either UserAccounts or GridUser | ||
492 | // and stick it into the cache | ||
493 | TryGetUserNamesFromServices(userID, names); | ||
494 | lock (m_UserCache) | ||
495 | m_UserCache.TryGetValue(userID, out ud); | ||
496 | } | ||
497 | |||
492 | if (ud != null) | 498 | if (ud != null) |
493 | { | 499 | { |
494 | string homeURL = ud.HomeURL; | 500 | string homeURL = ud.HomeURL; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 3849a3f..31ef79b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -235,6 +235,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
235 | return m_GridService.GetDefaultRegions(scopeID); | 235 | return m_GridService.GetDefaultRegions(scopeID); |
236 | } | 236 | } |
237 | 237 | ||
238 | public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID) | ||
239 | { | ||
240 | return m_GridService.GetDefaultHypergridRegions(scopeID); | ||
241 | } | ||
242 | |||
238 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) | 243 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) |
239 | { | 244 | { |
240 | return m_GridService.GetFallbackRegions(scopeID, x, y); | 245 | return m_GridService.GetFallbackRegions(scopeID, x, y); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index b2646ba..6a57d1f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -277,6 +277,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
277 | return rinfo; | 277 | return rinfo; |
278 | } | 278 | } |
279 | 279 | ||
280 | public List<GridRegion> GetDefaultHypergridRegions(UUID scopeID) | ||
281 | { | ||
282 | List<GridRegion> rinfo = m_LocalGridService.GetDefaultHypergridRegions(scopeID); | ||
283 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultHypergridRegions {0} found {1} regions", name, rinfo.Count); | ||
284 | List<GridRegion> grinfo = m_RemoteGridService.GetDefaultHypergridRegions(scopeID); | ||
285 | |||
286 | if (grinfo != null) | ||
287 | { | ||
288 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultHypergridRegions {0} found {1} regions", name, grinfo.Count); | ||
289 | foreach (GridRegion r in grinfo) | ||
290 | { | ||
291 | m_RegionInfoCache.Cache(r); | ||
292 | if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) | ||
293 | rinfo.Add(r); | ||
294 | } | ||
295 | } | ||
296 | |||
297 | return rinfo; | ||
298 | } | ||
299 | |||
280 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) | 300 | public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y) |
281 | { | 301 | { |
282 | List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y); | 302 | List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f864392..18e7eb8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3854,10 +3854,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3854 | 3854 | ||
3855 | // We need to ensure that we are not already removing the scene presence before we ask it not to be | 3855 | // We need to ensure that we are not already removing the scene presence before we ask it not to be |
3856 | // closed. | 3856 | // closed. |
3857 | if (sp != null && sp.IsChildAgent && sp.LifecycleState == ScenePresenceState.Running) | 3857 | if (sp != null && sp.IsChildAgent |
3858 | && (sp.LifecycleState == ScenePresenceState.Running | ||
3859 | || sp.LifecycleState == ScenePresenceState.PreRemove)) | ||
3858 | { | 3860 | { |
3859 | m_log.DebugFormat( | 3861 | m_log.DebugFormat( |
3860 | "[SCENE]: Reusing existing child scene presence for {0} in {1}", sp.Name, Name); | 3862 | "[SCENE]: Reusing existing child scene presence for {0}, state {1} in {2}", |
3863 | sp.Name, sp.LifecycleState, Name); | ||
3861 | 3864 | ||
3862 | // In the case where, for example, an A B C D region layout, an avatar may | 3865 | // In the case where, for example, an A B C D region layout, an avatar may |
3863 | // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C | 3866 | // teleport from A -> D, but then -> C before A has asked B to close its old child agent. When C |
@@ -3879,6 +3882,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3879 | // } | 3882 | // } |
3880 | // else if (EntityTransferModule.IsInTransit(sp.UUID)) | 3883 | // else if (EntityTransferModule.IsInTransit(sp.UUID)) |
3881 | 3884 | ||
3885 | sp.LifecycleState = ScenePresenceState.Running; | ||
3886 | |||
3882 | if (EntityTransferModule.IsInTransit(sp.UUID)) | 3887 | if (EntityTransferModule.IsInTransit(sp.UUID)) |
3883 | { | 3888 | { |
3884 | sp.DoNotCloseAfterTeleport = true; | 3889 | sp.DoNotCloseAfterTeleport = true; |
@@ -4018,6 +4023,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
4018 | // uses down the line. | 4023 | // uses down the line. |
4019 | sp.TeleportFlags = (TPFlags)teleportFlags; | 4024 | sp.TeleportFlags = (TPFlags)teleportFlags; |
4020 | 4025 | ||
4026 | // We must carry out a further authorization check if there's an | ||
4027 | // attempt to make a child agent into a root agent, since SeeIntoRegion may have allowed a child | ||
4028 | // agent to login to a region where a full avatar would not be allowed. | ||
4029 | // | ||
4030 | // We determine whether this is a CreateAgent for a future non-child agent by inspecting | ||
4031 | // TeleportFlags, which will be default for a child connection. This relies on input from the source | ||
4032 | // region. | ||
4033 | if (sp.TeleportFlags != TPFlags.Default) | ||
4034 | { | ||
4035 | if (!AuthorizeUser(acd, false, out reason)) | ||
4036 | return false; | ||
4037 | } | ||
4038 | |||
4021 | if (sp.IsChildAgent) | 4039 | if (sp.IsChildAgent) |
4022 | { | 4040 | { |
4023 | m_log.DebugFormat( | 4041 | m_log.DebugFormat( |
@@ -4526,10 +4544,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4526 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | 4544 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); |
4527 | if (childAgentUpdate != null) | 4545 | if (childAgentUpdate != null) |
4528 | { | 4546 | { |
4529 | if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID) | 4547 | // if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID) |
4530 | // Only warn for now | 4548 | // // Only warn for now |
4531 | m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?", | 4549 | // m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?", |
4532 | childAgentUpdate.UUID, cAgentData.SessionID); | 4550 | // childAgentUpdate.UUID, cAgentData.SessionID); |
4533 | 4551 | ||
4534 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. | 4552 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. |
4535 | // however to avoid a race condition crossing borders.. | 4553 | // however to avoid a race condition crossing borders.. |
@@ -4631,6 +4649,50 @@ namespace OpenSim.Region.Framework.Scenes | |||
4631 | } | 4649 | } |
4632 | 4650 | ||
4633 | /// <summary> | 4651 | /// <summary> |
4652 | /// Tell a single agent to prepare to close. | ||
4653 | /// </summary> | ||
4654 | /// <remarks> | ||
4655 | /// This should only be called if we may close the agent but there will be some delay in so doing. Meant for | ||
4656 | /// internal use - other callers should almost certainly called IncomingCloseAgent(). | ||
4657 | /// </remarks> | ||
4658 | /// <param name="sp"></param> | ||
4659 | /// <returns>true if pre-close state notification was successful. false if the agent | ||
4660 | /// was not in a state where it could transition to pre-close.</returns> | ||
4661 | public bool IncomingPreCloseAgent(ScenePresence sp) | ||
4662 | { | ||
4663 | lock (m_removeClientLock) | ||
4664 | { | ||
4665 | // We need to avoid a race condition where in, for example, an A B C D region layout, an avatar may | ||
4666 | // teleport from A -> D, but then -> C before A has asked B to close its old child agent. We do not | ||
4667 | // want to obey this close since C may have renewed the child agent lease on B. | ||
4668 | if (sp.DoNotCloseAfterTeleport) | ||
4669 | { | ||
4670 | m_log.DebugFormat( | ||
4671 | "[SCENE]: Not pre-closing {0} agent {1} in {2} since another simulator has re-established the child connection", | ||
4672 | sp.IsChildAgent ? "child" : "root", sp.Name, Name); | ||
4673 | |||
4674 | // Need to reset the flag so that a subsequent close after another teleport can succeed. | ||
4675 | sp.DoNotCloseAfterTeleport = false; | ||
4676 | |||
4677 | return false; | ||
4678 | } | ||
4679 | |||
4680 | if (sp.LifecycleState != ScenePresenceState.Running) | ||
4681 | { | ||
4682 | m_log.DebugFormat( | ||
4683 | "[SCENE]: Called IncomingPreCloseAgent() for {0} in {1} but presence is already in state {2}", | ||
4684 | sp.Name, Name, sp.LifecycleState); | ||
4685 | |||
4686 | return false; | ||
4687 | } | ||
4688 | |||
4689 | sp.LifecycleState = ScenePresenceState.PreRemove; | ||
4690 | |||
4691 | return true; | ||
4692 | } | ||
4693 | } | ||
4694 | |||
4695 | /// <summary> | ||
4634 | /// Tell a single agent to disconnect from the region. | 4696 | /// Tell a single agent to disconnect from the region. |
4635 | /// </summary> | 4697 | /// </summary> |
4636 | /// <param name="agentID"></param> | 4698 | /// <param name="agentID"></param> |
@@ -4649,16 +4711,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
4649 | if (sp == null) | 4711 | if (sp == null) |
4650 | { | 4712 | { |
4651 | m_log.DebugFormat( | 4713 | m_log.DebugFormat( |
4652 | "[SCENE]: Called RemoveClient() with agent ID {0} but no such presence is in {1}", | 4714 | "[SCENE]: Called IncomingCloseAgent() with agent ID {0} but no such presence is in {1}", |
4653 | agentID, Name); | 4715 | agentID, Name); |
4654 | 4716 | ||
4655 | return false; | 4717 | return false; |
4656 | } | 4718 | } |
4657 | 4719 | ||
4658 | if (sp.LifecycleState != ScenePresenceState.Running) | 4720 | if (sp.LifecycleState != ScenePresenceState.Running && sp.LifecycleState != ScenePresenceState.PreRemove) |
4659 | { | 4721 | { |
4660 | m_log.DebugFormat( | 4722 | m_log.DebugFormat( |
4661 | "[SCENE]: Called RemoveClient() for {0} in {1} but presence is already in state {2}", | 4723 | "[SCENE]: Called IncomingCloseAgent() for {0} in {1} but presence is already in state {2}", |
4662 | sp.Name, Name, sp.LifecycleState); | 4724 | sp.Name, Name, sp.LifecycleState); |
4663 | 4725 | ||
4664 | return false; | 4726 | return false; |
@@ -6025,7 +6087,7 @@ Environment.Exit(1); | |||
6025 | { | 6087 | { |
6026 | if (!AuthorizeUser(aCircuit, false, out reason)) | 6088 | if (!AuthorizeUser(aCircuit, false, out reason)) |
6027 | { | 6089 | { |
6028 | // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); | 6090 | //m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); |
6029 | return false; | 6091 | return false; |
6030 | } | 6092 | } |
6031 | } | 6093 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs b/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs index dc3a212..cae7fe5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresenceStateMachine.cs | |||
@@ -37,7 +37,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
37 | /// This is a state machine. | 37 | /// This is a state machine. |
38 | /// | 38 | /// |
39 | /// [Entry] => Running | 39 | /// [Entry] => Running |
40 | /// Running => Removing | 40 | /// Running => PreRemove, Removing |
41 | /// PreRemove => Running, Removing | ||
41 | /// Removing => Removed | 42 | /// Removing => Removed |
42 | /// | 43 | /// |
43 | /// All other methods should only see the scene presence in running state - this is the normal operational state | 44 | /// All other methods should only see the scene presence in running state - this is the normal operational state |
@@ -46,6 +47,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
46 | public enum ScenePresenceState | 47 | public enum ScenePresenceState |
47 | { | 48 | { |
48 | Running, // Normal operation state. The scene presence is available. | 49 | Running, // Normal operation state. The scene presence is available. |
50 | PreRemove, // The presence is due to be removed but can still be returning to running. | ||
49 | Removing, // The presence is in the process of being removed from the scene via Scene.RemoveClient. | 51 | Removing, // The presence is in the process of being removed from the scene via Scene.RemoveClient. |
50 | Removed, // The presence has been removed from the scene and is effectively dead. | 52 | Removed, // The presence has been removed from the scene and is effectively dead. |
51 | // There is no exit from this state. | 53 | // There is no exit from this state. |
@@ -80,8 +82,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
80 | 82 | ||
81 | lock (this) | 83 | lock (this) |
82 | { | 84 | { |
83 | if (newState == ScenePresenceState.Removing && m_state == ScenePresenceState.Running) | 85 | if (newState == m_state) |
86 | return; | ||
87 | else if (newState == ScenePresenceState.Running && m_state == ScenePresenceState.PreRemove) | ||
84 | transitionOkay = true; | 88 | transitionOkay = true; |
89 | else if (newState == ScenePresenceState.PreRemove && m_state == ScenePresenceState.Running) | ||
90 | transitionOkay = true; | ||
91 | else if (newState == ScenePresenceState.Removing) | ||
92 | { | ||
93 | if (m_state == ScenePresenceState.Running || m_state == ScenePresenceState.PreRemove) | ||
94 | transitionOkay = true; | ||
95 | } | ||
85 | else if (newState == ScenePresenceState.Removed && m_state == ScenePresenceState.Removing) | 96 | else if (newState == ScenePresenceState.Removed && m_state == ScenePresenceState.Removing) |
86 | transitionOkay = true; | 97 | transitionOkay = true; |
87 | } | 98 | } |
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index 15dea17..1eb0a6b 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | |||
@@ -624,9 +624,16 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden | |||
624 | int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); | 624 | int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); |
625 | avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); | 625 | avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); |
626 | 626 | ||
627 | string childAgentStatus; | ||
628 | |||
629 | if (llClient.SceneAgent != null) | ||
630 | childAgentStatus = llClient.SceneAgent.IsChildAgent ? "N" : "Y"; | ||
631 | else | ||
632 | childAgentStatus = "Off!"; | ||
633 | |||
627 | m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", | 634 | m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", |
628 | scene.RegionInfo.RegionName, llClient.Name, | 635 | scene.RegionInfo.RegionName, llClient.Name, |
629 | llClient.SceneAgent.IsChildAgent ? "N" : "Y", | 636 | childAgentStatus, |
630 | (DateTime.Now - cinfo.StartedTime).Minutes, | 637 | (DateTime.Now - cinfo.StartedTime).Minutes, |
631 | avg_reqs, | 638 | avg_reqs, |
632 | string.Format( | 639 | string.Format( |