Esempio n. 1
0
 def onConnectStatusChangeEvent(self, schid, newStatus, errorNumber):
     if newStatus != ts3defines.ConnectStatus.STATUS_CONNECTION_ESTABLISHED: return
     (err, suid) = ts3lib.getServerVariable(schid, ts3defines.VirtualServerProperties.VIRTUALSERVER_UNIQUE_IDENTIFIER)
     if suid != self.suid: return
     (err, uid) = ts3lib.getClientSelfVariable(schid, ts3defines.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
     self.requested = uid
     ts3lib.requestClientDBIDfromUID(schid, uid)
Esempio n. 2
0
 def checkUser(self, uid):
     if not self.check: return False
     if self.toggle:
         if len(self.ownchannels) > 0:
             if uid != "serveradmin" and uid != "ServerQuery":
                 _in = self.InContacts(uid)
                 if _in < 2:
                     _schid = ts3lib.getCurrentschid()
                     self.requestedC.extend([_in])
                     ts3lib.requestClientDBIDfromUID(_schid, uid)
Esempio n. 3
0
 def onClientKickFromChannelEvent(self, schid, clientID, oldChannelID,
                                  newChannelID, visibility, kickerID,
                                  kickerName, kickerUniqueIdentifier,
                                  kickMessage):
     if not self.autoBanOnKick: return False
     if self.toggle:
         (error, _clid) = ts3lib.getClientID(schid)
         if not clientID == _clid:
             (error, _cgid) = ts3lib.getClientVariableAsInt(
                 schid, _clid, ts3defines.ClientPropertiesRare.
                 CLIENT_CHANNEL_GROUP_ID)
             if _cgid == self.smgroup or _cgid == self.sagroup:
                 (error, _cid) = ts3lib.getChannelOfClient(schid, _clid)
                 (error, uid) = ts3lib.getClientVariableAsString(
                     schid, clientID, ts3defines.ClientProperties.
                     CLIENT_UNIQUE_IDENTIFIER)
                 if oldChannelID == _cid and kickMessage == "":
                     self.checkcurrent = uid
                     ts3lib.requestClientDBIDfromUID(schid, uid)
Esempio n. 4
0
 def onNewChannelCreatedEvent(self, schid, cid, channelParentID, clid, name,
                              uid):
     if not self.toggle: return
     if not schid in self.cgroups: return
     (err, sname) = ts3lib.getServerVariable(
         schid, ts3defines.VirtualServerProperties.VIRTUALSERVER_NAME)
     (err, suid) = ts3lib.getServerVariable(
         schid,
         ts3defines.VirtualServerProperties.VIRTUALSERVER_UNIQUE_IDENTIFIER)
     (err, dbid) = ts3lib.getClientVariable(
         schid, clid, ts3defines.ClientPropertiesRare.CLIENT_DATABASE_ID)
     if err != ts3defines.ERROR_ok or not dbid:
         if not schid in self.waitForDBID: self.waitForDBID[schid] = list()
         item = (uid, name, clid, cid, suid, sname)
         self.waitForDBID[schid].append(item)
         ts3lib.requestClientDBIDfromUID(schid, uid)
         return
     cgid = self.cgroups[schid]["admin"]
     # ts3lib.printMessageToCurrentTab("onNewChannelCreatedEvent > NEW CHANNEL CREATED BY {} as {}".format(clid, cgid))
     self.dbInsert(schid, cid, clid, cgid, dbid, sname, suid)
Esempio n. 5
0
 def onUpdateClientEvent(self, schid, clientID, invokerID, invokerName, invokerUniqueIdentifier):
     return
     if self.check and self.toggle:
         (error, _clid) = ts3lib.getClientID(schid)
         if not clientID == _clid:
             (error, _tcid) = ts3lib.getChannelOfClient(schid, clientID)
             if _tcid in self.ownchannels:
                 (error, _cgid) = ts3lib.getClientVariableAsInt(schid, _clid, ts3defines.ClientPropertiesRare.CLIENT_CHANNEL_GROUP_ID)
                 if _cgid in [self.smgroup, self.sagroup]:
                     if self.checkRecording:
                         (error, clientRecStatus) = ts3lib.getClientVariableAsInt(schid, clientID, ts3defines.ClientProperties.CLIENT_IS_RECORDING)
                         if clientRecStatus == 1:
                             self.reason == "Recording"
                             _schid = ts3lib.getCurrentschid()
                             self.requestedC.extend([1])
                             _dbid = ts3lib.requestClientDBIDfromUID(_schid, invokerUniqueIdentifier)