diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
6 files changed, 59 insertions, 22 deletions
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); |