From 7fbc3266dfb5e923fb240fe81591fc96691a06b9 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 13 Aug 2007 13:41:54 +0000 Subject: [PATCH] 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). --- OpenSim/Region/Application/OpenSimMain.cs | 5 +++- .../Local/CommunicationsLocal.cs | 4 +-- .../Communications/Local/LocalUserServices.cs | 25 +++++++++++++------ OpenSim/Region/Examples/SimpleApp/Program.cs | 2 +- bin/OpenSim.ini | 1 + 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 6c498179ae..ca95a8d079 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -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"); } /// @@ -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) { diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 5b6681639c..a0bbf6d901 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -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; diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 223c1576bb..63f8c21d68 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -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 /// 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) diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 8db3262e5e..0763b83f4e 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -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); diff --git a/bin/OpenSim.ini b/bin/OpenSim.ini index 278202d5bd..c2cbdec52e 100644 --- a/bin/OpenSim.ini +++ b/bin/OpenSim.ini @@ -3,3 +3,4 @@ gridmode = false physics = basicphysics storage_plugin = "OpenSim.DataStore.NullStorage.dll" standalone_authenticate = false +standalone_welcome = "Welcome to OpenSim" \ No newline at end of file