Sync player piloting state
This commit is contained in:
parent
fa7c562bb5
commit
13a1845e6b
@ -143,13 +143,15 @@ func _on_property_update(uuid: String, property_name: String, value: Variant):
|
||||
_handle_ship_sync_rotation(value)
|
||||
else:
|
||||
node.set(property_name, value)
|
||||
|
||||
else:
|
||||
printerr("Received property update but node_id is wrong? Expected " + str(uuid) + " but got " + str(uuid))
|
||||
|
||||
func _sync_piloting_state():
|
||||
NetworkManager.sync_property(network_uuid, "ship_is_piloted", ship_is_piloted)
|
||||
NetworkManager.sync_property(network_uuid, "piloting_player", piloting_player)
|
||||
if piloting_player != null:
|
||||
NetworkManager.sync_property(network_uuid, "piloting_player", piloting_player.network_uuid)
|
||||
else:
|
||||
NetworkManager.sync_property(network_uuid, "piloting_player", "")
|
||||
|
||||
func _send_ship_sync():
|
||||
if Time.get_ticks_msec() - last_sync_time > sync_interval * 1000:
|
||||
|
Loading…
Reference in New Issue
Block a user