feat: advance paused action snapshots to protocol v7
This commit is contained in:
parent
4c55fb6a15
commit
ad1af31492
6 changed files with 71 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class_name NetworkProtocol
|
||||
extends RefCounted
|
||||
|
||||
const PROTOCOL_VERSION: int = 6
|
||||
const PROTOCOL_VERSION: int = 7
|
||||
const GAME_BUILD: String = "prealpha"
|
||||
const MAX_GAME_VERSION_LENGTH: int = 64
|
||||
const MAX_DISPLAY_NAME_LENGTH: int = 24
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const AUTHENTICATION_TIMEOUT_SECONDS: float = 60.0
|
|||
const INPUT_INTERVAL: float = 1.0 / 30.0
|
||||
const SNAPSHOT_INTERVAL: float = 1.0 / 30.0
|
||||
const MOVEMENT_SNAPSHOT_BATCH_SIZE: int = 8
|
||||
const MOVEMENT_SNAPSHOT_FIELD_COUNT: int = 12
|
||||
const MOVEMENT_SNAPSHOT_FIELD_COUNT: int = 13
|
||||
const MAX_MOVEMENT_INPUT_SEQUENCE: int = 2147483647
|
||||
const MAX_MOVEMENT_ONE_WAY_TRANSIT_SECONDS: float = 0.25
|
||||
|
||||
|
|
@ -1837,6 +1837,7 @@ static func _encode_movement_snapshot(snapshot: Dictionary) -> Array:
|
|||
str(action["id"]),
|
||||
int(action["sequence"]),
|
||||
float(action["elapsed"]),
|
||||
bool(action.get("paused", false)),
|
||||
bool(snapshot.get("sitting", false)),
|
||||
bool(snapshot.get("casting", false)),
|
||||
]
|
||||
|
|
@ -1860,6 +1861,7 @@ static func _decode_movement_snapshot(value: Variant) -> Dictionary:
|
|||
or typeof(fields[9]) not in [TYPE_FLOAT, TYPE_INT]
|
||||
or typeof(fields[10]) != TYPE_BOOL
|
||||
or typeof(fields[11]) != TYPE_BOOL
|
||||
or typeof(fields[12]) != TYPE_BOOL
|
||||
):
|
||||
return {}
|
||||
var position: Vector3 = fields[2]
|
||||
|
|
@ -1880,9 +1882,10 @@ static func _decode_movement_snapshot(value: Variant) -> Dictionary:
|
|||
StringName(str(fields[7])),
|
||||
int(fields[8]),
|
||||
float(fields[9]),
|
||||
bool(fields[10]),
|
||||
),
|
||||
"sitting": bool(fields[10]),
|
||||
"casting": bool(fields[11]),
|
||||
"sitting": bool(fields[11]),
|
||||
"casting": bool(fields[12]),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue