mirror of
https://github.com/yuukiwww/taiko-web.git
synced 2024-10-22 17:05:49 +02:00
allow multiplayer port to be changed
This commit is contained in:
parent
29176e896e
commit
f70cbe44b3
@ -4,6 +4,7 @@ import asyncio
|
|||||||
import websockets
|
import websockets
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
|
import sys
|
||||||
|
|
||||||
server_status = {
|
server_status = {
|
||||||
"waiting": {},
|
"waiting": {},
|
||||||
@ -314,7 +315,9 @@ async def connection(ws, path):
|
|||||||
elif user["action"] == "invite" and user["session"] in server_status["invites"]:
|
elif user["action"] == "invite" and user["session"] in server_status["invites"]:
|
||||||
del server_status["invites"][user["session"]]
|
del server_status["invites"][user["session"]]
|
||||||
|
|
||||||
|
port = int(sys.argv[1]) if len(sys.argv) > 1 else 34802
|
||||||
|
print('Starting server on port %d' % port)
|
||||||
asyncio.get_event_loop().run_until_complete(
|
asyncio.get_event_loop().run_until_complete(
|
||||||
websockets.serve(connection, "localhost", 34802)
|
websockets.serve(connection, "localhost", port)
|
||||||
)
|
)
|
||||||
asyncio.get_event_loop().run_forever()
|
asyncio.get_event_loop().run_forever()
|
||||||
|
Loading…
Reference in New Issue
Block a user