Add a user server XMLRPC method to set the MOTD and the minimum GodLevel

required to log in. set_login_params accepts avatar_uuid and password of a
user with god level 200 or more, and allows setting either or both the
login_motd or login_level
This commit is contained in:
Melanie Thielker
2008-10-01 15:17:37 +00:00
parent dabe61f283
commit fecbb2febd
4 changed files with 69 additions and 0 deletions

View File

@@ -275,6 +275,22 @@ namespace OpenSim.Framework.Communications
"false");
}
public XmlRpcResponse CreateLoginBlockedResponse()
{
return
(GenerateFailureResponse("presence",
"Logins are currently restricted. Please try again later",
"false"));
}
public LLSD CreateLoginBlockedResponseLLSD()
{
return GenerateFailureResponseLLSD(
"presence",
"Logins are currently restricted. Please try again later",
"false");
}
public XmlRpcResponse CreateDeadRegionResponse()
{
return

View File

@@ -47,6 +47,7 @@ namespace OpenSim.Framework.Communications
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected string m_welcomeMessage = "Welcome to OpenSim";
protected int m_minLoginLevel = 0;
protected UserManagerBase m_userManager = null;
protected Mutex m_loginMutex = new Mutex(false);
@@ -196,6 +197,10 @@ namespace OpenSim.Framework.Communications
return logResponse.CreateLoginFailedResponse();
}
else if (userProfile.GodLevel < m_minLoginLevel)
{
return logResponse.CreateLoginBlockedResponse();
}
else
{
// If we already have a session...
@@ -363,6 +368,10 @@ namespace OpenSim.Framework.Communications
{
return logResponse.CreateLoginFailedResponseLLSD();
}
else if (userProfile.GodLevel < m_minLoginLevel)
{
return logResponse.CreateLoginBlockedResponseLLSD();
}
else
{
// If we already have a session...