ajanata / PretendYoureXyzzy

A web clone of the card game Cards Against Humanity.
https://pretendyoure.xyz/zy
BSD 2-Clause "Simplified" License
1.23k stars 397 forks source link

Add /host and /skip commands. #102

Open uecasm opened 10 years ago

uecasm commented 10 years ago

"/host playername": changes the host of the game to the specified player (who must already be in the game). Useful for tournament-style or other prearranged play to hand over "ownership" of a game without having to create a separate game. Also useful to "recover" host status if the host is disconnected, but this requires the cooperation of whoever became host in the meantime.

"/skip playername": skips the specified player in the same manner as the idle timer, except that it does not increment their skip count and will never cause a game reset (it will just skip the round if there aren't enough players). Mostly intended to allow manually skipping an AFK player when playing with the idle timer disabled. (This was one of the things I added before I found the bugfix for the idle timer.)

Both of these commands will only work for admins and hosts.

uecasm commented 10 years ago

BTW, this resolves #68.

GUIpsp commented 10 years ago

:+1:

ajanata commented 10 years ago

Allowing a skip when the round would end up being unplayable just seems silly. You're not going to be able to continue the game until that person gets back anyway... Or maybe someone just joined and you will. Hmm. Okay, I guess it makes sense. :)

uecasm commented 10 years ago

Bear in mind that most of this was written as an alternative to the auto-skip timer, back when that kept resetting games for no readily apparent reason. So it was intentionally written to avoid resets no matter what. In practice, what usually happens (at least in my playtests) is that you're just wanting to skip someone who has said that they're leaving the game but didn't actually click the button (and you don't want to wait for them to ping timeout) -- or just going AFK for longer than expected. (Possibly where having that "stand up" feature might be useful.) Often the same player comes back in later anyway. But if not, the game just spins uselessly for a little while; it doesn't really do any harm except waste a few black cards and judging turns.

I'm occasionally tempted to go back and make the same changes to the auto-skip, actually. That way there'd be no resets at all (unless the host manually hit Stop Game).

uecasm commented 10 years ago

Actually, wait -- I'm a derp. This doesn't resolve #68 yet; I meant it to do so but somehow left that code out. I'll fix that up shortly too, along with most of your other suggestions. (I'll just add the changes onto this PR as extra commits by default; if you prefer, let me know and I'll rebase the PR and/or split it into separate chunks.)

ajanata commented 10 years ago

Extra commits are fine by me.