mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 07:58:40 +00:00
Allow more customization of the eula & announce screens
This commit is contained in:
parent
6e2e7ae529
commit
11297b3f06
2 changed files with 17 additions and 6 deletions
|
@ -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"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue