Skip to main content

游戏开发人员脚本工具

配置

安装本工具:

pip3 install saiblo-dev-tools

使用前请先执行:

saiblo-dev-tools init

脚本会在 ~/ 下创建 .saiblo-dev-tools 目录,里面将会存放所有配置文件。初始化后,请编辑 ~/.saiblo-dev-tools/config.json,按照模板填写配置文件。

选项

脚本包含了若干子命令,在每个子命令下有对应的帮助信息:

saiblo-dev-tools <subcommand> --help

init

saiblo-dev-tools init

会将 ~/.saiblo-dev-tools/config.json 和 database.json 复原为模板文件。

ai

AI 管理脚本。AI 以 <tag>: <token> 的形式存储在 ~/.saiblo-dev-tools/database.json 的 ai 字段下。<tag> 为人类友好的名称,<token> 用于在 Saiblo 数据库中唯一确定某个 AI. "human" 保留给人类玩家,请勿使用。

  • -d, --delete <tag>
    

    删除名为 <tag> 的 AI,并将其 token 打印出来,防止误操作。

  • -i, --insert <tag> <token>
    

    添加 AI,若 <tag> 已存在,则会覆盖,但会将原有 AI 的 token 打印出来。脚本不会对 token 的合法性进行检验。

  • -l, --list
    

    显示数据库中所有 AI.

  • -r, --rename <old_tag> <new_tag>
    

    将名为 <old_tag> 的 AI 更名为 <new_tag>. 若 <new_tag> 已存在,则会覆盖,但会将原有 AI 的 token 打印出来。

  • -u, --upload <config_path>
    

    上传 AI 至 Saiblo,并将 token 添加进本地数据库。<config_path> 为配置文件的路径,格式如下:

    {
        "game": number,  // <game_id>
        "language": string,  // {c, cmake, cpp, make, python, python_zip}
        "path": string,  // AI 代码的路径,需要打包成单文件
        "tag": string,  // <tag>
    }
    

game

游戏管理脚本。

  • -t, --test <config_path> <result_dir>
    

    在 Saiblo 上发起一次评测。<result_dir> 为存放评测信息的目录,将包含配置信息、评测结果、回放文件。<config_path> 是配置文件的路径,格式如下:

    {
        "ai": [
            string,  // <tag>
            ...
        ],
        "config": any,  // 自定义配置信息,若无,可以填空字符串
        "game": number,  // <game_id>
    }
    

    saiblo-dev-tools 现已支持启动人机、人人对战,你只需要将上述配置文件中原本填写 ai tag 的位置改为填写 "human",即可在相应位置添加人类玩家。该脚本随后会输出人类玩家的 token.

  • -u, --upload <config_path>
    

    上传游戏逻辑至 Saiblo. <config_path> 为配置文件的路径,格式如下:

    {
        "id": number,  // <game_id>
        "path": string,  // 游戏逻辑的路径,需要打包成单文件
    }
    

    注意:目前 Saiblo 对游戏逻辑代码的管理与 AI 不同,因此该命令会覆盖 Saiblo 上先前的游戏逻辑,请谨慎使用。

login

saiblo-dev-tools login <username>

登录 Saiblo 开发账号。脚本将会在 ~/.saiblo-dev-tools/cookie 中保存登录凭据,请妥善保管。

logout

saiblo-dev-tools logout

删除 ~/.saiblo-dev-tools/cookie,下次使用与 Saiblo 交互的命令将需要登录。

Release files for saiblo-dev-tools 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for saiblo-dev-tools 0.0.2
File Size Uploaded
saiblo-dev-tools-0.0.2.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for saiblo-dev-tools 0.0.2
File Interpreter ABI Platform
saiblo_dev_tools-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size:21.1 kB

Release files / saiblo-dev-tools-0.0.2.tar.gz

Download URL saiblo-dev-tools-0.0.2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d8298f745adccc6bb88abe177af08c0154f04a1adf53731b2d17406ca9f0936c
BLAKE2b-256 checksum
How to use checksums
6135b07a026df5295b341927b0c04adf32a893daa8e7b7e16a89f19a9dee9319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / saiblo_dev_tools-0.0.2-py3-none-any.whl

Download URL saiblo_dev_tools-0.0.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
272fe7d990a6809c353b15ccf9fcc9034c64a7e96f27d46e103d87d2e1e6d0c7
BLAKE2b-256 checksum
How to use checksums
b53abc2de49532baec0d42b53092f13fb159040d702f88910495dd9c0cb99c71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page