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

unreal: send kill messages without killpath

Closes #671.
This commit is contained in:
James Lu 2021-12-25 01:00:42 -08:00
parent 171eccf9c7
commit d6de0d97f3

View File

@ -381,6 +381,16 @@ class UnrealProtocol(TS6BaseProtocol):
self.call_hooks([self.sid, 'CHGNAME', self.call_hooks([self.sid, 'CHGNAME',
{'target': target, 'newgecos': text}]) {'target': target, 'newgecos': text}])
def kill(self, source, target, reason):
"""Sends a kill from a PyLink client or server."""
if (not self.is_internal_client(source)) and \
(not self.is_internal_server(source)):
raise LookupError('No such PyLink client/server exists.')
self._send_with_prefix(source, 'KILL %s :%s' % (target, reason))
self._remove_client(target)
def knock(self, numeric, target, text): def knock(self, numeric, target, text):
"""Sends a KNOCK from a PyLink client.""" """Sends a KNOCK from a PyLink client."""
# KNOCKs in UnrealIRCd are actually just specially formatted NOTICEs, # KNOCKs in UnrealIRCd are actually just specially formatted NOTICEs,