3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 23:09:23 +01:00
Commit Graph

738 Commits

Author SHA1 Message Date
James Lu
bd755e137f pr/inspircd: fix a typo in removeClient 2015-07-05 13:07:18 -07:00
James Lu
b22f674785 Support prefix modes (+qaohv); refactor applyModes to apply in place; add removeuser() to IrcChannel
Closes #16.
2015-07-05 12:48:39 -07:00
James Lu
d62a413c50 fix last commit 2015-07-05 12:40:34 -07:00
James Lu
2ecaab1586 pr/inspircd: catch KeyError only in the function lookup, not the function call!
This suppressed KeyErrors in execution... BAD
2015-07-05 12:38:55 -07:00
James Lu
dafeff6324 Add channel mode handling (more testing needed)
Closes #28.
2015-07-05 00:20:45 -07:00
James Lu
8b93b78d13 Support modes with arguments in our modestring parsers
Closes #27.
2015-07-04 23:49:28 -07:00
James Lu
3749e642f2 pr/inspircd: fix typo in handle_mode 2015-07-04 23:47:27 -07:00
James Lu
3e86cbdd33 Better protocol capability negotiation
Respect our uplink's supported c/umodes, NICKLEN, and max channel name lengths.
2015-07-04 23:12:00 -07:00
James Lu
35346d7990 pr/inspircd: part messages are optional... 2015-07-04 19:08:58 -07:00
James Lu
d23d34e316 Refactor hooks to send parsed arguments instead of raw args
ref #18.

- Command handlers that support hooks will now return parsed args, which are then sent to the hooks
- Hook commands are now stored in uppercase letters, consistent with the IRC spec
2015-07-04 19:00:29 -07:00
James Lu
b6f489fa9c add tests for KILL, KICK, UID, and SERVER handlers
todo: rewrite the MODE handling so it doesn't suck, and test those too
2015-07-04 12:34:33 -07:00
James Lu
8ea62c31de tests for spawnServer and SQUIT, make server name case-insensitive 2015-07-04 11:57:21 -07:00
James Lu
942f97352d test kick/nickClient; make kickClient update channel userlist... 2015-07-03 23:48:28 -07:00
James Lu
d6341109be inspircd: bug fixes found by testing
- Lowercase all channel names consistently, to prevent duplicates
- Store uidgen as an attribute of Irc, so each Irc instance gets its own set of UID generators
- Raise an error in handle_part of the user doesn't exist in the channel.
2015-07-03 23:31:57 -07:00
James Lu
0c8a30323a proto/inspircd: raise ProtocolError instead of calling sys.exit on errors 2015-07-03 18:07:01 -07:00
James Lu
0f4d3df757 inspircd.py: spawnServer tweaks
- Send ENDBURST from the server, not its uplink
- Check to make sure SID is 3 characters long...
2015-07-03 17:10:32 -07:00
James Lu
072cc72602 defaultdict for channels, fix user tracking in {join|part}Client, isInternal* to utils
- collections.defaultdict for simpler channel handling
- proto/inspircd: fix join/partClient not updating the channel's user list
- move isInternal* to utils
2015-06-23 19:29:53 -07:00
James Lu
6370ad492f Add basic command hooks (ref #18) 2015-06-23 19:08:43 -07:00
James Lu
28e7b52ef4 utils.TS6UIDGenerator: initialize SID variable once per instance 2015-06-22 16:51:42 -07:00
James Lu
6a69ed0459 proto/inspircd: handle RSQUIT for removing PyLink leaves 2015-06-21 17:07:31 -07:00
James Lu
ab1a946364 proto/inspircd: fix ping reply syntax
Although InspIRCd doesn't seem to care, the correct PONG syntax is:

-> :<our sid> PONG <our sid> <their sid>,

and not

-> :<our sid> PONG <our sid>,

which was used prior to this commit.
2015-06-21 15:04:19 -07:00
James Lu
c686523a6e Add pseudoserver spawning, adapting _sendFromServer and spawnClient accordingly.
Now you can spawn multiple servers for a multi-server botnet!

Also, create proto.isInternalServer() / utils.isServerName() checkers.

Closes #22.
2015-06-21 15:03:58 -07:00
James Lu
ce249dfe33 uhhh.... let's clear our variables properly 2015-06-20 21:06:45 -07:00
James Lu
aeb53a14e3 Make IrcUser.modes a set 2015-06-20 20:58:25 -07:00
James Lu
d3257f9314 Don't hardcode client usermodes in spawnClient
Still a bit of a WIP here...
2015-06-20 20:54:01 -07:00
James Lu
379f442a14 Add basic user mode tracking (Closes #10) 2015-06-20 20:36:35 -07:00
James Lu
f352166d25 proto/insp: use the client's TS in WHOIS IDLE replies
Use the client's TS, not the global IRC start time. Everything else for client timestamp tracking is basically done, at least for this protocol handler. Closes #11.
2015-06-19 13:18:22 -07:00
James Lu
55a5d08378 Use a WORKING TS6 UID generator, adapted from InspIRCd source
Closes #21.
2015-06-19 10:43:42 -07:00
James Lu
f7244ee6b7 Add basic nick and channel checking (ref #20) 2015-06-16 20:46:01 -07:00
James Lu
f40cb7954a Allow dynamic protocol loading again, and make proto an attribute of Irc()
This should remove the need for plugins, etc. to import proto directly,
which wouldn't work because of dynamic naming.
2015-06-16 20:05:41 -07:00
James Lu
9b4fb50f25 Today's code dump, featuring:
- PLUGIN SUPPORT and COMMAND HANDLING, wow!!!!!!!
- Restructuring of files so that there's only one protocol module (anything else is too much to maintain for now)
- Split protocol things into utils.py
- Bugfixes: don't go into an endless loop of text spamming when the remote host closes the connection!
2015-04-24 22:37:07 -07:00
James Lu
80a2ce1d0a more things 2015-04-17 22:11:49 -07:00
James Lu
c074d58052 Change of plans, we're now just a regular pseudoservice
- Remove multinet support
- Update config.yml.example
2015-04-17 19:55:48 -07:00
James Lu
b1a989c971 add a make-next-uid function and rename pylink-main.py -> main.py
The "I really hate Python imports" update.
2015-04-03 18:45:18 -07:00
James Lu
7a62a655a3 never mind - use multiprocessing, add auto-reconnect, and some more handlers 2015-04-03 12:35:55 -07:00
James Lu
324551e185 rewrite in asyncio and other refactoring to support multinet - doesn't work yet! 2015-04-03 00:17:03 -07:00
James Lu
f3e736b6fb Add an inspircd protocol module - still a WIP 2015-03-19 16:21:49 -07:00
James Lu
be3fe38206 Initial upload! 2015-03-19 12:55:18 -07:00