From 7fbc3266dfb5e923fb240fe81591fc96691a06b9 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 13 Aug 2007 13:41:54 +0000 Subject: 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). --- .../Communications/Local/CommunicationsLocal.cs | 4 ++-- .../Communications/Local/LocalUserServices.cs | 25 +++++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 5b66816..a0bbf6d 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 223c157..63f8c21 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); + + profile = getUserProfile(firstname, lastname); - return profile; + return profile; + } + return null; } public override bool AuthenticateUser(UserProfileData profile, string password) -- cgit v1.1