NDP Reforged SDK 使用文档

本文档详细描述 NDP Reforged API 的多语言 SDK使用方法,适用于 Minecraft 服务器反作弊集成场景。


1. SDK 概述

语言依赖
Pythonrequests
JavaOkHttp 4.x + Gson 2.x
Go无 (标准库)
C#.NET 6+

Base URL: https://api.ndpreforged.com


2. 安装方式

Python

方式一:pip 安装

Bash
pip install ndpreforged

方式二:whl 包安装

下载 ndpreforged.whl,然后:

Bash
pip install ndpreforged-1.0.0-py3-none-any.whl

Java

下载 ndpreforged-sdk.jar ,然后:

Maven (pom.xml)

XML
<dependency> <groupId>com.ndpreforged</groupId> <artifactId>ndpreforged-sdk</artifactId> <version>1.0.0</version> <scope>system</scope> <systemPath>path/to/ndpreforged-sdk.jar</systemPath> </dependency>

编译

Bash
cd sdk/java javac -encoding UTF-8 -d target src/main/java/com/ndpreforged/NDPReforgedClient.java

Go

下载 ndpreforged.go ,然后:

Bash
go mod init your/module go mod tidy # 将 ndpreforged.go 放入项目目录 go build

C#

下载 NDPReforged.cs ,然后:

项目引用

Bash
dotnet add package NDPReforged

或直接将 NDPReforged.cs 添加至项目。

编译

Bash
dotnet build -c Release

下载链接汇总

语言文件大小
Python ndpreforged.whl3.88 KB
Java ndpreforged-sdk.jar10.58 KB
Go ndpreforged.go7.98 KB
C# NDPReforged.cs7.74 KB

3. 初始化配置

Python

Python
from ndpreforged import NDPReforged # 默认 Base URL + 30s 超时 client = NDPReforged() # 自定义配置 client = NDPReforged( base_url="https://api.ndpreforged.com", timeout=60 )

Java

Java
import com.ndpreforged.NDPReforgedClient; // 默认 30s 超时 NDPReforgedClient client = new NDPReforgedClient("https://api.ndpreforged.com"); // 自定义超时 (秒) NDPReforgedClient client = new NDPReforgedClient("https://api.ndpreforged.com", 60);

Go

go
import "ndpreforged" // 默认 30s 超时 client := ndpreforged.NewClient("https://api.ndpreforged.com") // 自定义超时 client := ndpreforged.NewClientWithTimeout("https://api.ndpreforged.com", 60)

C#

csharp
using NDPReforged; // 默认 30s 超时 var client = new NDPReforgedClient(); // 自定义配置 var client = new NDPReforgedClient("https://api.ndpreforged.com", 60);

4. API 列表

4.1 健康检查

验证 API 服务可用性。

SDK方法签名
Pythonhealth_check() -> Dict
JavahealthCheck() -> ApiResponse
GoHealthCheck() -> (*APIResponse, error)
C#HealthCheckAsync() -> Task<ApiResponse>

返回字段: