diff --git a/client/Main.gd b/client/Main.gd index c9befbe..8f513da 100644 --- a/client/Main.gd +++ b/client/Main.gd @@ -1,12 +1,18 @@ extends Node func _ready(): - %Logout.success.emit() + # %Logout.success.emit() pause(true) %Login.success.connect(on_login) %Logout.success.connect(on_logout) - %Login.send_login() + # %Login.send_login() + + Global.username = "Local" + Global.account_id = "test" + Global.auth_token = "test" + %Login.success.emit() + Global.player = %PlayerAdd.spawn_player(Global.account_id) func _input(event): if event.is_action_pressed("toggle_fullscreen"): diff --git a/client/network/PlayerAdd.gd b/client/network/PlayerAdd.gd index a874177..ef2aadc 100644 --- a/client/network/PlayerAdd.gd +++ b/client/network/PlayerAdd.gd @@ -24,7 +24,6 @@ func handle_packet(data: PackedByteArray): var player := spawn_player(player_id) player.position = server_position player.set_character_name(player_name) - Global.players.add(player) func spawn_player(id: String) -> Player: var player: Player @@ -48,4 +47,5 @@ func spawn_player(id: String) -> Player: player.controller = ProxyController.new(player) player.add_child(player.controller) + Global.players.add(player) return player