Commit Graph

2310 Commits

Author SHA1 Message Date
Vgr E. Barry
081f909260 Use proper __class__ cell for super 2016-12-19 13:10:06 -05:00
Vgr E. Barry
e7eabba791 More easily create fake users 2016-12-19 13:09:57 -05:00
Vgr E. Barry
85f8f9717a Change variable name to be more informative 2016-12-19 13:09:47 -05:00
Vgr E. Barry
b6738f2216 Better handle channel key 2016-12-19 13:09:34 -05:00
Vgr E. Barry
898a7107ca Allow passing contexts to Channel.mode 2016-12-19 13:09:23 -05:00
Vgr E. Barry
9014d5c35c Make comparing contexts easier 2016-12-19 13:09:12 -05:00
Vgr E. Barry
59e7c13a0b Move equals from users to context 2016-12-19 13:08:18 -05:00
Vgr E. Barry
63d908a61a Properly handle channel casing 2016-12-19 13:08:07 -05:00
nyuszika7h
a3fd532b3a Fix UnboundLocalError for regain/release 2016-12-16 11:38:07 +01:00
Vgr E. Barry
33563da1eb Fix users.get(..., allow_multiple=True) to always return a list 2016-12-14 20:04:36 -05:00
skizzerz
6bf12520f1 Fix day timeout causing game to end twice 2016-12-14 10:23:00 -06:00
nyuszika7h
144b01cfed !restart already fixed, small change for consistency 2016-12-11 10:27:39 +01:00
nyuszika7h
218366cbd8 !die: Fix first word of message being cut off in debug mode 2016-12-11 10:25:14 +01:00
Vgr E. Barry
06486e14bd Fix fsay/fact broken for non-existent users 2016-12-11 01:33:14 -05:00
Vgr E. Barry
dff024e5e4 Allow contexts to be used directly in str.format() calls 2016-12-09 10:56:34 -05:00
Vgr E. Barry
e1be940f24 Fix !join erroring out 2016-12-09 10:54:16 -05:00
jacob1
2c5e108751 fix error on !join when ACCOUNTS_ONLY is set 2016-12-09 07:56:40 -05:00
Ryan Schmidt
9f4b1a243d Merge pull request #274 from lykoss/cmd-old-api
Add a backwards-compatibility handler for commands
2016-12-08 16:35:19 -07:00
skizzerz
47339618f8 Remove part/fpart command
There is no reason for this to be a command. It has no analogue outside
of fsend, in which case you can just fsend a raw PART if needed as well.
2016-12-08 17:23:15 -06:00
Vgr E. Barry
bb8548ccdf Right. 2016-12-06 08:40:12 -05:00
nyuszika7h
3d5aa8c8e3 Fix message name 2016-12-05 14:06:22 +01:00
nyuszika7h
b2104e4d36 Respect LOG_PREFIX for !fwarn add/set 2016-12-01 23:21:01 +01:00
Vgr E. Barry
e8338d1ef6 Add the new command API + converted commands
Converted commands mostly use some backwards-compatibility hack. Please don't mind it, I'll eventually get to it.
2016-11-28 20:19:48 -05:00
nyuszika7h
da502fa34c Require a minimum of 6 players for charming
In 5-player charming games, it is possible to get into a situation where
it's impossible for the village to win - if all players except for the
wolf are charmed, lynching the wolf results in the piper winning, and
lynching the piper results in the wolf winning.
2016-11-25 14:23:16 +01:00
Vgr E. Barry
c26c7887bc Add a hook for account changes 2016-11-24 17:05:08 -05:00
Vgr E. Barry
5f50096d08 Delay error in users.get until after the end of the loop
This was originally done so that we wouldn't need to iterate through the (presumably large) set of users. However, when this raises, we have no idea which users actually match the criterias. By waiting until after, the traceback will actually print off the list of all potential users.
2016-11-24 16:29:58 -05:00
nyuszika7h
21b8ffa342 Fix denying commands with warnings 2016-11-24 16:17:53 +01:00
skizzerz
08652301c2 Properly delay night properly in villagergame, all proper-like now 2016-11-23 16:27:37 -06:00
skizzerz
a01f8860d0 Delay night properly in villagergame 2016-11-23 16:26:06 -06:00
nyuszika7h
ed7d3eda6a Add a random delay to night in villagergame 2016-11-23 19:34:41 +01:00
jacob1
bb99493ae8 fix protections not carrying over after nick change 2016-11-23 11:53:45 -05:00
Vgr E. Barry
27b0c9578d Move static methods out of the IRCContext class 2016-11-22 07:42:07 -05:00
Vgr E. Barry
423f7e352c Fix IRCContext.send_messages 2016-11-22 07:40:29 -05:00
Vgr E. Barry
ea3acbfb2a Allow implicit replacement of users without a ident and a host
This takes a different code path because of slightly different conditions; in the first case, the ident and host are both known, and so the instance is hashable. Being hashable, it can be checked for set containment, and exactly one instance in that set will be equal (since the hash is based off of the ident and host, and the comparisons check for all non-None attributes, two instances cannot possibly be equal while having a different hash).

