Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] style beautify #635

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 61 additions & 3 deletions Lagrange.Core/Internal/Service/System/FetchUserInfoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,46 @@ namespace Lagrange.Core.Internal.Service.System;
[Service("OidbSvcTrpcTcp.0xfe1_2")]
internal class FetchUserInfoService : BaseService<FetchUserInfoEvent>
{
private static readonly List<OidbSvcTrpcTcp0xFE1_2Key> _keys = new() {
new() { Key = 20002 }, new() { Key = 27394 }, new() { Key = 20009 }, new() { Key = 20031 }, new() { Key = 101 }, new() { Key = 103 }, new() { Key = 102 }, new() { Key = 20022 }, new() { Key = 20023 }, new() { Key = 20024 }, new() { Key = 24002 }, new() { Key = 27037 }, new() { Key = 27049 }, new() { Key = 20011 }, new() { Key = 20016 }, new() { Key = 20021 }, new() { Key = 20003 }, new() { Key = 20004 }, new() { Key = 20005 }, new() { Key = 20006 }, new() { Key = 20020 }, new() { Key = 20026 }, new() { Key = 24007 }, new() { Key = 104 }, new() { Key = 105 }, new() { Key = 42432 }, new() { Key = 42362 }, new() { Key = 41756 }, new() { Key = 41757 }, new() { Key = 42257 }, new() { Key = 27372 }, new() { Key = 42315 }, new() { Key = 107 }, new() { Key = 45160 }, new() { Key = 45161 }, new() { Key = 27406 }, new() { Key = 62026 }, new() { Key = 20037 }
private static readonly List<OidbSvcTrpcTcp0xFE1_2Key> _keys = new()
{
new() { Key = 20002 },
new() { Key = 27394 },
new() { Key = 20009 },
new() { Key = 20031 },
new() { Key = 101 },
new() { Key = 103 },
new() { Key = 102 },
new() { Key = 20022 },
new() { Key = 20023 },
new() { Key = 20024 },
new() { Key = 24002 },
new() { Key = 27037 },
new() { Key = 27049 },
new() { Key = 20011 },
new() { Key = 20016 },
new() { Key = 20021 },
new() { Key = 20003 },
new() { Key = 20004 },
new() { Key = 20005 },
new() { Key = 20006 },
new() { Key = 20020 },
new() { Key = 20026 },
new() { Key = 24007 },
new() { Key = 104 },
new() { Key = 105 },
new() { Key = 42432 },
new() { Key = 42362 },
new() { Key = 41756 },
new() { Key = 41757 },
new() { Key = 42257 },
new() { Key = 27372 },
new() { Key = 42315 },
new() { Key = 107 },
new() { Key = 45160 },
new() { Key = 45161 },
new() { Key = 27406 },
new() { Key = 62026 },
new() { Key = 20037 }
};

protected override bool Build(FetchUserInfoEvent input, BotKeystore keystore, BotAppInfo appInfo,
Expand Down Expand Up @@ -82,7 +120,27 @@ protected override bool Parse(Span<byte> input, BotKeystore keystore, BotAppInfo
string? school = Encoding.UTF8.GetString(bytesProperties[20021]);
string? sign = Encoding.UTF8.GetString(bytesProperties[102]);

var info = new BotUserInfo(payload.Body.Body.Uin, nickname, avatarurl, birthday, city, country, school, numberProperties[20037], reg, (GenderInfo)numberProperties[20009], qid, numberProperties[105], sign, new() { StatusId = statusId, FaceId = customs?.FaceId ?? 0, Msg = customs?.Msg });
var info = new BotUserInfo(
payload.Body.Body.Uin,
nickname,
avatarurl,
birthday,
city,
country,
school,
numberProperties[20037],
reg,
(GenderInfo)numberProperties[20009],
qid,
numberProperties[105],
sign,
new()
{
StatusId = statusId,
FaceId = customs?.FaceId ?? 0,
Msg = customs?.Msg
}
);

output = FetchUserInfoEvent.Result(0, info);
extraEvents = null;
Expand Down