Avoid registering console commands in every single instance of GridUserService running on the same process. Only one registers them now.

fsassets
Diva Canto 2015-06-09 13:21:41 -07:00
parent 0c5facbd75
commit b931f393a8
1 changed files with 21 additions and 15 deletions

View File

@ -43,11 +43,16 @@ namespace OpenSim.Services.UserAccountService
public class GridUserService : GridUserServiceBase, IGridUserService public class GridUserService : GridUserServiceBase, IGridUserService
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static bool m_Initialized;
public GridUserService(IConfigSource config) : base(config) public GridUserService(IConfigSource config) : base(config)
{ {
m_log.Debug("[GRID USER SERVICE]: Starting user grid service"); m_log.Debug("[GRID USER SERVICE]: Starting user grid service");
if (!m_Initialized)
{
m_Initialized = true;
MainConsole.Instance.Commands.AddCommand( MainConsole.Instance.Commands.AddCommand(
"Users", false, "Users", false,
"show grid user", "show grid user",
@ -65,6 +70,7 @@ namespace OpenSim.Services.UserAccountService
+ "For this reason, users online for more than 5 days are not currently counted", + "For this reason, users online for more than 5 days are not currently counted",
HandleShowGridUsersOnline); HandleShowGridUsersOnline);
} }
}
protected void HandleShowGridUser(string module, string[] cmdparams) protected void HandleShowGridUser(string module, string[] cmdparams)
{ {