Hi Courgette!
Ive tried to find the privatemessage-code, so first i have declared what i am searching for: some kind of rcon-command send by b3.
The search started in admin.py. Search for the cmd "kick". Found in line 1108.
def cmd_kick(self, data, client=None, cmd=None):
"""\
<name> [<reason>] - kick a player
"""
m = self.parseUserCmd(data)
if not m:
client.message('^7Invalid parameters')
return False
cid, keyword = m
reason = self.getReason(keyword)
if not reason and client.maxLevel < self.config.getint('settings', 'noreason_level'):
client.message('^1ERROR: ^7You must supply a reason')
return False
sclient = self.findClientPrompt(cid, client)
if sclient:
if sclient.cid == client.cid:
self.console.say(self.getMessage('kick_self', client.exactName))
return True
elif sclient.maxLevel >= client.maxLevel:
if sclient.maskGroup:
client.message('^7%s ^7is a masked higher level player, can\'t kick' % client.exactName)
else:
self.console.say(self.getMessage('kick_denied', sclient.exactName, client.exactName, sclient.exactName))
return True
else:
sclient.kick(reason, keyword, client)
return True
elif re.match('^[0-9]+$', cid):
# failsafe, do a manual client id ban
self.console.kick(cid, reason, client)
the interesting line for me was: client.message('^7Invalid parameters')
a class client with the method message! that should be what im looking for. so ive searched the method and found it in file clients.py at line 541.
def message(self, msg):
self.console.message(self, msg)
and there my trace stops: i cant find the class console. ive searched for "class console" in the whole b3-folder but the search is endless.
could someone explain how it is working? sending a chat-message to just ONE player.
i just know: rcon("say message to all");
many thanks!