You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
534 B
18 lines
534 B
class_name PlayerNetwork |
|
extends Node |
|
|
|
var is_local: bool: |
|
get: return is_multiplayer_authority() |
|
|
|
var peer_id: int: |
|
get: return get_multiplayer_authority() |
|
set(value): |
|
get_parent().set_multiplayer_authority(value) |
|
get_parent().name = str(value) |
|
|
|
@onready var player: Player = get_parent() |
|
|
|
func _ready() -> void: |
|
if not is_local and multiplayer.is_server(): |
|
player.chunk_loader.start_tracking.connect(Game.WORLD.spawn_chunk.bind(peer_id)) |
|
player.chunk_loader.stop_tracking.connect(Game.WORLD.despawn_chunk.bind(peer_id))
|
|
|