-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[All] Fix the issue of sending super emoticons and some other normal …
…emoticons (#618) * [Core] Correction of some field names in QFaceExtra * [Core] Correction of some field names in QFaceExtra x2 * [Core] Introduce `0x9154_1` & spilt `QFaceExtra` * [Core] faceId >= 260 * [All] Fix the issue of sending super emoticons & add JoinEmojiChan * [Core] Always send small face by default * [Core] resolve #618 (comment) & #618 (comment)
- Loading branch information
Showing
23 changed files
with
584 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
namespace Lagrange.Core.Common.Entity; | ||
|
||
[Serializable] | ||
public class SysFaceEntry | ||
{ | ||
public string QSid { get; set; } | ||
|
||
public string? QDes { get; set; } | ||
|
||
public string? EMCode { get; set; } | ||
|
||
public int? QCid { get; set; } | ||
|
||
public int? AniStickerType { get; set; } | ||
|
||
public int? AniStickerPackId { get; set; } | ||
|
||
public int? AniStickerId { get; set; } | ||
|
||
public string? Url { get; set; } | ||
|
||
public string[]? EmojiNameAlias { get; set; } | ||
|
||
public int? AniStickerWidth { get; set; } | ||
|
||
public int? AniStickerHeight { get; set; } | ||
|
||
public SysFaceEntry(string qSid, string? qDes, string? emCode, int? qCid, int? aniStickerType, | ||
int? aniStickerPackId, int? aniStickerId, string? url, string[]? emojiNameAlias, int? aniStickerWidth, | ||
int? aniStickerHeight) | ||
{ | ||
QSid = qSid; | ||
QDes = qDes; | ||
EMCode = emCode; | ||
QCid = qCid; | ||
AniStickerType = aniStickerType; | ||
AniStickerPackId = aniStickerPackId; | ||
AniStickerId = aniStickerId; | ||
Url = url; | ||
EmojiNameAlias = emojiNameAlias; | ||
AniStickerWidth = aniStickerWidth; | ||
AniStickerHeight = aniStickerHeight; | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class SysFacePackEntry | ||
{ | ||
public string EmojiPackName { get; set; } | ||
|
||
public SysFaceEntry[] Emojis { get; set; } | ||
|
||
public SysFacePackEntry(string emojiPackName, SysFaceEntry[] emojis) | ||
{ | ||
EmojiPackName = emojiPackName; | ||
Emojis = emojis; | ||
} | ||
|
||
public uint[] GetUniqueSuperQSids((int AniStickerType, int AniStickerPackId)[] excludeAniStickerTypesAndPackIds) | ||
=> Emojis | ||
.Where(e => e.AniStickerType is not null | ||
&& e.AniStickerPackId is not null | ||
&& !excludeAniStickerTypesAndPackIds.Contains((e.AniStickerType.Value, e.AniStickerPackId.Value))) | ||
.Select(e => uint.Parse(e.QSid)) | ||
.Distinct() | ||
.ToArray(); | ||
} |
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
14 changes: 14 additions & 0 deletions
14
Lagrange.Core/Internal/Event/Action/FriendJoinEmojiChainEvent.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 @@ | ||
namespace Lagrange.Core.Internal.Event.Action; | ||
|
||
internal class FriendJoinEmojiChainEvent : JoinEmojiChainEvent | ||
{ | ||
private FriendJoinEmojiChainEvent(uint targetMessageSeq, uint targetFaceId, string friendUid) : base(targetMessageSeq, targetFaceId) | ||
{ | ||
FriendUid = friendUid; | ||
} | ||
|
||
private FriendJoinEmojiChainEvent(int resultCode) : base(resultCode) { } | ||
|
||
public static FriendJoinEmojiChainEvent Create(uint targetMessageSeq, uint targetFaceId, string friendUid) | ||
=> new(targetMessageSeq, targetFaceId, friendUid); | ||
} |
14 changes: 14 additions & 0 deletions
14
Lagrange.Core/Internal/Event/Action/GroupJoinEmojiChainEvent.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 @@ | ||
namespace Lagrange.Core.Internal.Event.Action; | ||
|
||
internal class GroupJoinEmojiChainEvent : JoinEmojiChainEvent | ||
{ | ||
private GroupJoinEmojiChainEvent(uint targetMessageSeq, uint targetFaceId, uint groupUin) : base(targetMessageSeq, targetFaceId) | ||
{ | ||
GroupUin = groupUin; | ||
} | ||
|
||
private GroupJoinEmojiChainEvent(int resultCode) : base(resultCode) { } | ||
|
||
public static GroupJoinEmojiChainEvent Create(uint targetMessageSeq, uint targetFaceId, uint groupUin) | ||
=> new(targetMessageSeq, targetFaceId, groupUin); | ||
} |
22 changes: 22 additions & 0 deletions
22
Lagrange.Core/Internal/Event/Action/JoinEmojiChainEvent.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,22 @@ | ||
namespace Lagrange.Core.Internal.Event.Action; | ||
|
||
internal class JoinEmojiChainEvent : ProtocolEvent | ||
{ | ||
public uint TargetMessageSeq { get; set; } | ||
|
||
public uint TargetFaceId { get; set; } | ||
|
||
public uint? GroupUin { get; set; } | ||
|
||
public string? FriendUid { get; set; } | ||
|
||
protected JoinEmojiChainEvent(uint targetMessageSeq, uint targetFaceId) : base(true) | ||
{ | ||
TargetMessageSeq = targetMessageSeq; | ||
TargetFaceId = targetFaceId; | ||
} | ||
|
||
protected JoinEmojiChainEvent(int resultCode) : base(resultCode) { } | ||
|
||
public static JoinEmojiChainEvent Result(int resultCode) => new(resultCode); | ||
} |
22 changes: 22 additions & 0 deletions
22
Lagrange.Core/Internal/Event/System/FetchFullSysFacesEvent.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,22 @@ | ||
using Lagrange.Core.Common.Entity; | ||
|
||
namespace Lagrange.Core.Internal.Event.System; | ||
|
||
internal class FetchFullSysFacesEvent : ProtocolEvent | ||
{ | ||
public List<SysFacePackEntry> FacePacks { get; set; } | ||
|
||
private FetchFullSysFacesEvent(List<SysFacePackEntry> facePacks) : base(true) | ||
{ | ||
FacePacks = facePacks; | ||
} | ||
|
||
private FetchFullSysFacesEvent(int resultCode, List<SysFacePackEntry> facePacks) : base(resultCode) | ||
{ | ||
FacePacks = facePacks; | ||
} | ||
|
||
public static FetchFullSysFacesEvent Create() => new(new List<SysFacePackEntry>()); | ||
|
||
public static FetchFullSysFacesEvent Result(int resultCode, List<SysFacePackEntry> emojiPacks) => new(resultCode, emojiPacks); | ||
} |
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
13 changes: 7 additions & 6 deletions
13
Lagrange.Core/Internal/Packets/Message/Element/Implementation/Extra/QSmallFaceExtra.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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
using ProtoBuf; | ||
|
||
|
||
#pragma warning disable CS8618 | ||
namespace Lagrange.Core.Internal.Packets.Message.Element.Implementation.Extra; | ||
|
||
/// <summary> | ||
/// Constructed at <see cref="CommonElem"/>, Service Type 33, Small face (FaceId >= 260) | ||
/// </summary> | ||
[ProtoContract] | ||
internal class QSmallFaceExtra | ||
{ | ||
[ProtoMember(1)] public uint FaceId { get; set; } | ||
[ProtoMember(2)] public string Preview { get; set; } | ||
[ProtoMember(3)] public string Preview2 { get; set; } | ||
|
||
[ProtoMember(2)] public string? Text { get; set; } | ||
|
||
[ProtoMember(3)] public string? CompatText { get; set; } | ||
} |
24 changes: 24 additions & 0 deletions
24
Lagrange.Core/Internal/Packets/Service/Oidb/Request/OidbSvcTrpcTcp.0x90EE_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,24 @@ | ||
using ProtoBuf; | ||
|
||
#pragma warning disable CS8618 | ||
// ReSharper disable InconsistentNaming | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.Oidb.Request; | ||
|
||
[ProtoContract] | ||
[OidbSvcTrpcTcp(0x90EE, 1)] | ||
internal class OidbSvcTrpcTcp0x90EE_1 | ||
{ | ||
[ProtoMember(1)] public uint FaceId { get; set; } | ||
|
||
[ProtoMember(2)] public uint TargetMsgSeq { get; set; } | ||
|
||
[ProtoMember(3)] public uint TargetMsgSeq_2 { get; set; } | ||
|
||
[ProtoMember(4)] public int Field4 { get; set; } // group 2 friend 1 ? | ||
|
||
[ProtoMember(5)] public uint? TargetGroupId { get; set; } | ||
|
||
[ProtoMember(6)] public string? TargetUid { get; set; } | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
Lagrange.Core/Internal/Packets/Service/Oidb/Request/OidbSvcTrpcTcp0x9154_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,17 @@ | ||
using ProtoBuf; | ||
|
||
#pragma warning disable CS8618 | ||
// ReSharper disable InconsistentNaming | ||
|
||
namespace Lagrange.Core.Internal.Packets.Service.Oidb.Request; | ||
|
||
[ProtoContract] | ||
[OidbSvcTrpcTcp(0x9154, 1)] | ||
internal class OidbSvcTrpcTcp0x9154_1 | ||
{ | ||
[ProtoMember(1)] public int Field1 { get; set; } // 0 | ||
|
||
[ProtoMember(2)] public int Field2 { get; set; } // 7 | ||
|
||
[ProtoMember(3)] public string Field3 { get; set; } // 0 | ||
} |
Oops, something went wrong.