Mantis #2314
Thank you, sacha magne, for a patch to add login level and message commands to the user server0.6.0-stable
parent
cf9835130a
commit
8963522aab
|
@ -274,7 +274,6 @@ namespace OpenSim.Grid.UserServer
|
||||||
public override void RunCmd(string cmd, string[] cmdparams)
|
public override void RunCmd(string cmd, string[] cmdparams)
|
||||||
{
|
{
|
||||||
base.RunCmd(cmd, cmdparams);
|
base.RunCmd(cmd, cmdparams);
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case "create":
|
case "create":
|
||||||
|
@ -285,6 +284,30 @@ namespace OpenSim.Grid.UserServer
|
||||||
Reset(cmdparams);
|
Reset(cmdparams);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case "login-level":
|
||||||
|
// Set the minimal level to allow login
|
||||||
|
// Usefull to allow grid update without worrying about users.
|
||||||
|
// or fixing critical issue
|
||||||
|
if (cmdparams.Length == 1)
|
||||||
|
{
|
||||||
|
int level = Convert.ToInt32(cmdparams[0]);
|
||||||
|
m_loginService.setloginlevel(level);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "login-reset":
|
||||||
|
if (cmdparams.Length == 1)
|
||||||
|
{
|
||||||
|
m_loginService.setloginlevel(0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "login-text":
|
||||||
|
if (cmdparams.Length == 1)
|
||||||
|
{
|
||||||
|
m_loginService.setwelcometext(cmdparams[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case "test-inventory":
|
case "test-inventory":
|
||||||
// RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>();
|
// RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>();
|
||||||
// requester.ReturnResponseVal = TestResponse;
|
// requester.ReturnResponseVal = TestResponse;
|
||||||
|
@ -316,7 +339,7 @@ namespace OpenSim.Grid.UserServer
|
||||||
if (theUser != null)
|
if (theUser != null)
|
||||||
{
|
{
|
||||||
if (theUser.CurrentAgent != null)
|
if (theUser.CurrentAgent != null)
|
||||||
{
|
{
|
||||||
if (theUser.CurrentAgent.AgentOnline)
|
if (theUser.CurrentAgent.AgentOnline)
|
||||||
{
|
{
|
||||||
m_log.Info("[LOGOFF]: Logging off requested user!");
|
m_log.Info("[LOGOFF]: Logging off requested user!");
|
||||||
|
@ -365,12 +388,16 @@ namespace OpenSim.Grid.UserServer
|
||||||
m_console.Notice("create user - create a new user");
|
m_console.Notice("create user - create a new user");
|
||||||
m_console.Notice("logoff-user <firstname> <lastname> <message> - logs off the specified user from the grid");
|
m_console.Notice("logoff-user <firstname> <lastname> <message> - logs off the specified user from the grid");
|
||||||
m_console.Notice("reset user password - reset a user's password.");
|
m_console.Notice("reset user password - reset a user's password.");
|
||||||
|
m_console.Notice("login-level <value> - Set the miminim userlevel allowed To login.");
|
||||||
|
m_console.Notice("login-reset - reset the login level to its default value.");
|
||||||
|
m_console.Notice("login-text <text to print during the login>");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
{
|
{
|
||||||
m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation;
|
m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation;
|
||||||
|
|
||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,18 @@ namespace OpenSim.Grid.UserServer
|
||||||
m_config = config;
|
m_config = config;
|
||||||
m_inventoryService = inventoryService;
|
m_inventoryService = inventoryService;
|
||||||
}
|
}
|
||||||
|
public void setloginlevel(int level)
|
||||||
|
{
|
||||||
|
m_minLoginLevel = level;
|
||||||
|
m_log.InfoFormat("[GRID] Login Level set to {0} ", level);
|
||||||
|
|
||||||
|
}
|
||||||
|
public void setwelcometext(string text)
|
||||||
|
{
|
||||||
|
m_welcomeMessage = text;
|
||||||
|
m_log.InfoFormat("[GRID] Login text set to {0} ", text);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public override void LogOffUser(UserProfileData theUser, string message)
|
public override void LogOffUser(UserProfileData theUser, string message)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue