wuzilong 5b4a8ecfb7 docs: document real game login implementation 1 개월 전
..
docs 5b4a8ecfb7 docs: document real game login implementation 1 개월 전
jfbym_diag 352b3dc0b2 chore: import existing project sources 1 개월 전
lua-dec2 352b3dc0b2 chore: import existing project sources 1 개월 전
scripts 352b3dc0b2 chore: import existing project sources 1 개월 전
src 323829db72 fix: harden real game login boundaries 1 개월 전
tests 323829db72 fix: harden real game login boundaries 1 개월 전
.env.example 352b3dc0b2 chore: import existing project sources 1 개월 전
.gitignore 352b3dc0b2 chore: import existing project sources 1 개월 전
.python-version 352b3dc0b2 chore: import existing project sources 1 개월 전
CHANGELOG.md 5a3c0e0b08 feat: enable high-level cq2 game login 1 개월 전
README.md 5a3c0e0b08 feat: enable high-level cq2 game login 1 개월 전
after_ready_start.png 352b3dc0b2 chore: import existing project sources 1 개월 전
before_launch.png 352b3dc0b2 chore: import existing project sources 1 개월 전
captcha_attempt1.png 352b3dc0b2 chore: import existing project sources 1 개월 전
captcha_attempt2.png 352b3dc0b2 chore: import existing project sources 1 개월 전
captcha_attempt3.png 352b3dc0b2 chore: import existing project sources 1 개월 전
captcha_attempt4.png 352b3dc0b2 chore: import existing project sources 1 개월 전
captcha_attempt5.png 352b3dc0b2 chore: import existing project sources 1 개월 전
cdp_captcha_state.png 352b3dc0b2 chore: import existing project sources 1 개월 전
cdp_game_page.png 352b3dc0b2 chore: import existing project sources 1 개월 전
cdp_login_page.png 352b3dc0b2 chore: import existing project sources 1 개월 전
cdp_main_page.png 352b3dc0b2 chore: import existing project sources 1 개월 전
gameupdate2.png 352b3dc0b2 chore: import existing project sources 1 개월 전
gameupdate_window.png 352b3dc0b2 chore: import existing project sources 1 개월 전
no_launch_on_detail.png 352b3dc0b2 chore: import existing project sources 1 개월 전
pyproject.toml 352b3dc0b2 chore: import existing project sources 1 개월 전
pytest.ini 352b3dc0b2 chore: import existing project sources 1 개월 전
search_commit.png 352b3dc0b2 chore: import existing project sources 1 개월 전
search_results.png 352b3dc0b2 chore: import existing project sources 1 개월 전
spawnLauncher.js 352b3dc0b2 chore: import existing project sources 1 개월 전
target_card.png 352b3dc0b2 chore: import existing project sources 1 개월 전

README.md

cq2_sdk

Python SDK for driving the cq2 (传奇) game through 13 new-player tasks via protocol-level simulation.

Architecture

3-layer (login / transport / task) + Lua bridge (lupa). Single-account synchronous async API.

Status

Pre-alpha. 996box authentication, detailed server resolution, TCP role login, and entry through SC2 world initialization are implemented. The 13 gameplay task classes remain protocol stubs.

Design documents

  • Login spec: ../docs/superpowers/specs/2026-09-18-real-game-login-design.md
  • Login plan: ../docs/superpowers/plans/2026-09-18-real-game-login.md

Installation

uv sync --group dev

Usage

from cq2_sdk import Cq2Client

async with Cq2Client(account="your-account", password="...") as cli:
    # Existing roles are selected automatically. If this zone has no role,
    # pass char_name="角色名", job=0, sex=0 explicitly.
    session = await cli.launcher.run_until_enter_game(zone_index=0)
    print(session.char_name, session.world_ready)

    # Gameplay tasks are still under protocol development.
    result = await cli.run_newbie_flow()
    print(f"完成 {len(result.completed_tasks)} 步, 用时 {result.elapsed}")

run_until_enter_game() returns only after the world server sends SC2. A live smoke run does not create a role unless char_name is supplied.

Development

cd cq2_sdk
uv sync
uv run pytest