aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/UserAccountService
diff options
context:
space:
mode:
authorDiva Canto2015-06-09 13:21:41 -0700
committerDiva Canto2015-06-09 13:21:41 -0700
commitb931f393a8255ede47ee37b43e318e817ed6de4f (patch)
treecde10159452985e30c2ea4c03d3b95ee5523b225 /OpenSim/Services/UserAccountService
parentTypo Fix (diff)
downloadopensim-SC_OLD-b931f393a8255ede47ee37b43e318e817ed6de4f.zip
opensim-SC_OLD-b931f393a8255ede47ee37b43e318e817ed6de4f.tar.gz
opensim-SC_OLD-b931f393a8255ede47ee37b43e318e817ed6de4f.tar.bz2
opensim-SC_OLD-b931f393a8255ede47ee37b43e318e817ed6de4f.tar.xz
Avoid registering console commands in every single instance of GridUserService running on the same process. Only one registers them now.
Diffstat (limited to 'OpenSim/Services/UserAccountService')
-rw-r--r--OpenSim/Services/UserAccountService/GridUserService.cs38
1 files changed, 22 insertions, 16 deletions
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs
index 5aa2078..e4bcf15 100644
--- a/OpenSim/Services/UserAccountService/GridUserService.cs
+++ b/OpenSim/Services/UserAccountService/GridUserService.cs
@@ -43,27 +43,33 @@ namespace OpenSim.Services.UserAccountService
43 public class GridUserService : GridUserServiceBase, IGridUserService 43 public class GridUserService : GridUserServiceBase, IGridUserService
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 private static bool m_Initialized;
46 47
47 public GridUserService(IConfigSource config) : base(config) 48 public GridUserService(IConfigSource config) : base(config)
48 { 49 {
49 m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); 50 m_log.Debug("[GRID USER SERVICE]: Starting user grid service");
50 51
51 MainConsole.Instance.Commands.AddCommand( 52 if (!m_Initialized)
52 "Users", false, 53 {
53 "show grid user", 54 m_Initialized = true;
54 "show grid user <ID>", 55
55 "Show grid user entry or entries that match or start with the given ID. This will normally be a UUID.", 56 MainConsole.Instance.Commands.AddCommand(
56 "This is for debug purposes to see what data is found for a particular user id.", 57 "Users", false,
57 HandleShowGridUser); 58 "show grid user",
58 59 "show grid user <ID>",
59 MainConsole.Instance.Commands.AddCommand( 60 "Show grid user entry or entries that match or start with the given ID. This will normally be a UUID.",
60 "Users", false, 61 "This is for debug purposes to see what data is found for a particular user id.",
61 "show grid users online", 62 HandleShowGridUser);
62 "show grid users online", 63
63 "Show number of grid users registered as online.", 64 MainConsole.Instance.Commands.AddCommand(
64 "This number may not be accurate as a region may crash or not be cleanly shutdown and leave grid users shown as online\n." 65 "Users", false,
65 + "For this reason, users online for more than 5 days are not currently counted", 66 "show grid users online",
66 HandleShowGridUsersOnline); 67 "show grid users online",
68 "Show number of grid users registered as online.",
69 "This number may not be accurate as a region may crash or not be cleanly shutdown and leave grid users shown as online\n."
70 + "For this reason, users online for more than 5 days are not currently counted",
71 HandleShowGridUsersOnline);
72 }
67 } 73 }
68 74
69 protected void HandleShowGridUser(string module, string[] cmdparams) 75 protected void HandleShowGridUser(string module, string[] cmdparams)