예제 #1
0
    def loadFromString(self, xmlstring):
        """\
        Read the xml config from a string
        """

        self.fileName = None
        self.fileMtime = time.time()

        try:
            self._xml = ElementTree.XML(xmlstring)
        except ExpatError, e:
            raise ConfigFileNotValid("%s" % e)
예제 #2
0
        self._checkqueue.put(self._checkqueue_end_token)

            
    def _checkClient(self, client):
        """\
        Examine players steam community id and allow/deny connection.
        """
        self.debug('checking %s (%s)', client, client.guid)
        try:
            response = self._query_service(client.guid)
        except Exception, err:
            self.exception(err)
        else:
            if response:
                try:
                    xml = ElementTree.XML(response)
                    error = xml.findtext('./error', None)
                    if error:
                        self.warning("Steam answered with error : %s", error)
                    else:
                        bandata = xml.findtext('./vacBanned', None)
                        if bandata is None:
                            self.info("cannot tell if banned. received : %s" % response)
                        elif bandata == '0':
                            self.info("%s has no VAC ban", client.name)
                        elif bandata == '1':
                            self.info("%s (%s) is banned by VAC", client.name, client.guid)
                            self._takeActionAgainst(client)
                except ExpatError, e:
                    self.error(e)
            else: