Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] How to get room's name in python? #206

Open
qdhj opened this issue Nov 8, 2023 · 1 comment
Open

[QUESTION] How to get room's name in python? #206

qdhj opened this issue Nov 8, 2023 · 1 comment

Comments

@qdhj
Copy link

qdhj commented Nov 8, 2023

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

@qdhj qdhj changed the title How to get room's name in python? [QUESTION] How to get room's name in python? Nov 8, 2023
@jagerman
Copy link
Member

jagerman commented Nov 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants