WIP: Handle player disconnected
This commit is contained in:
@ -32,6 +32,10 @@ func spawn_players(spawn_location: SpawnController, id: int) -> Error:
|
||||
|
||||
func remove_player(id: int) -> Error:
|
||||
if multiplayer.is_server():
|
||||
_get_root().find_child("PlayerPlaceholder_" + str(id)).queue_free()
|
||||
var found_childen: Array[Node] =_get_root().get_children()
|
||||
for found_child in found_childen:
|
||||
if found_child.owner_id:
|
||||
if found_child.owner_id == id:
|
||||
found_child.queue_free()
|
||||
return OK
|
||||
return ERR_UNAUTHORIZED
|
||||
|
Reference in New Issue
Block a user