binding: FeatureFlags.TagSharedExtra, protocol 11 (TICKET-433, v1.6.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa14698115
commit
c0dfa8ef19
2 files changed
+15
-7
No files matched your search
@@ -158,7 +158,7 @@ namespace YGOLegacy.Protocol.Tests
|
||||
Assert.That((int)StocCodecs.SeatResumeResult.Id, Is.EqualTo(0x57));
|
||||
Assert.That((int)StocCodecs.RestartOpened.Id, Is.EqualTo(0x58));
|
||||
Assert.That(FeatureFlags.RulesRestart, Is.EqualTo(0x10));
|
||||
Assert.That(FeatureFlags.All, Is.EqualTo(0x37FB));
|
||||
Assert.That(FeatureFlags.All, Is.EqualTo(0x77FB));
|
||||
|
||||
var id = Enumerable.Repeat((byte)0xAB, 16).ToArray();
|
||||
var token = Enumerable.Range(1, 16).Select(i => (byte)i).ToArray();
|
||||
@@ -273,11 +273,18 @@ namespace YGOLegacy.Protocol.Tests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TagTwoFields_Flag_AndProtocol_ArePinned_0x1000_10()
|
||||
public void TagTwoFields_Flag_IsPinned_0x1000()
|
||||
{
|
||||
Assert.That(FeatureFlags.TagTwoFields, Is.EqualTo(0x1000));
|
||||
Assert.That(FeatureFlags.All & FeatureFlags.TagTwoFields, Is.EqualTo(FeatureFlags.TagTwoFields));
|
||||
Assert.That(Capability.ProtocolVersion, Is.EqualTo(10));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TagSharedExtra_Flag_AndProtocol_ArePinned_0x4000_11()
|
||||
{
|
||||
Assert.That(FeatureFlags.TagSharedExtra, Is.EqualTo(0x4000));
|
||||
Assert.That(FeatureFlags.All & FeatureFlags.TagSharedExtra, Is.EqualTo(FeatureFlags.TagSharedExtra));
|
||||
Assert.That(Capability.ProtocolVersion, Is.EqualTo(11));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -286,7 +293,6 @@ namespace YGOLegacy.Protocol.Tests
|
||||
Assert.That((int)StocCodecs.TagPartnerCards.Id, Is.EqualTo(0x5F));
|
||||
Assert.That(FeatureFlags.TagPartnerCards, Is.EqualTo(0x2000));
|
||||
Assert.That(FeatureFlags.All & FeatureFlags.TagPartnerCards, Is.EqualTo(FeatureFlags.TagPartnerCards));
|
||||
Assert.That(Capability.ProtocolVersion, Is.EqualTo(10));
|
||||
Assert.That(TagPartnerCardsCodec.HeaderSize, Is.EqualTo(7));
|
||||
|
||||
var faceUpPendulum = 0x80000000u | 16178681u;
|
||||
@@ -430,7 +436,7 @@ namespace YGOLegacy.Protocol.Tests
|
||||
{
|
||||
var bytes = Bytes(w => LobbyCodecs.Capability.Write(w, new Capability(Capability.ProtocolVersion, FeatureFlags.All)));
|
||||
|
||||
Assert.That(bytes, Is.EqualTo(Concat(Le16(10), Le32(0x37FB))));
|
||||
Assert.That(bytes, Is.EqualTo(Concat(Le16(11), Le32(0x77FB))));
|
||||
|
||||
var read = LobbyCodecs.Capability.Read(Reader(bytes));
|
||||
Assert.That(read.Protocol, Is.EqualTo(Capability.ProtocolVersion));
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace YGOLegacy.Protocol.Contracts
|
||||
{
|
||||
public const uint Appearance = 0x1;
|
||||
public const uint Dialogue = 0x2;
|
||||
public const uint All = Appearance | Dialogue | SeatPlan | RulesRestart | SeatState | LobbyAfterMatch | CoinToss | DeckList | Profile | AttackPreview | TagTwoFields | TagPartnerCards;
|
||||
public const uint All = Appearance | Dialogue | SeatPlan | RulesRestart | SeatState | LobbyAfterMatch | CoinToss | DeckList | Profile | AttackPreview | TagTwoFields | TagPartnerCards | TagSharedExtra;
|
||||
// Server-only: the host relays setup pairs (0x43); a client never advertises it.
|
||||
public const uint SetupPairs = 0x4;
|
||||
// Server: chosen seats (0x50-0x53). Client: it renders the seat plan.
|
||||
@@ -29,6 +29,8 @@ namespace YGOLegacy.Protocol.Contracts
|
||||
public const uint TagTwoFields = 0x1000;
|
||||
// Server: tag partner cards (0x5F): the waiting teammate's hand, Extra Deck and deck go to that side's two seats. Client: the partner view shows them.
|
||||
public const uint TagPartnerCards = 0x2000;
|
||||
// Server: with the setup pair ygol.tag.extra=shared a Tag team has one Extra Deck and its Extra Deck refreshes carry the partner each card came from; a Tag room refuses a joiner without the bit. Client: it reads the value and refuses a host without the bit.
|
||||
public const uint TagSharedExtra = 0x4000;
|
||||
// Client role, not a feature: set only on the room host's own line, so every peer can badge the host's seat.
|
||||
public const uint RoomHost = 0x80000000;
|
||||
}
|
||||
@@ -58,7 +60,7 @@ namespace YGOLegacy.Protocol.Contracts
|
||||
|
||||
public readonly struct Capability
|
||||
{
|
||||
public const ushort ProtocolVersion = 10;
|
||||
public const ushort ProtocolVersion = 11;
|
||||
public const int ServerSender = 0xFF;
|
||||
|
||||
public ushort Protocol { get; }
|
||||
|
||||
Reference in new issue
Block a user