Define wrap-safe snapshot sequencing
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
from transport_policy import Delivery, delivery_for_packet_type, is_snapshot_packet
|
||||
from transport_policy import (
|
||||
Delivery,
|
||||
delivery_for_packet_type,
|
||||
is_snapshot_packet,
|
||||
requires_application_sequence,
|
||||
)
|
||||
|
||||
|
||||
def test_snapshot_packets_use_unreliable_sequenced_delivery():
|
||||
@@ -6,6 +11,8 @@ def test_snapshot_packets_use_unreliable_sequenced_delivery():
|
||||
assert delivery_for_packet_type("npcState") is Delivery.UNRELIABLE_SEQUENCED
|
||||
assert is_snapshot_packet("transform")
|
||||
assert is_snapshot_packet("npcState")
|
||||
assert requires_application_sequence("transform")
|
||||
assert requires_application_sequence("npcState")
|
||||
|
||||
|
||||
def test_gameplay_and_control_packets_use_reliable_ordered_delivery():
|
||||
@@ -25,7 +32,9 @@ def test_gameplay_and_control_packets_use_reliable_ordered_delivery():
|
||||
for packet_type in reliable_types:
|
||||
assert delivery_for_packet_type(packet_type) is Delivery.RELIABLE_ORDERED
|
||||
assert not is_snapshot_packet(packet_type)
|
||||
assert not requires_application_sequence(packet_type)
|
||||
|
||||
|
||||
def test_unknown_packet_types_never_default_to_unreliable():
|
||||
assert delivery_for_packet_type("futureControlPacket") is Delivery.RELIABLE_ORDERED
|
||||
assert not requires_application_sequence("futureControlPacket")
|
||||
|
||||
Reference in New Issue
Block a user