Lots of bug fixes
- Toggling autoplay checkbox in debug now disallows saving the score - Fix crown of the song that was previously selected rendering above the genre - Outline of empty crowns is slightly darker - Fix rendering when there is a crown on oni and no crown on ura - Fix crowns overlapping the netplay 2P icon - Fix gauge in latency calibration - Fix debug to work on mobile, can be toggled with ctrl+alt+`;` on hacker's keyboard with permanent notification - Fix being unable to scroll the settings list without toggling something - Handle KeyboardInterrupt in server.py - Fix category jumping not working in session mode - Fix mouse cursor being hidden at results screen in session mode - Make "Issues" on the about screen and "An error occurred, please refresh" on loading screens translateable - CanvasCache uses integer increments for comparison instead of Date.now() - For imported songs, exclude song titles from genre comparisons if they appear in the name of the folder - Fix tja files with spaces in the notation - Fix second player's score on the results screen to have upside down appearance - Add fixed chinese strings
This commit is contained in:
25
server.py
25
server.py
@@ -262,7 +262,7 @@ async def connection(ws, path):
|
||||
elif action == "songsel":
|
||||
# Session song selection
|
||||
if "other_user" in user and "ws" in user["other_user"]:
|
||||
if type == "songsel":
|
||||
if type == "songsel" or type == "catjump":
|
||||
# Change song select position
|
||||
if user["other_user"]["action"] == "songsel":
|
||||
sent_msg = msgobj(type, value)
|
||||
@@ -336,7 +336,26 @@ async def connection(ws, path):
|
||||
|
||||
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(
|
||||
loop = asyncio.get_event_loop()
|
||||
tasks = asyncio.gather(
|
||||
websockets.serve(connection, "localhost", port)
|
||||
)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
try:
|
||||
loop.run_until_complete(tasks)
|
||||
loop.run_forever()
|
||||
except KeyboardInterrupt:
|
||||
print("Stopping server")
|
||||
def shutdown_exception_handler(loop, context):
|
||||
if "exception" not in context or not isinstance(context["exception"], asyncio.CancelledError):
|
||||
loop.default_exception_handler(context)
|
||||
loop.set_exception_handler(shutdown_exception_handler)
|
||||
tasks = asyncio.gather(*asyncio.all_tasks(loop=loop), loop=loop, return_exceptions=True)
|
||||
tasks.add_done_callback(lambda t: loop.stop())
|
||||
tasks.cancel()
|
||||
while not tasks.done() and not loop.is_closed():
|
||||
loop.run_forever()
|
||||
finally:
|
||||
if hasattr(loop, "shutdown_asyncgens"):
|
||||
loop.run_until_complete(loop.shutdown_asyncgens())
|
||||
loop.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user