From 5fb7b485b211bbf19f4531a051b78dde92da4ba3 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 19 Sep 2008 17:41:21 +0000 Subject: * Only allow logins on standalone when the sim has completed it's initial startup (script startup doesn't count here) * There was a small window where region logins were allowed before modules were loaded - avatars logins that hit this window could have caused bad things to happen. * A similar change will follow for grid mode sometime soon --- .../Cache/UserProfileCacheService.cs | 22 +++++++++++++++------- .../Communications/CommunicationsManager.cs | 9 ++++----- OpenSim/Framework/Communications/IGridServices.cs | 7 ++++++- OpenSim/Framework/Communications/LoginService.cs | 4 ++-- 4 files changed, 27 insertions(+), 15 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 3675053..cf6a74d 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -51,12 +51,20 @@ namespace OpenSim.Framework.Communications.Cache /// private readonly Dictionary m_userProfiles = new Dictionary(); - public readonly LibraryRootFolder libraryRoot = new LibraryRootFolder(); + /// + /// The root library folder. + /// + public readonly LibraryRootFolder LibraryRoot; - // Methods - public UserProfileCacheService(CommunicationsManager commsManager) + /// + /// Constructor + /// + /// + /// + public UserProfileCacheService(CommunicationsManager commsManager, LibraryRootFolder libraryRootFolder) { m_commsManager = commsManager; + LibraryRoot = libraryRootFolder; } /// @@ -293,10 +301,10 @@ namespace OpenSim.Framework.Communications.Cache // FIXME MAYBE: We're not handling sortOrder! InventoryFolderImpl fold = null; - if ((fold = libraryRoot.FindFolder(folderID)) != null) + if ((fold = LibraryRoot.FindFolder(folderID)) != null) { remoteClient.SendInventoryFolderDetails( - libraryRoot.Owner, folderID, fold.RequestListOfItems(), + LibraryRoot.Owner, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fetchFolders, fetchItems); return; @@ -337,7 +345,7 @@ namespace OpenSim.Framework.Communications.Cache // FIXME MAYBE: We're not handling sortOrder! InventoryFolderImpl fold; - if ((fold = libraryRoot.FindFolder(folderID)) != null) + if ((fold = LibraryRoot.FindFolder(folderID)) != null) { return fold.RequestListOfItems(); } @@ -428,7 +436,7 @@ namespace OpenSim.Framework.Communications.Cache public void HandleFetchInventory(IClientAPI remoteClient, UUID itemID, UUID ownerID) { - if (ownerID == libraryRoot.Owner) + if (ownerID == LibraryRoot.Owner) { //Console.WriteLine("request info for library item"); diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 5bed282..198bd83 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -112,11 +112,11 @@ namespace OpenSim.Framework.Communications /// /// public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, - bool dumpAssetsToFile) + bool dumpAssetsToFile, LibraryRootFolder libraryRootFolder) { m_networkServersInfo = serversInfo; m_assetCache = assetCache; - m_userProfileCacheService = new UserProfileCacheService(this); + m_userProfileCacheService = new UserProfileCacheService(this, libraryRootFolder); // m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile); } @@ -356,7 +356,7 @@ namespace OpenSim.Framework.Communications public void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) { - if (uuid == m_userProfileCacheService.libraryRoot.Owner) + if (uuid == m_userProfileCacheService.LibraryRoot.Owner) { remote_client.SendNameReply(uuid, "Mr", "OpenSim"); } @@ -376,7 +376,6 @@ namespace OpenSim.Framework.Communications string[] returnstring = new string[0]; bool doLookup = false; - lock (m_nameRequestCache) { if (m_nameRequestCache.ContainsKey(uuid)) @@ -405,8 +404,8 @@ namespace OpenSim.Framework.Communications } } } + return returnstring; - } public bool UUIDNameCachedTest(UUID uuid) diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index 6c5d2e2..f6a2885 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs @@ -33,6 +33,11 @@ namespace OpenSim.Framework.Communications public interface IGridServices { string gdebugRegionName { get; set; } + + /// + /// If true, then regions will accept logins from the user service. If false, then they will not. + /// + bool RegionLoginsEnabled { get; set; } /// /// Register a region with the grid service. @@ -42,7 +47,7 @@ namespace OpenSim.Framework.Communications /// Thrown if region registration failed RegionCommsListener RegisterRegion(RegionInfo regionInfos); - bool DeregisterRegion(RegionInfo regionInfo); + bool DeregisterRegion(RegionInfo regionInfo); /// /// Get information about the regions neighbouring the given co-ordinates. diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index f4c43ef..8d27a23 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -239,8 +239,8 @@ namespace OpenSim.Framework.Communications catch (Exception e) { m_log.ErrorFormat( - "[LOGIN END]: XMLRPC Error retrieving inventory skeleton of agent {0}, {1} - {2}", - agentID, e.GetType(), e.Message); + "[LOGIN END]: Error retrieving inventory skeleton of agent {0} - {1}", + agentID, e); return logResponse.CreateLoginInventoryFailedResponse(); } -- cgit v1.1