Skip to content

Commit e87f37e

Browse files
committed
Move
1 parent 80225ae commit e87f37e

33 files changed

+1656
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 验证器
2+
3+
账户信息是启动 Minecraft 的一个重要参数,没有账户信息您将无法正常启动游戏
4+
5+
:::tip
6+
验证器模块在 3.0.0 以下需要安装 `MinecraftOAuth` 才能使用,而 3.0.0 以上版本则无需安装!
7+
:::
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# 微软验证器
2+
3+
微软验证器提供给用于 Minecraft 正版的用户,允许进入正版验证的服务器
4+
5+
## 参数详解
6+
7+
| 参数名 | 说明 |
8+
|:--------:|:---------------------:|
9+
| account | 微软账户信息 |
10+
| clientId | 在 Azure 中获取的 AppID |
11+
12+
- 初始化代码示例
13+
14+
```cs
15+
//构造方法一 适用于设备流验证
16+
MicrosoftAuthenticator authenticator = new("Your Client ID");
17+
18+
//构造方法一 适用于刷新验证
19+
MicrosoftAccount account;//此处的Account是您的旧的微软账户信息
20+
MicrosoftAuthenticator authenticator = new(account);
21+
```
22+
23+
除此之外,验证器还提供了一个 'IsCheckOwnership' 属性用于确定是否检查游戏所有权
24+
25+
## 获取验证代码以及 Microsoft 访问令牌
26+
27+
在初始化完毕后即可获取验证代码
28+
29+
- 代码示例
30+
31+
```cs
32+
await authenticator.DeviceFlowAuthAsync(dc => {
33+
//在获取到一次性代码后要执行的代码
34+
});
35+
```
36+
37+
## 验证
38+
39+
在获取访问令牌后即可开始验证步骤
40+
41+
- 代码示例
42+
43+
``` cs
44+
var userProfile = await authenticator.AuthenticateAsync();
45+
```
46+
47+
在上述示例中,'AuthenticateAsync' 方法的返回值便是构建好的账户信息类,可以直接用于启动游戏
48+
49+
## 完整示例
50+
51+
- 代码示例
52+
53+
``` cs
54+
//设备流验证
55+
MicrosoftAuthenticator authenticator = new("Your Client ID");
56+
await authenticator.DeviceFlowAuthAsync(dc => {
57+
//在获取到一次性代码后要执行的代码
58+
Console.WriteLine(dc.UserCode);
59+
});
60+
61+
var userProfile = await authenticator.AuthenticateAsync();
62+
63+
//刷新验证
64+
MicrosoftAuthenticator authenticator = new(account);//account为您的旧的微软账户信息
65+
var userProfile = await authenticator.AuthenticateAsync();
66+
```
67+
68+
:::tip
69+
若出现 await 报错,请在您的方法中添加 async 关键字合理解决
70+
:::
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# 离线验证器
2+
3+
离线账户可以使没有购买 Minecraft 正版的用户游玩,但无法进入开了正版验证的服务器
4+
5+
## 初始化验证器
6+
7+
``` cs
8+
OfflineAuthenticator(string name, Guid uuid = default)
9+
```
10+
11+
|参数名|说明 |
12+
|:---:|:------:|
13+
|name| 账户名 |
14+
|uuid| 账户的 Uuid,可以忽略 |
15+
16+
- 初始化代码示例
17+
18+
``` cs
19+
OfflineAuthenticator authenticator = new("Your name");
20+
```
21+
22+
## 验证
23+
24+
在初始化完毕后即可开始验证步骤
25+
26+
- 代码示例
27+
28+
``` cs
29+
var userProfile = authenticator.Authenticate();
30+
```
31+
32+
在上述示例中,'Authenticate' 方法的返回值便是构建好的账户信息类,可以直接用于启动游戏
33+
34+
## 完整示例
35+
36+
- 代码示例
37+
38+
``` cs
39+
OfflineAuthenticator authenticator = new("Yang114");
40+
var userProfile = authenticator.Authenticate();
41+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 外置验证器
2+
3+
此验证器适用于所有基于 [AuthLib-Injector](https://github.com/yushijinhun/authlib-injector) 的第三方验证服务(例如 LittleSkin)
4+
5+
## 初始化验证器
6+
7+
|参数名|说明|
8+
|:------:|:----:|
9+
|uri | 验证服务器地址 |
10+
|email | 用户账户邮件 |
11+
|password | 用户账户密码 |
12+
|account | 旧的 Yggdrasil 账户|
13+
14+
- 初始化代码示例
15+
16+
``` cs
17+
//刷新验证
18+
YggdrasilAuthenticator authenticator = new(account);//account为您的旧的Yggdrasil账户信息
19+
20+
//请求验证
21+
YggdrasilAuthenticator authenticator = new("Server Url", "Your Email", "Your Password");
22+
```
23+
24+
## 验证
25+
26+
在初始化完毕后即可开始验证步骤
27+
28+
- 代码示例
29+
30+
``` cs
31+
var userProfile = await authenticator.AuthenticateAsync();
32+
```
33+
34+
在上述示例中,'AuthenticateAsync' 方法的返回值便是构建好的所有账户信息类,可以直接用于启动游戏
35+
36+
## 完整示例
37+
38+
- 代码示例
39+
40+
``` cs
41+
//刷新验证
42+
YggdrasilAuthenticator authenticator = new(account);//account为您的旧的Yggdrasil账户信息
43+
var userProfile = await authenticator.AuthenticateAsync();
44+
45+
//请求验证
46+
YggdrasilAuthenticator authenticator = new("Server Url", "Your Email", "Your Password");
47+
var userProfile = await authenticator.AuthenticateAsync();
48+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 检查器
2+
3+
`ML` 提供了各式各样的检查器用来进行一些检查操作
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 游戏资源检查器
2+
3+
游戏资源检查器用于检查 Minecraft 游戏实例的依赖库以及资源文件是否缺失
4+
5+
## 初始化检查器
6+
7+
``` cs
8+
IChecker resourceChecker = new ResourceChecker(GameEntry entry);
9+
```
10+
11+
- 参数详解
12+
13+
|参数名|说明|
14+
|:------:|:----:|
15+
|entry | Minecraft 游戏实例 |
16+
17+
## 开始检查
18+
19+
在异步上下文中,使用 CheckAsync 来完成检查步骤:
20+
21+
``` cs
22+
await resourceChecker.CheckAsync();
23+
```
24+
25+
:::info
26+
在检查完成后 CheckAsync 方法会返回检查结果,如果返回值为 `false` 则可以通过类的 `MissingResources` 属性获取缺失的文件
27+
:::
28+
29+
## 控制台示例
30+
31+
为了满足一些懒狗的模块(
32+
33+
``` cs
34+
IChecker resourceChecker = new ResourceChecker(GameEntry entry);
35+
var result = await resourceChecker.CheckAsync();
36+
37+
if (!result) {
38+
Console.WriteLine($"有资源缺失,总计 {resourceChecker.MissingResources.Count} 个");
39+
}
40+
```
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Curseforge 资源搜寻器
2+
3+
它可以搜寻 [Curseforge](https://www.curseforge.com/minecraft) 上的任何资源
4+
5+
:::tip
6+
在使用搜寻器前您需要先拥有 Curseforge 的 Api Key
7+
:::
8+
9+
## 初始化
10+
11+
``` cs
12+
CurseForgeFetcher(string apiKey)
13+
```
14+
15+
|参数名|说明|
16+
|:------:|:----:|
17+
|apiKey | Curseforge 的 Api Key |
18+
19+
- 初始化代码示例
20+
21+
``` cs
22+
var curseForgeFetcher = new("Your Api Key");
23+
```
24+
25+
## 搜索资源
26+
27+
``` cs
28+
SearchResourcesAsync(string searchFilter, int classId = 6, int category = -1, string gameVersion = null, LoaderType modLoaderType = LoaderType.Any)
29+
```
30+
31+
|参数名|说明|
32+
|:------:|:----:|
33+
|searchFilter | 要搜寻的资源名字,例如 “JEI” |
34+
|classId | 资源类别 |
35+
|category | 资源类别 |
36+
|gameVersion | 资源的 Minecraft 版本 |
37+
|modLoaderType | 资源的加载器类别 |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 搜寻器
2+
3+
`ML` 提供了各式各样的搜寻器用来搜寻网络或本地的一些资源

0 commit comments

Comments
 (0)