예제 #1
0
 def onUpdateClientEvent(self, schid, clientID, invokerID, invokerName,
                         invokerUniqueIdentifier):
     if not self.update == clientID: return
     self.update = 0
     (error, connects) = ts3lib.getClientVariableAsUInt64(
         schid, clientID,
         ts3defines.ClientPropertiesRare.CLIENT_TOTALCONNECTIONS)
     (error, uid) = ts3lib.getClientVariableAsString(
         schid, clientID,
         ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
     if self.debug:
         ts3lib.printMessageToCurrentTab(
             "error: {0} | connects: {1} | uid: {2}".format(
                 error, connects, uid))
     if connects > 1 and not uid == "x63jNGEr/PXnu9l3bFECzMzWfXk=": return
     (error, suid) = ts3lib.getServerVariableAsString(
         schid,
         ts3defines.VirtualServerProperties.VIRTUALSERVER_UNIQUE_IDENTIFIER)
     (error, country) = ts3lib.getClientVariableAsString(
         schid, clientID, ts3defines.ClientPropertiesRare.CLIENT_COUNTRY)
     if self.debug:
         ts3lib.printMessageToCurrentTab("error: {0} | country: {1}".format(
             error, country))
     msg = self.cfg.get(suid, country, fallback=self.cfg.get(suid, 'US'))
     if '{nick}' in msg:
         msg = msg.replace('{nick}', self.clientURL(schid, clientID, uid))
     if '{country}' in msg: msg = msg.replace('{country}', country)
     if '{cid}' in msg: msg = msg.replace('{cid}', clientID)
     if '{uid}' in msg: msg = msg.replace('{uid}', uid)
     if '{connects}' in msg: msg = msg.replace('{connects}', connects)
     msg = [msg[i:i + 1024] for i in range(0, len(msg), 1024)]
     for message in msg:
         ts3lib.requestSendPrivateTextMsg(schid, "{0}".format(message),
                                          clientID)
     (error, ownid) = ts3lib.getClientID(schid)
     (error, _uid) = ts3lib.getClientVariableAsString(
         schid, ownid, ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
     ts3lib.clientChatClosed(schid, uid, clientID)
     ts3lib.printMessageToCurrentTab(
         "Sent client {0} the welcome message for {1}".format(
             clientID, suid))
예제 #2
0
 def chatClosed(self, msg):
     err = ts3lib.clientChatClosed(self.schid, self.uniqueIdentifier,
                                   self.clientID)
     if err != ts3defines.ERROR_ok:
         raise ts3Error("Error closing client chat: (%s, %s)" %
                        (err, ts3lib.getErrorMessage(err)[1]))
예제 #3
0
    def onUpdateClientEvent(self, schid, clientID, invokerID, invokerName,
                            invokerUniqueIdentifier):
        if not self.requested or not self.toggle: return
        error, _uid = ts3.getServerVariable(
            schid,
            ts3defines.VirtualServerProperties.VIRTUALSERVER_UNIQUE_IDENTIFIER)
        if _uid in self.blacklist: return
        self.requested = False
        (error, _uid) = ts3.getClientVariable(
            schid, clientID,
            ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
        if _uid in self._sent: return
        _done = False
        (error, country) = ts3.getClientVariable(
            schid, clientID, ts3defines.ClientPropertiesRare.CLIENT_COUNTRY)
        if self.debug:
            ts3.printMessageToCurrentTab(
                "clid: {} error: {} country: {}".format(
                    clientID, error, country))
        if self.checkOutdatedVersion:
            (error, platform) = ts3.getClientVariable(
                schid, clientID, ts3defines.ClientProperties.CLIENT_PLATFORM)
            if self.debug:
                ts3.printMessageToCurrentTab(
                    "clid: {} error: {} platform: {}".format(
                        clientID, error, platform))
            if not platform in ["Windows", "OSX", "Linux"]: return
            (error, targetVer) = ts3.getClientVariable(
                schid, clientID, ts3defines.ClientProperties.CLIENT_VERSION)
            if self.debug:
                ts3.printMessageToCurrentTab(
                    "clid: {} error: {} targetVer: {}".format(
                        clientID, error, targetVer))
            if error == ts3defines.ERROR_ok:
                current = self.parseVersion(targetVer)
                if current["rev"] < self.versions["clientrev"]:
                    if country in ["DE", "CH", "AT"]:
                        msg = """[b][color=red]Hinweis[/color][/b]
Du nutzt eine veraltete Version von Teamspeak ([color=red]{current}[/color]).
Bitte aktualisiere deinen Client auf Version [color=blue]{latest}[/color] um mögliche Sicherheitsrisiken auszuschliessen.
Um zu updaten gehe einfach auf "Hilfe" => "Nach Aktualisierung suchen"
Falls du nicht aktualisierst setzt du dich unter Umständen einigen Gefahren aus.
Hier mal ein paar Beispiele: https://r4p3.net/resources/exploit-overview.84/
                        """
                    else:
                        msg = """[b][color=red]Attention[/color][/b]
You are using a outdated version of Teamspeak ([color=red]{current}[/color]).
Your version is very likely vulnerable to several exploits.
Please update your Client to Version [color=blue]{latest}[/color]
To update click on "Help" => "Check for Update"
If you don't update you might risk your computer being hacked.
Some examples: https://r4p3.net/resources/exploit-overview.84/
                        """
                    ts3.requestSendPrivateTextMsg(
                        schid,
                        msg.format(current=current["ver"],
                                   latest=self.versions["clientver"]),
                        clientID)
                    _done = True
        if self.checkUnreadMessages:
            (error, platform) = ts3.getClientVariable(
                schid, clientID, ts3defines.ClientProperties.CLIENT_PLATFORM)
            if self.debug:
                ts3.printMessageToCurrentTab(
                    "clid: {} error: {} platform: {}".format(
                        clientID, error, platform))
            if platform in ["Android", "iOS"]: return
            (error, messages) = ts3.getClientVariableAsInt(
                schid, clientID,
                ts3defines.ClientPropertiesRare.CLIENT_UNREAD_MESSAGES)
            if self.debug:
                ts3.printMessageToCurrentTab(
                    "clid: {} error: {} messages: {}".format(
                        clientID, error, messages))
            if messages > 0:
                if country in ["DE", "CH", "AT"]:
                    msg = """[b][color=orange]Hinweis[/color][/b]
Du hast [color=blue]%s[/color] ungelesene Offline Nachrichte(n).
Du kannst sie nachlesen indem du auf \"Extras\" => \"Offline Nachrichten\" klickst oder einfach [STRG]+[O] auf deiner Tastatur drückst.
                    """
                else:
                    msg = """[b][color=orange]Reminder[/color][/b]
You have [color=blue]%s[/color] unread offline message(s).
You can read them by clicking on \"Tools\" => \"Offline Messages\" or pressing [CTRL]+[O] on your keyboard.
                    """
                ts3.requestSendPrivateTextMsg(schid, msg % messages, clientID)
                _done = True
            if _done:
                self._sent.extend([_uid])
                (err, _ownuid) = ts3.getClientSelfVariable(
                    schid,
                    ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
                close = ts3.clientChatClosed(schid, _ownuid, clientID)
                if self.debug:
                    ts3.printMessageToCurrentTab(
                        "\nSCHID: {}\nownUID: {}\nclientID: {}\nclientUID: {}\nclosed: {}\nerrorid: {}"
                        .format(schid, _ownuid, clientID, _uid,
                                close == ts3defines.ERROR_ok, close))