-
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.
[Core] Implemented FriendRequest Event
- Loading branch information
Linwenxuan
authored and
Linwenxuan
committed
Oct 30, 2023
1 parent
9d9e541
commit e4e796b
Showing
8 changed files
with
84 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
19 changes: 19 additions & 0 deletions
19
Lagrange.Core/Internal/Event/EventArg/FriendRequestEvent.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 @@ | ||
namespace Lagrange.Core.Internal.Event.EventArg; | ||
|
||
public class FriendRequestEvent : EventBase | ||
{ | ||
public uint SourceUin { get; } | ||
|
||
public string Name { get; } | ||
|
||
public string Message { get; } | ||
|
||
internal FriendRequestEvent(uint sourceUin, string name, string message) | ||
{ | ||
SourceUin = sourceUin; | ||
Name = name; | ||
Message = message; | ||
|
||
EventMessage = $"[{nameof(FriendRequestEvent)}]: {SourceUin}:{Name} {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
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
23 changes: 23 additions & 0 deletions
23
Lagrange.Core/Internal/Event/Protocol/Notify/FriendSysRequestEvent.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,23 @@ | ||
namespace Lagrange.Core.Internal.Event.Protocol.Notify; | ||
|
||
internal class FriendSysRequestEvent : ProtocolEvent | ||
{ | ||
public uint SourceUin { get; } | ||
|
||
public string SourceUid { get; } | ||
|
||
public string Message { get; } | ||
|
||
public string Name { get; } | ||
|
||
private FriendSysRequestEvent(uint sourceUin, string sourceUid, string message, string name) : base(0) | ||
{ | ||
SourceUin = sourceUin; | ||
SourceUid = sourceUid; | ||
Message = message; | ||
Name = name; | ||
} | ||
|
||
public static FriendSysRequestEvent Result(uint sourceUin, string sourceUid, string message, string name) => | ||
new(sourceUin, sourceUid, message, name); | ||
} |
25 changes: 25 additions & 0 deletions
25
Lagrange.Core/Internal/Packets/Message/Notify/FriendRequest.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,25 @@ | ||
using ProtoBuf; | ||
|
||
#pragma warning disable CS8618 | ||
|
||
namespace Lagrange.Core.Internal.Packets.Message.Notify; | ||
|
||
[ProtoContract] | ||
internal class FriendRequest | ||
{ | ||
[ProtoMember(1)] public FriendRequestInfo Info { get; set; } | ||
} | ||
|
||
[ProtoContract] | ||
internal class FriendRequestInfo | ||
{ | ||
[ProtoMember(1)] public uint Field0 { get; set; } | ||
|
||
[ProtoMember(2)] public string SourceUid { get; set; } | ||
|
||
[ProtoMember(3)] public string Message { get; set; } | ||
|
||
[ProtoMember(4)] public string Name { get; set; } | ||
|
||
[ProtoMember(5)] public uint Field5 { get; set; } | ||
} |
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