mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
Fixed an issue where data is too long in MySQL mode
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user