12 lines
365 B
GDScript3
Raw Normal View History

2024-01-28 15:47:41 +00:00
extends PacketHandler
func handle_packet(data: PackedByteArray, _peer: PacketPeer):
var player_id := data.get_string_from_ascii()
print("[%s] Remove player: %s" % [Global.username, player_id])
var player := %Players.get_node(player_id)
if is_instance_valid(player):
player.queue_free()
else:
push_warning("PlayerRemove: Player with ID %s doesn't exist")