diff --git a/scripts/global/signaller_client.gd b/scripts/global/signaller_client.gd index 72f7d60..d5d5938 100644 --- a/scripts/global/signaller_client.gd +++ b/scripts/global/signaller_client.gd @@ -32,7 +32,6 @@ signal connection_failure signal disconnected onready var websocket: WebSocketClient = WebSocketClient.new() -# TODO: setget these? onready var client_id = null onready var display_name = DEFAULT_DISPLAY_NAME setget set_display_name onready var peer_id = null diff --git a/scripts/screens/game.gd b/scripts/screens/game.gd index 4a8d1fd..807c3e0 100644 --- a/scripts/screens/game.gd +++ b/scripts/screens/game.gd @@ -3,6 +3,7 @@ extends Node2D onready var player = preload("res://objects/player.tscn") func _ready(): + # TODO: probably have to wait for all peers to be ready before we add players rpc("add_player", get_tree().get_network_unique_id()) func _process(delta): diff --git a/scripts/screens/lobby_browser.gd b/scripts/screens/lobby_browser.gd index 5dfd9c9..837ac2c 100644 --- a/scripts/screens/lobby_browser.gd +++ b/scripts/screens/lobby_browser.gd @@ -1,7 +1,5 @@ extends Control -# TODO: rename to server browser - onready var is_loaded = false onready var lobbies_grid = $v/body/p/lobbies @@ -58,7 +56,6 @@ func _on_join_pressed(): Global.signaller_client.join_lobby(lobbies.get_item_metadata(items[0])["id"]) func _lobby_data(new_lobbies: Array): - # TODO: handle scrolling so that the user is never too jarred (like chat) for l in new_lobbies: if lobbies.has(l.id): _update_lobby(l.id, l) else: _add_lobby(l.id, l) diff --git a/scripts/screens/multiplayer_lobby.gd b/scripts/screens/multiplayer_lobby.gd index a68f28c..6f2aa1f 100644 --- a/scripts/screens/multiplayer_lobby.gd +++ b/scripts/screens/multiplayer_lobby.gd @@ -141,6 +141,7 @@ remotesync func set_ready(ready): var from = get_tree().get_rpc_sender_id() print(from) peer_by_peer_id(from).ready = ready + if is_host: update_can_start() func _on_TextEdit_text_entered(_new_text): if !send_button.disabled: diff --git a/server.ts b/server.ts index ede7fb6..700e4d1 100644 --- a/server.ts +++ b/server.ts @@ -8,7 +8,7 @@ type ID = string; // app state const allLobbies = new Map(); const allClients = new Map(); -// TODO: client index by id +// TODO: client index by id? interface DataMessage { type: string; @@ -336,7 +336,7 @@ function parseMessage(message: string): { type: string; data?: ServerData } { // events function onMessage(client: Client, ev: MessageEvent) { - // TODO: log who from? + // TODO: log who from? IPs etc.? const msg = parseMessage(ev.data); if (msg.type === "pong") return; console.log("Client Message Received", msg);