mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 19:52:53 +01:00
unreal: add killServer/killClient
This commit is contained in:
parent
fcd1bf5c37
commit
76472560ab
@ -140,6 +140,25 @@ class UnrealProtocol(TS6BaseProtocol):
|
||||
if not (target is None or source is None):
|
||||
self._send(source, 'PING %s %s' % (self.irc.servers[source].name, self.irc.servers[target].name))
|
||||
|
||||
def killServer(self, numeric, target, reason):
|
||||
"""Sends a kill from a PyLink server."""
|
||||
# <- :GL KILL 38QAAAAAA :hidden-1C620195!GL (test)
|
||||
if not utils.isInternalServer(self.irc, numeric):
|
||||
raise LookupError('No such PyLink server exists.')
|
||||
|
||||
assert target in self.irc.users, "Unknown target %r for killServer!" % target
|
||||
# The killpath doesn't really matter here...
|
||||
self._send(numeric, 'KILL %s :%s!PyLink (%s)' % (target, self.irc.serverdata['hostname'], reason))
|
||||
self.removeClient(target)
|
||||
|
||||
def killClient(self, numeric, target, reason):
|
||||
"""Sends a kill from a PyLink client."""
|
||||
if not utils.isInternalClient(self.irc, numeric):
|
||||
raise LookupError('No such PyLink client exists.')
|
||||
assert target in self.irc.users, "Unknown target %r for killClient!" % target
|
||||
self._send(numeric, 'KILL %s :%s!PyLink (%s)' % (target, self.irc.serverdata['hostname'], reason))
|
||||
self.removeClient(target)
|
||||
|
||||
### HANDLERS
|
||||
|
||||
def connect(self):
|
||||
|
Loading…
Reference in New Issue
Block a user