-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Decrabbityyy <[email protected]>
- Loading branch information
1 parent
47b819d
commit 843492e
Showing
18 changed files
with
538 additions
and
6 deletions.
There are no files selected for viewing
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
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,26 @@ | ||
namespace Lagrange.Core.Event.EventArg; | ||
|
||
public class PinChangedEvent : EventBase | ||
{ | ||
public ChatType Type { get; } | ||
|
||
public uint Uin { get; } | ||
|
||
public bool IsPin { get; } | ||
|
||
public PinChangedEvent(ChatType type, uint uin, bool isPin) | ||
{ | ||
Type = type; | ||
Uin = uin; | ||
IsPin = isPin; | ||
|
||
EventMessage = $"{nameof(PinChangedEvent)} {{ChatType: {Type} | Uin: {Uin} | IsPin: {IsPin}}}"; | ||
} | ||
|
||
public enum ChatType | ||
{ | ||
Friend, | ||
Group, | ||
Service | ||
} | ||
} |
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
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
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
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
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,42 @@ | ||
namespace Lagrange.Core.Internal.Event.Action; | ||
|
||
internal class FetchPinsEvent : ProtocolEvent | ||
{ | ||
internal List<string> FriendUids { get; set; } | ||
|
||
public List<uint> FriendUins { get; set; } | ||
|
||
public List<uint> GroupUins { get; set; } | ||
|
||
public string Message { get; set; } | ||
|
||
protected FetchPinsEvent() : base(true) | ||
{ | ||
FriendUids = new(); | ||
FriendUins = new(); | ||
GroupUins = new(); | ||
Message = string.Empty; | ||
} | ||
|
||
protected FetchPinsEvent(List<string> friendUids, List<uint> groupUins) : base(0) | ||
{ | ||
FriendUids = friendUids; | ||
FriendUins = new(); | ||
GroupUins = groupUins; | ||
Message = string.Empty; | ||
} | ||
|
||
protected FetchPinsEvent(int retcode, string message) : base(retcode) | ||
{ | ||
FriendUids = new(); | ||
FriendUins = new(); | ||
GroupUins = new(); | ||
Message = string.Empty; | ||
} | ||
|
||
public static FetchPinsEvent Create() => new(); | ||
|
||
public static FetchPinsEvent Result(List<string> friendUids, List<uint> groupUins) => new(friendUids, groupUins); | ||
|
||
public static FetchPinsEvent Result(int retcode, string message) => new(retcode, message); | ||
} |
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,31 @@ | ||
namespace Lagrange.Core.Internal.Event.Action; | ||
|
||
internal class SetPinFriendEvent : ProtocolEvent | ||
{ | ||
internal string Uid { get; set; } | ||
|
||
public uint Uin { get; set; } | ||
|
||
public bool IsPin { get; set; } | ||
|
||
public string Message { get; set; } | ||
|
||
protected SetPinFriendEvent(uint uin, bool isPin) : base(true) | ||
{ | ||
Uid = string.Empty; | ||
Uin = uin; | ||
Message = string.Empty; | ||
IsPin = isPin; | ||
} | ||
|
||
protected SetPinFriendEvent(int retcode, string message) : base(retcode) | ||
{ | ||
Uid = string.Empty; | ||
Uin = 0; | ||
Message = message; | ||
} | ||
|
||
public static SetPinFriendEvent Create(uint uin, bool isPin) => new(uin, isPin); | ||
|
||
public static SetPinFriendEvent Result(int retcode, string message) => new(retcode, message); | ||
} |
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 @@ | ||
namespace Lagrange.Core.Internal.Event.Action; | ||
|
||
internal class SetPinGroupEvent : ProtocolEvent | ||
{ | ||
public uint Uin { get; set; } | ||
|
||
public bool IsPin { get; set; } | ||
|
||
public string Message { get; set; } | ||
|
||
protected SetPinGroupEvent(uint uin, bool isPin) : base(true) | ||
{ | ||
Uin = uin; | ||
Message = string.Empty; | ||
IsPin = isPin; | ||
} | ||
|
||
protected SetPinGroupEvent(int retcode, string message) : base(retcode) | ||
{ | ||
Uin = 0; | ||
Message = message; | ||
} | ||
|
||
public static SetPinGroupEvent Create(uint uin, bool isPin) => new(uin, isPin); | ||
|
||
public static SetPinGroupEvent Result(int retcode, string message) => new(retcode, message); | ||
} |
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 @@ | ||
namespace Lagrange.Core.Internal.Event.Notify; | ||
|
||
internal class SysPinChangedEvent : ProtocolEvent | ||
{ | ||
public string Uid { get; } | ||
|
||
public uint? GroupUin { get; } | ||
|
||
public bool IsPin { get; } | ||
|
||
private SysPinChangedEvent(string uid, uint? groupUin, bool isPin) : base(0) | ||
{ | ||
Uid = uid; | ||
GroupUin = groupUin; | ||
IsPin = isPin; | ||
} | ||
|
||
public static SysPinChangedEvent Result(string uid, uint? groupUin, bool isPin) => new(uid, groupUin, isPin); | ||
} |
48 changes: 48 additions & 0 deletions
48
Lagrange.Core/Internal/Packets/Message/Notify/FriendDeleteOrPinChanged.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,48 @@ | ||
using ProtoBuf; | ||
|
||
namespace Lagrange.Core.Internal.Packets.Message.Notify; | ||
|
||
#pragma warning disable CS8618 | ||
|
||
// Stupid TX | ||
// TODO: Currently only supports PinChanged | ||
[ProtoContract] | ||
internal class FriendDeleteOrPinChanged | ||
{ | ||
[ProtoMember(1)] public FriendDeleteOrPinChangedBody Body { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class FriendDeleteOrPinChangedBody | ||
{ | ||
// Maybe is type, need check | ||
// 7 Pin changed | ||
// 5 Friend delete | ||
[ProtoMember(2)] public uint Type { get; set; } | ||
|
||
[ProtoMember(20)] public PinChanged? PinChanged { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class PinChanged | ||
{ | ||
[ProtoMember(1)] public PinChangedBody Body { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class PinChangedBody | ||
{ | ||
[ProtoMember(1)] public string Uid { get; set; } | ||
|
||
[ProtoMember(2)] public uint? GroupUin { get; set; } | ||
|
||
[ProtoMember(400)] public PinChangedInfo Info { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class PinChangedInfo | ||
{ | ||
// if (Timestamp.Length != 0) pin | ||
// if (Timestamp.Length == 0) unpin | ||
[ProtoMember(2)] public byte[] Timestamp { get; set; } | ||
} |
32 changes: 32 additions & 0 deletions
32
Lagrange.Core/Internal/Packets/Service/Oidb/Request/OidbSvcTrpcTcp0x5D6_1.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,32 @@ | ||
using ProtoBuf; | ||
|
||
#pragma warning disable CS8618 | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.Oidb.Request; | ||
|
||
[ProtoContract] | ||
[OidbSvcTrpcTcp(0x5d6, 1)] | ||
internal class OidbSvcTrpcTcp0x5D6_1 | ||
{ | ||
[ProtoMember(1)] public uint Field1 { get; set; } | ||
|
||
[ProtoMember(2)] public OidbSvcTrpcTcp0x5D6_1Info Info { get; set; } | ||
|
||
[ProtoMember(3)] public uint Field3 { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class OidbSvcTrpcTcp0x5D6_1Info | ||
{ | ||
[ProtoMember(2)] public uint GroupUin { get; set; } | ||
|
||
[ProtoMember(400)] public OidbSvcTrpcTcp0x5D6_1Field4_2_400 Field400 { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class OidbSvcTrpcTcp0x5D6_1Field4_2_400 | ||
{ | ||
[ProtoMember(1)] public uint Field1 { get; set; } | ||
|
||
[ProtoMember(2)] public byte[] Timestamp { get; set; } | ||
} |
Oops, something went wrong.