Ship mostly works #10

Merged
chrisbell merged 60 commits from feature/ship-syncing into develop 2024-12-29 04:35:51 +00:00
Showing only changes of commit 13a1845e6b - Show all commits

View File

@ -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:
@ -176,4 +178,4 @@ func _handle_ship_sync_rotation(rot: Vector3):
angular_velocity = delta_rot.get_euler() / delta_time
# Apply server rotation directly
global_rotation = Quaternion.from_euler(rot).get_euler()
global_rotation = Quaternion.from_euler(rot).get_euler()