The Welcome message /message of the day shown in the client during login, can now be set from the .INI file for standalone mode (change the standalone_welcome = "Welcome to OpenSim" line).

afrisby
MW 2007-08-13 13:41:54 +00:00
parent 82f8ecf673
commit 7fbc3266df
5 changed files with 25 additions and 12 deletions

View File

@ -72,6 +72,8 @@ namespace OpenSim
private string m_logFilename = ("region-console.log");
private bool standaloneAuthenticate = false;
private string welcomeMessage = null;
public ConsoleCommand CreateAccount = null;
public OpenSimMain(IConfigSource configSource)
@ -104,6 +106,7 @@ namespace OpenSim
m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
standaloneAuthenticate = configSource.Configs["Startup"].GetBoolean("standalone_authenticate", false);
welcomeMessage = configSource.Configs["Startup"].GetString("standalone_welcome", "Welcome to OpenSim");
}
/// <summary>
@ -123,7 +126,7 @@ namespace OpenSim
if (m_sandbox)
{
CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, standaloneAuthenticate);
CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, standaloneAuthenticate, welcomeMessage);
m_commsManager = localComms;
if(standaloneAuthenticate)
{

View File

@ -40,10 +40,10 @@ namespace OpenSim.Region.Communications.Local
public LocalBackEndServices SandBoxServices = new LocalBackEndServices();
public LocalUserServices UserServices;
public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate )
public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate, string welcomeMessage )
: base(serversInfo, httpServer, assetCache)
{
UserServices = new LocalUserServices(this, serversInfo, accountsAuthenticate);
UserServices = new LocalUserServices(this, serversInfo, accountsAuthenticate, welcomeMessage);
UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll");
UserServer = UserServices;
GridServer = SandBoxServices;

View File

@ -16,14 +16,19 @@ namespace OpenSim.Region.Communications.Local
private uint defaultHomeX ;
private uint defaultHomeY;
private bool authUsers = false;
private string welcomeMessage = "Welcome to OpenSim";
public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate, string welcomeMess)
{
m_Parent = parent;
this.serversInfo = serversInfo;
defaultHomeX = this.serversInfo.DefaultHomeLocX;
defaultHomeY = this.serversInfo.DefaultHomeLocY;
this.authUsers = authenticate;
if (welcomeMess != "")
{
this.welcomeMessage = welcomeMess;
}
}
public UserProfileData GetUserProfile(string firstName, string lastName)
@ -47,7 +52,7 @@ namespace OpenSim.Region.Communications.Local
/// <returns></returns>
public override string GetMessage()
{
return "Welcome to OpenSim";
return welcomeMessage;
}
public override UserProfileData GetTheUser(string firstname, string lastname)
@ -59,13 +64,17 @@ namespace OpenSim.Region.Communications.Local
return profile;
}
//no current user account so make one
Console.WriteLine("No User account found so creating a new one ");
this.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
profile = getUserProfile(firstname, lastname);
if (!authUsers)
{
//no current user account so make one
Console.WriteLine("No User account found so creating a new one ");
this.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
return profile;
profile = getUserProfile(firstname, lastname);
return profile;
}
return null;
}
public override bool AuthenticateUser(UserProfileData profile, string password)

View File

@ -47,7 +47,7 @@ namespace SimpleApp
{
base.StartUp();
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, false);
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, false, "");
m_log.Notice(m_log.LineInfo);

View File

@ -3,3 +3,4 @@ gridmode = false
physics = basicphysics
storage_plugin = "OpenSim.DataStore.NullStorage.dll"
standalone_authenticate = false
standalone_welcome = "Welcome to OpenSim"