-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Lagrange.Core/Internal/Packets/Service/WebSso/Request/OidbSvc0x5d4_0.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
#pragma warning disable CS8618 | ||
// ReSharper disable InconsistentNaming | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso.Request; | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/web.go#L23 | ||
[Serializable] | ||
[WebSso("ti.qq.com", "OidbSvc.0x5d4_0")] | ||
internal class OidbSvc0x5d4_0 | ||
{ | ||
[JsonPropertyName("uin_list")] public uint[] UinList { get; set; } | ||
} |
20 changes: 20 additions & 0 deletions
20
Lagrange.Core/Internal/Packets/Service/WebSso/Request/OidbSvc0xe17_0.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
#pragma warning disable CS8618 | ||
// ReSharper disable InconsistentNaming | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso.Request; | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/web.go#L23 | ||
[Serializable] | ||
[WebSso("ti.qq.com", "OidbSvc.0xe17_0")] | ||
internal class OidbSvc0xe17_0 | ||
{ | ||
[JsonPropertyName("uint64_uin")] public uint Uin { get; set; } | ||
|
||
[JsonPropertyName("uint64_top")] public uint Top { get; set; } = 0; | ||
|
||
[JsonPropertyName("uint32_req_num")] public uint ReqNum { get; set; } = 99; | ||
|
||
[JsonPropertyName("bytes_cookies")] public string Cookies { get; set; } = string.Empty; | ||
} |
9 changes: 9 additions & 0 deletions
9
Lagrange.Core/Internal/Packets/Service/WebSso/Response/OidbSvc0x5d4_0.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso.Response; | ||
|
||
[Serializable] | ||
internal class OidbSvc0x5d4_0 | ||
{ | ||
[JsonPropertyName("ErrorCode")] public int ErrorCode { get; set; } | ||
} |
41 changes: 41 additions & 0 deletions
41
Lagrange.Core/Internal/Packets/Service/WebSso/Response/OidbSvc0xe17_0.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
|
||
#pragma warning disable CS8618 | ||
// ReSharper disable InconsistentNaming | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso.Response; | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/web.go | ||
[Serializable] | ||
internal class OidbSvc0xe17_0 | ||
{ | ||
[JsonPropertyName("rpt_block_list")] public BlockList BlockList { get; set; } | ||
|
||
[JsonPropertyName("ErrorCode")] public int ErrorCode { get; set; } | ||
} | ||
|
||
[Serializable] | ||
internal class BlockList | ||
{ | ||
[JsonPropertyName("uint64_uin")] public uint Uin { get; set; } | ||
|
||
[JsonPropertyName("str_uid")] public string Uid { get; set; } | ||
|
||
[JsonPropertyName("bytes_nick")] public string _nickname { get; set; } | ||
|
||
public string Nickname => | ||
string.IsNullOrEmpty(_nickname) | ||
? string.Empty | ||
: Encoding.UTF8.GetString(Convert.FromBase64String(_nickname)); | ||
|
||
[JsonPropertyName("uint32_age")] public uint Age { get; set; } | ||
|
||
[JsonPropertyName("uint32_sex")] public uint Sex { get; set; } | ||
|
||
[JsonPropertyName("bytes_source")] public string _source { get; set; } | ||
|
||
public string Source => string.IsNullOrEmpty(_source) | ||
? string.Empty | ||
: Encoding.UTF8.GetString(Convert.FromBase64String(_source)); | ||
} |
27 changes: 27 additions & 0 deletions
27
Lagrange.Core/Internal/Packets/Service/WebSso/STServiceMonitReq.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using ProtoBuf; | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso; | ||
|
||
// Resharper disable InconsistentNaming | ||
#pragma warning disable CS8618 | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/pb/web/WebSsoBody.proto | ||
[ProtoContract] | ||
internal class STServiceMonitItem | ||
{ | ||
[ProtoMember(1)] public string? Cmd { get; set; } | ||
|
||
[ProtoMember(2)] public string? URL { get; set; } | ||
|
||
[ProtoMember(3)] public int? ErrCode { get; set; } | ||
|
||
[ProtoMember(4)] public uint? Cost { get; set; } | ||
|
||
[ProtoMember(5)] public uint? Src { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class STServiceMonitReq | ||
{ | ||
[ProtoMember(1)] public STServiceMonitItem[] list { get; set; } | ||
} |
15 changes: 15 additions & 0 deletions
15
Lagrange.Core/Internal/Packets/Service/WebSso/WebSsoAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Lagrange.Core.Internal.Packets.Service.WebSso; | ||
|
||
[AttributeUsage(AttributeTargets.Class)] | ||
internal class WebSsoAttribute : Attribute | ||
{ | ||
public string Host { get; set; } | ||
|
||
public string Cmd { get; set; } | ||
|
||
public WebSsoAttribute(string host, string cmd) | ||
{ | ||
Host = host; | ||
Cmd = cmd; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Lagrange.Core/Internal/Packets/Service/WebSso/WebSsoRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using ProtoBuf; | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso; | ||
|
||
// Resharper disable InconsistentNaming | ||
#pragma warning disable CS8618 | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/pb/web/WebSsoBody.proto | ||
[ProtoContract] | ||
internal class WebSsoRequest | ||
{ | ||
[ProtoMember(1)] public string? Version { get; set; } | ||
|
||
[ProtoMember(2)] public uint? Type { get; set; } | ||
|
||
[ProtoMember(3)] public string? Data { get; set; } | ||
|
||
[ProtoMember(4)] public string? WebData { get; set; } | ||
} |
29 changes: 29 additions & 0 deletions
29
Lagrange.Core/Internal/Packets/Service/WebSso/WebSsoResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using ProtoBuf; | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.WebSso; | ||
|
||
// Resharper disable InconsistentNaming | ||
#pragma warning disable CS8618 | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/pb/web/WebSsoBody.proto | ||
[ProtoContract] | ||
internal class WebSsoResponse | ||
{ | ||
[ProtoMember(1)] public uint? Version { get; set; } | ||
|
||
[ProtoMember(2)] public uint? Type { get; set; } | ||
|
||
[ProtoMember(3)] public uint? Ret { get; set; } | ||
|
||
[ProtoMember(4)] public string? Data { get; set; } | ||
|
||
[ProtoMember(5)] public WebSsoControlData? ControlData { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class WebSsoControlData | ||
{ | ||
[ProtoMember(1)] public uint? Frequency { get; set; } | ||
|
||
[ProtoMember(2)] public uint? PackageSize { get; set; } | ||
} |