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

Reintroduce hangman multiplayer #872

Open
1 of 2 tasks
Bluenix2 opened this issue Sep 19, 2021 · 13 comments
Open
1 of 2 tasks

Reintroduce hangman multiplayer #872

Bluenix2 opened this issue Sep 19, 2021 · 13 comments
Labels
status: stalled Something is blocking further progress type: feature Relating to the functionality of the application.

Comments

@Bluenix2
Copy link
Member

Description

Following the removal in #871, hangman should be re-added again.

Reasoning

Quickly following its introduction it become apparent that hangman's multiplayer mode had some flaws. Most importantly, it meant that a whole channel was occupied.

Proposed Implementation

Multiplayer mode should be reintroduced using threads, this is also the reason that the issues are separated. As the Python bot doesn't quite yet receive messages in threads so threads have not yet been enabled.

The bot should open a thread on the hangman message and listen for messages in that thread, unless the command was invoked in a thread that is, at which point it will play like normal.

Would you like to implement this yourself?

  • I'd like to implement this feature myself
  • Anyone can implement this feature
@Bluenix2 Bluenix2 added status: planning Discussing details type: feature Relating to the functionality of the application. labels Sep 19, 2021
@lxnn
Copy link
Contributor

lxnn commented Sep 28, 2021

I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?

@DMFriends
Copy link
Contributor

I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?

So, here's the thing: we can technically use threads manually, but that's not going to be very effective for this game, right? So what we are waiting on is the full release of d.py 2.0, after which we can upgrade the main Python bot so it can manage threads (there is a PR for it in the bot repo), and only after that could someone start working on this. So yes, you are right, this issue is pretty much blocked for now. Does that answer your question?

@DMFriends
Copy link
Contributor

DMFriends commented Sep 28, 2021

I have 2 alternative implementations that don't really require the use of threads.

  1. What we could do is, instead of opening threads when the multiplayer game command is run, (I'm not even sure if this is possible) unlock a special channel where anyone can join the person who ran the command. This one has some problems, which I'm not sure if it's obvious or not so I'll say it anyway. Other people could join the new channel and spam it.

  2. We could also do it like this: whenever someone runs the multiplayer game command, we could make it so that the bot sends an embed asking someone to accept the challenge using buttons, and once another player accepts, the person who ran the command and the person who accepted will get a special role which unlocks a channel just for the players, and then, when the game is over, the role is removed and the channel is locked again.

If no one accepts the challenge within a certain amount of time, let's say 5 minutes, then the challenge expires.

I personally like option 2 better. Please let me know what you guys think about this.

CC @Bluenix2 @Shom770 @ChrisLovering

@Bluenix2 Bluenix2 added status: stalled Something is blocking further progress and removed status: planning Discussing details labels Sep 28, 2021
@Bluenix2
Copy link
Member Author

I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?

Yes @lxnn we need to wait for Python bot's usage of discord.py to use threads anywhere. Even though Sir Lancebot does support threads.

I have 2 alternative implementations that don't really require the use of threads.

  1. What we could do is, instead of opening threads when the multiplayer game command is run, (I'm not even sure if this is possible) unlock a special channel where anyone can join the person who ran the command. This one has some problems, which I'm not sure if it's obvious or not so I'll say it anyway. Other people could join the new channel and spam it.
  2. We could also do it like this: whenever someone runs the multiplayer game command, we could make it so that the bot sends an embed asking someone to accept the challenge using buttons, and once another player accepts, the person who ran the command and the person who accepted will get a special role which unlocks a channel just for the players, and then, when the game is over, the role is removed and the channel is locked again.

If no one accepts the challenge within a certain amount of time, let's say 5 minutes, then the challenge expires.

I personally like #2 better. Please let me know what you guys think about this.

I would much rather we wait until we can use threads.

@DMFriends
Copy link
Contributor

I'm not up to date on whether we are already using threads with Sir Lancebot. Is this issue currently blocked?

Yes @lxnn we need to wait for Python bot's usage of discord.py to use threads anywhere. Even though Sir Lancebot does support threads.

I have 2 alternative implementations that don't really require the use of threads.

  1. What we could do is, instead of opening threads when the multiplayer game command is run, (I'm not even sure if this is possible) unlock a special channel where anyone can join the person who ran the command. This one has some problems, which I'm not sure if it's obvious or not so I'll say it anyway. Other people could join the new channel and spam it.
  2. We could also do it like this: whenever someone runs the multiplayer game command, we could make it so that the bot sends an embed asking someone to accept the challenge using buttons, and once another player accepts, the person who ran the command and the person who accepted will get a special role which unlocks a channel just for the players, and then, when the game is over, the role is removed and the channel is locked again.

If no one accepts the challenge within a certain amount of time, let's say 5 minutes, then the challenge expires.

I personally like #2 better. Please let me know what you guys think about this.

I would much rather we wait until we can use threads.

Ok, I guess we can wait. Do you know approximately when dpy 2.0 will be released? @Bluenix2

@Bluenix2
Copy link
Member Author

It won't, discord.py has been archived and Python bot will be moved to the most recent commit and use that for the time being.

@DMFriends
Copy link
Contributor

It won't, discord.py has been archived and Python bot will be moved to the most recent commit and use that for the time being.

What do you mean by "most recent commit"? Of dpy? And my guess is that commit does not include thread support, correct? If so, I'm curious to know how thread support will be added to the Python bot and when that will happen? @Bluenix2

@Bluenix2
Copy link
Member Author

Discord.py has been archived and Python bot (the same way Sir Lancebot does) install from the GitHub repository where there is thread support and support for interactions.

@DMFriends
Copy link
Contributor

Discord.py has been archived and Python bot (the same way Sir Lancebot does) install from the GitHub repository where there is thread support and support for interactions.

So wait, you got me confused. Before you said we are still waiting on the thread support addition, but now it seems like you're saying the bots are supporting threads already? Please clarify @Bluenix2

@Bluenix2
Copy link
Member Author

Python bot doesn't use discord.py 2.0 yet.

@DMFriends
Copy link
Contributor

Python bot doesn't use discord.py 2.0 yet.

Ok, thanks for clarifying.

@DMFriends
Copy link
Contributor

Hey @Bluenix2, is this issue still stalled? I don't think I'll be able to work on it, but if it is no longer stalled you could switch the labels.

@Bluenix2
Copy link
Member Author

Threads are still not yet allowed to be used by the wider community except for the permanent ones created by mods and admins. Therefore, this issue is still stalled yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: stalled Something is blocking further progress type: feature Relating to the functionality of the application.
Projects
None yet
Development

No branches or pull requests

3 participants