Skip to main content

Python SDK for Codexus OpenSDK - Third-party Minecraft launcher

Project description

Codexus Python SDK

C# Codexus.OpenSDK 的 Python 移植版本,用于网易 Minecraft (X19) 的第三方登录和启动。

功能特性

  • ✅ 4399 账号密码登录
  • ✅ X19 认证流程 (LoginOtp -> AuthenticationOtp)
  • ✅ HTTP AES 加密/解密 (HttpCipher)
  • ✅ 动态令牌计算 (DynamicToken)
  • ✅ SKIP32 加密 (Skip32Cipher)
  • ✅ 完整的类型注解和数据模型

安装

# 方式1: 直接安装
pip install codexus-sdk

# 方式2: 从源码安装
git clone https://github.com/your-repo/codexus-sdk.git
cd codexus-sdk
pip install -e .

依赖:

  • requests >= 2.28.0
  • cryptography >= 37.0.0

使用示例

from codexussdk import MgbSdk

# 创建 SDK 实例
sdk = MgbSdk(x19_version="1.1.0")

# 登录
result = sdk.login("your_username", "your_password")
if result.success:
    print(f"登录成功: {result.username}")
    
    # 获取游戏令牌
    token = sdk.get_game_token()
    print(f"游戏令牌: {token}")
    
    # 构建启动参数
    params = sdk.build_launch_parameters(
        server_address="mc.example.com",
        server_port=25565,
        player_name="PlayerName",
        version="1.20.1"
    )
    print(f"启动参数: {params}")
else:
    print(f"登录失败: {result.message}")

# 释放资源
sdk.close()

模块说明

模块 说明
codexussdk.cipher 加密解密工具 (HttpCipher, DynamicToken, Skip32Cipher)
codexussdk.http_client HTTP 客户端封装
codexussdk.entities 数据模型 (LoginResult, X19AuthDetail, MPayUser 等)
codexussdk.c4399 4399 登录实现
codexussdk.x19 X19 认证实现
codexussdk.mgb_sdk MGB SDK 主入口

文件结构

codexussdk/
├── __init__.py      # 包入口,导出所有公共 API
├── cipher.py        # 加密模块
├── http_client.py   # HTTP 客户端
├── entities.py      # 数据模型
├── c4399.py         # 4399 登录
├── x19.py           # X19 认证
├── mgb_sdk.py       # SDK 主类
├── example.py       # 使用示例
├── setup.py         # 安装配置
├── pyproject.toml   # 现代 Python 包配置
├── requirements.txt # 依赖列表
├── README.md        # 说明文档
└── tests/           # 单元测试
    ├── __init__.py
    ├── test_cipher.py
    └── test_sdk.py

注意事项

  1. 本 SDK 为 C# 版本的 Python 移植,部分实现可能因语言差异而简化
  2. X19 认证流程涉及加密通信,实际使用时需要确保网络环境正常
  3. 4399 登录可能需要验证码,请根据返回结果处理

许可证

GPL 3.0 (与原始 C# SDK 保持一致)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codexus_sdk-1.1.3.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codexus_sdk-1.1.3-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file codexus_sdk-1.1.3.tar.gz.

File metadata

  • Download URL: codexus_sdk-1.1.3.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for codexus_sdk-1.1.3.tar.gz
Algorithm Hash digest
SHA256 8d65ddefaea7f7ada22e442c4e24db63f288006597c660dd2f874282936ed3bb
MD5 56834ce1edd18c0b446fe98a71157ec8
BLAKE2b-256 76068a91908ee73566066407827dcbaeb373eb695bc4523ac65e94b9de3e5118

See more details on using hashes here.

File details

Details for the file codexus_sdk-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: codexus_sdk-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for codexus_sdk-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 272c3d7a3640f3d9eb1a990da5f631d136906aa97648240360fb92ae1e9c974d
MD5 d961edccf4b425985767ba9baeff7e22
BLAKE2b-256 67ee2eb767e14b3c1767def96515c4c5f75085912671e497c7763dc606e0031a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page