Fix world population race and add multiplayer diagnostics
The world was populated before NetworkManager.world_ready() actually called host()/join(), so owns_world() read true for every peer (including a joining client) and each one built its own local, unreplicated copy instead of the client receiving the server's spawn through the MultiplayerSpawner. Population now happens after the session is actually established. Also adds net-log coverage for spawn/despawn, station gating, item authority handoff, station snapping, avatar spawn/despawn, and scene transitions, so multiplayer behavior is visible in %TEMP%\vryhungry_net_<pid>.log instead of failing silently. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,8 @@ func _on_picked_up(_p) -> void:
|
||||
var by := _pickable.get_picked_up_by()
|
||||
if not (by is XRToolsFunctionPickup):
|
||||
return
|
||||
if NetworkManager.is_online():
|
||||
NetworkManager.log_line("Grabbed %s by hand, requesting authority" % _pickable.name)
|
||||
NetworkManager.request_item_authority.rpc_id(1, _pickable.get_path())
|
||||
|
||||
|
||||
@@ -69,6 +71,8 @@ func _on_dropped(_p) -> void:
|
||||
# apply_held_state() losing authority (see above) must not re-report.
|
||||
if not is_multiplayer_authority():
|
||||
return
|
||||
if NetworkManager.is_online():
|
||||
NetworkManager.log_line("Dropped %s, reporting release to server" % _pickable.name)
|
||||
NetworkManager.release_item_authority.rpc_id(
|
||||
1, _pickable.get_path(), _pickable.linear_velocity, _pickable.angular_velocity
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user