Exemplo n.º 1
0
    def __getitem__(self, key):
        cs = minqlbot.get_configstring(0, self.cached)
        if not cs:
            self.__valid = False
            raise NonexistentGameError("Invalid game. Did the bot disconnect?")

        cvars = minqlbot.parse_variables(cs)
        return cvars[key]
Exemplo n.º 2
0
    def __getitem__(self, key):
        cs = minqlbot.get_configstring(0, self.cached)
        if not cs:
            self.__valid = False
            raise NonexistentGameError("Invalid game. Did the bot disconnect?")

        cvars = minqlbot.parse_variables(cs)
        return cvars[key]
Exemplo n.º 3
0
    def __contains__(self, key):
        if not self.__valid:
            self.__invalidate()

        cs = self.configstring(529 + self.__id, self.cached)
        if not cs:
            self.__invalidate()

        cvars = minqlbot.parse_variables(cs)
        return key in cvars
Exemplo n.º 4
0
    def __contains__(self, key):
        if not self.__valid:
            self.__invalidate()

        cs = self.configstring(529 + self.__id, self.cached)
        if not cs:
            self.__invalidate()

        cvars = minqlbot.parse_variables(cs)
        return key in cvars
Exemplo n.º 5
0
    def __getitem__(self, key):
        if not self.__valid:
            self.__invalidate()

        cs = self.configstring(529 + self.__id, self.cached)
        if not cs:
            self.__invalidate()

        cvars = minqlbot.parse_variables(cs)
        # Could still be invalid, so we need to check the name.
        if self.__name and self.__name.lower() != re.sub(r"\^[0-9]", "", cvars["n"]).lower():
            self.__invalidate()
        return cvars[key]
Exemplo n.º 6
0
    def __getitem__(self, key):
        if not self.__valid:
            self.__invalidate()

        cs = self.configstring(529 + self.__id, self.cached)
        if not cs:
            self.__invalidate()

        cvars = minqlbot.parse_variables(cs)
        # Could still be invalid, so we need to check the name.
        if self.__name and self.__name.lower() != re.sub(
                r"\^[0-9]", "", cvars["n"]).lower():
            self.__invalidate()
        return cvars[key]