def sayqueuelistenerworker(self): while self.working: message = self.sayqueue.get() message = self.stripColors(prefixText([self.msgPrefix], message)).strip() for line in self.getWrap(message): self.write(self.getCommand('say', message=line)) time.sleep(self._message_delay)
def saybigqueuelistenerworker(self): while self.working: msg = self.saybigqueue.get() for line in self.getWrap( self.stripColors(prefixText([self.msgPrefix], msg))): self.write( self.getCommand('saybig', message=line, duration=2400)) time.sleep(self._message_delay)
def saybig(self, msg): """ Broadcast a message to all players in a way that will catch their attention. :param msg: The message to be broadcasted """ msg = prefixText(['#' + self.msgPrefix + '#'], self.stripColors(msg)) for line in self.getWrap(msg): self.write('SAY %s' % line)
def say(self, msg): """ Broadcast a message to all players. :param msg: The message to be broadcasted """ msg = prefixText([self.msgPrefix], self.stripMsgColors(msg)) for line in self.getWrap(msg): self.write(self.getCommand('say', message=line))
def say(self, msg): """ Broadcast a message to all players. :param msg: The message to be broadcasted """ msg = prefixText([self.msgPrefix], self.stripColors(msg)) for line in self.getWrap(msg): self.write('SAY %s' % line)
def saybig(self, msg): """ Broadcast a message to all players in a way that will catch their attention. :param msg: The message to be sent. """ message = self.stripColors(prefixText([self.msgPrefix], msg)).strip() for line in self.getWrap(message): self.write(self.getCommand('saybig', message=line))
def say(self, text): """ Broadcast a message to all players. :param text: The message to be sent. """ message = self.stripColors(prefixText([self.msgPrefix], text)).strip() for line in self.getWrap(message): self.write(self.getCommand('say', message=line))
def saybig(self, msg, *args): """ Broadcast a message to all players in a way that will catch their attention. """ if msg and len(msg.strip()) > 0: msg = msg % args text = self.stripColors(prefixText([self.msgPrefix], msg)) for line in self.getWrap(text): self.write(self.getCommand('yell', message=line))
def message(self, client, text): """ Display a message to a given client :param client: The client to who send the message :param text: The message to be sent """ # actually send private messages text = prefixText([self.msgPrefix], self.stripMsgColors(text)) for line in self.getWrap(text): self.write(self.getCommand('message', uid=client.guid, message=line))
def say(self, text): """ Broadcast a message to all players. :param text: The message to be broadcasted """ lines = [] message = prefixText([self.msgPrefix], text) message = message.strip() for line in self.getWrap(message): lines.append(self.getCommand('say', message=line)) self.writelines(lines)
def message(self, client, text): """ Send a private message to a client. :param client: The client to who send the message. :param text: The message to be sent. """ # actually send private messages message = prefixText([self.msgPrefix, self.pmPrefix], text) message = self.stripColors(message).strip() for line in self.getWrap(message): self.write(self.getCommand('message', uid=client.guid, message=line))
def message(self, client, text): """ Need to override message format. Game does not support PM's """ lines = [] message = prefixText([self.msgPrefix, "^7[^3%s^7]:" % client.name], text) message = message.strip() for line in self.getWrap(message): lines.append(self.getCommand('message', message=line)) self.writelines(lines)
def message(self, client, text): """ Need to override message format. Game does not support PM's """ lines = [] message = prefixText( [self.msgPrefix, "^7[^3%s^7]:" % client.name], text) message = message.strip() for line in self.getWrap(message): lines.append(self.getCommand('message', message=line)) self.writelines(lines)
def sayDead(self, text): """ Send a private message to all the dead clients. :param text: The message to be sent. """ lines = [] message = prefixText([self.msgPrefix, self.deadPrefix], text) message = message.strip() wrapped = self.getWrap(message) for client in self.clients.getClientsByState(b3.STATE_DEAD): if client.cid: for line in wrapped: lines.append(self.getCommand('message', cid=client.cid, message=line)) self.writelines(lines)
def saybig(self, msg, *args): """ Broadcast a message to all players in a way that will catch their attention. :param msg: The message to be broadcasted """ if msg and len(msg.strip()): msg = msg % args template = 'sm_hsay %s' if "B3 Say" in self.sm_plugins: template = 'b3_hsay %s' else: msg = prefixText([self.msgPrefix], msg) for line in self.getWrap(msg): self.output.write(template % line)
def message(self, client, msg, *args): """ Display a message to a given client :param client: The client to who send the message :param msg: The message to be sent """ if not client.bot: # do not talk to bots msg = msg % args if msg and len(msg.strip()): template = 'sm_psay #%(guid)s "%(msg)s"' if "B3 Say" in self.sm_plugins: template = 'b3_psay #%(guid)s "%(msg)s"' else: msg = prefixText([self.msgPrefix], msg) for line in self.getWrap(msg): self.output.write(template % {'guid': client.guid, 'msg': line})
def message(self, client, text): """ Send a private message to a client. :param client: The client to who send the message. :param text: The message to be sent. """ if client is None: # do a normal say self.say(text) return lines = [] message = prefixText([self.msgPrefix, self.pmPrefix], text) message = message.strip() for line in self.getWrap(message): lines.append(self.getCommand('message', name=client.name, message=line)) self.writelines(lines)
def message(self, client, text): """ Send a private message to a client. :param client: The client to who send the message. :param text: The message to be sent. """ if client is None: # do a normal say self.say(text) return lines = [] message = prefixText([self.msgPrefix, self.pmPrefix], text) message = message.strip() for line in self.getWrap(message): lines.append( self.getCommand('message', name=client.name, message=line)) self.writelines(lines)
def saybigqueuelistenerworker(self): while self.working: msg = self.saybigqueue.get() for line in self.getWrap(self.stripColors(prefixText([self.msgPrefix], msg))): self.write(self.getCommand('saybig', message=line, duration=2400)) time.sleep(self._message_delay)