diff --git a/ProjectLighthouse/Controllers/MessageController.cs b/ProjectLighthouse/Controllers/MessageController.cs index c16f6921..98680ffb 100644 --- a/ProjectLighthouse/Controllers/MessageController.cs +++ b/ProjectLighthouse/Controllers/MessageController.cs @@ -28,7 +28,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers User? user = await this.database.UserFromGameRequest(this.Request); if (user == null) return this.StatusCode(403, ""); - return this.Ok(ServerSettings.Instance.EulaText + "\n" + $"{EulaHelper.License}\n"); + return this.Ok($"{EulaHelper.License}\n{ServerSettings.Instance.EulaText}"); } [HttpGet("announce")] @@ -47,19 +47,24 @@ namespace LBPUnion.ProjectLighthouse.Controllers GameToken gameToken = userAndToken.Value.Item2; #endif + string announceText = ServerSettings.Instance.AnnounceText; + + announceText = announceText.Replace("%user", user.Username); + announceText = announceText.Replace("%id", user.UserId.ToString()); + return this.Ok ( - $"You are now logged in as {user.Username}.\n\n" + + announceText + #if DEBUG - "---DEBUG INFO---\n" + + "\n\n---DEBUG INFO---\n" + $"user.UserId: {user.UserId}\n" + $"token.Approved: {gameToken.Approved}\n" + $"token.Used: {gameToken.Used}\n" + $"token.UserLocation: {gameToken.UserLocation}\n" + $"token.GameVersion: {gameToken.GameVersion}\n" + - "---DEBUG INFO---\n\n" + + "---DEBUG INFO---" + #endif - ServerSettings.Instance.EulaText + "\n" ); } diff --git a/ProjectLighthouse/Types/Settings/ServerSettings.cs b/ProjectLighthouse/Types/Settings/ServerSettings.cs index bdbb7676..67a3aeec 100644 --- a/ProjectLighthouse/Types/Settings/ServerSettings.cs +++ b/ProjectLighthouse/Types/Settings/ServerSettings.cs @@ -12,7 +12,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings public class ServerSettings { - public const int CurrentConfigVersion = 13; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE! + public const int CurrentConfigVersion = 14; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE! static ServerSettings() { if (ServerStatics.IsUnitTesting) return; // Unit testing, we don't want to read configurations here since the tests will provide their own @@ -74,6 +74,12 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings public string EulaText { get; set; } = ""; + #if !DEBUG + public string AnnounceText { get; set; } = "You are now logged in as %user."; + #else + public string AnnounceText { get; set; } = "You are now logged in as %user (id: %id)."; + #endif + public string DbConnectionString { get; set; } = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse"; public string ExternalUrl { get; set; } = "http://localhost:10060";