mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-31 21:22:28 +00:00
Rename ServerSettings to ServerStatics
This commit is contained in:
parent
2f817f9aa8
commit
5de122f1d5
8 changed files with 14 additions and 14 deletions
|
@ -8,8 +8,8 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
{
|
||||
public DatabaseFact()
|
||||
{
|
||||
ServerSettings.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
|
||||
if (!ServerSettings.DbConnected)
|
||||
ServerStatics.DbConnectionString = "server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse";
|
||||
if (!ServerStatics.DbConnected)
|
||||
{
|
||||
this.Skip = "Database not available";
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
Assert.True(response.IsSuccessStatusCode);
|
||||
string responseContent = await response.Content.ReadAsStringAsync();
|
||||
Assert.Contains("MM_AUTH=", responseContent);
|
||||
Assert.Contains(ServerSettings.ServerName, responseContent);
|
||||
Assert.Contains(ServerStatics.ServerName, responseContent);
|
||||
}
|
||||
|
||||
[DatabaseFact]
|
||||
|
@ -41,7 +41,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
Assert.NotNull(loginResult.LbpEnvVer);
|
||||
|
||||
Assert.Contains("MM_AUTH=", loginResult.AuthTicket);
|
||||
Assert.Equal(ServerSettings.ServerName, loginResult.LbpEnvVer);
|
||||
Assert.Equal(ServerStatics.ServerName, loginResult.LbpEnvVer);
|
||||
}
|
||||
|
||||
[DatabaseFact]
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
new LoginResult
|
||||
{
|
||||
AuthTicket = "MM_AUTH=" + token.UserToken,
|
||||
LbpEnvVer = ServerSettings.ServerName,
|
||||
LbpEnvVer = ServerStatics.ServerName,
|
||||
}.Serialize()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
.Include(s => s.Location)
|
||||
.Where(s => s.Creator!.Username == user.Username)
|
||||
.Skip(pageStart - 1)
|
||||
.Take(Math.Min(pageSize, ServerSettings.EntitledSlots)),
|
||||
.Take(Math.Min(pageSize, ServerStatics.EntitledSlots)),
|
||||
string.Empty,
|
||||
(current, slot) => current + slot.Serialize()
|
||||
);
|
||||
|
@ -55,7 +55,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
|||
new Dictionary<string, object>
|
||||
{
|
||||
{
|
||||
"hint_start", pageStart + Math.Min(pageSize, ServerSettings.EntitledSlots)
|
||||
"hint_start", pageStart + Math.Min(pageSize, ServerStatics.EntitledSlots)
|
||||
},
|
||||
{
|
||||
"total", user.UsedSlots
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace LBPUnion.ProjectLighthouse
|
|||
public DbSet<RatedLevel> RatedLevels { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
=> options.UseMySql(ServerSettings.DbConnectionString, MySqlServerVersion.LatestSupportedServerVersion);
|
||||
=> options.UseMySql(ServerStatics.DbConnectionString, MySqlServerVersion.LatestSupportedServerVersion);
|
||||
|
||||
public async Task<User> CreateUser(string username)
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace LBPUnion.ProjectLighthouse
|
|||
|
||||
Logger.Log("Welcome to Project Lighthouse!", LoggerLevelStartup.Instance);
|
||||
Logger.Log("Determining if the database is available...", LoggerLevelStartup.Instance);
|
||||
bool dbConnected = ServerSettings.DbConnected;
|
||||
bool dbConnected = ServerStatics.DbConnected;
|
||||
Logger.Log(dbConnected ? "Connected to the database." : "Database unavailable! Exiting.", LoggerLevelStartup.Instance);
|
||||
|
||||
if (!dbConnected) Environment.Exit(1);
|
||||
|
|
|
@ -5,7 +5,7 @@ using LBPUnion.ProjectLighthouse.Logging;
|
|||
|
||||
namespace LBPUnion.ProjectLighthouse.Types.Settings
|
||||
{
|
||||
public static class ServerSettings
|
||||
public static class ServerStatics
|
||||
{
|
||||
/// <summary>
|
||||
/// The maximum amount of slots allowed on users' earth
|
|
@ -100,7 +100,7 @@ namespace LBPUnion.ProjectLighthouse.Types
|
|||
LbpSerializer.StringElement("game", this.Game) +
|
||||
this.SerializeSlots(gameVersion == GameVersion.LittleBigPlanetVita) +
|
||||
LbpSerializer.StringElement("lists", this.Lists) +
|
||||
LbpSerializer.StringElement("lists_quota", ServerSettings.ListsQuota) + // technically not a part of the user but LBP expects it
|
||||
LbpSerializer.StringElement("lists_quota", ServerStatics.ListsQuota) + // technically not a part of the user but LBP expects it
|
||||
LbpSerializer.StringElement("biography", this.Biography) +
|
||||
LbpSerializer.StringElement("reviewCount", this.Reviews) +
|
||||
LbpSerializer.StringElement("commentCount", this.Comments) +
|
||||
|
@ -142,7 +142,7 @@ namespace LBPUnion.ProjectLighthouse.Types
|
|||
/// <summary>
|
||||
/// The number of slots remaining on the earth
|
||||
/// </summary>
|
||||
public int FreeSlots => ServerSettings.EntitledSlots - this.UsedSlots;
|
||||
public int FreeSlots => ServerStatics.EntitledSlots - this.UsedSlots;
|
||||
|
||||
private static readonly string[] slotTypes =
|
||||
{
|
||||
|
@ -172,12 +172,12 @@ namespace LBPUnion.ProjectLighthouse.Types
|
|||
slotTypesLocal = slotTypes;
|
||||
}
|
||||
|
||||
slots += LbpSerializer.StringElement("entitledSlots", ServerSettings.EntitledSlots);
|
||||
slots += LbpSerializer.StringElement("entitledSlots", ServerStatics.EntitledSlots);
|
||||
slots += LbpSerializer.StringElement("freeSlots", this.FreeSlots);
|
||||
|
||||
foreach (string slotType in slotTypesLocal)
|
||||
{
|
||||
slots += LbpSerializer.StringElement(slotType + "EntitledSlots", ServerSettings.EntitledSlots);
|
||||
slots += LbpSerializer.StringElement(slotType + "EntitledSlots", ServerStatics.EntitledSlots);
|
||||
// ReSharper disable once StringLiteralTypo
|
||||
slots += LbpSerializer.StringElement(slotType + slotType == "crossControl" ? "PurchsedSlots" : "PurchasedSlots", 0);
|
||||
slots += LbpSerializer.StringElement(slotType + "FreeSlots", this.FreeSlots);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue