2016-03-12 08:13:55 +01:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<html><head><title>Python: module ts6</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
|
|
<tr bgcolor="#7799ee">
|
|
|
|
<td valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>ts6</strong></big></big></font></td
|
|
|
|
><td align=right valign=bottom
|
|
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/gl/pylink/protocols/ts6.py">/home/gl/pylink/protocols/ts6.py</a></font></td></tr></table>
|
|
|
|
<p><tt>ts6.py: PyLink protocol module for TS6-based IRCds (charybdis, elemental-ircd).</tt></p>
|
|
|
|
<p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#aa55cc">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="hashlib.html">hashlib</a><br>
|
|
|
|
<a href="logging.html">logging</a><br>
|
|
|
|
<a href="os.html">os</a><br>
|
|
|
|
</td><td width="25%" valign=top><a href="re.html">re</a><br>
|
|
|
|
<a href="socket.html">socket</a><br>
|
|
|
|
<a href="ssl.html">ssl</a><br>
|
|
|
|
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
|
|
|
|
<a href="threading.html">threading</a><br>
|
|
|
|
<a href="time.html">time</a><br>
|
|
|
|
</td><td width="25%" valign=top><a href="utils.html">utils</a><br>
|
|
|
|
<a href="world.html">world</a><br>
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#ee77aa">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
|
|
<td width="100%"><dl>
|
|
|
|
<dt><font face="helvetica, arial"><a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>(<a href="classes.html#Protocol">classes.Protocol</a>)
|
|
|
|
</font></dt><dd>
|
|
|
|
<dl>
|
|
|
|
<dt><font face="helvetica, arial"><a href="ts6.html#TS6Protocol">TS6Protocol</a>
|
|
|
|
</font></dt></dl>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
<p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#000000" face="helvetica, arial"><strong>Class</strong> = <a name="Class">class TS6Protocol</a>(<a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>)</font></td></tr>
|
|
|
|
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
|
|
<td colspan=2><tt>Base Protocol module class for PyLink.<br> </tt></td></tr>
|
|
|
|
<tr><td> </td>
|
|
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
|
|
<dd><a href="ts6.html#TS6Protocol">TS6Protocol</a></dd>
|
|
|
|
<dd><a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a></dd>
|
|
|
|
<dd><a href="classes.html#Protocol">classes.Protocol</a></dd>
|
|
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
|
|
</dl>
|
|
|
|
<hr>
|
|
|
|
Methods defined here:<br>
|
|
|
|
<dl><dt><a name="TS6Protocol-__init__"><strong>__init__</strong></a>(self, irc)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-connect"><strong>connect</strong></a>(self)</dt><dd><tt>Initializes a connection to a server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_472"><strong>handle_472</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the incoming 472 numeric.<br>
|
|
|
|
<br>
|
|
|
|
472 is sent to us when one of our clients tries to set a mode the uplink<br>
|
|
|
|
server doesn't support. In this case, we'll raise a warning to alert<br>
|
|
|
|
the administrator that certain extensions should be loaded for the best<br>
|
|
|
|
compatibility.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_bmask"><strong>handle_bmask</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming BMASK commands (ban propagation on burst).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_capab"><strong>handle_capab</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the CAPAB command, used for TS6 capability negotiation.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_chghost"><strong>handle_chghost</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming CHGHOST commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_encap"><strong>handle_encap</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the ENCAP command - encapsulated TS6 commands with a variety of<br>
|
|
|
|
subcommands used for different purposes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_euid"><strong>handle_euid</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming EUID commands (user introduction).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_invite"><strong>handle_invite</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming INVITEs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_join"><strong>handle_join</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming channel JOINs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_pass"><strong>handle_pass</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the PASS command, used to send the server's SID and negotiate<br>
|
|
|
|
passwords on connect.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_ping"><strong>handle_ping</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PING commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_server"><strong>handle_server</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles 1) incoming legacy (no SID) server introductions,<br>
|
|
|
|
2) Sending server data in initial connection.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_sid"><strong>handle_sid</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming server introductions.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_sjoin"><strong>handle_sjoin</strong></a>(self, servernumeric, command, args)</dt><dd><tt>Handles incoming SJOIN commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_tb"><strong>handle_tb</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming topic burst (TB) commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_tmode"><strong>handle_tmode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming TMODE commands (channel mode change).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_uid"><strong>handle_uid</strong></a>(self, numeric, command, args)</dt></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_whois"><strong>handle_whois</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming WHOIS commands.<br>
|
|
|
|
<br>
|
|
|
|
Note: The core of WHOIS handling is done by coreplugin.py<br>
|
|
|
|
(IRCd-independent), and not here.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-invite"><strong>invite</strong></a>(self, numeric, target, channel)</dt><dd><tt>Sends an INVITE from a PyLink client..</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-join"><strong>join</strong></a>(self, client, channel)</dt><dd><tt>Joins a PyLink client to a channel.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-kill"><strong>kill</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink client/server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-knock"><strong>knock</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a KNOCK from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-mode"><strong>mode</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends mode changes from a PyLink client/server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-ping"><strong>ping</strong></a>(self, source=None, target=None)</dt><dd><tt>Sends a PING to a target server. Periodic PINGs are sent to our uplink<br>
|
|
|
|
automatically by the Irc() internals; plugins shouldn't have to use this.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-sjoin"><strong>sjoin</strong></a>(self, server, channel, users, ts=None)</dt><dd><tt>Sends an SJOIN for a group of users to a channel.<br>
|
|
|
|
<br>
|
|
|
|
The sender should always be a Server ID (SID). TS is optional, and defaults<br>
|
|
|
|
to the one we've stored in the channel state if not given.<br>
|
|
|
|
<users> is a list of (prefix mode, UID) pairs:<br>
|
|
|
|
<br>
|
|
|
|
Example uses:<br>
|
|
|
|
<a href="#Class-sjoin">sjoin</a>('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])<br>
|
|
|
|
<a href="#Class-sjoin">sjoin</a>(self.<strong>irc</strong>.sid, '#test', [('o', self.<strong>irc</strong>.pseudoclient.uid)])</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None, manipulatable=False)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
|
|
|
<br>
|
|
|
|
Note: No nick collision / valid nickname checks are done here; it is<br>
|
|
|
|
up to plugins to make sure they don't introduce anything invalid.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-topicBurst"><strong>topicBurst</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a topic change from a PyLink server. This is usually used on burst.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-updateClient"><strong>updateClient</strong></a>(self, target, field, text)</dt><dd><tt>Updates the hostname of any connected client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Methods inherited from <a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>:<br>
|
|
|
|
<dl><dt><a name="TS6Protocol-away"><strong>away</strong></a>(self, source, text)</dt><dd><tt>Sends an AWAY message from a PyLink client. <text> can be an empty string<br>
|
|
|
|
to unset AWAY status.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_away"><strong>handle_away</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming AWAY messages.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_error"><strong>handle_error</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles ERROR messages - these mean that our uplink has disconnected us!</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for TS6 protocols.<br>
|
|
|
|
<br>
|
|
|
|
This passes most commands to the various handle_ABCD() functions<br>
|
|
|
|
elsewhere defined protocol modules, coersing various sender prefixes<br>
|
|
|
|
from nicks and server names to UIDs and SIDs respectively,<br>
|
|
|
|
whenever possible.<br>
|
|
|
|
<br>
|
|
|
|
Commands sent without an explicit sender prefix will have them set to<br>
|
|
|
|
the SID of the uplink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_kick"><strong>handle_kick</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KICKs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_kill"><strong>handle_kill</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KILLs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_nick"><strong>handle_nick</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming NICK changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_notice"><strong>handle_notice</strong></a> = handle_privmsg(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_part"><strong>handle_part</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PART commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_privmsg"><strong>handle_privmsg</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUIT commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_save"><strong>handle_save</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SAVE messages, used to handle nick collisions.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_squit"><strong>handle_squit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SQUITs (netsplits).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_topic"><strong>handle_topic</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming TOPIC changes from clients. For topic bursts,<br>
|
|
|
|
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.</tt></dd></dl>
|
|
|
|
|
2016-03-26 19:42:12 +01:00
|
|
|
<dl><dt><a name="TS6Protocol-handle_version"><strong>handle_version</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles requests for the PyLink server version.</tt></dd></dl>
|
|
|
|
|
2016-03-12 08:13:55 +01:00
|
|
|
<dl><dt><a name="TS6Protocol-kick"><strong>kick</strong></a>(self, numeric, channel, target, reason=None)</dt><dd><tt>Sends kicks from a PyLink client/server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-message"><strong>message</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a PRIVMSG from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-nick"><strong>nick</strong></a>(self, numeric, newnick)</dt><dd><tt>Changes the nick of a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-notice"><strong>notice</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a NOTICE from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-numeric"><strong>numeric</strong></a>(self, source, numeric, target, text)</dt><dd><tt>Sends raw numerics from a server to a remote client, used for WHOIS<br>
|
|
|
|
replies.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-parseTS6Args"><strong>parseTS6Args</strong></a>(self, args)</dt><dd><tt>Similar to <a href="#Class-parseArgs">parseArgs</a>(), but stripping leading colons from the first argument<br>
|
|
|
|
of a line (usually the sender field).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-part"><strong>part</strong></a>(self, client, channel, reason=None)</dt><dd><tt>Sends a part from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-quit"><strong>quit</strong></a>(self, numeric, reason)</dt><dd><tt>Quits a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)</dt><dd><tt>Spawns a server off a PyLink server. desc (server description)<br>
|
|
|
|
defaults to the one in the config. uplink defaults to the main PyLink<br>
|
|
|
|
server, and sid (the server ID) is automatically generated if not<br>
|
|
|
|
given.<br>
|
|
|
|
<br>
|
|
|
|
Note: TS6 doesn't use a specific ENDBURST command, so the endburst_delay<br>
|
|
|
|
option will be ignored if given.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-squit"><strong>squit</strong></a>(self, source, target, text='No reason given')</dt><dd><tt>SQUITs a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-topic"><strong>topic</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a TOPIC change from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Methods inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
|
|
|
<dl><dt><a name="TS6Protocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
|
|
|
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-updateTS"><strong>updateTS</strong></a>(self, channel, their_ts)</dt><dd><tt>Compares the current TS of the channel given with the new TS, resetting<br>
|
|
|
|
all modes we have if the one given is older.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
</td></tr></table> <p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#000000" face="helvetica, arial"><a name="TS6Protocol">class <strong>TS6Protocol</strong></a>(<a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>)</font></td></tr>
|
|
|
|
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
|
|
<td colspan=2><tt>Base Protocol module class for PyLink.<br> </tt></td></tr>
|
|
|
|
<tr><td> </td>
|
|
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
|
|
<dd><a href="ts6.html#TS6Protocol">TS6Protocol</a></dd>
|
|
|
|
<dd><a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a></dd>
|
|
|
|
<dd><a href="classes.html#Protocol">classes.Protocol</a></dd>
|
|
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
|
|
</dl>
|
|
|
|
<hr>
|
|
|
|
Methods defined here:<br>
|
|
|
|
<dl><dt><a name="TS6Protocol-__init__"><strong>__init__</strong></a>(self, irc)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-connect"><strong>connect</strong></a>(self)</dt><dd><tt>Initializes a connection to a server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_472"><strong>handle_472</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the incoming 472 numeric.<br>
|
|
|
|
<br>
|
|
|
|
472 is sent to us when one of our clients tries to set a mode the uplink<br>
|
|
|
|
server doesn't support. In this case, we'll raise a warning to alert<br>
|
|
|
|
the administrator that certain extensions should be loaded for the best<br>
|
|
|
|
compatibility.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_bmask"><strong>handle_bmask</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming BMASK commands (ban propagation on burst).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_capab"><strong>handle_capab</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the CAPAB command, used for TS6 capability negotiation.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_chghost"><strong>handle_chghost</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming CHGHOST commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_encap"><strong>handle_encap</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the ENCAP command - encapsulated TS6 commands with a variety of<br>
|
|
|
|
subcommands used for different purposes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_euid"><strong>handle_euid</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming EUID commands (user introduction).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_invite"><strong>handle_invite</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming INVITEs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_join"><strong>handle_join</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming channel JOINs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_pass"><strong>handle_pass</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the PASS command, used to send the server's SID and negotiate<br>
|
|
|
|
passwords on connect.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_ping"><strong>handle_ping</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PING commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_server"><strong>handle_server</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles 1) incoming legacy (no SID) server introductions,<br>
|
|
|
|
2) Sending server data in initial connection.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_sid"><strong>handle_sid</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming server introductions.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_sjoin"><strong>handle_sjoin</strong></a>(self, servernumeric, command, args)</dt><dd><tt>Handles incoming SJOIN commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_tb"><strong>handle_tb</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming topic burst (TB) commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_tmode"><strong>handle_tmode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming TMODE commands (channel mode change).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_uid"><strong>handle_uid</strong></a>(self, numeric, command, args)</dt></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_whois"><strong>handle_whois</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming WHOIS commands.<br>
|
|
|
|
<br>
|
|
|
|
Note: The core of WHOIS handling is done by coreplugin.py<br>
|
|
|
|
(IRCd-independent), and not here.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-invite"><strong>invite</strong></a>(self, numeric, target, channel)</dt><dd><tt>Sends an INVITE from a PyLink client..</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-join"><strong>join</strong></a>(self, client, channel)</dt><dd><tt>Joins a PyLink client to a channel.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-kill"><strong>kill</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink client/server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-knock"><strong>knock</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a KNOCK from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-mode"><strong>mode</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends mode changes from a PyLink client/server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-ping"><strong>ping</strong></a>(self, source=None, target=None)</dt><dd><tt>Sends a PING to a target server. Periodic PINGs are sent to our uplink<br>
|
|
|
|
automatically by the Irc() internals; plugins shouldn't have to use this.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-sjoin"><strong>sjoin</strong></a>(self, server, channel, users, ts=None)</dt><dd><tt>Sends an SJOIN for a group of users to a channel.<br>
|
|
|
|
<br>
|
|
|
|
The sender should always be a Server ID (SID). TS is optional, and defaults<br>
|
|
|
|
to the one we've stored in the channel state if not given.<br>
|
|
|
|
<users> is a list of (prefix mode, UID) pairs:<br>
|
|
|
|
<br>
|
|
|
|
Example uses:<br>
|
|
|
|
<a href="#TS6Protocol-sjoin">sjoin</a>('100', '#test', [('', '100AAABBC'), ('o', 100AAABBB'), ('v', '100AAADDD')])<br>
|
|
|
|
<a href="#TS6Protocol-sjoin">sjoin</a>(self.<strong>irc</strong>.sid, '#test', [('o', self.<strong>irc</strong>.pseudoclient.uid)])</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None, manipulatable=False)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
|
|
|
<br>
|
|
|
|
Note: No nick collision / valid nickname checks are done here; it is<br>
|
|
|
|
up to plugins to make sure they don't introduce anything invalid.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-topicBurst"><strong>topicBurst</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a topic change from a PyLink server. This is usually used on burst.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-updateClient"><strong>updateClient</strong></a>(self, target, field, text)</dt><dd><tt>Updates the hostname of any connected client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Methods inherited from <a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>:<br>
|
|
|
|
<dl><dt><a name="TS6Protocol-away"><strong>away</strong></a>(self, source, text)</dt><dd><tt>Sends an AWAY message from a PyLink client. <text> can be an empty string<br>
|
|
|
|
to unset AWAY status.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_away"><strong>handle_away</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming AWAY messages.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_error"><strong>handle_error</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles ERROR messages - these mean that our uplink has disconnected us!</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for TS6 protocols.<br>
|
|
|
|
<br>
|
|
|
|
This passes most commands to the various handle_ABCD() functions<br>
|
|
|
|
elsewhere defined protocol modules, coersing various sender prefixes<br>
|
|
|
|
from nicks and server names to UIDs and SIDs respectively,<br>
|
|
|
|
whenever possible.<br>
|
|
|
|
<br>
|
|
|
|
Commands sent without an explicit sender prefix will have them set to<br>
|
|
|
|
the SID of the uplink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_kick"><strong>handle_kick</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KICKs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_kill"><strong>handle_kill</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KILLs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_nick"><strong>handle_nick</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming NICK changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_notice"><strong>handle_notice</strong></a> = handle_privmsg(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_part"><strong>handle_part</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PART commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_privmsg"><strong>handle_privmsg</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUIT commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_save"><strong>handle_save</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SAVE messages, used to handle nick collisions.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_squit"><strong>handle_squit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SQUITs (netsplits).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-handle_topic"><strong>handle_topic</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming TOPIC changes from clients. For topic bursts,<br>
|
|
|
|
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.</tt></dd></dl>
|
|
|
|
|
2016-03-26 19:42:12 +01:00
|
|
|
<dl><dt><a name="TS6Protocol-handle_version"><strong>handle_version</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles requests for the PyLink server version.</tt></dd></dl>
|
|
|
|
|
2016-03-12 08:13:55 +01:00
|
|
|
<dl><dt><a name="TS6Protocol-kick"><strong>kick</strong></a>(self, numeric, channel, target, reason=None)</dt><dd><tt>Sends kicks from a PyLink client/server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-message"><strong>message</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a PRIVMSG from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-nick"><strong>nick</strong></a>(self, numeric, newnick)</dt><dd><tt>Changes the nick of a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-notice"><strong>notice</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a NOTICE from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-numeric"><strong>numeric</strong></a>(self, source, numeric, target, text)</dt><dd><tt>Sends raw numerics from a server to a remote client, used for WHOIS<br>
|
|
|
|
replies.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-parseTS6Args"><strong>parseTS6Args</strong></a>(self, args)</dt><dd><tt>Similar to <a href="#TS6Protocol-parseArgs">parseArgs</a>(), but stripping leading colons from the first argument<br>
|
|
|
|
of a line (usually the sender field).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-part"><strong>part</strong></a>(self, client, channel, reason=None)</dt><dd><tt>Sends a part from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-quit"><strong>quit</strong></a>(self, numeric, reason)</dt><dd><tt>Quits a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)</dt><dd><tt>Spawns a server off a PyLink server. desc (server description)<br>
|
|
|
|
defaults to the one in the config. uplink defaults to the main PyLink<br>
|
|
|
|
server, and sid (the server ID) is automatically generated if not<br>
|
|
|
|
given.<br>
|
|
|
|
<br>
|
|
|
|
Note: TS6 doesn't use a specific ENDBURST command, so the endburst_delay<br>
|
|
|
|
option will be ignored if given.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-squit"><strong>squit</strong></a>(self, source, target, text='No reason given')</dt><dd><tt>SQUITs a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-topic"><strong>topic</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a TOPIC change from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Methods inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
|
|
|
<dl><dt><a name="TS6Protocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
|
|
|
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="TS6Protocol-updateTS"><strong>updateTS</strong></a>(self, channel, their_ts)</dt><dd><tt>Compares the current TS of the channel given with the new TS, resetting<br>
|
|
|
|
all modes we have if the one given is older.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#55aa55">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
2016-03-26 19:42:12 +01:00
|
|
|
<td width="100%"><strong>conf</strong> = {'bot': {'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'logging': {'stdout': 'CRITICAL'}, 'servers': defaultdict(<function <lambda> at 0x7f7bc713a598>, {})}<br>
|
2016-03-12 08:13:55 +01:00
|
|
|
<strong>confname</strong> = 'testconf'<br>
|
|
|
|
<strong>curdir</strong> = '/home/gl/pylink'<br>
|
|
|
|
<strong>files</strong> = None<br>
|
|
|
|
<strong>log</strong> = <logging.RootLogger object><br>
|
|
|
|
<strong>logdir</strong> = '/home/gl/pylink/log'<br>
|
|
|
|
<strong>logformatter</strong> = <logging.Formatter object><br>
|
2016-03-26 19:42:12 +01:00
|
|
|
<strong>stdout_handler</strong> = <logging.StreamHandler object><br>
|
2016-03-12 08:13:55 +01:00
|
|
|
<strong>stdout_level</strong> = 'CRITICAL'</td></tr></table>
|
|
|
|
</body></html>
|