In the second case (the new one), however, at least the ident or the host is missing, and so the hash cannot be calculated. This means that two instances may compare equal and hash to different values (since only non-None attributes are compared), so we need to run through the entire set no matter what to make sure that one - and only one - instance in that set compares equal with the new one. We can't know in advance whether or not there is an instance that compares equal to the new one in that set, nor can we know if there are multiple instances that are going to compare equal.

The two code paths are separated so that the difference in functionality is obvious (and this commit description, as well as the comment in the code, should help with that), and that the distinction remains clear.
2016-11-21 21:44:34 -05:00
Vgr E. Barry
ea51642240 Allow users.get(..., allow_multiple=True) to return an empty list 2016-11-21 21:12:27 -05:00
Vgr E. Barry
d590e7b727 Fix servers setting modes and !fsync breaking the bot 2016-11-21 10:29:14 -05:00
skizzerz
1f7b5ee6a3 Break infinite regain/release loops redux 2016-11-20 21:44:40 -06:00
skizzerz
11d626ab25 Revert old_api cmd change
Causing way too many bugs, need to use a more sane method of breaking
the cmd API, and only do so when it's actually ready to go. My
personal preference is to make the new API use @command instead of @cmd.

This reverts commits c90d35e6c0 and 5f5966a8b4.
2016-11-20 21:33:36 -06:00
jacob1
c90d35e6c0 add old_api=True to sleepy commands, default it to true 2016-11-20 22:30:13 -05:00
skizzerz
ed2576ef7e Remove debug printouts 2016-11-20 12:49:21 -06:00
skizzerz
24ae5c1e39 Kill USE_NICKSERV_GHOST, default more things in settings.py
Whether or not GHOST is used now depends on if NICKSERV_RELEASE_COMMAND
or NICKSERV_REGAIN_COMMAND are empty. Also, we do not try to go into an
infinite loop should the command we use fail to work, and instead just
run with a "wrong" nick.

Not tested at all, so blame ilbelkyr when things inevitably don't work
with it (and while you're blaming him, get him to fix the ASM website).
2016-11-20 12:36:31 -06:00
skizzerz
73fb0c65c9 Fix coin/pony chances 2016-11-20 12:33:39 -06:00
Vgr E. Barry
e922bb220e Move the message queuing to IRCContext 2016-11-20 08:25:45 -05:00
Vgr E. Barry
6d9017a4bd Improve context creation and lowercasing 2016-11-20 08:24:50 -05:00
Emanuel Barry
5f5966a8b4 Add a transition method for the old->new interface (#272)
* Add a transition method for the old->new interface

* Modify direct calls to cmd to explicitly use the old API
2016-11-19 17:47:54 +01:00
nyuszika7h
89c7716c07 Remove unused message
Forgot to remove this in the previous commit.
2016-11-19 17:32:23 +01:00
nyuszika7h
313d33f1a2 Display full help text on bare "!fwarn" and "!fwarn help"
It was listing the warnings on a bare "!fwarn" because re.split()
returned an array containing one element, the empty string. And it's not
really helpful to show just the syntax for the help subcommand in
"!fwarn help", because it already does that in the normal help message,
and also shows the available subcommands.
2016-11-19 17:10:50 +01:00
Trigonoculus
5b0dae3cb3 Removed comma in "... played Russian roulette, and lost".
20:01:04 <+nyuszika7h> "beaky played Russian roulette, and lost"
20:01:10 <+nyuszika7h> I don't think there should be a comma there
20:01:58 <+nyuszika7h> idk though
20:02:04 <+nyuszika7h> it seems weird, though that's not a list of things
2016-11-19 09:58:57 -05:00
nyuszika7h
af2b284efa Update CONTRIBUTING.md
Since lykos is a separate project, removed note about ##werewolf-ops.
Obviously we will provide a way to disable changes not suitable
for ##werewolf. Also told users to PR to master and claried that newest
stable branch is also OK to report issues.
2016-11-19 11:37:26 +01:00
Vgr E. Barry
1766f54b21 Properly handle the option to use ghost or release 2016-11-18 21:14:15 -05:00