From a1c9349d4765833691e7816d7f4df7bd37b9ee36 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 4 Feb 2008 16:22:58 +0000
Subject: Refactor only: serve stats objects directly through StatsManager
singleton
---
OpenSim/Framework/Communications/LoginService.cs | 18 ++++++------------
OpenSim/Framework/Communications/UserManagerBase.cs | 15 ++-------------
2 files changed, 8 insertions(+), 25 deletions(-)
(limited to 'OpenSim/Framework/Communications')
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 1707607..865349f 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -46,9 +46,7 @@ namespace OpenSim.Framework.UserManagement
{
protected string m_welcomeMessage = "Welcome to OpenSim";
protected UserManagerBase m_userManager = null;
- protected Mutex m_loginMutex = new Mutex(false);
-
- protected UserStatsReporter m_statsCollector;
+ protected Mutex m_loginMutex = new Mutex(false);
///
/// Used during login to send the skeleton of the OpenSim Library to the client.
@@ -60,16 +58,12 @@ namespace OpenSim.Framework.UserManagement
///
///
///
- ///
- /// An object for collecting statistical information.
- /// Can be null if statistics are not required
///
public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder,
- UserStatsReporter statsCollector, string welcomeMess)
+ string welcomeMess)
{
m_userManager = userManager;
m_libraryRootFolder = libraryRootFolder;
- m_statsCollector = statsCollector;
if (welcomeMess != String.Empty)
{
@@ -226,8 +220,8 @@ namespace OpenSim.Framework.UserManagement
CommitAgent(ref userProfile);
// If we reach this point, then the login has successfully logged onto the grid
- if (m_statsCollector != null)
- m_statsCollector.AddSuccessfulLogin();
+ if (StatsManager.UserStats != null)
+ StatsManager.UserStats.AddSuccessfulLogin();
return logResponse.ToXmlRpcResponse();
}
@@ -358,8 +352,8 @@ namespace OpenSim.Framework.UserManagement
CommitAgent(ref userProfile);
// If we reach this point, then the login has successfully logged onto the grid
- if (m_statsCollector != null)
- m_statsCollector.AddSuccessfulLogin();
+ if (StatsManager.UserStats != null)
+ StatsManager.UserStats.AddSuccessfulLogin();
return logResponse.ToLLSDResponse();
}
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 4967cd9..3b1d837 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -45,17 +45,6 @@ namespace OpenSim.Framework.UserManagement
{
public UserConfig _config;
private Dictionary _plugins = new Dictionary();
- protected UserStatsReporter _stats;
-
- ///
- /// Constructor.
- ///
- /// Can be null if stats collection is not required.
- ///
- public UserManagerBase(UserStatsReporter statsCollector)
- {
- _stats = statsCollector;
- }
///
/// Adds a new user server plugin - user servers will be requested in the order they were loaded.
@@ -435,8 +424,8 @@ namespace OpenSim.Framework.UserManagement
///
public void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz)
{
- if (_stats != null)
- _stats.AddLogout();
+ if (StatsManager.UserStats != null)
+ StatsManager.UserStats.AddLogout();
UserProfileData userProfile;
UserAgentData userAgent;
--
cgit v1.1