debug
This commit is contained in:
parent
d0c0da7ef4
commit
1c90656508
@ -59,11 +59,13 @@ async def echoClients(client):
|
|||||||
|
|
||||||
async def takeControll(client, boat):
|
async def takeControll(client, boat):
|
||||||
global boats
|
global boats
|
||||||
|
print("DEBUG: " + client['id'] " takes controll of " + boat)
|
||||||
if (client['boat'] is not None):
|
if (client['boat'] is not None):
|
||||||
boat["state"] = BOAT_STATE_AVAILABLE
|
boat["state"] = BOAT_STATE_AVAILABLE
|
||||||
client["boat"] = None
|
client["boat"] = None
|
||||||
for b in boats:
|
for b in boats:
|
||||||
if (b['id'] == boat):
|
if (b['id'] == boat):
|
||||||
|
print("DEBUG: boat found")
|
||||||
if (boat['state'] == BOAT_STATE_AVAILABLE):
|
if (boat['state'] == BOAT_STATE_AVAILABLE):
|
||||||
boat["state"] = BOAT_STATE_INCTRL
|
boat["state"] = BOAT_STATE_INCTRL
|
||||||
print("take controll: " + str(client["id"]) + " -> " + boat["name"])
|
print("take controll: " + str(client["id"]) + " -> " + boat["name"])
|
||||||
@ -72,6 +74,8 @@ async def takeControll(client, boat):
|
|||||||
else:
|
else:
|
||||||
print("WARN: takeControll: " + boat["name"] + " not available (" + str(client["id"]) + ")")
|
print("WARN: takeControll: " + boat["name"] + " not available (" + str(client["id"]) + ")")
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
print("DEBUG: " boat " != " b['id'])
|
||||||
|
|
||||||
async def freeBoat(boat):
|
async def freeBoat(boat):
|
||||||
global boats, clients
|
global boats, clients
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user