diff --git a/Lagrange.Core/Internal/Context/Logic/Implementation/CachingLogic.cs b/Lagrange.Core/Internal/Context/Logic/Implementation/CachingLogic.cs index c47991f80..41eeb06aa 100644 --- a/Lagrange.Core/Internal/Context/Logic/Implementation/CachingLogic.cs +++ b/Lagrange.Core/Internal/Context/Logic/Implementation/CachingLogic.cs @@ -72,22 +72,12 @@ public Task> GetCachedGroups() return _uinToUid.TryGetValue(friendUin, out var uid) ? uid : null; } - public async Task ResolveUin(uint? groupUin, string friendUid) + public async Task ResolveUin(uint? groupUin, string friendUid, bool force = false) { if (_uinToUid.Count == 0) await ResolveFriendsUid(); if (groupUin == null) return _uinToUid.FirstOrDefault(x => x.Value == friendUid).Key; - await CacheUid(groupUin.Value); - - return _uinToUid.FirstOrDefault(x => x.Value == friendUid).Key; - } - - public async Task ForceResolveUint(uint? groupUin, string friendUid) - { - if (_uinToUid.Count == 0) await ResolveFriendsUid(); - if (groupUin == null) return _uinToUid.FirstOrDefault(x => x.Value == friendUid).Key; - - await CacheUid(groupUin.Value, true); + await CacheUid(groupUin.Value, force); return _uinToUid.FirstOrDefault(x => x.Value == friendUid).Key; } diff --git a/Lagrange.Core/Internal/Context/Logic/Implementation/MessagingLogic.cs b/Lagrange.Core/Internal/Context/Logic/Implementation/MessagingLogic.cs index 382772caa..682fda681 100644 --- a/Lagrange.Core/Internal/Context/Logic/Implementation/MessagingLogic.cs +++ b/Lagrange.Core/Internal/Context/Logic/Implementation/MessagingLogic.cs @@ -60,7 +60,7 @@ public override async Task Incoming(ProtocolEvent e) } case GroupSysIncreaseEvent increase: { - uint memberUin = await Collection.Business.CachingLogic.ForceResolveUint(increase.GroupUin, increase.MemberUid) ?? 0; + uint memberUin = await Collection.Business.CachingLogic.ResolveUin(increase.GroupUin, increase.MemberUid, true) ?? 0; uint? invitorUin = null; if (increase.InvitorUid != null) invitorUin = await Collection.Business.CachingLogic.ResolveUin(increase.GroupUin, increase.InvitorUid); var increaseArgs = new GroupMemberIncreaseEvent(increase.GroupUin, memberUin, invitorUin); diff --git a/Lagrange.Core/Internal/Packets/Service/Oidb/Response/OidbSvcTrpcTcp0xFE7_2Response.cs b/Lagrange.Core/Internal/Packets/Service/Oidb/Response/OidbSvcTrpcTcp0xFE7_2Response.cs index 8428f020e..e9f2bba96 100644 --- a/Lagrange.Core/Internal/Packets/Service/Oidb/Response/OidbSvcTrpcTcp0xFE7_2Response.cs +++ b/Lagrange.Core/Internal/Packets/Service/Oidb/Response/OidbSvcTrpcTcp0xFE7_2Response.cs @@ -42,7 +42,7 @@ internal class OidbSvcTrpcTcp0xFE7_2Member [ProtoContract] internal class OidbSvcTrpcTcp0xFE7_2Uin { - [ProtoMember(1)] public string Uid { get; set; } + [ProtoMember(2)] public string Uid { get; set; } [ProtoMember(4)] public uint Uin { get; set; } } diff --git a/Lagrange.Core/Internal/Service/System/FetchMembersService.cs b/Lagrange.Core/Internal/Service/System/FetchMembersService.cs index 7a540d23f..7432ed235 100644 --- a/Lagrange.Core/Internal/Service/System/FetchMembersService.cs +++ b/Lagrange.Core/Internal/Service/System/FetchMembersService.cs @@ -8,6 +8,7 @@ using Lagrange.Core.Internal.Packets.Service.Oidb.Response; using Lagrange.Core.Internal.Service.Abstraction; using Lagrange.Core.Utility.Binary; +using Lagrange.Core.Utility.Extension; using ProtoBuf; namespace Lagrange.Core.Internal.Service.System; @@ -48,6 +49,7 @@ protected override bool Parse(SsoPacket input, BotKeystore keystore, BotAppInfo out FetchMembersEvent output, out List? extraEvents) { var payload = input.Payload.ReadBytes(BinaryPacket.Prefix.Uint32 | BinaryPacket.Prefix.WithPrefix); + Console.WriteLine(payload.Hex()); var response = Serializer.Deserialize>(payload.AsSpan()); var members = response.Body.Members.Select(member =>