Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,6 +43,7 @@ async def echo(websocket):
|
|
| 43 |
if key != jm["token"]:
|
| 44 |
if time.time() * 1000 - value["time"] < timout:
|
| 45 |
players.append({"pos": value["pos"], "name": value["name"], "color": value["color"]})
|
|
|
|
| 46 |
for key, value in b.items():
|
| 47 |
if type(value) is list:
|
| 48 |
for i in value:
|
|
@@ -52,7 +53,6 @@ async def echo(websocket):
|
|
| 52 |
if (time.time() - value["time"] / 1000) * 60 <= 420:
|
| 53 |
bullets.append(value)
|
| 54 |
await websocket.send(json.dumps({"type": "bullet", "data": bullets}))
|
| 55 |
-
await websocket.send(json.dumps({"type": "update", "data": {"players": players}}))
|
| 56 |
elif jm["type"] == "bullet":
|
| 57 |
print(jm)
|
| 58 |
if jm["token"] not in b.keys():
|
|
|
|
| 43 |
if key != jm["token"]:
|
| 44 |
if time.time() * 1000 - value["time"] < timout:
|
| 45 |
players.append({"pos": value["pos"], "name": value["name"], "color": value["color"]})
|
| 46 |
+
await websocket.send(json.dumps({"type": "update", "data": {"players": players}}))
|
| 47 |
for key, value in b.items():
|
| 48 |
if type(value) is list:
|
| 49 |
for i in value:
|
|
|
|
| 53 |
if (time.time() - value["time"] / 1000) * 60 <= 420:
|
| 54 |
bullets.append(value)
|
| 55 |
await websocket.send(json.dumps({"type": "bullet", "data": bullets}))
|
|
|
|
| 56 |
elif jm["type"] == "bullet":
|
| 57 |
print(jm)
|
| 58 |
if jm["token"] not in b.keys():
|