From 0ebd6b87414afb619f872e85b452b04db2045351 Mon Sep 17 00:00:00 2001 From: Linwenxuan Date: Sun, 3 Mar 2024 22:04:01 +0800 Subject: [PATCH] [Core] Fixed wrong and expire message of ForwardEntity --- .../Message/Element/Implementation/SourceMsg.PbPreserve.cs | 4 ++-- Lagrange.Core/Message/Entity/ForwardEntity.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Lagrange.Core/Internal/Packets/Message/Element/Implementation/SourceMsg.PbPreserve.cs b/Lagrange.Core/Internal/Packets/Message/Element/Implementation/SourceMsg.PbPreserve.cs index 6346379e4..58183d594 100644 --- a/Lagrange.Core/Internal/Packets/Message/Element/Implementation/SourceMsg.PbPreserve.cs +++ b/Lagrange.Core/Internal/Packets/Message/Element/Implementation/SourceMsg.PbPreserve.cs @@ -7,12 +7,12 @@ internal partial class SrcMsg [ProtoContract] internal class Preserve { - [ProtoMember(3)] public long? Field3 { get; set; } + [ProtoMember(3)] public long? MessageId { get; set; } [ProtoMember(6)] public string? SenderUid { get; set; } [ProtoMember(7)] public string? ReceiverUid { get; set; } - [ProtoMember(8)] public int? Field8 { get; set; } + [ProtoMember(8)] public uint? MessageSequence { get; set; } } } \ No newline at end of file diff --git a/Lagrange.Core/Message/Entity/ForwardEntity.cs b/Lagrange.Core/Message/Entity/ForwardEntity.cs index 70e40b853..8a7b1dee9 100644 --- a/Lagrange.Core/Message/Entity/ForwardEntity.cs +++ b/Lagrange.Core/Message/Entity/ForwardEntity.cs @@ -36,10 +36,10 @@ IEnumerable IMessageEntity.PackElement() { var reserve = new SrcMsg.Preserve { - Field3 = Random.Shared.Next(0, int.MaxValue), + MessageId = Random.Shared.NextInt64(0, int.MaxValue) | 0x1000000000000000L, ReceiverUid = SelfUid, SenderUid = Uid, - Field8 = Random.Shared.Next(0, 10000) + MessageSequence = Sequence }; using var stream = new MemoryStream(); Serializer.Serialize(stream, reserve);