From 47cf171a79d3aec0c4263b579aedaeb991420995 Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 9 Dec 2025 09:49:35 -0500 Subject: [PATCH] Loot fix --- Game/Dungeon/LootService.cs | 37 +- ...251105224215_InitialGameSchema.Designer.cs | 470 ----- .../20251105224215_InitialGameSchema.cs | 327 ---- .../20251110131236_UpdateSessions.Designer.cs | 478 ----- Migrations/20251110131236_UpdateSessions.cs | 88 - ...5003_UpdateSessions-revokation.Designer.cs | 481 ----- ...0251110195003_UpdateSessions-revokation.cs | 29 - ...4134242_AddVoidScavengersStats.Designer.cs | 658 ------- .../20251204134242_AddVoidScavengersStats.cs | 123 -- ...3006_AddVoidScavengersEntities.Designer.cs | 831 --------- ...0251204143006_AddVoidScavengersEntities.cs | 118 -- ...20251204180408_AddAccountRoles.Designer.cs | 836 --------- Migrations/20251204180408_AddAccountRoles.cs | 29 - .../20251205131939_DungeonDiver.Designer.cs | 836 --------- Migrations/20251205131939_DungeonDiver.cs | 22 - .../20251206162408_DungeonDiver2.Designer.cs | 836 --------- Migrations/20251206162408_DungeonDiver2.cs | 22 - ...0532_AddDungeonCrawlerEntities.Designer.cs | 1439 --------------- ...0251206230532_AddDungeonCrawlerEntities.cs | 354 ---- .../20251208165644_LootTables.Designer.cs | 1599 ----------------- Migrations/20251208165644_LootTables.cs | 135 -- Migrations/20251209140805_Inventory2.cs | 22 - ... => 20251209142654_Initialize.Designer.cs} | 4 +- Migrations/20251209142654_Initialize.cs | 986 ++++++++++ SystemRevivalServer.csproj | 4 + data/entities/DungeonCharacterItem.cs | 14 +- 26 files changed, 1024 insertions(+), 9754 deletions(-) delete mode 100644 Migrations/20251105224215_InitialGameSchema.Designer.cs delete mode 100644 Migrations/20251105224215_InitialGameSchema.cs delete mode 100644 Migrations/20251110131236_UpdateSessions.Designer.cs delete mode 100644 Migrations/20251110131236_UpdateSessions.cs delete mode 100644 Migrations/20251110195003_UpdateSessions-revokation.Designer.cs delete mode 100644 Migrations/20251110195003_UpdateSessions-revokation.cs delete mode 100644 Migrations/20251204134242_AddVoidScavengersStats.Designer.cs delete mode 100644 Migrations/20251204134242_AddVoidScavengersStats.cs delete mode 100644 Migrations/20251204143006_AddVoidScavengersEntities.Designer.cs delete mode 100644 Migrations/20251204143006_AddVoidScavengersEntities.cs delete mode 100644 Migrations/20251204180408_AddAccountRoles.Designer.cs delete mode 100644 Migrations/20251204180408_AddAccountRoles.cs delete mode 100644 Migrations/20251205131939_DungeonDiver.Designer.cs delete mode 100644 Migrations/20251205131939_DungeonDiver.cs delete mode 100644 Migrations/20251206162408_DungeonDiver2.Designer.cs delete mode 100644 Migrations/20251206162408_DungeonDiver2.cs delete mode 100644 Migrations/20251206230532_AddDungeonCrawlerEntities.Designer.cs delete mode 100644 Migrations/20251206230532_AddDungeonCrawlerEntities.cs delete mode 100644 Migrations/20251208165644_LootTables.Designer.cs delete mode 100644 Migrations/20251208165644_LootTables.cs delete mode 100644 Migrations/20251209140805_Inventory2.cs rename Migrations/{20251209140805_Inventory2.Designer.cs => 20251209142654_Initialize.Designer.cs} (99%) create mode 100644 Migrations/20251209142654_Initialize.cs diff --git a/Game/Dungeon/LootService.cs b/Game/Dungeon/LootService.cs index 4b11a56..b7e5baf 100644 --- a/Game/Dungeon/LootService.cs +++ b/Game/Dungeon/LootService.cs @@ -37,55 +37,68 @@ public class LootService _log = log; _scopeFactory = scopeFactory; } - + public async Task InitializeAsync() { if (_initialized) return; - + using var scope = _scopeFactory.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - + // Load all loot tables with their entries var tables = await db.Set() .Include(t => t.Entries) .Where(t => t.IsEnabled) .ToListAsync(); - + // Seed defaults if empty if (tables.Count == 0) { tables = await SeedDefaultLootTablesAsync(db); } - + _lootTables = tables.ToDictionary(t => t.Id); - + // Load mob -> loot table mappings var mappings = await db.Set() .Include(m => m.LootTable) .ToListAsync(); - + + // Seed mob mappings if missing (can happen if tables exist but mappings were cleared) + if (mappings.Count == 0 && tables.Count > 0) + { + _log.LogInformation("No mob loot table mappings found, seeding defaults..."); + var defaultMappings = GetDefaultMobLootTableMappings(tables); + db.Set().AddRange(defaultMappings); + await db.SaveChangesAsync(); + mappings = await db.Set() + .Include(m => m.LootTable) + .ToListAsync(); + _log.LogInformation("Seeded {Count} mob loot table mappings", mappings.Count); + } + _mobLootTableMappings = mappings .GroupBy(m => m.MobDefinitionId) .ToDictionary(g => g.Key, g => g.OrderBy(m => m.Priority).ToList()); - + // Load item definitions var items = await db.Set() .Where(i => i.IsEnabled) .ToListAsync(); - + // Seed default items if empty if (items.Count == 0) { items = await SeedDefaultItemsAsync(db); } - + _itemDefinitions = items.ToDictionary(i => i.Id); - + _initialized = true; _log.LogInformation("LootService initialized: {Tables} tables, {Items} items, {Mappings} mob mappings", _lootTables.Count, _itemDefinitions.Count, mappings.Count); } - + /// /// Generate loot for a mob kill /// diff --git a/Migrations/20251105224215_InitialGameSchema.Designer.cs b/Migrations/20251105224215_InitialGameSchema.Designer.cs deleted file mode 100644 index 95c82bf..0000000 --- a/Migrations/20251105224215_InitialGameSchema.Designer.cs +++ /dev/null @@ -1,470 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251105224215_InitialGameSchema")] - partial class InitialGameSchema - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("Token") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251105224215_InitialGameSchema.cs b/Migrations/20251105224215_InitialGameSchema.cs deleted file mode 100644 index 51cce05..0000000 --- a/Migrations/20251105224215_InitialGameSchema.cs +++ /dev/null @@ -1,327 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class InitialGameSchema : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "accounts", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Username = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Email = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - PasswordHash = table.Column(type: "varbinary(64)", nullable: false), - PasswordSalt = table.Column(type: "varbinary(32)", nullable: false), - IsBanned = table.Column(type: "tinyint(1)", nullable: false), - BannedUntil = table.Column(type: "datetime(6)", nullable: true), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_accounts", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "item_templates", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ItemType = table.Column(type: "tinyint unsigned", nullable: false), - Rarity = table.Column(type: "tinyint unsigned", nullable: false), - MaxStack = table.Column(type: "int unsigned", nullable: false), - Weight = table.Column(type: "int unsigned", nullable: false), - StatsJson = table.Column(type: "json", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_item_templates", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "zones", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MinX = table.Column(type: "double", nullable: false), - MinY = table.Column(type: "double", nullable: false), - MinZ = table.Column(type: "double", nullable: false), - MaxX = table.Column(type: "double", nullable: false), - MaxY = table.Column(type: "double", nullable: false), - MaxZ = table.Column(type: "double", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_zones", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "sessions", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - AccountId = table.Column(type: "bigint unsigned", nullable: false), - Token = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ExpiresAt = table.Column(type: "datetime(6)", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - }, - constraints: table => - { - table.PrimaryKey("PK_sessions", x => x.Id); - table.ForeignKey( - name: "FK_sessions_accounts_AccountId", - column: x => x.AccountId, - principalTable: "accounts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "characters", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - AccountId = table.Column(type: "bigint unsigned", nullable: false), - Name = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Level = table.Column(type: "int unsigned", nullable: false), - Xp = table.Column(type: "bigint unsigned", nullable: false), - StatStrength = table.Column(type: "int unsigned", nullable: false), - StatDexterity = table.Column(type: "int unsigned", nullable: false), - StatWisdom = table.Column(type: "int unsigned", nullable: false), - StatIntelligence = table.Column(type: "int unsigned", nullable: false), - StatEndurance = table.Column(type: "int unsigned", nullable: false), - HpCurrent = table.Column(type: "int unsigned", nullable: false), - HpMax = table.Column(type: "int unsigned", nullable: false), - MpCurrent = table.Column(type: "int unsigned", nullable: false), - MpMax = table.Column(type: "int unsigned", nullable: false), - StaminaCurrent = table.Column(type: "int unsigned", nullable: false), - StaminaMax = table.Column(type: "int unsigned", nullable: false), - ZoneId = table.Column(type: "bigint unsigned", nullable: false), - PosX = table.Column(type: "double", nullable: false), - PosY = table.Column(type: "double", nullable: false), - PosZ = table.Column(type: "double", nullable: false), - FacingDeg = table.Column(type: "float", nullable: false), - AppearanceJson = table.Column(type: "json", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_characters", x => x.Id); - table.ForeignKey( - name: "FK_characters_accounts_AccountId", - column: x => x.AccountId, - principalTable: "accounts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_characters_zones_ZoneId", - column: x => x.ZoneId, - principalTable: "zones", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "equipment", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CharacterId = table.Column(type: "bigint unsigned", nullable: false), - SlotCode = table.Column(type: "tinyint unsigned", nullable: false), - ItemTemplateId = table.Column(type: "bigint unsigned", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_equipment", x => x.Id); - table.ForeignKey( - name: "FK_equipment_characters_CharacterId", - column: x => x.CharacterId, - principalTable: "characters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_equipment_item_templates_ItemTemplateId", - column: x => x.ItemTemplateId, - principalTable: "item_templates", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "inventories", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CharacterId = table.Column(type: "bigint unsigned", nullable: false), - SlotIndex = table.Column(type: "int unsigned", nullable: false), - ItemTemplateId = table.Column(type: "bigint unsigned", nullable: false), - Quantity = table.Column(type: "int unsigned", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_inventories", x => x.Id); - table.ForeignKey( - name: "FK_inventories_characters_CharacterId", - column: x => x.CharacterId, - principalTable: "characters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_inventories_item_templates_ItemTemplateId", - column: x => x.ItemTemplateId, - principalTable: "item_templates", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_accounts_Email", - table: "accounts", - column: "Email", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_accounts_Username", - table: "accounts", - column: "Username", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_characters_AccountId", - table: "characters", - column: "AccountId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_characters_ZoneId", - table: "characters", - column: "ZoneId"); - - migrationBuilder.CreateIndex( - name: "IX_equipment_CharacterId_SlotCode", - table: "equipment", - columns: new[] { "CharacterId", "SlotCode" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_equipment_ItemTemplateId", - table: "equipment", - column: "ItemTemplateId"); - - migrationBuilder.CreateIndex( - name: "IX_inventories_CharacterId", - table: "inventories", - column: "CharacterId"); - - migrationBuilder.CreateIndex( - name: "IX_inventories_CharacterId_SlotIndex", - table: "inventories", - columns: new[] { "CharacterId", "SlotIndex" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_inventories_ItemTemplateId", - table: "inventories", - column: "ItemTemplateId"); - - migrationBuilder.CreateIndex( - name: "IX_item_templates_Name", - table: "item_templates", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_sessions_AccountId", - table: "sessions", - column: "AccountId"); - - migrationBuilder.CreateIndex( - name: "IX_sessions_Token", - table: "sessions", - column: "Token", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_zones_Name", - table: "zones", - column: "Name", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "equipment"); - - migrationBuilder.DropTable( - name: "inventories"); - - migrationBuilder.DropTable( - name: "sessions"); - - migrationBuilder.DropTable( - name: "characters"); - - migrationBuilder.DropTable( - name: "item_templates"); - - migrationBuilder.DropTable( - name: "accounts"); - - migrationBuilder.DropTable( - name: "zones"); - } - } -} diff --git a/Migrations/20251110131236_UpdateSessions.Designer.cs b/Migrations/20251110131236_UpdateSessions.Designer.cs deleted file mode 100644 index 82af4f0..0000000 --- a/Migrations/20251110131236_UpdateSessions.Designer.cs +++ /dev/null @@ -1,478 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251110131236_UpdateSessions")] - partial class UpdateSessions - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251110131236_UpdateSessions.cs b/Migrations/20251110131236_UpdateSessions.cs deleted file mode 100644 index 45fad07..0000000 --- a/Migrations/20251110131236_UpdateSessions.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class UpdateSessions : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_sessions_Token", - table: "sessions"); - - migrationBuilder.DropColumn( - name: "Token", - table: "sessions"); - - migrationBuilder.AddColumn( - name: "CreatedIp", - table: "sessions", - type: "varchar(64)", - maxLength: 64, - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "TokenHash", - table: "sessions", - type: "varchar(128)", - maxLength: 128, - nullable: false, - defaultValue: "") - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "UserAgent", - table: "sessions", - type: "varchar(256)", - maxLength: 256, - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_sessions_TokenHash", - table: "sessions", - column: "TokenHash", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_sessions_TokenHash", - table: "sessions"); - - migrationBuilder.DropColumn( - name: "CreatedIp", - table: "sessions"); - - migrationBuilder.DropColumn( - name: "TokenHash", - table: "sessions"); - - migrationBuilder.DropColumn( - name: "UserAgent", - table: "sessions"); - - migrationBuilder.AddColumn( - name: "Token", - table: "sessions", - type: "varchar(64)", - maxLength: 64, - nullable: false, - defaultValue: "") - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_sessions_Token", - table: "sessions", - column: "Token", - unique: true); - } - } -} diff --git a/Migrations/20251110195003_UpdateSessions-revokation.Designer.cs b/Migrations/20251110195003_UpdateSessions-revokation.Designer.cs deleted file mode 100644 index 23b469a..0000000 --- a/Migrations/20251110195003_UpdateSessions-revokation.Designer.cs +++ /dev/null @@ -1,481 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251110195003_UpdateSessions-revokation")] - partial class UpdateSessionsrevokation - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251110195003_UpdateSessions-revokation.cs b/Migrations/20251110195003_UpdateSessions-revokation.cs deleted file mode 100644 index 90c2117..0000000 --- a/Migrations/20251110195003_UpdateSessions-revokation.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class UpdateSessionsrevokation : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "RevokedAt", - table: "sessions", - type: "datetime(6)", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "RevokedAt", - table: "sessions"); - } - } -} diff --git a/Migrations/20251204134242_AddVoidScavengersStats.Designer.cs b/Migrations/20251204134242_AddVoidScavengersStats.Designer.cs deleted file mode 100644 index 08e8397..0000000 --- a/Migrations/20251204134242_AddVoidScavengersStats.Designer.cs +++ /dev/null @@ -1,658 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251204134242_AddVoidScavengersStats")] - partial class AddVoidScavengersStats - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251204134242_AddVoidScavengersStats.cs b/Migrations/20251204134242_AddVoidScavengersStats.cs deleted file mode 100644 index 668267e..0000000 --- a/Migrations/20251204134242_AddVoidScavengersStats.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class AddVoidScavengersStats : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "match_history", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - MatchId = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AccountId = table.Column(type: "bigint unsigned", nullable: false), - Result = table.Column(type: "int", nullable: false), - Placement = table.Column(type: "int", nullable: false), - TotalPlayers = table.Column(type: "int", nullable: false), - Kills = table.Column(type: "int", nullable: false), - Deaths = table.Column(type: "int", nullable: false), - DamageDealt = table.Column(type: "int", nullable: false), - DamageTaken = table.Column(type: "int", nullable: false), - ScrapCollected = table.Column(type: "int", nullable: false), - EnergyCollected = table.Column(type: "int", nullable: false), - RareCollected = table.Column(type: "int", nullable: false), - ItemsCrafted = table.Column(type: "int", nullable: false), - SurvivalTimeSeconds = table.Column(type: "int", nullable: false), - MatchDurationSeconds = table.Column(type: "int", nullable: false), - EloChange = table.Column(type: "int", nullable: false), - EloAfter = table.Column(type: "int", nullable: false), - PlayedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - }, - constraints: table => - { - table.PrimaryKey("PK_match_history", x => x.Id); - table.ForeignKey( - name: "FK_match_history_accounts_AccountId", - column: x => x.AccountId, - principalTable: "accounts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "player_stats", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - AccountId = table.Column(type: "bigint unsigned", nullable: false), - MatchesPlayed = table.Column(type: "int", nullable: false), - Wins = table.Column(type: "int", nullable: false), - Losses = table.Column(type: "int", nullable: false), - Extractions = table.Column(type: "int", nullable: false), - Kills = table.Column(type: "int", nullable: false), - Deaths = table.Column(type: "int", nullable: false), - TotalDamageDealt = table.Column(type: "bigint", nullable: false), - TotalDamageTaken = table.Column(type: "bigint", nullable: false), - TotalScrapCollected = table.Column(type: "bigint", nullable: false), - TotalEnergyCollected = table.Column(type: "bigint", nullable: false), - TotalRareCollected = table.Column(type: "bigint", nullable: false), - ItemsCrafted = table.Column(type: "int", nullable: false), - TotalPlayTimeSeconds = table.Column(type: "bigint", nullable: false), - LongestSurvivalSeconds = table.Column(type: "int", nullable: false), - Elo = table.Column(type: "int", nullable: false, defaultValue: 1000), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_player_stats", x => x.Id); - table.ForeignKey( - name: "FK_player_stats_accounts_AccountId", - column: x => x.AccountId, - principalTable: "accounts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_match_history_AccountId", - table: "match_history", - column: "AccountId"); - - migrationBuilder.CreateIndex( - name: "IX_match_history_MatchId", - table: "match_history", - column: "MatchId"); - - migrationBuilder.CreateIndex( - name: "IX_match_history_PlayedAt", - table: "match_history", - column: "PlayedAt"); - - migrationBuilder.CreateIndex( - name: "IX_player_stats_AccountId", - table: "player_stats", - column: "AccountId", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "match_history"); - - migrationBuilder.DropTable( - name: "player_stats"); - } - } -} diff --git a/Migrations/20251204143006_AddVoidScavengersEntities.Designer.cs b/Migrations/20251204143006_AddVoidScavengersEntities.Designer.cs deleted file mode 100644 index 882c253..0000000 --- a/Migrations/20251204143006_AddVoidScavengersEntities.Designer.cs +++ /dev/null @@ -1,831 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251204143006_AddVoidScavengersEntities")] - partial class AddVoidScavengersEntities - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameItem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("AmmoType") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("CraftCost") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Damage") - .HasColumnType("int"); - - b.Property("DamageReduction") - .HasColumnType("float"); - - b.Property("DashCooldown") - .HasColumnType("float"); - - b.Property("DashDistance") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("ExplosionRadius") - .HasColumnType("float"); - - b.Property("FireRate") - .HasColumnType("float"); - - b.Property("HarvestMultiplier") - .HasColumnType("float"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("HealthBonus") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("LootValue") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("PelletCount") - .HasColumnType("int"); - - b.Property("ProjectileSpeed") - .HasColumnType("float"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("ScanCooldown") - .HasColumnType("float"); - - b.Property("ScanRadius") - .HasColumnType("float"); - - b.Property("ShieldBoostDuration") - .HasColumnType("float"); - - b.Property("ShieldDuration") - .HasColumnType("float"); - - b.Property("ShieldHealth") - .HasColumnType("int"); - - b.Property("SpeedBoostDuration") - .HasColumnType("float"); - - b.Property("SpeedMultiplier") - .HasColumnType("float"); - - b.Property("SpeedPenalty") - .HasColumnType("float"); - - b.Property("Spread") - .HasColumnType("float"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Category"); - - b.HasIndex("IsEnabled"); - - b.ToTable("game_items", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("EnergyCost") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("RareCost") - .HasColumnType("int"); - - b.Property("ResultItemId") - .HasColumnType("int"); - - b.Property("ScrapCost") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("IsEnabled"); - - b.HasIndex("ResultItemId"); - - b.ToTable("game_recipes", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.HasOne("Server.Data.GameItem", "ResultItem") - .WithMany() - .HasForeignKey("ResultItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ResultItem"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251204143006_AddVoidScavengersEntities.cs b/Migrations/20251204143006_AddVoidScavengersEntities.cs deleted file mode 100644 index aa4bc48..0000000 --- a/Migrations/20251204143006_AddVoidScavengersEntities.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class AddVoidScavengersEntities : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "game_items", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Category = table.Column(type: "int", nullable: false), - CraftCost = table.Column(type: "int", nullable: false), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - LootValue = table.Column(type: "int", nullable: false), - Stackable = table.Column(type: "tinyint(1)", nullable: false), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: true), - Damage = table.Column(type: "int", nullable: false), - FireRate = table.Column(type: "float", nullable: false), - ProjectileSpeed = table.Column(type: "float", nullable: false), - Range = table.Column(type: "float", nullable: false), - AmmoType = table.Column(type: "int", nullable: false), - PelletCount = table.Column(type: "int", nullable: false), - Spread = table.Column(type: "float", nullable: false), - ExplosionRadius = table.Column(type: "float", nullable: false), - HarvestMultiplier = table.Column(type: "float", nullable: false), - ScanRadius = table.Column(type: "float", nullable: false), - ScanCooldown = table.Column(type: "float", nullable: false), - ShieldHealth = table.Column(type: "int", nullable: false), - ShieldDuration = table.Column(type: "float", nullable: false), - HealAmount = table.Column(type: "int", nullable: false), - ShieldBoostDuration = table.Column(type: "float", nullable: false), - DamageReduction = table.Column(type: "float", nullable: false), - SpeedBoostDuration = table.Column(type: "float", nullable: false), - SpeedMultiplier = table.Column(type: "float", nullable: false), - HealthBonus = table.Column(type: "int", nullable: false), - SpeedPenalty = table.Column(type: "float", nullable: false), - DashDistance = table.Column(type: "float", nullable: false), - DashCooldown = table.Column(type: "float", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_game_items", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "game_recipes", - columns: table => new - { - Id = table.Column(type: "int", nullable: false), - ResultItemId = table.Column(type: "int", nullable: false), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: true), - ScrapCost = table.Column(type: "int", nullable: false), - EnergyCost = table.Column(type: "int", nullable: false), - RareCost = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), - UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_game_recipes", x => x.Id); - table.ForeignKey( - name: "FK_game_recipes_game_items_ResultItemId", - column: x => x.ResultItemId, - principalTable: "game_items", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_game_items_Category", - table: "game_items", - column: "Category"); - - migrationBuilder.CreateIndex( - name: "IX_game_items_IsEnabled", - table: "game_items", - column: "IsEnabled"); - - migrationBuilder.CreateIndex( - name: "IX_game_recipes_IsEnabled", - table: "game_recipes", - column: "IsEnabled"); - - migrationBuilder.CreateIndex( - name: "IX_game_recipes_ResultItemId", - table: "game_recipes", - column: "ResultItemId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "game_recipes"); - - migrationBuilder.DropTable( - name: "game_items"); - } - } -} diff --git a/Migrations/20251204180408_AddAccountRoles.Designer.cs b/Migrations/20251204180408_AddAccountRoles.Designer.cs deleted file mode 100644 index 189e6c0..0000000 --- a/Migrations/20251204180408_AddAccountRoles.Designer.cs +++ /dev/null @@ -1,836 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251204180408_AddAccountRoles")] - partial class AddAccountRoles - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("Role") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameItem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("AmmoType") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("CraftCost") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Damage") - .HasColumnType("int"); - - b.Property("DamageReduction") - .HasColumnType("float"); - - b.Property("DashCooldown") - .HasColumnType("float"); - - b.Property("DashDistance") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("ExplosionRadius") - .HasColumnType("float"); - - b.Property("FireRate") - .HasColumnType("float"); - - b.Property("HarvestMultiplier") - .HasColumnType("float"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("HealthBonus") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("LootValue") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("PelletCount") - .HasColumnType("int"); - - b.Property("ProjectileSpeed") - .HasColumnType("float"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("ScanCooldown") - .HasColumnType("float"); - - b.Property("ScanRadius") - .HasColumnType("float"); - - b.Property("ShieldBoostDuration") - .HasColumnType("float"); - - b.Property("ShieldDuration") - .HasColumnType("float"); - - b.Property("ShieldHealth") - .HasColumnType("int"); - - b.Property("SpeedBoostDuration") - .HasColumnType("float"); - - b.Property("SpeedMultiplier") - .HasColumnType("float"); - - b.Property("SpeedPenalty") - .HasColumnType("float"); - - b.Property("Spread") - .HasColumnType("float"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Category"); - - b.HasIndex("IsEnabled"); - - b.ToTable("game_items", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("EnergyCost") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("RareCost") - .HasColumnType("int"); - - b.Property("ResultItemId") - .HasColumnType("int"); - - b.Property("ScrapCost") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("IsEnabled"); - - b.HasIndex("ResultItemId"); - - b.ToTable("game_recipes", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.HasOne("Server.Data.GameItem", "ResultItem") - .WithMany() - .HasForeignKey("ResultItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ResultItem"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Character", "Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Character"); - - b.Navigation("ItemTemplate"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251204180408_AddAccountRoles.cs b/Migrations/20251204180408_AddAccountRoles.cs deleted file mode 100644 index b7de48e..0000000 --- a/Migrations/20251204180408_AddAccountRoles.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class AddAccountRoles : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Role", - table: "accounts", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Role", - table: "accounts"); - } - } -} diff --git a/Migrations/20251205131939_DungeonDiver.Designer.cs b/Migrations/20251205131939_DungeonDiver.Designer.cs deleted file mode 100644 index 79b806d..0000000 --- a/Migrations/20251205131939_DungeonDiver.Designer.cs +++ /dev/null @@ -1,836 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251205131939_DungeonDiver")] - partial class DungeonDiver - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("Role") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameItem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("AmmoType") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("CraftCost") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Damage") - .HasColumnType("int"); - - b.Property("DamageReduction") - .HasColumnType("float"); - - b.Property("DashCooldown") - .HasColumnType("float"); - - b.Property("DashDistance") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("ExplosionRadius") - .HasColumnType("float"); - - b.Property("FireRate") - .HasColumnType("float"); - - b.Property("HarvestMultiplier") - .HasColumnType("float"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("HealthBonus") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("LootValue") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("PelletCount") - .HasColumnType("int"); - - b.Property("ProjectileSpeed") - .HasColumnType("float"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("ScanCooldown") - .HasColumnType("float"); - - b.Property("ScanRadius") - .HasColumnType("float"); - - b.Property("ShieldBoostDuration") - .HasColumnType("float"); - - b.Property("ShieldDuration") - .HasColumnType("float"); - - b.Property("ShieldHealth") - .HasColumnType("int"); - - b.Property("SpeedBoostDuration") - .HasColumnType("float"); - - b.Property("SpeedMultiplier") - .HasColumnType("float"); - - b.Property("SpeedPenalty") - .HasColumnType("float"); - - b.Property("Spread") - .HasColumnType("float"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Category"); - - b.HasIndex("IsEnabled"); - - b.ToTable("game_items", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("EnergyCost") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("RareCost") - .HasColumnType("int"); - - b.Property("ResultItemId") - .HasColumnType("int"); - - b.Property("ScrapCost") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("IsEnabled"); - - b.HasIndex("ResultItemId"); - - b.ToTable("game_recipes", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.HasOne("Server.Data.GameItem", "ResultItem") - .WithMany() - .HasForeignKey("ResultItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ResultItem"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251205131939_DungeonDiver.cs b/Migrations/20251205131939_DungeonDiver.cs deleted file mode 100644 index 6110fdd..0000000 --- a/Migrations/20251205131939_DungeonDiver.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class DungeonDiver : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Migrations/20251206162408_DungeonDiver2.Designer.cs b/Migrations/20251206162408_DungeonDiver2.Designer.cs deleted file mode 100644 index 5589079..0000000 --- a/Migrations/20251206162408_DungeonDiver2.Designer.cs +++ /dev/null @@ -1,836 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251206162408_DungeonDiver2")] - partial class DungeonDiver2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("Role") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameItem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("AmmoType") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("CraftCost") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Damage") - .HasColumnType("int"); - - b.Property("DamageReduction") - .HasColumnType("float"); - - b.Property("DashCooldown") - .HasColumnType("float"); - - b.Property("DashDistance") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("ExplosionRadius") - .HasColumnType("float"); - - b.Property("FireRate") - .HasColumnType("float"); - - b.Property("HarvestMultiplier") - .HasColumnType("float"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("HealthBonus") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("LootValue") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("PelletCount") - .HasColumnType("int"); - - b.Property("ProjectileSpeed") - .HasColumnType("float"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("ScanCooldown") - .HasColumnType("float"); - - b.Property("ScanRadius") - .HasColumnType("float"); - - b.Property("ShieldBoostDuration") - .HasColumnType("float"); - - b.Property("ShieldDuration") - .HasColumnType("float"); - - b.Property("ShieldHealth") - .HasColumnType("int"); - - b.Property("SpeedBoostDuration") - .HasColumnType("float"); - - b.Property("SpeedMultiplier") - .HasColumnType("float"); - - b.Property("SpeedPenalty") - .HasColumnType("float"); - - b.Property("Spread") - .HasColumnType("float"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Category"); - - b.HasIndex("IsEnabled"); - - b.ToTable("game_items", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("EnergyCost") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("RareCost") - .HasColumnType("int"); - - b.Property("ResultItemId") - .HasColumnType("int"); - - b.Property("ScrapCost") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("IsEnabled"); - - b.HasIndex("ResultItemId"); - - b.ToTable("game_recipes", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.HasOne("Server.Data.GameItem", "ResultItem") - .WithMany() - .HasForeignKey("ResultItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ResultItem"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251206162408_DungeonDiver2.cs b/Migrations/20251206162408_DungeonDiver2.cs deleted file mode 100644 index 28dce4c..0000000 --- a/Migrations/20251206162408_DungeonDiver2.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class DungeonDiver2 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Migrations/20251206230532_AddDungeonCrawlerEntities.Designer.cs b/Migrations/20251206230532_AddDungeonCrawlerEntities.Designer.cs deleted file mode 100644 index d9ce79c..0000000 --- a/Migrations/20251206230532_AddDungeonCrawlerEntities.Designer.cs +++ /dev/null @@ -1,1439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251206230532_AddDungeonCrawlerEntities")] - partial class AddDungeonCrawlerEntities - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("Role") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("BossesKilled") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CurrentHealth") - .HasColumnType("int"); - - b.Property("CurrentMana") - .HasColumnType("int"); - - b.Property("Dexterity") - .HasColumnType("int"); - - b.Property("DungeonsCompleted") - .HasColumnType("int"); - - b.Property("Endurance") - .HasColumnType("int"); - - b.Property("EquippedAccessory") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedBoots") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedChest") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedGloves") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedHead") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedLegs") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedOffhand") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedWeapon") - .HasColumnType("bigint unsigned"); - - b.Property("Experience") - .HasColumnType("bigint"); - - b.Property("Intelligence") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("LastPlayedAt") - .HasColumnType("datetime(6)"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PlayersKilled") - .HasColumnType("int"); - - b.Property("Strength") - .HasColumnType("int"); - - b.Property("TotalDeaths") - .HasColumnType("int"); - - b.Property("TotalKills") - .HasColumnType("int"); - - b.Property("UnspentStatPoints") - .HasColumnType("int"); - - b.Property("Wisdom") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.ToTable("dungeon_characters"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacterItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AcquiredAt") - .HasColumnType("datetime(6)"); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("DefinitionId") - .HasColumnType("int"); - - b.Property("ItemDefinitionId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SlotIndex") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("DefinitionId"); - - b.ToTable("dungeon_character_items"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Armor") - .HasColumnType("int"); - - b.Property("AttackRange") - .HasColumnType("float"); - - b.Property("BonusDexterity") - .HasColumnType("int"); - - b.Property("BonusEndurance") - .HasColumnType("int"); - - b.Property("BonusHealth") - .HasColumnType("int"); - - b.Property("BonusIntelligence") - .HasColumnType("int"); - - b.Property("BonusMana") - .HasColumnType("int"); - - b.Property("BonusStrength") - .HasColumnType("int"); - - b.Property("BonusWisdom") - .HasColumnType("int"); - - b.Property("DamageType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EquipSlot") - .HasColumnType("int"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("IsTeleportScroll") - .HasColumnType("tinyint(1)"); - - b.Property("MagicResist") - .HasColumnType("int"); - - b.Property("ManaRestore") - .HasColumnType("int"); - - b.Property("MaxDamage") - .HasColumnType("int"); - - b.Property("MaxStack") - .HasColumnType("int"); - - b.Property("MinDamage") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("int"); - - b.Property("RequiredDexterity") - .HasColumnType("int"); - - b.Property("RequiredIntelligence") - .HasColumnType("int"); - - b.Property("RequiredLevel") - .HasColumnType("int"); - - b.Property("RequiredStrength") - .HasColumnType("int"); - - b.Property("RequiredWisdom") - .HasColumnType("int"); - - b.Property("SpriteId") - .HasColumnType("int"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("StaminaRestore") - .HasColumnType("int"); - - b.Property("TeachesSpellId") - .HasColumnType("int"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("dungeon_item_definitions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLearnedSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("DefinitionId") - .HasColumnType("int"); - - b.Property("LearnedAt") - .HasColumnType("datetime(6)"); - - b.Property("SpellDefinitionId") - .HasColumnType("int"); - - b.Property("SpellLevel") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("DefinitionId"); - - b.ToTable("dungeon_learned_spells"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonMobDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AbilitiesJson") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); - - b.Property("AggroRange") - .HasColumnType("float"); - - b.Property("AnimationSpeed") - .HasColumnType("float"); - - b.Property("ArmorPerTier") - .HasColumnType("float"); - - b.Property("AttackFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("AttackRange") - .HasColumnType("float"); - - b.Property("AttackSpeed") - .HasColumnType("float"); - - b.Property("BaseArmor") - .HasColumnType("int"); - - b.Property("BaseHealth") - .HasColumnType("int"); - - b.Property("BaseMagicDamage") - .HasColumnType("int"); - - b.Property("BaseMagicResist") - .HasColumnType("int"); - - b.Property("BaseMana") - .HasColumnType("int"); - - b.Property("BasePhysicalDamage") - .HasColumnType("int"); - - b.Property("BaseXp") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("DamagePerTier") - .HasColumnType("float"); - - b.Property("DeathFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("DropChanceMultiplier") - .HasColumnType("float"); - - b.Property("HealthPerTier") - .HasColumnType("float"); - - b.Property("IdleFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LeashRange") - .HasColumnType("float"); - - b.Property("LootTableId") - .HasColumnType("int"); - - b.Property("MaxTier") - .HasColumnType("int"); - - b.Property("MinTier") - .HasColumnType("int"); - - b.Property("MoveSpeed") - .HasColumnType("float"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ResistancesJson") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); - - b.Property("SpriteHeight") - .HasColumnType("int"); - - b.Property("SpriteIndex") - .HasColumnType("int"); - - b.Property("SpriteSheet") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("SpriteWidth") - .HasColumnType("int"); - - b.Property("TintColor") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("varchar(16)"); - - b.Property("Type") - .HasColumnType("int"); - - b.Property("WalkFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("XpPerTier") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("dungeon_mob_definitions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonSpellDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaOfEffect") - .HasColumnType("float"); - - b.Property("BaseDamage") - .HasColumnType("int"); - - b.Property("BaseHealing") - .HasColumnType("int"); - - b.Property("Cooldown") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EffectColor") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("IsShield") - .HasColumnType("tinyint(1)"); - - b.Property("IsTeleport") - .HasColumnType("tinyint(1)"); - - b.Property("ManaCost") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("RequiredIntelligence") - .HasColumnType("int"); - - b.Property("RequiredLevel") - .HasColumnType("int"); - - b.Property("RequiredWisdom") - .HasColumnType("int"); - - b.Property("ShieldAmount") - .HasColumnType("int"); - - b.Property("SpriteId") - .HasColumnType("int"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("dungeon_spell_definitions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonStashItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("DefinitionId") - .HasColumnType("int"); - - b.Property("ItemDefinitionId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SlotIndex") - .HasColumnType("int"); - - b.Property("StoredAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("DefinitionId"); - - b.ToTable("dungeon_stash_items"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameItem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("AmmoType") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("CraftCost") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Damage") - .HasColumnType("int"); - - b.Property("DamageReduction") - .HasColumnType("float"); - - b.Property("DashCooldown") - .HasColumnType("float"); - - b.Property("DashDistance") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("ExplosionRadius") - .HasColumnType("float"); - - b.Property("FireRate") - .HasColumnType("float"); - - b.Property("HarvestMultiplier") - .HasColumnType("float"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("HealthBonus") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("LootValue") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("PelletCount") - .HasColumnType("int"); - - b.Property("ProjectileSpeed") - .HasColumnType("float"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("ScanCooldown") - .HasColumnType("float"); - - b.Property("ScanRadius") - .HasColumnType("float"); - - b.Property("ShieldBoostDuration") - .HasColumnType("float"); - - b.Property("ShieldDuration") - .HasColumnType("float"); - - b.Property("ShieldHealth") - .HasColumnType("int"); - - b.Property("SpeedBoostDuration") - .HasColumnType("float"); - - b.Property("SpeedMultiplier") - .HasColumnType("float"); - - b.Property("SpeedPenalty") - .HasColumnType("float"); - - b.Property("Spread") - .HasColumnType("float"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Category"); - - b.HasIndex("IsEnabled"); - - b.ToTable("game_items", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("EnergyCost") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("RareCost") - .HasColumnType("int"); - - b.Property("ResultItemId") - .HasColumnType("int"); - - b.Property("ScrapCost") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("IsEnabled"); - - b.HasIndex("ResultItemId"); - - b.ToTable("game_recipes", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacter", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacterItem", b => - { - b.HasOne("Server.Data.Entities.DungeonCharacter", "Character") - .WithMany("Inventory") - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonItemDefinition", "Definition") - .WithMany() - .HasForeignKey("DefinitionId"); - - b.Navigation("Character"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLearnedSpell", b => - { - b.HasOne("Server.Data.Entities.DungeonCharacter", "Character") - .WithMany("LearnedSpells") - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonSpellDefinition", "Definition") - .WithMany() - .HasForeignKey("DefinitionId"); - - b.Navigation("Character"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonStashItem", b => - { - b.HasOne("Server.Data.Entities.DungeonCharacter", "Character") - .WithMany("Stash") - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonItemDefinition", "Definition") - .WithMany() - .HasForeignKey("DefinitionId"); - - b.Navigation("Character"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.HasOne("Server.Data.GameItem", "ResultItem") - .WithMany() - .HasForeignKey("ResultItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ResultItem"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacter", b => - { - b.Navigation("Inventory"); - - b.Navigation("LearnedSpells"); - - b.Navigation("Stash"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251206230532_AddDungeonCrawlerEntities.cs b/Migrations/20251206230532_AddDungeonCrawlerEntities.cs deleted file mode 100644 index 9f316d4..0000000 --- a/Migrations/20251206230532_AddDungeonCrawlerEntities.cs +++ /dev/null @@ -1,354 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class AddDungeonCrawlerEntities : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "dungeon_characters", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - AccountId = table.Column(type: "bigint unsigned", nullable: false), - Name = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - LastPlayedAt = table.Column(type: "datetime(6)", nullable: false), - Level = table.Column(type: "int", nullable: false), - Experience = table.Column(type: "bigint", nullable: false), - UnspentStatPoints = table.Column(type: "int", nullable: false), - Strength = table.Column(type: "int", nullable: false), - Intelligence = table.Column(type: "int", nullable: false), - Wisdom = table.Column(type: "int", nullable: false), - Endurance = table.Column(type: "int", nullable: false), - Dexterity = table.Column(type: "int", nullable: false), - CurrentHealth = table.Column(type: "int", nullable: false), - CurrentMana = table.Column(type: "int", nullable: false), - EquippedWeapon = table.Column(type: "bigint unsigned", nullable: true), - EquippedOffhand = table.Column(type: "bigint unsigned", nullable: true), - EquippedHead = table.Column(type: "bigint unsigned", nullable: true), - EquippedChest = table.Column(type: "bigint unsigned", nullable: true), - EquippedLegs = table.Column(type: "bigint unsigned", nullable: true), - EquippedBoots = table.Column(type: "bigint unsigned", nullable: true), - EquippedGloves = table.Column(type: "bigint unsigned", nullable: true), - EquippedAccessory = table.Column(type: "bigint unsigned", nullable: true), - TotalKills = table.Column(type: "int", nullable: false), - TotalDeaths = table.Column(type: "int", nullable: false), - PlayersKilled = table.Column(type: "int", nullable: false), - DungeonsCompleted = table.Column(type: "int", nullable: false), - BossesKilled = table.Column(type: "int", nullable: false), - IsDeleted = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_characters", x => x.Id); - table.ForeignKey( - name: "FK_dungeon_characters_accounts_AccountId", - column: x => x.AccountId, - principalTable: "accounts", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_item_definitions", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Type = table.Column(type: "int", nullable: false), - Rarity = table.Column(type: "int", nullable: false), - EquipSlot = table.Column(type: "int", nullable: true), - RequiredStrength = table.Column(type: "int", nullable: false), - RequiredIntelligence = table.Column(type: "int", nullable: false), - RequiredWisdom = table.Column(type: "int", nullable: false), - RequiredDexterity = table.Column(type: "int", nullable: false), - RequiredLevel = table.Column(type: "int", nullable: false), - BonusStrength = table.Column(type: "int", nullable: false), - BonusIntelligence = table.Column(type: "int", nullable: false), - BonusWisdom = table.Column(type: "int", nullable: false), - BonusEndurance = table.Column(type: "int", nullable: false), - BonusDexterity = table.Column(type: "int", nullable: false), - BonusHealth = table.Column(type: "int", nullable: false), - BonusMana = table.Column(type: "int", nullable: false), - MinDamage = table.Column(type: "int", nullable: false), - MaxDamage = table.Column(type: "int", nullable: false), - AttackRange = table.Column(type: "float", nullable: false), - DamageType = table.Column(type: "int", nullable: false), - Armor = table.Column(type: "int", nullable: false), - MagicResist = table.Column(type: "int", nullable: false), - HealAmount = table.Column(type: "int", nullable: false), - ManaRestore = table.Column(type: "int", nullable: false), - StaminaRestore = table.Column(type: "int", nullable: false), - IsTeleportScroll = table.Column(type: "tinyint(1)", nullable: false), - TeachesSpellId = table.Column(type: "int", nullable: true), - Stackable = table.Column(type: "tinyint(1)", nullable: false), - MaxStack = table.Column(type: "int", nullable: false), - SpriteId = table.Column(type: "int", nullable: false), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_item_definitions", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_mob_definitions", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Type = table.Column(type: "int", nullable: false), - Category = table.Column(type: "int", nullable: false), - MinTier = table.Column(type: "int", nullable: false), - MaxTier = table.Column(type: "int", nullable: false), - BaseHealth = table.Column(type: "int", nullable: false), - BaseMana = table.Column(type: "int", nullable: false), - BasePhysicalDamage = table.Column(type: "int", nullable: false), - BaseMagicDamage = table.Column(type: "int", nullable: false), - BaseArmor = table.Column(type: "int", nullable: false), - BaseMagicResist = table.Column(type: "int", nullable: false), - MoveSpeed = table.Column(type: "float", nullable: false), - AttackRange = table.Column(type: "float", nullable: false), - AttackSpeed = table.Column(type: "float", nullable: false), - AggroRange = table.Column(type: "float", nullable: false), - LeashRange = table.Column(type: "float", nullable: false), - HealthPerTier = table.Column(type: "float", nullable: false), - DamagePerTier = table.Column(type: "float", nullable: false), - ArmorPerTier = table.Column(type: "float", nullable: false), - BaseXp = table.Column(type: "int", nullable: false), - XpPerTier = table.Column(type: "float", nullable: false), - LootTableId = table.Column(type: "int", nullable: false), - DropChanceMultiplier = table.Column(type: "float", nullable: false), - ResistancesJson = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AbilitiesJson = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SpriteSheet = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SpriteIndex = table.Column(type: "int", nullable: false), - SpriteWidth = table.Column(type: "int", nullable: false), - SpriteHeight = table.Column(type: "int", nullable: false), - TintColor = table.Column(type: "varchar(16)", maxLength: 16, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - IdleFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WalkFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AttackFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DeathFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AnimationSpeed = table.Column(type: "float", nullable: false), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_mob_definitions", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_spell_definitions", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Type = table.Column(type: "int", nullable: false), - RequiredWisdom = table.Column(type: "int", nullable: false), - RequiredIntelligence = table.Column(type: "int", nullable: false), - RequiredLevel = table.Column(type: "int", nullable: false), - ManaCost = table.Column(type: "int", nullable: false), - Cooldown = table.Column(type: "float", nullable: false), - BaseDamage = table.Column(type: "int", nullable: false), - BaseHealing = table.Column(type: "int", nullable: false), - Range = table.Column(type: "float", nullable: false), - AreaOfEffect = table.Column(type: "float", nullable: false), - IsTeleport = table.Column(type: "tinyint(1)", nullable: false), - IsShield = table.Column(type: "tinyint(1)", nullable: false), - ShieldAmount = table.Column(type: "int", nullable: false), - SpriteId = table.Column(type: "int", nullable: false), - EffectColor = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_spell_definitions", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_character_items", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CharacterId = table.Column(type: "bigint unsigned", nullable: false), - ItemDefinitionId = table.Column(type: "int", nullable: false), - Quantity = table.Column(type: "int", nullable: false), - SlotIndex = table.Column(type: "int", nullable: false), - AcquiredAt = table.Column(type: "datetime(6)", nullable: false), - DefinitionId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_character_items", x => x.Id); - table.ForeignKey( - name: "FK_dungeon_character_items_dungeon_characters_CharacterId", - column: x => x.CharacterId, - principalTable: "dungeon_characters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_dungeon_character_items_dungeon_item_definitions_DefinitionId", - column: x => x.DefinitionId, - principalTable: "dungeon_item_definitions", - principalColumn: "Id"); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_stash_items", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CharacterId = table.Column(type: "bigint unsigned", nullable: false), - ItemDefinitionId = table.Column(type: "int", nullable: false), - Quantity = table.Column(type: "int", nullable: false), - SlotIndex = table.Column(type: "int", nullable: false), - StoredAt = table.Column(type: "datetime(6)", nullable: false), - DefinitionId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_stash_items", x => x.Id); - table.ForeignKey( - name: "FK_dungeon_stash_items_dungeon_characters_CharacterId", - column: x => x.CharacterId, - principalTable: "dungeon_characters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_dungeon_stash_items_dungeon_item_definitions_DefinitionId", - column: x => x.DefinitionId, - principalTable: "dungeon_item_definitions", - principalColumn: "Id"); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_learned_spells", - columns: table => new - { - Id = table.Column(type: "bigint unsigned", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CharacterId = table.Column(type: "bigint unsigned", nullable: false), - SpellDefinitionId = table.Column(type: "int", nullable: false), - LearnedAt = table.Column(type: "datetime(6)", nullable: false), - SpellLevel = table.Column(type: "int", nullable: false), - DefinitionId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_learned_spells", x => x.Id); - table.ForeignKey( - name: "FK_dungeon_learned_spells_dungeon_characters_CharacterId", - column: x => x.CharacterId, - principalTable: "dungeon_characters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_dungeon_learned_spells_dungeon_spell_definitions_DefinitionId", - column: x => x.DefinitionId, - principalTable: "dungeon_spell_definitions", - principalColumn: "Id"); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_character_items_CharacterId", - table: "dungeon_character_items", - column: "CharacterId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_character_items_DefinitionId", - table: "dungeon_character_items", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_characters_AccountId", - table: "dungeon_characters", - column: "AccountId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_learned_spells_CharacterId", - table: "dungeon_learned_spells", - column: "CharacterId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_learned_spells_DefinitionId", - table: "dungeon_learned_spells", - column: "DefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_stash_items_CharacterId", - table: "dungeon_stash_items", - column: "CharacterId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_stash_items_DefinitionId", - table: "dungeon_stash_items", - column: "DefinitionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "dungeon_character_items"); - - migrationBuilder.DropTable( - name: "dungeon_learned_spells"); - - migrationBuilder.DropTable( - name: "dungeon_mob_definitions"); - - migrationBuilder.DropTable( - name: "dungeon_stash_items"); - - migrationBuilder.DropTable( - name: "dungeon_spell_definitions"); - - migrationBuilder.DropTable( - name: "dungeon_characters"); - - migrationBuilder.DropTable( - name: "dungeon_item_definitions"); - } - } -} diff --git a/Migrations/20251208165644_LootTables.Designer.cs b/Migrations/20251208165644_LootTables.Designer.cs deleted file mode 100644 index f953da9..0000000 --- a/Migrations/20251208165644_LootTables.Designer.cs +++ /dev/null @@ -1,1599 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Server.Data; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - [DbContext(typeof(GameDbContext))] - [Migration("20251208165644_LootTables")] - partial class LootTables - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.10") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BannedUntil") - .HasColumnType("datetime(6)"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Email") - .HasMaxLength(255) - .HasColumnType("varchar(255)"); - - b.Property("IsBanned") - .HasColumnType("tinyint(1)"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("varbinary(64)"); - - b.Property("PasswordSalt") - .IsRequired() - .HasColumnType("varbinary(32)"); - - b.Property("Role") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Username") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.HasKey("Id"); - - b.HasIndex("Email") - .IsUnique(); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacter", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("BossesKilled") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CurrentHealth") - .HasColumnType("int"); - - b.Property("CurrentMana") - .HasColumnType("int"); - - b.Property("Dexterity") - .HasColumnType("int"); - - b.Property("DungeonsCompleted") - .HasColumnType("int"); - - b.Property("Endurance") - .HasColumnType("int"); - - b.Property("EquippedAccessory") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedBoots") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedChest") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedGloves") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedHead") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedLegs") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedOffhand") - .HasColumnType("bigint unsigned"); - - b.Property("EquippedWeapon") - .HasColumnType("bigint unsigned"); - - b.Property("Experience") - .HasColumnType("bigint"); - - b.Property("Intelligence") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("tinyint(1)"); - - b.Property("LastPlayedAt") - .HasColumnType("datetime(6)"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PlayersKilled") - .HasColumnType("int"); - - b.Property("Strength") - .HasColumnType("int"); - - b.Property("TotalDeaths") - .HasColumnType("int"); - - b.Property("TotalKills") - .HasColumnType("int"); - - b.Property("UnspentStatPoints") - .HasColumnType("int"); - - b.Property("Wisdom") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.ToTable("dungeon_characters"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacterItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AcquiredAt") - .HasColumnType("datetime(6)"); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("DefinitionId") - .HasColumnType("int"); - - b.Property("ItemDefinitionId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SlotIndex") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("DefinitionId"); - - b.ToTable("dungeon_character_items"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Armor") - .HasColumnType("int"); - - b.Property("AttackRange") - .HasColumnType("float"); - - b.Property("BonusDexterity") - .HasColumnType("int"); - - b.Property("BonusEndurance") - .HasColumnType("int"); - - b.Property("BonusHealth") - .HasColumnType("int"); - - b.Property("BonusIntelligence") - .HasColumnType("int"); - - b.Property("BonusMana") - .HasColumnType("int"); - - b.Property("BonusStrength") - .HasColumnType("int"); - - b.Property("BonusWisdom") - .HasColumnType("int"); - - b.Property("DamageType") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EquipSlot") - .HasColumnType("int"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("IsTeleportScroll") - .HasColumnType("tinyint(1)"); - - b.Property("MagicResist") - .HasColumnType("int"); - - b.Property("ManaRestore") - .HasColumnType("int"); - - b.Property("MaxDamage") - .HasColumnType("int"); - - b.Property("MaxStack") - .HasColumnType("int"); - - b.Property("MinDamage") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("int"); - - b.Property("RequiredDexterity") - .HasColumnType("int"); - - b.Property("RequiredIntelligence") - .HasColumnType("int"); - - b.Property("RequiredLevel") - .HasColumnType("int"); - - b.Property("RequiredStrength") - .HasColumnType("int"); - - b.Property("RequiredWisdom") - .HasColumnType("int"); - - b.Property("SpriteId") - .HasColumnType("int"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("StaminaRestore") - .HasColumnType("int"); - - b.Property("TeachesSpellId") - .HasColumnType("int"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("dungeon_item_definitions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLearnedSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("DefinitionId") - .HasColumnType("int"); - - b.Property("LearnedAt") - .HasColumnType("datetime(6)"); - - b.Property("SpellDefinitionId") - .HasColumnType("int"); - - b.Property("SpellLevel") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("DefinitionId"); - - b.ToTable("dungeon_learned_spells"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLootTable", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("DropChanceMultiplier") - .HasColumnType("float"); - - b.Property("GuaranteedDrop") - .HasColumnType("tinyint(1)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("MaxDrops") - .HasColumnType("int"); - - b.Property("MaxTier") - .HasColumnType("int"); - - b.Property("MinDrops") - .HasColumnType("int"); - - b.Property("MinTier") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.HasKey("Id"); - - b.ToTable("dungeon_loot_tables"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLootTableEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("DropChance") - .HasColumnType("float"); - - b.Property("DropChancePerTier") - .HasColumnType("float"); - - b.Property("Guaranteed") - .HasColumnType("tinyint(1)"); - - b.Property("ItemDefinitionId") - .HasColumnType("int"); - - b.Property("LootTableId") - .HasColumnType("int"); - - b.Property("MaxDropChance") - .HasColumnType("float"); - - b.Property("MaxQuantity") - .HasColumnType("int"); - - b.Property("MinQuantity") - .HasColumnType("int"); - - b.Property("Weight") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ItemDefinitionId"); - - b.HasIndex("LootTableId"); - - b.ToTable("dungeon_loot_table_entries"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonMobDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AbilitiesJson") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); - - b.Property("AggroRange") - .HasColumnType("float"); - - b.Property("AnimationSpeed") - .HasColumnType("float"); - - b.Property("ArmorPerTier") - .HasColumnType("float"); - - b.Property("AttackFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("AttackRange") - .HasColumnType("float"); - - b.Property("AttackSpeed") - .HasColumnType("float"); - - b.Property("BaseArmor") - .HasColumnType("int"); - - b.Property("BaseHealth") - .HasColumnType("int"); - - b.Property("BaseMagicDamage") - .HasColumnType("int"); - - b.Property("BaseMagicResist") - .HasColumnType("int"); - - b.Property("BaseMana") - .HasColumnType("int"); - - b.Property("BasePhysicalDamage") - .HasColumnType("int"); - - b.Property("BaseXp") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("DamagePerTier") - .HasColumnType("float"); - - b.Property("DeathFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("DropChanceMultiplier") - .HasColumnType("float"); - - b.Property("HealthPerTier") - .HasColumnType("float"); - - b.Property("IdleFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LeashRange") - .HasColumnType("float"); - - b.Property("LootTableId") - .HasColumnType("int"); - - b.Property("MaxTier") - .HasColumnType("int"); - - b.Property("MinTier") - .HasColumnType("int"); - - b.Property("MoveSpeed") - .HasColumnType("float"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ResistancesJson") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("varchar(1024)"); - - b.Property("SpriteHeight") - .HasColumnType("int"); - - b.Property("SpriteIndex") - .HasColumnType("int"); - - b.Property("SpriteSheet") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("SpriteWidth") - .HasColumnType("int"); - - b.Property("TintColor") - .IsRequired() - .HasMaxLength(16) - .HasColumnType("varchar(16)"); - - b.Property("Type") - .HasColumnType("int"); - - b.Property("WalkFrames") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("XpPerTier") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("dungeon_mob_definitions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonMobLootTable", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("LootTableId") - .HasColumnType("int"); - - b.Property("MobDefinitionId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("RollChance") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("LootTableId"); - - b.HasIndex("MobDefinitionId"); - - b.ToTable("dungeon_mob_loot_tables"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonSpellDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaOfEffect") - .HasColumnType("float"); - - b.Property("BaseDamage") - .HasColumnType("int"); - - b.Property("BaseHealing") - .HasColumnType("int"); - - b.Property("Cooldown") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EffectColor") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("IsShield") - .HasColumnType("tinyint(1)"); - - b.Property("IsTeleport") - .HasColumnType("tinyint(1)"); - - b.Property("ManaCost") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("RequiredIntelligence") - .HasColumnType("int"); - - b.Property("RequiredLevel") - .HasColumnType("int"); - - b.Property("RequiredWisdom") - .HasColumnType("int"); - - b.Property("ShieldAmount") - .HasColumnType("int"); - - b.Property("SpriteId") - .HasColumnType("int"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("dungeon_spell_definitions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonStashItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("DefinitionId") - .HasColumnType("int"); - - b.Property("ItemDefinitionId") - .HasColumnType("int"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("SlotIndex") - .HasColumnType("int"); - - b.Property("StoredAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("DefinitionId"); - - b.ToTable("dungeon_stash_items"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("SlotCode") - .HasColumnType("tinyint unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotCode") - .IsUnique(); - - b.ToTable("equipment", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameItem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("AmmoType") - .HasColumnType("int"); - - b.Property("Category") - .HasColumnType("int"); - - b.Property("CraftCost") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Damage") - .HasColumnType("int"); - - b.Property("DamageReduction") - .HasColumnType("float"); - - b.Property("DashCooldown") - .HasColumnType("float"); - - b.Property("DashDistance") - .HasColumnType("float"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("ExplosionRadius") - .HasColumnType("float"); - - b.Property("FireRate") - .HasColumnType("float"); - - b.Property("HarvestMultiplier") - .HasColumnType("float"); - - b.Property("HealAmount") - .HasColumnType("int"); - - b.Property("HealthBonus") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("LootValue") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("PelletCount") - .HasColumnType("int"); - - b.Property("ProjectileSpeed") - .HasColumnType("float"); - - b.Property("Range") - .HasColumnType("float"); - - b.Property("ScanCooldown") - .HasColumnType("float"); - - b.Property("ScanRadius") - .HasColumnType("float"); - - b.Property("ShieldBoostDuration") - .HasColumnType("float"); - - b.Property("ShieldDuration") - .HasColumnType("float"); - - b.Property("ShieldHealth") - .HasColumnType("int"); - - b.Property("SpeedBoostDuration") - .HasColumnType("float"); - - b.Property("SpeedMultiplier") - .HasColumnType("float"); - - b.Property("SpeedPenalty") - .HasColumnType("float"); - - b.Property("Spread") - .HasColumnType("float"); - - b.Property("Stackable") - .HasColumnType("tinyint(1)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Category"); - - b.HasIndex("IsEnabled"); - - b.ToTable("game_items", (string)null); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("EnergyCost") - .HasColumnType("int"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint(1)") - .HasDefaultValue(true); - - b.Property("RareCost") - .HasColumnType("int"); - - b.Property("ResultItemId") - .HasColumnType("int"); - - b.Property("ScrapCost") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("IsEnabled"); - - b.HasIndex("ResultItemId"); - - b.ToTable("game_recipes", (string)null); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CharacterId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemTemplateId") - .HasColumnType("bigint unsigned"); - - b.Property("Quantity") - .HasColumnType("int unsigned"); - - b.Property("SlotIndex") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("CharacterId"); - - b.HasIndex("ItemTemplateId"); - - b.HasIndex("CharacterId", "SlotIndex") - .IsUnique(); - - b.ToTable("inventories", (string)null); - }); - - modelBuilder.Entity("Server.Data.ItemTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("ItemType") - .HasColumnType("tinyint unsigned"); - - b.Property("MaxStack") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("Rarity") - .HasColumnType("tinyint unsigned"); - - b.Property("StatsJson") - .HasColumnType("json"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Weight") - .HasColumnType("int unsigned"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("item_templates", (string)null); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("DamageDealt") - .HasColumnType("int"); - - b.Property("DamageTaken") - .HasColumnType("int"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("EloAfter") - .HasColumnType("int"); - - b.Property("EloChange") - .HasColumnType("int"); - - b.Property("EnergyCollected") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("MatchDurationSeconds") - .HasColumnType("int"); - - b.Property("MatchId") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("Placement") - .HasColumnType("int"); - - b.Property("PlayedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("RareCollected") - .HasColumnType("int"); - - b.Property("Result") - .HasColumnType("int"); - - b.Property("ScrapCollected") - .HasColumnType("int"); - - b.Property("SurvivalTimeSeconds") - .HasColumnType("int"); - - b.Property("TotalPlayers") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("MatchId"); - - b.HasIndex("PlayedAt"); - - b.ToTable("match_history", (string)null); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("AppearanceJson") - .HasColumnType("json"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("FacingDeg") - .HasColumnType("float"); - - b.Property("HpCurrent") - .HasColumnType("int unsigned"); - - b.Property("HpMax") - .HasColumnType("int unsigned"); - - b.Property("Level") - .HasColumnType("int unsigned"); - - b.Property("MpCurrent") - .HasColumnType("int unsigned"); - - b.Property("MpMax") - .HasColumnType("int unsigned"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("varchar(32)"); - - b.Property("PosX") - .HasColumnType("double"); - - b.Property("PosY") - .HasColumnType("double"); - - b.Property("PosZ") - .HasColumnType("double"); - - b.Property("StaminaCurrent") - .HasColumnType("int unsigned"); - - b.Property("StaminaMax") - .HasColumnType("int unsigned"); - - b.Property("StatDexterity") - .HasColumnType("int unsigned"); - - b.Property("StatEndurance") - .HasColumnType("int unsigned"); - - b.Property("StatIntelligence") - .HasColumnType("int unsigned"); - - b.Property("StatStrength") - .HasColumnType("int unsigned"); - - b.Property("StatWisdom") - .HasColumnType("int unsigned"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Xp") - .HasColumnType("bigint unsigned"); - - b.Property("ZoneId") - .HasColumnType("bigint unsigned"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.HasIndex("ZoneId"); - - b.ToTable("characters", (string)null); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("Deaths") - .HasColumnType("int"); - - b.Property("Elo") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1000); - - b.Property("Extractions") - .HasColumnType("int"); - - b.Property("ItemsCrafted") - .HasColumnType("int"); - - b.Property("Kills") - .HasColumnType("int"); - - b.Property("LongestSurvivalSeconds") - .HasColumnType("int"); - - b.Property("Losses") - .HasColumnType("int"); - - b.Property("MatchesPlayed") - .HasColumnType("int"); - - b.Property("TotalDamageDealt") - .HasColumnType("bigint"); - - b.Property("TotalDamageTaken") - .HasColumnType("bigint"); - - b.Property("TotalEnergyCollected") - .HasColumnType("bigint"); - - b.Property("TotalPlayTimeSeconds") - .HasColumnType("bigint"); - - b.Property("TotalRareCollected") - .HasColumnType("bigint"); - - b.Property("TotalScrapCollected") - .HasColumnType("bigint"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.Property("Wins") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AccountId") - .IsUnique(); - - b.ToTable("player_stats", (string)null); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint unsigned"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("CreatedIp") - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("ExpiresAt") - .HasColumnType("datetime(6)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - - b.Property("UserAgent") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("AccountId"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Server.Data.Zone", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint unsigned"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - b.Property("MaxX") - .HasColumnType("double"); - - b.Property("MaxY") - .HasColumnType("double"); - - b.Property("MaxZ") - .HasColumnType("double"); - - b.Property("MinX") - .HasColumnType("double"); - - b.Property("MinY") - .HasColumnType("double"); - - b.Property("MinZ") - .HasColumnType("double"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("varchar(64)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime(6)") - .HasDefaultValueSql("CURRENT_TIMESTAMP(6)"); - - MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property("UpdatedAt")); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("zones", (string)null); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacter", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacterItem", b => - { - b.HasOne("Server.Data.Entities.DungeonCharacter", "Character") - .WithMany("Inventory") - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonItemDefinition", "Definition") - .WithMany() - .HasForeignKey("DefinitionId"); - - b.Navigation("Character"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLearnedSpell", b => - { - b.HasOne("Server.Data.Entities.DungeonCharacter", "Character") - .WithMany("LearnedSpells") - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonSpellDefinition", "Definition") - .WithMany() - .HasForeignKey("DefinitionId"); - - b.Navigation("Character"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLootTableEntry", b => - { - b.HasOne("Server.Data.Entities.DungeonItemDefinition", "ItemDefinition") - .WithMany() - .HasForeignKey("ItemDefinitionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonLootTable", "LootTable") - .WithMany("Entries") - .HasForeignKey("LootTableId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ItemDefinition"); - - b.Navigation("LootTable"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonMobLootTable", b => - { - b.HasOne("Server.Data.Entities.DungeonLootTable", "LootTable") - .WithMany() - .HasForeignKey("LootTableId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonMobDefinition", "MobDefinition") - .WithMany() - .HasForeignKey("MobDefinitionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LootTable"); - - b.Navigation("MobDefinition"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonStashItem", b => - { - b.HasOne("Server.Data.Entities.DungeonCharacter", "Character") - .WithMany("Stash") - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Entities.DungeonItemDefinition", "Definition") - .WithMany() - .HasForeignKey("DefinitionId"); - - b.Navigation("Character"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Server.Data.EquipmentSlot", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.GameRecipe", b => - { - b.HasOne("Server.Data.GameItem", "ResultItem") - .WithMany() - .HasForeignKey("ResultItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ResultItem"); - }); - - modelBuilder.Entity("Server.Data.InventoryItem", b => - { - b.HasOne("Server.Data.Old_Character", "Old_Character") - .WithMany() - .HasForeignKey("CharacterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.ItemTemplate", "ItemTemplate") - .WithMany() - .HasForeignKey("ItemTemplateId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("ItemTemplate"); - - b.Navigation("Old_Character"); - }); - - modelBuilder.Entity("Server.Data.MatchHistory", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Old_Character", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Characters") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Server.Data.Zone", "Zone") - .WithMany() - .HasForeignKey("ZoneId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Account"); - - b.Navigation("Zone"); - }); - - modelBuilder.Entity("Server.Data.PlayerStats", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithOne() - .HasForeignKey("Server.Data.PlayerStats", "AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Session", b => - { - b.HasOne("Server.Data.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("Server.Data.Account", b => - { - b.Navigation("Characters"); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonCharacter", b => - { - b.Navigation("Inventory"); - - b.Navigation("LearnedSpells"); - - b.Navigation("Stash"); - }); - - modelBuilder.Entity("Server.Data.Entities.DungeonLootTable", b => - { - b.Navigation("Entries"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Migrations/20251208165644_LootTables.cs b/Migrations/20251208165644_LootTables.cs deleted file mode 100644 index 023c1ac..0000000 --- a/Migrations/20251208165644_LootTables.cs +++ /dev/null @@ -1,135 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class LootTables : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "dungeon_loot_tables", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - MinTier = table.Column(type: "int", nullable: false), - MaxTier = table.Column(type: "int", nullable: false), - DropChanceMultiplier = table.Column(type: "float", nullable: false), - MinDrops = table.Column(type: "int", nullable: false), - MaxDrops = table.Column(type: "int", nullable: false), - GuaranteedDrop = table.Column(type: "tinyint(1)", nullable: false), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_loot_tables", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_loot_table_entries", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - LootTableId = table.Column(type: "int", nullable: false), - ItemDefinitionId = table.Column(type: "int", nullable: false), - DropChance = table.Column(type: "float", nullable: false), - MinQuantity = table.Column(type: "int", nullable: false), - MaxQuantity = table.Column(type: "int", nullable: false), - Weight = table.Column(type: "int", nullable: false), - Guaranteed = table.Column(type: "tinyint(1)", nullable: false), - DropChancePerTier = table.Column(type: "float", nullable: false), - MaxDropChance = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_loot_table_entries", x => x.Id); - table.ForeignKey( - name: "FK_dungeon_loot_table_entries_dungeon_item_definitions_ItemDefi~", - column: x => x.ItemDefinitionId, - principalTable: "dungeon_item_definitions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_dungeon_loot_table_entries_dungeon_loot_tables_LootTableId", - column: x => x.LootTableId, - principalTable: "dungeon_loot_tables", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "dungeon_mob_loot_tables", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - MobDefinitionId = table.Column(type: "int", nullable: false), - LootTableId = table.Column(type: "int", nullable: false), - Priority = table.Column(type: "int", nullable: false), - RollChance = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_dungeon_mob_loot_tables", x => x.Id); - table.ForeignKey( - name: "FK_dungeon_mob_loot_tables_dungeon_loot_tables_LootTableId", - column: x => x.LootTableId, - principalTable: "dungeon_loot_tables", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_dungeon_mob_loot_tables_dungeon_mob_definitions_MobDefinitio~", - column: x => x.MobDefinitionId, - principalTable: "dungeon_mob_definitions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_loot_table_entries_ItemDefinitionId", - table: "dungeon_loot_table_entries", - column: "ItemDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_loot_table_entries_LootTableId", - table: "dungeon_loot_table_entries", - column: "LootTableId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_mob_loot_tables_LootTableId", - table: "dungeon_mob_loot_tables", - column: "LootTableId"); - - migrationBuilder.CreateIndex( - name: "IX_dungeon_mob_loot_tables_MobDefinitionId", - table: "dungeon_mob_loot_tables", - column: "MobDefinitionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "dungeon_loot_table_entries"); - - migrationBuilder.DropTable( - name: "dungeon_mob_loot_tables"); - - migrationBuilder.DropTable( - name: "dungeon_loot_tables"); - } - } -} diff --git a/Migrations/20251209140805_Inventory2.cs b/Migrations/20251209140805_Inventory2.cs deleted file mode 100644 index 376a71c..0000000 --- a/Migrations/20251209140805_Inventory2.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SystemRevivalServer.Migrations -{ - /// - public partial class Inventory2 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Migrations/20251209140805_Inventory2.Designer.cs b/Migrations/20251209142654_Initialize.Designer.cs similarity index 99% rename from Migrations/20251209140805_Inventory2.Designer.cs rename to Migrations/20251209142654_Initialize.Designer.cs index fba58c6..ae7ea26 100644 --- a/Migrations/20251209140805_Inventory2.Designer.cs +++ b/Migrations/20251209142654_Initialize.Designer.cs @@ -12,8 +12,8 @@ using Server.Data; namespace SystemRevivalServer.Migrations { [DbContext(typeof(GameDbContext))] - [Migration("20251209140805_Inventory2")] - partial class Inventory2 + [Migration("20251209142654_Initialize")] + partial class Initialize { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/Migrations/20251209142654_Initialize.cs b/Migrations/20251209142654_Initialize.cs new file mode 100644 index 0000000..56d4b6f --- /dev/null +++ b/Migrations/20251209142654_Initialize.cs @@ -0,0 +1,986 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SystemRevivalServer.Migrations +{ + /// + public partial class Initialize : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "accounts", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Username = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PasswordHash = table.Column(type: "varbinary(64)", nullable: false), + PasswordSalt = table.Column(type: "varbinary(32)", nullable: false), + IsBanned = table.Column(type: "tinyint(1)", nullable: false), + BannedUntil = table.Column(type: "datetime(6)", nullable: true), + Role = table.Column(type: "int", nullable: false, defaultValue: 0), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_accounts", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_item_definitions", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "int", nullable: false), + Rarity = table.Column(type: "int", nullable: false), + EquipSlot = table.Column(type: "int", nullable: true), + RequiredStrength = table.Column(type: "int", nullable: false), + RequiredIntelligence = table.Column(type: "int", nullable: false), + RequiredWisdom = table.Column(type: "int", nullable: false), + RequiredDexterity = table.Column(type: "int", nullable: false), + RequiredLevel = table.Column(type: "int", nullable: false), + BonusStrength = table.Column(type: "int", nullable: false), + BonusIntelligence = table.Column(type: "int", nullable: false), + BonusWisdom = table.Column(type: "int", nullable: false), + BonusEndurance = table.Column(type: "int", nullable: false), + BonusDexterity = table.Column(type: "int", nullable: false), + BonusHealth = table.Column(type: "int", nullable: false), + BonusMana = table.Column(type: "int", nullable: false), + MinDamage = table.Column(type: "int", nullable: false), + MaxDamage = table.Column(type: "int", nullable: false), + AttackRange = table.Column(type: "float", nullable: false), + DamageType = table.Column(type: "int", nullable: false), + Armor = table.Column(type: "int", nullable: false), + MagicResist = table.Column(type: "int", nullable: false), + HealAmount = table.Column(type: "int", nullable: false), + ManaRestore = table.Column(type: "int", nullable: false), + StaminaRestore = table.Column(type: "int", nullable: false), + IsTeleportScroll = table.Column(type: "tinyint(1)", nullable: false), + TeachesSpellId = table.Column(type: "int", nullable: true), + Stackable = table.Column(type: "tinyint(1)", nullable: false), + MaxStack = table.Column(type: "int", nullable: false), + SpriteId = table.Column(type: "int", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_item_definitions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_loot_tables", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + MinTier = table.Column(type: "int", nullable: false), + MaxTier = table.Column(type: "int", nullable: false), + DropChanceMultiplier = table.Column(type: "float", nullable: false), + MinDrops = table.Column(type: "int", nullable: false), + MaxDrops = table.Column(type: "int", nullable: false), + GuaranteedDrop = table.Column(type: "tinyint(1)", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_loot_tables", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_mob_definitions", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "int", nullable: false), + Category = table.Column(type: "int", nullable: false), + MinTier = table.Column(type: "int", nullable: false), + MaxTier = table.Column(type: "int", nullable: false), + BaseHealth = table.Column(type: "int", nullable: false), + BaseMana = table.Column(type: "int", nullable: false), + BasePhysicalDamage = table.Column(type: "int", nullable: false), + BaseMagicDamage = table.Column(type: "int", nullable: false), + BaseArmor = table.Column(type: "int", nullable: false), + BaseMagicResist = table.Column(type: "int", nullable: false), + MoveSpeed = table.Column(type: "float", nullable: false), + AttackRange = table.Column(type: "float", nullable: false), + AttackSpeed = table.Column(type: "float", nullable: false), + AggroRange = table.Column(type: "float", nullable: false), + LeashRange = table.Column(type: "float", nullable: false), + HealthPerTier = table.Column(type: "float", nullable: false), + DamagePerTier = table.Column(type: "float", nullable: false), + ArmorPerTier = table.Column(type: "float", nullable: false), + BaseXp = table.Column(type: "int", nullable: false), + XpPerTier = table.Column(type: "float", nullable: false), + LootTableId = table.Column(type: "int", nullable: false), + DropChanceMultiplier = table.Column(type: "float", nullable: false), + ResistancesJson = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AbilitiesJson = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SpriteSheet = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SpriteIndex = table.Column(type: "int", nullable: false), + SpriteWidth = table.Column(type: "int", nullable: false), + SpriteHeight = table.Column(type: "int", nullable: false), + TintColor = table.Column(type: "varchar(16)", maxLength: 16, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IdleFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + WalkFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AttackFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DeathFrames = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AnimationSpeed = table.Column(type: "float", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_mob_definitions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_spell_definitions", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Type = table.Column(type: "int", nullable: false), + RequiredWisdom = table.Column(type: "int", nullable: false), + RequiredIntelligence = table.Column(type: "int", nullable: false), + RequiredLevel = table.Column(type: "int", nullable: false), + ManaCost = table.Column(type: "int", nullable: false), + Cooldown = table.Column(type: "float", nullable: false), + BaseDamage = table.Column(type: "int", nullable: false), + BaseHealing = table.Column(type: "int", nullable: false), + Range = table.Column(type: "float", nullable: false), + AreaOfEffect = table.Column(type: "float", nullable: false), + IsTeleport = table.Column(type: "tinyint(1)", nullable: false), + IsShield = table.Column(type: "tinyint(1)", nullable: false), + ShieldAmount = table.Column(type: "int", nullable: false), + SpriteId = table.Column(type: "int", nullable: false), + EffectColor = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_spell_definitions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "game_items", + columns: table => new + { + Id = table.Column(type: "int", nullable: false), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Category = table.Column(type: "int", nullable: false), + CraftCost = table.Column(type: "int", nullable: false), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + LootValue = table.Column(type: "int", nullable: false), + Stackable = table.Column(type: "tinyint(1)", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: true), + Damage = table.Column(type: "int", nullable: false), + FireRate = table.Column(type: "float", nullable: false), + ProjectileSpeed = table.Column(type: "float", nullable: false), + Range = table.Column(type: "float", nullable: false), + AmmoType = table.Column(type: "int", nullable: false), + PelletCount = table.Column(type: "int", nullable: false), + Spread = table.Column(type: "float", nullable: false), + ExplosionRadius = table.Column(type: "float", nullable: false), + HarvestMultiplier = table.Column(type: "float", nullable: false), + ScanRadius = table.Column(type: "float", nullable: false), + ScanCooldown = table.Column(type: "float", nullable: false), + ShieldHealth = table.Column(type: "int", nullable: false), + ShieldDuration = table.Column(type: "float", nullable: false), + HealAmount = table.Column(type: "int", nullable: false), + ShieldBoostDuration = table.Column(type: "float", nullable: false), + DamageReduction = table.Column(type: "float", nullable: false), + SpeedBoostDuration = table.Column(type: "float", nullable: false), + SpeedMultiplier = table.Column(type: "float", nullable: false), + HealthBonus = table.Column(type: "int", nullable: false), + SpeedPenalty = table.Column(type: "float", nullable: false), + DashDistance = table.Column(type: "float", nullable: false), + DashCooldown = table.Column(type: "float", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_game_items", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "item_templates", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ItemType = table.Column(type: "tinyint unsigned", nullable: false), + Rarity = table.Column(type: "tinyint unsigned", nullable: false), + MaxStack = table.Column(type: "int unsigned", nullable: false), + Weight = table.Column(type: "int unsigned", nullable: false), + StatsJson = table.Column(type: "json", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_item_templates", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "zones", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + MinX = table.Column(type: "double", nullable: false), + MinY = table.Column(type: "double", nullable: false), + MinZ = table.Column(type: "double", nullable: false), + MaxX = table.Column(type: "double", nullable: false), + MaxY = table.Column(type: "double", nullable: false), + MaxZ = table.Column(type: "double", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_zones", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_characters", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + AccountId = table.Column(type: "bigint unsigned", nullable: false), + Name = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + LastPlayedAt = table.Column(type: "datetime(6)", nullable: false), + Level = table.Column(type: "int", nullable: false), + Experience = table.Column(type: "bigint", nullable: false), + UnspentStatPoints = table.Column(type: "int", nullable: false), + Strength = table.Column(type: "int", nullable: false), + Intelligence = table.Column(type: "int", nullable: false), + Wisdom = table.Column(type: "int", nullable: false), + Endurance = table.Column(type: "int", nullable: false), + Dexterity = table.Column(type: "int", nullable: false), + CurrentHealth = table.Column(type: "int", nullable: false), + CurrentMana = table.Column(type: "int", nullable: false), + EquippedWeapon = table.Column(type: "bigint unsigned", nullable: true), + EquippedOffhand = table.Column(type: "bigint unsigned", nullable: true), + EquippedHead = table.Column(type: "bigint unsigned", nullable: true), + EquippedChest = table.Column(type: "bigint unsigned", nullable: true), + EquippedLegs = table.Column(type: "bigint unsigned", nullable: true), + EquippedBoots = table.Column(type: "bigint unsigned", nullable: true), + EquippedGloves = table.Column(type: "bigint unsigned", nullable: true), + EquippedAccessory = table.Column(type: "bigint unsigned", nullable: true), + TotalKills = table.Column(type: "int", nullable: false), + TotalDeaths = table.Column(type: "int", nullable: false), + PlayersKilled = table.Column(type: "int", nullable: false), + DungeonsCompleted = table.Column(type: "int", nullable: false), + BossesKilled = table.Column(type: "int", nullable: false), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_characters", x => x.Id); + table.ForeignKey( + name: "FK_dungeon_characters_accounts_AccountId", + column: x => x.AccountId, + principalTable: "accounts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "match_history", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + MatchId = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AccountId = table.Column(type: "bigint unsigned", nullable: false), + Result = table.Column(type: "int", nullable: false), + Placement = table.Column(type: "int", nullable: false), + TotalPlayers = table.Column(type: "int", nullable: false), + Kills = table.Column(type: "int", nullable: false), + Deaths = table.Column(type: "int", nullable: false), + DamageDealt = table.Column(type: "int", nullable: false), + DamageTaken = table.Column(type: "int", nullable: false), + ScrapCollected = table.Column(type: "int", nullable: false), + EnergyCollected = table.Column(type: "int", nullable: false), + RareCollected = table.Column(type: "int", nullable: false), + ItemsCrafted = table.Column(type: "int", nullable: false), + SurvivalTimeSeconds = table.Column(type: "int", nullable: false), + MatchDurationSeconds = table.Column(type: "int", nullable: false), + EloChange = table.Column(type: "int", nullable: false), + EloAfter = table.Column(type: "int", nullable: false), + PlayedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + }, + constraints: table => + { + table.PrimaryKey("PK_match_history", x => x.Id); + table.ForeignKey( + name: "FK_match_history_accounts_AccountId", + column: x => x.AccountId, + principalTable: "accounts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "player_stats", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + AccountId = table.Column(type: "bigint unsigned", nullable: false), + MatchesPlayed = table.Column(type: "int", nullable: false), + Wins = table.Column(type: "int", nullable: false), + Losses = table.Column(type: "int", nullable: false), + Extractions = table.Column(type: "int", nullable: false), + Kills = table.Column(type: "int", nullable: false), + Deaths = table.Column(type: "int", nullable: false), + TotalDamageDealt = table.Column(type: "bigint", nullable: false), + TotalDamageTaken = table.Column(type: "bigint", nullable: false), + TotalScrapCollected = table.Column(type: "bigint", nullable: false), + TotalEnergyCollected = table.Column(type: "bigint", nullable: false), + TotalRareCollected = table.Column(type: "bigint", nullable: false), + ItemsCrafted = table.Column(type: "int", nullable: false), + TotalPlayTimeSeconds = table.Column(type: "bigint", nullable: false), + LongestSurvivalSeconds = table.Column(type: "int", nullable: false), + Elo = table.Column(type: "int", nullable: false, defaultValue: 1000), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_player_stats", x => x.Id); + table.ForeignKey( + name: "FK_player_stats_accounts_AccountId", + column: x => x.AccountId, + principalTable: "accounts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "sessions", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + AccountId = table.Column(type: "bigint unsigned", nullable: false), + TokenHash = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExpiresAt = table.Column(type: "datetime(6)", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + CreatedIp = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserAgent = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RevokedAt = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_sessions", x => x.Id); + table.ForeignKey( + name: "FK_sessions_accounts_AccountId", + column: x => x.AccountId, + principalTable: "accounts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_loot_table_entries", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + LootTableId = table.Column(type: "int", nullable: false), + ItemDefinitionId = table.Column(type: "int", nullable: false), + DropChance = table.Column(type: "float", nullable: false), + MinQuantity = table.Column(type: "int", nullable: false), + MaxQuantity = table.Column(type: "int", nullable: false), + Weight = table.Column(type: "int", nullable: false), + Guaranteed = table.Column(type: "tinyint(1)", nullable: false), + DropChancePerTier = table.Column(type: "float", nullable: false), + MaxDropChance = table.Column(type: "float", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_loot_table_entries", x => x.Id); + table.ForeignKey( + name: "FK_dungeon_loot_table_entries_dungeon_item_definitions_ItemDefi~", + column: x => x.ItemDefinitionId, + principalTable: "dungeon_item_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_dungeon_loot_table_entries_dungeon_loot_tables_LootTableId", + column: x => x.LootTableId, + principalTable: "dungeon_loot_tables", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_mob_loot_tables", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + MobDefinitionId = table.Column(type: "int", nullable: false), + LootTableId = table.Column(type: "int", nullable: false), + Priority = table.Column(type: "int", nullable: false), + RollChance = table.Column(type: "float", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_mob_loot_tables", x => x.Id); + table.ForeignKey( + name: "FK_dungeon_mob_loot_tables_dungeon_loot_tables_LootTableId", + column: x => x.LootTableId, + principalTable: "dungeon_loot_tables", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_dungeon_mob_loot_tables_dungeon_mob_definitions_MobDefinitio~", + column: x => x.MobDefinitionId, + principalTable: "dungeon_mob_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "game_recipes", + columns: table => new + { + Id = table.Column(type: "int", nullable: false), + ResultItemId = table.Column(type: "int", nullable: false), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: true), + ScrapCost = table.Column(type: "int", nullable: false), + EnergyCost = table.Column(type: "int", nullable: false), + RareCost = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_game_recipes", x => x.Id); + table.ForeignKey( + name: "FK_game_recipes_game_items_ResultItemId", + column: x => x.ResultItemId, + principalTable: "game_items", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "characters", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + AccountId = table.Column(type: "bigint unsigned", nullable: false), + Name = table.Column(type: "varchar(32)", maxLength: 32, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Level = table.Column(type: "int unsigned", nullable: false), + Xp = table.Column(type: "bigint unsigned", nullable: false), + StatStrength = table.Column(type: "int unsigned", nullable: false), + StatDexterity = table.Column(type: "int unsigned", nullable: false), + StatWisdom = table.Column(type: "int unsigned", nullable: false), + StatIntelligence = table.Column(type: "int unsigned", nullable: false), + StatEndurance = table.Column(type: "int unsigned", nullable: false), + HpCurrent = table.Column(type: "int unsigned", nullable: false), + HpMax = table.Column(type: "int unsigned", nullable: false), + MpCurrent = table.Column(type: "int unsigned", nullable: false), + MpMax = table.Column(type: "int unsigned", nullable: false), + StaminaCurrent = table.Column(type: "int unsigned", nullable: false), + StaminaMax = table.Column(type: "int unsigned", nullable: false), + ZoneId = table.Column(type: "bigint unsigned", nullable: false), + PosX = table.Column(type: "double", nullable: false), + PosY = table.Column(type: "double", nullable: false), + PosZ = table.Column(type: "double", nullable: false), + FacingDeg = table.Column(type: "float", nullable: false), + AppearanceJson = table.Column(type: "json", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_characters", x => x.Id); + table.ForeignKey( + name: "FK_characters_accounts_AccountId", + column: x => x.AccountId, + principalTable: "accounts", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_characters_zones_ZoneId", + column: x => x.ZoneId, + principalTable: "zones", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_character_items", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + ItemDefinitionId = table.Column(type: "int", nullable: false), + Quantity = table.Column(type: "int", nullable: false), + SlotIndex = table.Column(type: "int", nullable: false), + IsEquipped = table.Column(type: "tinyint(1)", nullable: false), + EquipSlot = table.Column(type: "int", nullable: true), + AcquiredAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_character_items", x => x.Id); + table.ForeignKey( + name: "FK_dungeon_character_items_dungeon_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "dungeon_characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_dungeon_character_items_dungeon_item_definitions_ItemDefinit~", + column: x => x.ItemDefinitionId, + principalTable: "dungeon_item_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_learned_spells", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + SpellDefinitionId = table.Column(type: "int", nullable: false), + LearnedAt = table.Column(type: "datetime(6)", nullable: false), + SpellLevel = table.Column(type: "int", nullable: false), + DefinitionId = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_learned_spells", x => x.Id); + table.ForeignKey( + name: "FK_dungeon_learned_spells_dungeon_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "dungeon_characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_dungeon_learned_spells_dungeon_spell_definitions_DefinitionId", + column: x => x.DefinitionId, + principalTable: "dungeon_spell_definitions", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "dungeon_stash_items", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + ItemDefinitionId = table.Column(type: "int", nullable: false), + Quantity = table.Column(type: "int", nullable: false), + SlotIndex = table.Column(type: "int", nullable: false), + StoredAt = table.Column(type: "datetime(6)", nullable: false), + DefinitionId = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_dungeon_stash_items", x => x.Id); + table.ForeignKey( + name: "FK_dungeon_stash_items_dungeon_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "dungeon_characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_dungeon_stash_items_dungeon_item_definitions_DefinitionId", + column: x => x.DefinitionId, + principalTable: "dungeon_item_definitions", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "equipment", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + SlotCode = table.Column(type: "tinyint unsigned", nullable: false), + ItemTemplateId = table.Column(type: "bigint unsigned", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_equipment", x => x.Id); + table.ForeignKey( + name: "FK_equipment_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_equipment_item_templates_ItemTemplateId", + column: x => x.ItemTemplateId, + principalTable: "item_templates", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "inventories", + columns: table => new + { + Id = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CharacterId = table.Column(type: "bigint unsigned", nullable: false), + SlotIndex = table.Column(type: "int unsigned", nullable: false), + ItemTemplateId = table.Column(type: "bigint unsigned", nullable: false), + Quantity = table.Column(type: "int unsigned", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)"), + UpdatedAt = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP(6)") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_inventories", x => x.Id); + table.ForeignKey( + name: "FK_inventories_characters_CharacterId", + column: x => x.CharacterId, + principalTable: "characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_inventories_item_templates_ItemTemplateId", + column: x => x.ItemTemplateId, + principalTable: "item_templates", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_accounts_Email", + table: "accounts", + column: "Email", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_accounts_Username", + table: "accounts", + column: "Username", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_characters_AccountId", + table: "characters", + column: "AccountId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_characters_ZoneId", + table: "characters", + column: "ZoneId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_character_items_CharacterId", + table: "dungeon_character_items", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_character_items_ItemDefinitionId", + table: "dungeon_character_items", + column: "ItemDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_characters_AccountId", + table: "dungeon_characters", + column: "AccountId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_learned_spells_CharacterId", + table: "dungeon_learned_spells", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_learned_spells_DefinitionId", + table: "dungeon_learned_spells", + column: "DefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_loot_table_entries_ItemDefinitionId", + table: "dungeon_loot_table_entries", + column: "ItemDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_loot_table_entries_LootTableId", + table: "dungeon_loot_table_entries", + column: "LootTableId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_mob_loot_tables_LootTableId", + table: "dungeon_mob_loot_tables", + column: "LootTableId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_mob_loot_tables_MobDefinitionId", + table: "dungeon_mob_loot_tables", + column: "MobDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_stash_items_CharacterId", + table: "dungeon_stash_items", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_dungeon_stash_items_DefinitionId", + table: "dungeon_stash_items", + column: "DefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_equipment_CharacterId_SlotCode", + table: "equipment", + columns: new[] { "CharacterId", "SlotCode" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_equipment_ItemTemplateId", + table: "equipment", + column: "ItemTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_game_items_Category", + table: "game_items", + column: "Category"); + + migrationBuilder.CreateIndex( + name: "IX_game_items_IsEnabled", + table: "game_items", + column: "IsEnabled"); + + migrationBuilder.CreateIndex( + name: "IX_game_recipes_IsEnabled", + table: "game_recipes", + column: "IsEnabled"); + + migrationBuilder.CreateIndex( + name: "IX_game_recipes_ResultItemId", + table: "game_recipes", + column: "ResultItemId"); + + migrationBuilder.CreateIndex( + name: "IX_inventories_CharacterId", + table: "inventories", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_inventories_CharacterId_SlotIndex", + table: "inventories", + columns: new[] { "CharacterId", "SlotIndex" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_inventories_ItemTemplateId", + table: "inventories", + column: "ItemTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_item_templates_Name", + table: "item_templates", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_match_history_AccountId", + table: "match_history", + column: "AccountId"); + + migrationBuilder.CreateIndex( + name: "IX_match_history_MatchId", + table: "match_history", + column: "MatchId"); + + migrationBuilder.CreateIndex( + name: "IX_match_history_PlayedAt", + table: "match_history", + column: "PlayedAt"); + + migrationBuilder.CreateIndex( + name: "IX_player_stats_AccountId", + table: "player_stats", + column: "AccountId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_sessions_AccountId", + table: "sessions", + column: "AccountId"); + + migrationBuilder.CreateIndex( + name: "IX_sessions_TokenHash", + table: "sessions", + column: "TokenHash", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_zones_Name", + table: "zones", + column: "Name", + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "dungeon_character_items"); + + migrationBuilder.DropTable( + name: "dungeon_learned_spells"); + + migrationBuilder.DropTable( + name: "dungeon_loot_table_entries"); + + migrationBuilder.DropTable( + name: "dungeon_mob_loot_tables"); + + migrationBuilder.DropTable( + name: "dungeon_stash_items"); + + migrationBuilder.DropTable( + name: "equipment"); + + migrationBuilder.DropTable( + name: "game_recipes"); + + migrationBuilder.DropTable( + name: "inventories"); + + migrationBuilder.DropTable( + name: "match_history"); + + migrationBuilder.DropTable( + name: "player_stats"); + + migrationBuilder.DropTable( + name: "sessions"); + + migrationBuilder.DropTable( + name: "dungeon_spell_definitions"); + + migrationBuilder.DropTable( + name: "dungeon_loot_tables"); + + migrationBuilder.DropTable( + name: "dungeon_mob_definitions"); + + migrationBuilder.DropTable( + name: "dungeon_characters"); + + migrationBuilder.DropTable( + name: "dungeon_item_definitions"); + + migrationBuilder.DropTable( + name: "game_items"); + + migrationBuilder.DropTable( + name: "characters"); + + migrationBuilder.DropTable( + name: "item_templates"); + + migrationBuilder.DropTable( + name: "accounts"); + + migrationBuilder.DropTable( + name: "zones"); + } + } +} diff --git a/SystemRevivalServer.csproj b/SystemRevivalServer.csproj index fabb35c..3bf1c56 100644 --- a/SystemRevivalServer.csproj +++ b/SystemRevivalServer.csproj @@ -27,4 +27,8 @@ + + + + diff --git a/data/entities/DungeonCharacterItem.cs b/data/entities/DungeonCharacterItem.cs index 1dc68ce..4ab4824 100644 --- a/data/entities/DungeonCharacterItem.cs +++ b/data/entities/DungeonCharacterItem.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations.Schema; using Server.Data.Enums; namespace Server.Data.Entities; - /// /// Actual item instance owned by a character (inventory or equipped) /// @@ -12,20 +11,21 @@ public class DungeonCharacterItem { [Key] public ulong Id { get; set; } - + public ulong CharacterId { get; set; } public int ItemDefinitionId { get; set; } - + public int Quantity { get; set; } = 1; - public int SlotIndex { get; set; } // Inventory position (0-29 for example), -1 if equipped - + public int SlotIndex { get; set; } // Inventory position (0-29), or -1 if equipped + public bool IsEquipped { get; set; } = false; public DungeonEquipmentSlot? EquipSlot { get; set; } - + public DateTime AcquiredAt { get; set; } = DateTime.UtcNow; - + // Navigation public virtual DungeonCharacter? Character { get; set; } + [ForeignKey(nameof(ItemDefinitionId))] public virtual DungeonItemDefinition? ItemDefinition { get; set; } }