commander update

This commit is contained in:
Laila van Reenen 2024-08-12 19:36:28 +02:00
parent 72b08b631d
commit 6064bd3f70
Signed by: LailaTheElf
GPG Key ID: 1F4E6EE3E6DDF769
2 changed files with 8 additions and 1 deletions

View File

@ -153,6 +153,10 @@
function addBoats(boats)
{
if (boats == "")
{
return;
}
boats = boats.split(':');
for (let boat in boats)
{

View File

@ -148,7 +148,10 @@ async def on_message(message, client):
async def new_client(clientId, ws):
"""handler for every new client connection"""
client = { "id": clientId, "boat": None, "ws": ws, "state": "active" }
print("new client connected: " + client['id'])
if client['id'] == ADMIN_ID:
print("new client connected: admin")
else:
print("new client connected: " + client['id'])
for clie in Clients:
if clie['id'] == client['id']:
clie['state'] = 'terminated'