session-pysogs
session-pysogs copied to clipboard
[QUESTION] How to get room's name in python?
For example, in sogs/routes/dm.py
@auth.user_required
def send_inbox(sid):
how to add
if room=sudoku {do this}
if room=atari {do that}
Many thanks in advance
For endpoints that are room specific they have a room argument, and room.name is the name of the room. For example, sogs/routes/rooms.py has get_one_room for the /room/NAME endpoint that has such a room argument.
send_inbox, however, doesn't have a room at all as it is a general SOGS server feature and not a room-specific command; the user issuing it could be in one or 10 rooms on the server, but we don't know which one when the send_inbox endpoint is invoked.