| |
- ts6_common.TS6BaseProtocol(classes.Protocol)
-
- InspIRCdProtocol
Class = class InspIRCdProtocol(ts6_common.TS6BaseProtocol) |
|
Base Protocol module class for PyLink. |
|
- Method resolution order:
- InspIRCdProtocol
- ts6_common.TS6BaseProtocol
- classes.Protocol
- builtins.object
Methods defined here:
- __init__(self, irc)
- Initialize self. See help(type(self)) for accurate signature.
- away(self, source, text)
- Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status.
- connect(self)
- Initializes a connection to a server.
- handle_away(self, numeric, command, args)
- Handles incoming AWAY messages.
- handle_capab(self, source, command, args)
- Handles the CAPAB command, used for capability negotiation with our
uplink.
- handle_encap(self, numeric, command, args)
- Handles incoming encapsulated commands (ENCAP). Hook arguments
returned by this should have a parse_as field, that sets the correct
hook name for the message.
For InspIRCd, the only ENCAP command we handle right now is KNOCK.
- handle_endburst(self, numeric, command, args)
- ENDBURST handler; sends a hook with empty contents.
- handle_fhost(self, numeric, command, args)
- Handles FHOST, used for denoting hostname changes.
- handle_fident(self, numeric, command, args)
- Handles FIDENT, used for denoting ident changes.
- handle_fjoin(self, servernumeric, command, args)
- Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN).
- handle_fmode(self, numeric, command, args)
- Handles the FMODE command, used for channel mode changes.
- handle_fname(self, numeric, command, args)
- Handles FNAME, used for denoting real name/gecos changes.
- handle_ftopic(self, numeric, command, args)
- Handles incoming FTOPIC (sets topic on burst).
- handle_idle(self, numeric, command, args)
- Handles the IDLE command, sent between servers in remote WHOIS queries.
- handle_invite(self, numeric, command, args)
- Handles incoming INVITEs.
- handle_metadata(self, numeric, command, args)
- Handles the METADATA command, used by servers to send metadata (services
login name, certfp data, etc.) for clients.
- handle_mode(self, numeric, command, args)
- Handles incoming user mode changes.
- handle_opertype(self, numeric, command, args)
- Handles incoming OPERTYPE, which is used to denote an oper up.
This calls the internal hook CLIENT_OPERED, sets the internal
opertype of the client, and assumes setting user mode +o on the caller.
- handle_ping(self, source, command, args)
- Handles incoming PING commands, so we don't time out.
- handle_pong(self, source, command, args)
- Handles incoming PONG commands.
This is used to keep track of whether the uplink is alive by the Irc()
internals - a server that fails to reply to our PINGs eventually
times out and is disconnected.
- handle_rsquit(self, numeric, command, args)
- Handles the RSQUIT command, which is sent by opers to SQUIT remote
servers.
- handle_server(self, numeric, command, args)
- Handles incoming SERVER commands (introduction of servers).
- handle_svstopic = handle_ftopic(self, numeric, command, args)
- handle_uid(self, numeric, command, args)
- Handles incoming UID commands (user introduction).
- handle_version(self, numeric, command, args)
- Stub VERSION handler (does nothing) to override the one in ts6_common.
- invite(self, numeric, target, channel)
- Sends an INVITE from a PyLink client..
- join(self, client, channel)
- Joins a PyLink client to a channel.
- kill(self, numeric, target, reason)
- Sends a kill from a PyLink client/server.
- knock(self, numeric, target, text)
- Sends a KNOCK from a PyLink client.
- mode(self, numeric, target, modes, ts=None)
- Sends mode changes from a PyLink client/server.
- numeric(self, source, numeric, target, text)
- Sends raw numerics from a server to a remote client, used for WHOIS
replies.
- ping(self, source=None, target=None)
- Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.
- sjoin(self, server, channel, users, ts=None)
- Sends an SJOIN for a group of users to a channel.
The sender should always be a Server ID (SID). TS is optional, and defaults
to the one we've stored in the channel state if not given.
<users> is a list of (prefix mode, UID) pairs:
Example uses:
sjoin('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])
sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)])
- spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
- Spawns a new client with the given options.
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
- spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)
- Spawns a server off a PyLink server. desc (server description)
defaults to the one in the config. uplink defaults to the main PyLink
server, and sid (the server ID) is automatically generated if not
given.
If endburst_delay is set greater than zero, the sending of ENDBURST
will be delayed by the amount given. This can be used to prevent
pseudoserver bursts from triggering IRCd join-flood preventions,
and prevent connections from filling up the snomasks too much.
- squit(self, source, target, text='No reason given')
- SQUITs a PyLink server.
- topicBurst(self, numeric, target, text)
- Sends a topic change from a PyLink server. This is usually used on burst.
- updateClient(self, target, field, text)
- Updates the ident, host, or realname of any connected client.
Methods inherited from ts6_common.TS6BaseProtocol:
- handle_error(self, numeric, command, args)
- Handles ERROR messages - these mean that our uplink has disconnected us!
- handle_events(self, data)
- Event handler for TS6 protocols.
This passes most commands to the various handle_ABCD() functions
elsewhere defined protocol modules, coersing various sender prefixes
from nicks and server names to UIDs and SIDs respectively,
whenever possible.
Commands sent without an explicit sender prefix will have them set to
the SID of the uplink server.
- handle_kick(self, source, command, args)
- Handles incoming KICKs.
- handle_kill(self, source, command, args)
- Handles incoming KILLs.
- handle_nick(self, numeric, command, args)
- Handles incoming NICK changes.
- handle_notice = handle_privmsg(self, source, command, args)
- Handles incoming PRIVMSG/NOTICE.
- handle_part(self, source, command, args)
- Handles incoming PART commands.
- handle_privmsg(self, source, command, args)
- Handles incoming PRIVMSG/NOTICE.
- handle_quit(self, numeric, command, args)
- Handles incoming QUIT commands.
- handle_save(self, numeric, command, args)
- Handles incoming SAVE messages, used to handle nick collisions.
- handle_squit(self, numeric, command, args)
- Handles incoming SQUITs (netsplits).
- handle_topic(self, numeric, command, args)
- Handles incoming TOPIC changes from clients. For topic bursts,
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.
- kick(self, numeric, channel, target, reason=None)
- Sends kicks from a PyLink client/server.
- message(self, numeric, target, text)
- Sends a PRIVMSG from a PyLink client.
- nick(self, numeric, newnick)
- Changes the nick of a PyLink client.
- notice(self, numeric, target, text)
- Sends a NOTICE from a PyLink client.
- parseTS6Args(self, args)
- Similar to parseArgs(), but stripping leading colons from the first argument
of a line (usually the sender field).
- part(self, client, channel, reason=None)
- Sends a part from a PyLink client.
- quit(self, numeric, reason)
- Quits a PyLink client.
- topic(self, numeric, target, text)
- Sends a TOPIC change from a PyLink client.
Methods inherited from classes.Protocol:
- parseArgs(self, args)
- Parses a string of RFC1459-style arguments split into a list, where ":" may
be used for multi-word arguments that last until the end of a line.
- removeClient(self, numeric)
- Internal function to remove a client from our internal state.
- updateTS(self, channel, their_ts)
- Compares the current TS of the channel given with the new TS, resetting
all modes we have if the one given is older.
Data descriptors inherited from classes.Protocol:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class InspIRCdProtocol(ts6_common.TS6BaseProtocol) |
|
Base Protocol module class for PyLink. |
|
- Method resolution order:
- InspIRCdProtocol
- ts6_common.TS6BaseProtocol
- classes.Protocol
- builtins.object
Methods defined here:
- __init__(self, irc)
- Initialize self. See help(type(self)) for accurate signature.
- away(self, source, text)
- Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status.
- connect(self)
- Initializes a connection to a server.
- handle_away(self, numeric, command, args)
- Handles incoming AWAY messages.
- handle_capab(self, source, command, args)
- Handles the CAPAB command, used for capability negotiation with our
uplink.
- handle_encap(self, numeric, command, args)
- Handles incoming encapsulated commands (ENCAP). Hook arguments
returned by this should have a parse_as field, that sets the correct
hook name for the message.
For InspIRCd, the only ENCAP command we handle right now is KNOCK.
- handle_endburst(self, numeric, command, args)
- ENDBURST handler; sends a hook with empty contents.
- handle_fhost(self, numeric, command, args)
- Handles FHOST, used for denoting hostname changes.
- handle_fident(self, numeric, command, args)
- Handles FIDENT, used for denoting ident changes.
- handle_fjoin(self, servernumeric, command, args)
- Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN).
- handle_fmode(self, numeric, command, args)
- Handles the FMODE command, used for channel mode changes.
- handle_fname(self, numeric, command, args)
- Handles FNAME, used for denoting real name/gecos changes.
- handle_ftopic(self, numeric, command, args)
- Handles incoming FTOPIC (sets topic on burst).
- handle_idle(self, numeric, command, args)
- Handles the IDLE command, sent between servers in remote WHOIS queries.
- handle_invite(self, numeric, command, args)
- Handles incoming INVITEs.
- handle_metadata(self, numeric, command, args)
- Handles the METADATA command, used by servers to send metadata (services
login name, certfp data, etc.) for clients.
- handle_mode(self, numeric, command, args)
- Handles incoming user mode changes.
- handle_opertype(self, numeric, command, args)
- Handles incoming OPERTYPE, which is used to denote an oper up.
This calls the internal hook CLIENT_OPERED, sets the internal
opertype of the client, and assumes setting user mode +o on the caller.
- handle_ping(self, source, command, args)
- Handles incoming PING commands, so we don't time out.
- handle_pong(self, source, command, args)
- Handles incoming PONG commands.
This is used to keep track of whether the uplink is alive by the Irc()
internals - a server that fails to reply to our PINGs eventually
times out and is disconnected.
- handle_rsquit(self, numeric, command, args)
- Handles the RSQUIT command, which is sent by opers to SQUIT remote
servers.
- handle_server(self, numeric, command, args)
- Handles incoming SERVER commands (introduction of servers).
- handle_svstopic = handle_ftopic(self, numeric, command, args)
- handle_uid(self, numeric, command, args)
- Handles incoming UID commands (user introduction).
- handle_version(self, numeric, command, args)
- Stub VERSION handler (does nothing) to override the one in ts6_common.
- invite(self, numeric, target, channel)
- Sends an INVITE from a PyLink client..
- join(self, client, channel)
- Joins a PyLink client to a channel.
- kill(self, numeric, target, reason)
- Sends a kill from a PyLink client/server.
- knock(self, numeric, target, text)
- Sends a KNOCK from a PyLink client.
- mode(self, numeric, target, modes, ts=None)
- Sends mode changes from a PyLink client/server.
- numeric(self, source, numeric, target, text)
- Sends raw numerics from a server to a remote client, used for WHOIS
replies.
- ping(self, source=None, target=None)
- Sends a PING to a target server. Periodic PINGs are sent to our uplink
automatically by the Irc() internals; plugins shouldn't have to use this.
- sjoin(self, server, channel, users, ts=None)
- Sends an SJOIN for a group of users to a channel.
The sender should always be a Server ID (SID). TS is optional, and defaults
to the one we've stored in the channel state if not given.
<users> is a list of (prefix mode, UID) pairs:
Example uses:
sjoin('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])
sjoin(self.irc.sid, '#test', [('o', self.irc.pseudoclient.uid)])
- spawnClient(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype='IRC Operator', manipulatable=False)
- Spawns a new client with the given options.
Note: No nick collision / valid nickname checks are done here; it is
up to plugins to make sure they don't introduce anything invalid.
- spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0)
- Spawns a server off a PyLink server. desc (server description)
defaults to the one in the config. uplink defaults to the main PyLink
server, and sid (the server ID) is automatically generated if not
given.
If endburst_delay is set greater than zero, the sending of ENDBURST
will be delayed by the amount given. This can be used to prevent
pseudoserver bursts from triggering IRCd join-flood preventions,
and prevent connections from filling up the snomasks too much.
- squit(self, source, target, text='No reason given')
- SQUITs a PyLink server.
- topicBurst(self, numeric, target, text)
- Sends a topic change from a PyLink server. This is usually used on burst.
- updateClient(self, target, field, text)
- Updates the ident, host, or realname of any connected client.
Methods inherited from ts6_common.TS6BaseProtocol:
- handle_error(self, numeric, command, args)
- Handles ERROR messages - these mean that our uplink has disconnected us!
- handle_events(self, data)
- Event handler for TS6 protocols.
This passes most commands to the various handle_ABCD() functions
elsewhere defined protocol modules, coersing various sender prefixes
from nicks and server names to UIDs and SIDs respectively,
whenever possible.
Commands sent without an explicit sender prefix will have them set to
the SID of the uplink server.
- handle_kick(self, source, command, args)
- Handles incoming KICKs.
- handle_kill(self, source, command, args)
- Handles incoming KILLs.
- handle_nick(self, numeric, command, args)
- Handles incoming NICK changes.
- handle_notice = handle_privmsg(self, source, command, args)
- Handles incoming PRIVMSG/NOTICE.
- handle_part(self, source, command, args)
- Handles incoming PART commands.
- handle_privmsg(self, source, command, args)
- Handles incoming PRIVMSG/NOTICE.
- handle_quit(self, numeric, command, args)
- Handles incoming QUIT commands.
- handle_save(self, numeric, command, args)
- Handles incoming SAVE messages, used to handle nick collisions.
- handle_squit(self, numeric, command, args)
- Handles incoming SQUITs (netsplits).
- handle_topic(self, numeric, command, args)
- Handles incoming TOPIC changes from clients. For topic bursts,
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.
- kick(self, numeric, channel, target, reason=None)
- Sends kicks from a PyLink client/server.
- message(self, numeric, target, text)
- Sends a PRIVMSG from a PyLink client.
- nick(self, numeric, newnick)
- Changes the nick of a PyLink client.
- notice(self, numeric, target, text)
- Sends a NOTICE from a PyLink client.
- parseTS6Args(self, args)
- Similar to parseArgs(), but stripping leading colons from the first argument
of a line (usually the sender field).
- part(self, client, channel, reason=None)
- Sends a part from a PyLink client.
- quit(self, numeric, reason)
- Quits a PyLink client.
- topic(self, numeric, target, text)
- Sends a TOPIC change from a PyLink client.
Methods inherited from classes.Protocol:
- parseArgs(self, args)
- Parses a string of RFC1459-style arguments split into a list, where ":" may
be used for multi-word arguments that last until the end of a line.
- removeClient(self, numeric)
- Internal function to remove a client from our internal state.
- updateTS(self, channel, their_ts)
- Compares the current TS of the channel given with the new TS, resetting
all modes we have if the one given is older.
Data descriptors inherited from classes.Protocol:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |