diff options
Diffstat (limited to 'OpenSim/Framework/Communications/LoginService.cs')
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 3a68bfb..1707607 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -38,6 +38,7 @@ using Nwc.XmlRpc; | |||
38 | 38 | ||
39 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Statistics; | ||
41 | 42 | ||
42 | namespace OpenSim.Framework.UserManagement | 43 | namespace OpenSim.Framework.UserManagement |
43 | { | 44 | { |
@@ -47,16 +48,28 @@ namespace OpenSim.Framework.UserManagement | |||
47 | protected UserManagerBase m_userManager = null; | 48 | protected UserManagerBase m_userManager = null; |
48 | protected Mutex m_loginMutex = new Mutex(false); | 49 | protected Mutex m_loginMutex = new Mutex(false); |
49 | 50 | ||
51 | protected UserStatsReporter m_statsCollector; | ||
52 | |||
50 | /// <summary> | 53 | /// <summary> |
51 | /// Used during login to send the skeleton of the OpenSim Library to the client. | 54 | /// Used during login to send the skeleton of the OpenSim Library to the client. |
52 | /// </summary> | 55 | /// </summary> |
53 | protected LibraryRootFolder m_libraryRootFolder; | 56 | protected LibraryRootFolder m_libraryRootFolder; |
54 | 57 | ||
55 | public LoginService( | 58 | /// <summary> |
56 | UserManagerBase userManager, LibraryRootFolder libraryRootFolder, string welcomeMess) | 59 | /// Constructor |
60 | /// </summary> | ||
61 | /// <param name="userManager"></param> | ||
62 | /// <param name="libraryRootFolder"></param> | ||
63 | /// <param name="statsCollector"> | ||
64 | /// An object for collecting statistical information. | ||
65 | /// Can be null if statistics are not required</param> | ||
66 | /// <param name="welcomeMess"></param> | ||
67 | public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder, | ||
68 | UserStatsReporter statsCollector, string welcomeMess) | ||
57 | { | 69 | { |
58 | m_userManager = userManager; | 70 | m_userManager = userManager; |
59 | m_libraryRootFolder = libraryRootFolder; | 71 | m_libraryRootFolder = libraryRootFolder; |
72 | m_statsCollector = statsCollector; | ||
60 | 73 | ||
61 | if (welcomeMess != String.Empty) | 74 | if (welcomeMess != String.Empty) |
62 | { | 75 | { |
@@ -211,6 +224,11 @@ namespace OpenSim.Framework.UserManagement | |||
211 | //return logResponse.ToXmlRpcResponse(); | 224 | //return logResponse.ToXmlRpcResponse(); |
212 | } | 225 | } |
213 | CommitAgent(ref userProfile); | 226 | CommitAgent(ref userProfile); |
227 | |||
228 | // If we reach this point, then the login has successfully logged onto the grid | ||
229 | if (m_statsCollector != null) | ||
230 | m_statsCollector.AddSuccessfulLogin(); | ||
231 | |||
214 | return logResponse.ToXmlRpcResponse(); | 232 | return logResponse.ToXmlRpcResponse(); |
215 | } | 233 | } |
216 | 234 | ||
@@ -338,6 +356,10 @@ namespace OpenSim.Framework.UserManagement | |||
338 | } | 356 | } |
339 | 357 | ||
340 | CommitAgent(ref userProfile); | 358 | CommitAgent(ref userProfile); |
359 | |||
360 | // If we reach this point, then the login has successfully logged onto the grid | ||
361 | if (m_statsCollector != null) | ||
362 | m_statsCollector.AddSuccessfulLogin(); | ||
341 | 363 | ||
342 | return logResponse.ToLLSDResponse(); | 364 | return logResponse.ToLLSDResponse(); |
343 | } | 365 | } |