mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 17:28:39 +00:00
Merge branch 'main' into account-banning
This commit is contained in:
commit
55dd1114f1
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);
|
User? user = await this.database.UserFromGameRequest(this.Request);
|
||||||
if (user == null) return this.StatusCode(403, "");
|
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")]
|
[HttpGet("announce")]
|
||||||
|
@ -47,19 +47,24 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
GameToken gameToken = userAndToken.Value.Item2;
|
GameToken gameToken = userAndToken.Value.Item2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
string announceText = ServerSettings.Instance.AnnounceText;
|
||||||
|
|
||||||
|
announceText = announceText.Replace("%user", user.Username);
|
||||||
|
announceText = announceText.Replace("%id", user.UserId.ToString());
|
||||||
|
|
||||||
return this.Ok
|
return this.Ok
|
||||||
(
|
(
|
||||||
$"You are now logged in as {user.Username}.\n\n" +
|
announceText +
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
"---DEBUG INFO---\n" +
|
"\n\n---DEBUG INFO---\n" +
|
||||||
$"user.UserId: {user.UserId}\n" +
|
$"user.UserId: {user.UserId}\n" +
|
||||||
$"token.Approved: {gameToken.Approved}\n" +
|
$"token.Approved: {gameToken.Approved}\n" +
|
||||||
$"token.Used: {gameToken.Used}\n" +
|
$"token.Used: {gameToken.Used}\n" +
|
||||||
$"token.UserLocation: {gameToken.UserLocation}\n" +
|
$"token.UserLocation: {gameToken.UserLocation}\n" +
|
||||||
$"token.GameVersion: {gameToken.GameVersion}\n" +
|
$"token.GameVersion: {gameToken.GameVersion}\n" +
|
||||||
"---DEBUG INFO---\n\n" +
|
"---DEBUG INFO---" +
|
||||||
#endif
|
#endif
|
||||||
ServerSettings.Instance.EulaText
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
|
||||||
public class ServerSettings
|
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()
|
static ServerSettings()
|
||||||
{
|
{
|
||||||
if (ServerStatics.IsUnitTesting) return; // Unit testing, we don't want to read configurations here since the tests will provide their own
|
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; } = "";
|
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 DbConnectionString { get; set; } = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
|
||||||
|
|
||||||
public string ExternalUrl { get; set; } = "http://localhost:10060";
|
public string ExternalUrl { get; set; } = "http://localhost:10060";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue