Fixed an issue where data is too long in MySQL mode

This commit is contained in:
qinfyy
2024-10-06 19:22:31 +08:00
parent eb9d7af201
commit 8c9ab51964
6 changed files with 9 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ public class FriendData : BaseDatabaseDataHelper
[SugarColumn(IsJson = true)] public List<int> ReceiveApplyList { get; set; } = [];
[SugarColumn(IsJson = true)]
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
public Dictionary<int, FriendChatHistory> ChatHistory { get; set; } = []; // key: friend uid
}

View File

@@ -7,7 +7,7 @@ namespace EggLink.DanhengServer.Database.Quests;
[SugarTable("Mission")]
public class MissionData : BaseDatabaseDataHelper
{
[SugarColumn(IsJson = true)]
[SugarColumn(IsJson = true, ColumnDataType = "TEXT")]
public Dictionary<int, Dictionary<int, MissionInfo>> MissionInfo { get; set; } =
[]; // Dictionary<MissionId, Dictionary<SubMissionId, MissionInfo>> // seems like main missionId is not used

View File

@@ -6,7 +6,8 @@ namespace EggLink.DanhengServer.Database.Quests;
[SugarTable("quest_data")]
public class QuestData : BaseDatabaseDataHelper
{
[SugarColumn(IsJson = true)] public Dictionary<int, QuestInfo> Quests { get; set; } = [];
[SugarColumn(IsJson = true, ColumnDataType = "MEDIUMTEXT")]
public Dictionary<int, QuestInfo> Quests { get; set; } = [];
}
public class QuestInfo

View File

@@ -69,7 +69,7 @@ public class Crypto
}
catch (Exception ex)
{
Logger.Error($"An error occurred while loading the Encryption Seed{ex}");
Logger.Error($"An error occurred while loading the Client Secret Key{ex}");
return null;
}
}

View File

@@ -16,7 +16,7 @@ namespace EggLink.DanhengServer.Util.Security
private byte[] Data;
private ulong Seed;
private byte[] xorKey;
private byte[] XorKey;
#pragma warning disable CS8618 // CS8618 - Non-nullable variable must contain a non-null value when exiting constructor.
private Ec2b(byte[] key, byte[] data)
@@ -127,7 +127,7 @@ namespace EggLink.DanhengServer.Util.Security
public byte[] GetXorKey()
{
return xorKey;
return XorKey;
}
private void GenerateDecryptionVector(byte[] key, byte[] crypt)
@@ -154,7 +154,7 @@ namespace EggLink.DanhengServer.Util.Security
output.AddRange(bytes);
}
xorKey = output.ToArray();
XorKey = output.ToArray();
}
private static void KeyScramble(byte[] key)

View File

@@ -134,6 +134,7 @@ public class DanhengConnection
{
if (ConfigManager.Config.GameServer.UsePacketEncryption)
Crypto.Xor(packet, XorKey);
_ = await Conversation.SendAsync(packet, CancelToken.Token);
}
catch
@@ -159,7 +160,6 @@ public class DanhengConnection
try
{
//_ = await Conversation.SendAsync(packetBytes, CancelToken.Token);
await SendPacket(packetBytes);
}
catch