def onChatReceived(self, name, txt): prefix = self.controller.getPlayerPrefix(name, Settings.value(Settings.SHOW_COUNTRY_FLAG_IN_CHAT)) txt = cgi.escape(txt.strip()).replace(self.controller.username, "<b>{}</b>".format(self.controller.username)) urls = findURLs(txt) chat = prefix + txt if urls: for url in urls: chat += " <a href='" + url + "'><font color=green>link</font></a>" self.appendChat(chat)
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))
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))
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))
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))