diff --git a/ground-station.py b/ground-station.py index 66b4122..3f1bb27 100644 --- a/ground-station.py +++ b/ground-station.py @@ -59,9 +59,9 @@ async def echoClients(client): async def takeControll(client, boat): global boats - print("DEBUG: " + client['id'] " takes controll of " + boat) + print("DEBUG: " + client['id'] + " takes controll of " + boat) if (client['boat'] is not None): - boat["state"] = BOAT_STATE_AVAILABLE + client['boat']["state"] = BOAT_STATE_AVAILABLE client["boat"] = None for b in boats: if (b['id'] == boat): @@ -75,7 +75,7 @@ async def takeControll(client, boat): print("WARN: takeControll: " + boat["name"] + " not available (" + str(client["id"]) + ")") break else: - print("DEBUG: " boat " != " b['id']) + print("DEBUG: " + boat + " != " + b['id']) async def freeBoat(boat): global boats, clients diff --git a/index.html b/index.html index 58fe7a7..6764c62 100644 --- a/index.html +++ b/index.html @@ -83,7 +83,7 @@ function selectBoat(e) { - connection.send(clientId + ';ctrl;', e.target.id.split('boat')[1]); + connection.send(clientId + ';ctrl;' + e.target.id.split('boat')[1]); console.log('ctrl:', e.target.id.split('boat')[1]); stickEl.style.display = 'block'; boatListEl.style.display = 'none';