mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-05 03:18:45 +00:00
parent
8facca8b39
commit
f671267ed8
5 changed files with 16 additions and 15 deletions
|
@ -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, ServerStatics.EntitledSlots)),
|
||||
.Take(Math.Min(pageSize, ServerSettings.Instance.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, ServerStatics.EntitledSlots)
|
||||
"hint_start", pageStart + Math.Min(pageSize, ServerSettings.Instance.EntitledSlots)
|
||||
},
|
||||
{
|
||||
"total", user.UsedSlots
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div class="userStats">
|
||||
<i class="pink heart icon" title="Hearts"></i> <span>@Model.ProfileUser.Hearts</span>
|
||||
<i class="blue comment icon" title="Comments"></i> <span>@Model.ProfileUser.Comments</span>
|
||||
<i class="green upload icon" title="Uploaded Levels"></i><span>@Model.ProfileUser.UsedSlots / @ServerStatics.EntitledSlots</span>
|
||||
<i class="green upload icon" title="Uploaded Levels"></i><span>@Model.ProfileUser.UsedSlots / @ServerSettings.Instance.EntitledSlots</span>
|
||||
<i class="purple camera icon" title="Uploaded Photos"></i><span>@Model.ProfileUser.PhotosByMe</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
|
|||
}
|
||||
}
|
||||
|
||||
public const int CurrentConfigVersion = 9; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE!
|
||||
public const int CurrentConfigVersion = 10; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE!
|
||||
|
||||
#region Meta
|
||||
|
||||
|
@ -95,5 +95,12 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
|
|||
public bool CheckForUnsafeFiles { get; set; } = true;
|
||||
|
||||
public bool RegistrationEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum amount of slots allowed on users' earth
|
||||
/// </summary>
|
||||
public int EntitledSlots { get; set; } = 50;
|
||||
|
||||
public int ListsQuota { get; set; } = 50;
|
||||
}
|
||||
}
|
|
@ -8,13 +8,6 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
|
|||
{
|
||||
public static class ServerStatics
|
||||
{
|
||||
/// <summary>
|
||||
/// The maximum amount of slots allowed on users' earth
|
||||
/// </summary>
|
||||
public const int EntitledSlots = 50;
|
||||
|
||||
public const int ListsQuota = 50;
|
||||
|
||||
public const string ServerName = "ProjectLighthouse";
|
||||
|
||||
public static bool DbConnected {
|
||||
|
|
|
@ -120,7 +120,8 @@ namespace LBPUnion.ProjectLighthouse.Types
|
|||
LbpSerializer.StringElement("game", this.Game) +
|
||||
this.SerializeSlots(gameVersion == GameVersion.LittleBigPlanetVita) +
|
||||
LbpSerializer.StringElement("lists", this.Lists) +
|
||||
LbpSerializer.StringElement("lists_quota", ServerStatics.ListsQuota) + // technically not a part of the user but LBP expects it
|
||||
LbpSerializer.StringElement
|
||||
("lists_quota", ServerSettings.Instance.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) +
|
||||
|
@ -162,7 +163,7 @@ namespace LBPUnion.ProjectLighthouse.Types
|
|||
/// <summary>
|
||||
/// The number of slots remaining on the earth
|
||||
/// </summary>
|
||||
public int FreeSlots => ServerStatics.EntitledSlots - this.UsedSlots;
|
||||
public int FreeSlots => ServerSettings.Instance.EntitledSlots - this.UsedSlots;
|
||||
|
||||
private static readonly string[] slotTypes =
|
||||
{
|
||||
|
@ -192,12 +193,12 @@ namespace LBPUnion.ProjectLighthouse.Types
|
|||
slotTypesLocal = slotTypes;
|
||||
}
|
||||
|
||||
slots += LbpSerializer.StringElement("entitledSlots", ServerStatics.EntitledSlots);
|
||||
slots += LbpSerializer.StringElement("entitledSlots", ServerSettings.Instance.EntitledSlots);
|
||||
slots += LbpSerializer.StringElement("freeSlots", this.FreeSlots);
|
||||
|
||||
foreach (string slotType in slotTypesLocal)
|
||||
{
|
||||
slots += LbpSerializer.StringElement(slotType + "EntitledSlots", ServerStatics.EntitledSlots);
|
||||
slots += LbpSerializer.StringElement(slotType + "EntitledSlots", ServerSettings.Instance.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