🐛 Fix social credit cache didn't have base value

This commit is contained in:
2025-08-22 22:41:38 +08:00
parent 8f3825e92c
commit 76c8bbf307
3 changed files with 2047 additions and 2 deletions

View File

@@ -137,8 +137,8 @@ public class AccountProfile : ModelBase, IIdentifiedResource
public int Experience { get; set; } public int Experience { get; set; }
[NotMapped] public int Level => Leveling.ExperiencePerLevel.Count(xp => Experience >= xp) - 1; [NotMapped] public int Level => Leveling.ExperiencePerLevel.Count(xp => Experience >= xp) - 1;
public double SocialCredits { get; set; } public double SocialCredits { get; set; } = 100;
[NotMapped] [NotMapped]
public int SocialCreditsLevel => SocialCredits switch public int SocialCreditsLevel => SocialCredits switch

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Pass.Migrations
{
/// <inheritdoc />
public partial class CacheSocialCreditsInProfile : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<double>(
name: "social_credits",
table: "account_profiles",
type: "double precision",
nullable: false,
defaultValue: 0.0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "social_credits",
table: "account_profiles");
}
}
}