Commit Graph

288 Commits

Author SHA1 Message Date
nyuszika7h
8be512c216 Repeat idle warning in PM if the player is PMing the bot 2015-08-27 21:08:04 +02:00
Emanuel Barry
77619306ec Fix bodyguard message 2015-08-27 14:51:21 -04:00
Emanuel Barry
b3f30bbd91 Improve error handler
Now it will only pastebin the error when it has finished gathering it
all.
2015-08-27 10:02:56 -04:00
skizzerz
3dc3e4d172 Fix race condition for day timing out immediately when a vote succeeds 2015-08-26 20:09:57 -05:00
skizzerz
bb5cb78c68 Fix fgame bug, str.split has idiotic semantics in python 2015-08-25 22:46:45 -05:00
skizzerz
75c407c403 Track player stats by nick if accounts are disabled 2015-08-25 15:52:27 -05:00
nyuszika7h
886434272f Remove !me alias for !mystats
It conflicts with normal messages like "me too" in wolfchat, and I think
it's rarely (if ever) used.
2015-08-24 19:54:13 +02:00
nyuszika7h
82ef99b837 Fix !join telling you to !swap if you're already joined 2015-08-18 12:43:01 +02:00
jacob1
3ce856818a fix the bot pinging everyone instead of just people using !pingif if DISABLE_ACCOUNTS is on 2015-08-17 18:17:45 -04:00
nyuszika7h
5a2a098db6 !wiki: Catch socket.timeout 2015-08-17 22:53:12 +02:00
nyuszika7h
79066e5ec6 Fix error in on_invite (blame @Vgr255) 2015-08-16 12:06:15 +02:00
jacob1
835441caea fix bug where you could fdeny the same command multiple times if done by host 2015-08-14 01:31:48 -04:00
billion57
b936a4d3c5 More lynch/quit/no victims messages
yayy
2015-08-14 00:20:50 +02:00
Vgr E.Barry
3534cc7d78 Better handle non-built-in exceptions 2015-08-10 09:49:52 -04:00
Vgr E.Barry
d58a9249ab Update error handler to ignore non-errors 2015-08-10 09:09:33 -04:00
nyuszika7h
0dd3c08862 Exit immediately if Ctrl-C is pressed twice 2015-08-08 22:46:32 +02:00
nyuszika7h
e8fc9f01bb Ping players when ending game due to error in join phase 2015-08-08 22:16:06 +02:00
nyuszika7h
58286e7596 !swap: Don't error if user is not playing
I blame @Vgr255.
2015-08-08 22:07:02 +02:00
skizzerz
7e1c656185 Fix harlot dying visiting protected victim 2015-08-06 22:30:32 -05:00
skizzerz
1b50a37b69 Fix break_long_message, broken in 5793097626 2015-08-06 22:06:04 -05:00
Vgr E.Barry
38b7ef81e2 Add proper error handling. Closes #151
All exceptions, if not caught, are unconditionally sent to `sys.stderr`.
We only need to use our own custom class with some modifications and we
can intercept all errors, even those in threads (which #151 was about).
The only real downside from this practice is that `cli` is not
accessible to us when the errors happen, so I used a hack to set it on
an instance variable. If anyone can find a better solution, please step
forward. For the time being, this will have to do.

If for some obscure reason this class breaks, `sys.__stderr__` holds the
original `sys.stderr`
2015-08-06 12:29:47 -04:00
nyuszika7h
74555f013a Fix Windows error messages in !ping 2015-08-06 12:37:37 +02:00
nyuszika7h
74d4f9c95e Actually add that ping message 2015-08-06 12:27:39 +02:00
nyuszika7h
e27cb0c1e0 Add another ping message 2015-08-06 12:27:10 +02:00
Vgr E.Barry
b3c8fd562a Fix some errors and style in !swap 2015-08-05 21:55:09 -04:00
Vgr E.Barry
a6a128586d Add a !swap command. Closes #129
This allows people to swap out an existing player from the game, and
join instead. Useful if, say, your home connection dropped, but your ZNC
is still online and you want to keep playing through your phone for
example. The player swapping and the one being swapped must be
identified to the same account for this to work. After the command has
been used, an implicit !myrole is performed, informing the player of
their role and templates. The on_nick handler has been decoupled into
two functions, where most of the logic is now in rename_player (which
swap uses).

Known issues: Hard drive space is left untouched.
2015-08-05 21:28:04 -04:00
Vgr E.Barry
188ede0b2e Change is_user_altpinged to return only an integer 2015-08-05 21:22:42 -04:00
Vgr E.Barry
397d7362db Update !roles
Now `!roles` while in a game will have the same effect as `!roles n`
where n is the number of players that joined. Also got rid of string
concatenation.
2015-08-01 09:54:08 -04:00
Vgr E.Barry
eef01df1f7 Nitpick by ChrisE 2015-08-01 09:35:27 -04:00
Vgr E.Barry
ff53ad4bcf Modify is_user_stasised to return only an integer, not a tuple 2015-08-01 09:22:42 -04:00
Vgr E.Barry
0eee4b1c88 Fix random randomly failing to start
Pun unintended
2015-08-01 09:18:19 -04:00
Vgr E.Barry
29cf18f7be Update revealroles
Now shows which side turncoat is on, and what role someone was if they
changed during game. Also removed string concanetation so save on
memory/time.
2015-07-31 13:30:40 -04:00
Vgr E.Barry
7c9b5ce51b Fix decorators 2015-07-31 13:29:26 -04:00
Vgr E.Barry
e259502ad4 Change a few hasattr/getattr calls for something more intuitive 2015-07-31 13:29:05 -04:00
Vgr E.Barry
f40e749c07 Allow !fjoin to join ranges of fake nicks 2015-07-31 13:28:34 -04:00
Vgr E.Barry
5793097626 Improve var.break_long_message
Concatenating strings repeatedly slows down the program and eats up
memory. It's not too bad for the number of players we have, but if you
get 10k players that makes a significant difference
2015-07-31 13:28:08 -04:00
Vgr E.Barry
dc54fdc883 Add random !ping replies 2015-07-31 13:26:50 -04:00
skizzerz
6fecec6df3 Re-add limit for fwait
Now restricted to adding/removing 900 seconds (15 minutes). There are no
valid reasons I can think of or that were given in -dev that would
require more time than this. 15 minutes is still likely too much and
from previous experience such long forced waits generally trigger a mass
exodus of players who would rather play a game than doing absolutely
nothing.
2015-07-30 13:06:48 -05:00
skizzerz
e27fd8c1fa Fix connect hooks
Apparently having multiple hooks on the same thing is just horribly
broken, even though we do it in other places. This only fixes the issue
on connecting as that one is the most severe, but the other cases will
need to be fixed as well (or the underlying issue preventing it from
working needs to be fixed).
2015-07-29 03:14:10 -05:00
skizzerz
dbb80a940e Fix issues related to undernet (and in general)
- Now possible to use the bot without it having a registered account by
  blanking NICKSERV_IDENTIFY_COMMAND
- Now possible to configure who ChanServ is as well as the command it
  uses to op up in channel (blank to prevent it from auto-opping).
  Example configuration provided for undernet
- Properly autojoin channels even if there isn't an MOTD
2015-07-28 22:35:47 -05:00
Vgr E.Barry
9d10a1a342 Display what amnesiac would have turned into at end of night 2015-07-27 10:24:55 -04:00
nyuszika7h
32ab792e2f Use the specified username for NickServ identify 2015-07-27 14:19:46 +02:00
nyuszika7h
21060b2bfb Add an option to change NickServ's name and the identify command 2015-07-27 13:08:52 +02:00
skizzerz
80f5f7d4e8 Separate bite from kill for alpha wolf.
Alpha now can choose to either bite or kill, but not both. If other
wolves are alive, they can still kill as normal allowing both to happen
that night. Additional interactions were added to deal with visiting
harlots and to not accidentally kill bodyguards/GAs in the event that
they are bitten and would die from wolves (if
BODYGUARD/GUARDIAN_ANGEL_DIES_AT_NIGHT_CHANCE is set).

Things to consider for the future but didn't have time to do yet:
- Should we play a message in channel if alpha wolf successfully bites
  someone at night?
- Avoid killing a bodyguard/GA if Fallen Angel is in play and said
  bodyguard/GA was bitten that night.
- Should wolves avoid automatically killing people bitten on previous
  nights (e.g. a bitten harlot wouldn't get nommed visiting wolves or
  victims, bitten bodyguards/GAs wouldn't die from fallen angel, etc.)?
2015-07-26 23:29:40 -05:00
Vgr E.Barry
017811b7db Fix game mode docstring parsing 2015-07-26 13:34:04 -04:00
skizzerz
4eaedea442 Fix fgame autocompletion 2015-07-26 12:32:07 -05:00
nyuszika7h
0e704e5533 Fix missing period in !hex message 2015-07-25 22:27:10 +02:00
skizzerz
6dd9c199fd Disable stats for noreveal, and make the 'no reveal' message more clear 2015-07-24 12:27:08 -05:00
nyuszika7h
2f5712cb3b Prefix "/me"s in wolfchat with an asterisk
This is needed to disambiguate them from the bot announcing wolfteam
actions in wolfchat, which was recently added.
2015-07-24 13:50:42 +02:00
jacob1
c39298cd43 remove det from lycan (a bit too OP), replaced with 2nd seer at 19p (fakeclaiming opportunity) 2015-07-22 20:27:41 -04:00