Exemple #1
0
 def onChatReceived(self, name, txt):
     prefix = self.controller.getPlayerPrefix(name, Settings.value(Settings.SHOW_COUNTRY_FLAG_IN_CHAT))
     if (self.controller.username+" ".lower() in txt.lower() or " "+self.controller.username.lower() in txt.lower() or txt.lower()==self.controller.username.lower()):
         txt = cgi.escape(txt.strip()).replace(self.controller.username, "<b>{}</b>".format(self.controller.username))
         ggpo.common.sound.notify()
     else:
         txt = cgi.escape(txt.strip())
     urls = findURLs(txt)
     chat = prefix + txt
     if urls:
         chat = prefix + replaceURLs(txt)
     self.appendChat(replaceReplayID(chat))
Exemple #2
0
 def onChatReceived(self, name, txt):
     if name=="System" and "GAME: " in txt and Settings.value(Settings.HIDE_INGAME_CHAT):
         return
     if name=="System" and "GAME: " in txt and not Settings.value(Settings.HIDE_INGAME_CHAT):
         txt = re.sub(r'<System> ', r'', txt)
     prefix = self.controller.getPlayerPrefix(name, Settings.value(Settings.SHOW_COUNTRY_FLAG_IN_CHAT))
     if (self.controller.username+" ".lower() in txt.lower() or " "+self.controller.username.lower() in txt.lower() or txt.lower()==self.controller.username.lower()):
         txt = cgi.escape(txt.strip()).replace(self.controller.username, "<b>{}</b>".format(self.controller.username))
         ggpo.common.sound.notify()
     else:
         txt = cgi.escape(txt.strip())
     urls = findURLs(txt)
     chat = prefix + txt
     if urls:
         chat = prefix + replaceURLs(txt)
     self.appendChat(replaceReplayID(chat))
Exemple #3
0
 def onChatReceived(self, name, txt):
     prefix = self.controller.getPlayerPrefix(
         name, Settings.value(Settings.SHOW_COUNTRY_FLAG_IN_CHAT))
     if (self.controller.username + " ".lower() in txt.lower()
             or " " + self.controller.username.lower() in txt.lower()
             or txt.lower() == self.controller.username.lower()):
         txt = cgi.escape(txt.strip()).replace(
             self.controller.username,
             "<b>{}</b>".format(self.controller.username))
         ggpo.common.sound.notify()
     else:
         txt = cgi.escape(txt.strip())
     urls = findURLs(txt)
     chat = prefix + txt
     if urls:
         chat = prefix + replaceURLs(txt)
     self.appendChat(replaceReplayID(chat))
Exemple #4
0
 def onChatReceived(self, name, txt):
     if name == "System" and "GAME: " in txt and Settings.value(
             Settings.HIDE_INGAME_CHAT):
         return
     if name == "System" and "GAME: " in txt and not Settings.value(
             Settings.HIDE_INGAME_CHAT):
         txt = re.sub(r'<System> ', r'', txt)
     prefix = self.controller.getPlayerPrefix(
         name, Settings.value(Settings.SHOW_COUNTRY_FLAG_IN_CHAT))
     if (self.controller.username + " ".lower() in txt.lower()
             or " " + self.controller.username.lower() in txt.lower()
             or txt.lower() == self.controller.username.lower()):
         txt = html.escape(txt.strip()).replace(
             self.controller.username,
             "<b>{}</b>".format(self.controller.username))
         ggpo.common.sound.notify()
     else:
         txt = html.escape(txt.strip())
     urls = findURLs(txt)
     chat = prefix + txt
     if urls:
         chat = prefix + replaceURLs(txt)
     self.appendChat(replaceReplayID(chat))