From c1fe07b02248b66d45fbbbd6f8e3db3fe3bdc157 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 8 May 2010 12:21:17 -0700 Subject: [PATCH] * Added missing loggout notification to home grid upon agents logging out in foreign grids. * Added missing config in StandaloneHypergrid.ini --- .../Framework/EntityTransfer/HGEntityTransferModule.cs | 8 ++++++++ OpenSim/Services/HypergridService/UserAgentService.cs | 4 ++++ bin/config-include/StandaloneHypergrid.ini | 3 +++ 3 files changed, 15 insertions(+) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 137dfec13b..7d26e3ff5f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -245,6 +245,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return; } + // Let's find out if this is a foreign user or a local user + UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); + if (account != null) + { + // local grid user + return; + } + AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 3af7ef9d3f..64f7e8aaca 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -185,6 +185,10 @@ namespace OpenSim.Services.HypergridService foreach (UUID session in travels) m_TravelingAgents.Remove(session); } + + GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString()); + if (guinfo != null) + m_GridUserService.LoggedOut(userID.ToString(), guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); } // We need to prevent foreign users with the same UUID as a local user diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 130e210a77..32b240b8b5 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -77,6 +77,9 @@ GridService = "OpenSim.Services.GridService.dll:GridService" InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" +[GridUserService] + LocalServiceModule = "OpenSim.Services.UserAccountService.dll:GridUserService" + [FriendsService] LocalServiceModule = "OpenSim.Services.FriendsService.dll" ConnectionString = "URI=file:friends.db,version=3"