From 6b04a87978b4ff8385fac97a3065b8b71b68d752 Mon Sep 17 00:00:00 2001 From: Meikel Philipp Date: Wed, 1 Nov 2023 17:01:29 +0100 Subject: [PATCH 1/2] FIX EmpireHandler --- Executables/Game/PacketHandlers/Select/EmpireHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Executables/Game/PacketHandlers/Select/EmpireHandler.cs b/Executables/Game/PacketHandlers/Select/EmpireHandler.cs index 81bf9c93..f03f0adc 100644 --- a/Executables/Game/PacketHandlers/Select/EmpireHandler.cs +++ b/Executables/Game/PacketHandlers/Select/EmpireHandler.cs @@ -22,7 +22,7 @@ public async Task ExecuteAsync(GamePacketContext ctx, CancellationToken { if (ctx.Packet.EmpireId is > 0 and < 4) { - var result = await _db.ExecuteAsync("UPDATE accounts set Empire = @Empire WHERE Id = @AccountId" + var result = await _db.ExecuteAsync("UPDATE account.accounts set Empire = @Empire WHERE Id = @AccountId" , new { AccountId = ctx.Connection.AccountId, Empire = ctx.Packet.EmpireId }); if (result is not 1) { @@ -34,4 +34,4 @@ public async Task ExecuteAsync(GamePacketContext ctx, CancellationToken _logger.LogWarning("Unexpected empire choice {Empire}", ctx.Packet.EmpireId); } } -} \ No newline at end of file +} From d5f53dd9652f2e933f93e45a33bfbd7d0eebd9fd Mon Sep 17 00:00:00 2001 From: Meikel Philipp Date: Wed, 1 Nov 2023 16:59:29 +0100 Subject: [PATCH 2/2] ADD missing migration for empire --- .../20231101165500_AlterAccountAddEmpire.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Executables/Migrator/Migrations/20231101165500_AlterAccountAddEmpire.cs diff --git a/Executables/Migrator/Migrations/20231101165500_AlterAccountAddEmpire.cs b/Executables/Migrator/Migrations/20231101165500_AlterAccountAddEmpire.cs new file mode 100644 index 00000000..15448845 --- /dev/null +++ b/Executables/Migrator/Migrations/20231101165500_AlterAccountAddEmpire.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FluentMigrator; +using QuantumCore.Database; + +namespace QuantumCore.Migrations +{ + [Tags("account")] + [Migration(20231101165500)] + public class AlterAccountAddEmpire : Migration + { + public override void Down() + { + Delete.Column("Empire").FromTable("accounts"); + } + + public override void Up() + { + Alter.Table("accounts").AddColumn("Empire").AsByte().WithDefaultValue(0); + } + } +}