diff options
author | Melanie | 2013-09-07 13:54:19 +0100 |
---|---|---|
committer | Melanie | 2013-09-07 13:54:19 +0100 |
commit | 2f365ea80be0df545a74da03afceb964da1546d1 (patch) | |
tree | a54202b1cdabaa201c0566232bde69cecdcfef6a /OpenSim/Services/UserAccountService | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-2f365ea80be0df545a74da03afceb964da1546d1.zip opensim-SC_OLD-2f365ea80be0df545a74da03afceb964da1546d1.tar.gz opensim-SC_OLD-2f365ea80be0df545a74da03afceb964da1546d1.tar.bz2 opensim-SC_OLD-2f365ea80be0df545a74da03afceb964da1546d1.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Services/UserAccountService')
-rw-r--r-- | OpenSim/Services/UserAccountService/GridUserService.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index b1cdd45..944411f 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs | |||
@@ -47,6 +47,44 @@ namespace OpenSim.Services.UserAccountService | |||
47 | public GridUserService(IConfigSource config) : base(config) | 47 | public GridUserService(IConfigSource config) : base(config) |
48 | { | 48 | { |
49 | m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); | 49 | m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); |
50 | |||
51 | MainConsole.Instance.Commands.AddCommand( | ||
52 | "Users", false, | ||
53 | "show grid users online", | ||
54 | "show grid users online", | ||
55 | "Show number of grid users registered as online.", | ||
56 | "This number may not be accurate as a region may crash or not be cleanly shutdown and leave grid users shown as online\n." | ||
57 | + "For this reason, users online for more than 5 days are not currently counted", | ||
58 | HandleShowGridUsersOnline); | ||
59 | } | ||
60 | |||
61 | protected void HandleShowGridUsersOnline(string module, string[] cmdparams) | ||
62 | { | ||
63 | // if (cmdparams.Length != 4) | ||
64 | // { | ||
65 | // MainConsole.Instance.Output("Usage: show grid users online"); | ||
66 | // return; | ||
67 | // } | ||
68 | |||
69 | // int onlineCount; | ||
70 | int onlineRecentlyCount = 0; | ||
71 | |||
72 | DateTime now = DateTime.UtcNow; | ||
73 | |||
74 | foreach (GridUserData gu in m_Database.GetAll("")) | ||
75 | { | ||
76 | if (bool.Parse(gu.Data["Online"])) | ||
77 | { | ||
78 | // onlineCount++; | ||
79 | |||
80 | int unixLoginTime = int.Parse(gu.Data["Login"]); | ||
81 | |||
82 | if ((now - Util.ToDateTime(unixLoginTime)).Days < 5) | ||
83 | onlineRecentlyCount++; | ||
84 | } | ||
85 | } | ||
86 | |||
87 | MainConsole.Instance.OutputFormat("Users online: {0}", onlineRecentlyCount); | ||
50 | } | 88 | } |
51 | 89 | ||
52 | public virtual GridUserInfo GetGridUserInfo(string userID) | 90 | public virtual GridUserInfo GetGridUserInfo(string userID) |