Beispiel #1
0
def check_djc_role_binding():
    load_config("config.toml", "config.toml.local")
    cfg = config()

    if not has_any_account_in_normal_run(cfg):
        logger.warning("未发现任何有效的账户配置,请检查配置文件")
        os.system("PAUSE")
        exit(-1)

    _show_head_line("启动时检查各账号是否在道聚城绑定了dnf账号和任意手游账号")

    while True:
        all_binded = True
        not_binded_accounts = []

        for _idx, account_config in enumerate(cfg.account_configs):
            idx = _idx + 1
            if not account_config.is_enabled():
                # 未启用的账户的账户不走该流程
                continue

            logger.warning(
                color("fg_bold_yellow") +
                "------------检查第{}个账户({})------------".format(
                    idx, account_config.name))
            djcHelper = DjcHelper(account_config, cfg.common)
            if not djcHelper.check_djc_role_binding():
                all_binded = False
                not_binded_accounts.append(account_config.name)

        if all_binded:
            break
        else:
            logger.warning(
                color("fg_bold_yellow") +
                "请前往道聚城将上述提示的未绑定dnf或任意手游的账号【{}】进行绑定,具体操作流程可以参考使用文档或者教学视频。".
                format(not_binded_accounts))
            logger.warning(
                color("fg_bold_yellow") +
                "如果本账号不需要道聚城相关操作,可以打开配置表,将该账号的cannot_bind_dnf设为true,game_name设为无,即可跳过道聚城相关操作"
            )
            logger.warning(
                color("fg_bold_yellow") +
                "  ps: 上面这个cannot_bind_dnf之前笔误写成了cannot_band_dnf,如果之前填过,请手动把配置名称改成cannot_bind_dnf~"
            )
            logger.warning(color("fg_bold_cyan") + "操作完成后点击任意键即可再次进行检查流程...")
            os.system("PAUSE")

            # 这时候重新读取一遍用户修改过后的配置文件(比如把手游设为了 无 )
            load_config("config.toml", "config.toml.local")
            cfg = config()
Beispiel #2
0
def check_djc_role_binding():
    load_config("config.toml", "config.toml.local")
    cfg = config()

    if not has_any_account_in_normal_run(cfg):
        logger.warning("未发现任何有效的账户配置,请检查配置文件")
        os.system("PAUSE")
        exit(-1)

    _show_head_line("启动时检查各账号是否在道聚城绑定了dnf账号和任意手游账号")

    while True:
        all_binded = True

        for _idx, account_config in enumerate(cfg.account_configs):
            idx = _idx + 1
            if not account_config.is_enabled():
                # 未启用的账户的账户不走该流程
                continue

            logger.warning(
                color("fg_bold_yellow") +
                "------------检查第{}个账户({})------------".format(
                    idx, account_config.name))
            djcHelper = DjcHelper(account_config, cfg.common)
            if not djcHelper.check_djc_role_binding():
                all_binded = False

        if all_binded:
            break
        else:
            logger.warning(
                color("fg_bold_yellow") +
                "请前往道聚城将上述提示的未绑定dnf或任意手游的账号进行绑定,具体操作流程可以参考使用文档或者教学视频。")
            logger.warning(color("fg_bold_cyan") + "操作完成后点击任意键即可再次进行检查流程...")
            os.system("PAUSE")

            # 这时候重新读取一遍用户修改过后的配置文件(比如把手游设为了 无 )
            load_config("config.toml", "config.toml.local")
            cfg = config()