Harden home exits and interior presentation
This commit is contained in:
parent
76b4f19e4d
commit
ac82a28f3b
4 changed files with 114 additions and 32 deletions
|
|
@ -63,6 +63,8 @@ func setup(
|
|||
_session.peer_authenticated.connect(_on_peer_authenticated)
|
||||
if not _session.peer_removed.is_connected(_on_peer_removed):
|
||||
_session.peer_removed.connect(_on_peer_removed)
|
||||
if not _spawn_service.avatar_spawned.is_connected(_on_avatar_spawned):
|
||||
_spawn_service.avatar_spawned.connect(_on_avatar_spawned)
|
||||
if not _local_home.changed.is_connected(_on_local_home_changed):
|
||||
_local_home.changed.connect(_on_local_home_changed)
|
||||
|
||||
|
|
@ -1126,11 +1128,8 @@ func _process_transition_request(peer_id: int, data: Dictionary) -> void:
|
|||
if (
|
||||
_session.get_peer_space(peer_id)
|
||||
!= NetworkHomeProtocolType.make_space_id(owner_fingerprint)
|
||||
or not _world_service.is_avatar_near_interior_exit(
|
||||
avatar, owner_fingerprint
|
||||
)
|
||||
):
|
||||
_send_transition_rejection(peer_id, "Move closer to the home door.")
|
||||
_send_transition_rejection(peer_id, "You are not inside that home.")
|
||||
return
|
||||
_apply_host_transition(
|
||||
peer_id,
|
||||
|
|
@ -1276,6 +1275,15 @@ func _refresh_peer_visibility() -> void:
|
|||
)
|
||||
|
||||
|
||||
func _on_avatar_spawned(peer_id: int, _avatar: Player) -> void:
|
||||
var local_peer_id: int = _session.get_local_peer_id()
|
||||
if local_peer_id <= 0 or peer_id == local_peer_id:
|
||||
return
|
||||
_spawn_service.set_peer_presentation_visible(
|
||||
peer_id, _session.peers_share_space(local_peer_id, peer_id)
|
||||
)
|
||||
|
||||
|
||||
func _on_local_home_changed() -> void:
|
||||
if _suppress_local_submission or _publish_queued:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue