コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
ファイル: __init__.py プロジェクト: HaoDrang/big-brother-bot
 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)
コード例 #4
0
 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))
コード例 #5
0
ファイル: __init__.py プロジェクト: HaoDrang/big-brother-bot
 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)
コード例 #6
0
 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))
コード例 #7
0
ファイル: __init__.py プロジェクト: HaoDrang/big-brother-bot
 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))
コード例 #8
0
ファイル: __init__.py プロジェクト: HaoDrang/big-brother-bot
 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))
コード例 #9
0
 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))
コード例 #10
0
 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)
コード例 #11
0
 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)
コード例 #12
0
 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)
コード例 #13
0
 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))
コード例 #14
0
 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))
コード例 #15
0
 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))
コード例 #16
0
 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)
コード例 #17
0
ファイル: __init__.py プロジェクト: HaoDrang/big-brother-bot
 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))
コード例 #18
0
 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)
コード例 #19
0
 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))
コード例 #20
0
 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)
コード例 #21
0
 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)
コード例 #22
0
 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)
コード例 #23
0
 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)
コード例 #24
0
 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)
コード例 #25
0
 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})
コード例 #26
0
ファイル: etpro.py プロジェクト: HaoDrang/big-brother-bot
    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)
コード例 #27
0
    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)
コード例 #28
0
ファイル: bfbc2.py プロジェクト: HaoDrang/big-brother-bot
 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)