Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 4adfc53

Browse files
committed
Bump version to 0.1.1-Beta
* Remove unused code * refactor: Rename variable
1 parent ca9d55c commit 4adfc53

File tree

6 files changed

+30
-92
lines changed

6 files changed

+30
-92
lines changed

PermissionAPI/Command.cpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ class PermCommand : public Command {
8282
bool checkPermission(const xuid_t& xuid) const {
8383
auto permissions = mod.perm.getPlayerPermissions(xuid);
8484
if (permissions.contains("PermissionAPI:cmd_control")) {
85-
auto& ab = permissions.at("PermissionAPI:cmd_control");
86-
if (!ab.extra.is_object() || (ab.extra.is_object() && ab.extra.empty())) {
85+
auto& perm = permissions.at("PermissionAPI:cmd_control");
86+
if (!perm.extra.is_object() || (perm.extra.is_object() && perm.extra.empty())) {
8787
// Invalid extra data/No extra data
8888
return true;
8989
}
9090
switch (this->subcmd) {
9191
case SubCommands::None: {
92-
if (!ab.extra.contains("view_self")) return true;
93-
if (ab.extra.at("view_self").is_boolean()) return ab.extra.at("view_self");
92+
if (!perm.extra.contains("view_self")) return true;
93+
if (perm.extra.at("view_self").is_boolean()) return perm.extra.at("view_self");
9494
break;
9595
}
9696
case SubCommands::Create: {
97-
if (!ab.extra.contains("create")) return true; // No more restrictions, pass
98-
if (ab.extra.at("create").is_boolean()) return ab.extra.at("create");
99-
auto& obj = ab.extra["create"];
97+
if (!perm.extra.contains("create")) return true; // No more restrictions, pass
98+
if (perm.extra.at("create").is_boolean()) return perm.extra.at("create");
99+
auto& obj = perm.extra["create"];
100100
switch (this->targetType1) {
101101
case TargetType::Role:
102102
if (!obj.contains("role")) return true; // Default pass
@@ -112,9 +112,9 @@ class PermCommand : public Command {
112112
break;
113113
}
114114
case SubCommands::Delete: {
115-
if (!ab.extra.contains("delete")) return true; // No more restrictions, pass
116-
if (ab.extra["delete"].is_boolean()) return ab.extra["delete"].get<bool>();
117-
auto& obj = ab.extra["delete"];
115+
if (!perm.extra.contains("delete")) return true; // No more restrictions, pass
116+
if (perm.extra["delete"].is_boolean()) return perm.extra["delete"].get<bool>();
117+
auto& obj = perm.extra["delete"];
118118
switch (this->targetType1) {
119119
case TargetType::Role:
120120
if (!obj.contains("role")) return true; // Default pass
@@ -130,9 +130,9 @@ class PermCommand : public Command {
130130
break;
131131
}
132132
case SubCommands::List: {
133-
if (!ab.extra.contains("list")) return true; // No more restrictions, pass
134-
if (ab.extra["list"].is_boolean()) return ab.extra["list"].get<bool>();
135-
auto& obj = ab.extra["list"];
133+
if (!perm.extra.contains("list")) return true; // No more restrictions, pass
134+
if (perm.extra["list"].is_boolean()) return perm.extra["list"].get<bool>();
135+
auto& obj = perm.extra["list"];
136136
switch (this->targetType1) {
137137
case TargetType::Role:
138138
if (!obj.contains("role")) return true; // Default pass
@@ -148,9 +148,9 @@ class PermCommand : public Command {
148148
break;
149149
}
150150
case SubCommands::View: {
151-
if (!ab.extra.contains("view")) return true; // No more restrictions, pass
152-
if (ab.extra["view"].is_boolean()) return ab.extra["view"].get<bool>();
153-
auto& obj = ab.extra["view"];
151+
if (!perm.extra.contains("view")) return true; // No more restrictions, pass
152+
if (perm.extra["view"].is_boolean()) return perm.extra["view"].get<bool>();
153+
auto& obj = perm.extra["view"];
154154
switch (this->targetType1) {
155155
case TargetType::Role:
156156
if (!obj.contains("role")) return true; // Default pass
@@ -219,9 +219,9 @@ class PermCommand : public Command {
219219
break;
220220
}
221221
case SubCommands::Update: {
222-
if (!ab.extra.contains("update")) return true; // No more restrictions, pass
223-
if (ab.extra["update"].is_boolean()) return ab.extra["update"].get<bool>();
224-
auto& obj = ab.extra["update"];
222+
if (!perm.extra.contains("update")) return true; // No more restrictions, pass
223+
if (perm.extra["update"].is_boolean()) return perm.extra["update"].get<bool>();
224+
auto& obj = perm.extra["update"];
225225
switch (this->targetType1) {
226226
case TargetType::Role:
227227
if (!obj.contains("role")) return true; // Default pass

PermissionAPI/Mod.cpp

-59
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,6 @@ void SetupAllCmds(CommandRegistry* reg);
1111
Mod mod;
1212
Logger& logger = mod.logger;
1313

14-
/*
15-
const I18nBase::LangData Mod::defaultLangData = {
16-
{"zh_CN", {
17-
{"Invalid command. Type '/help perm' to get help.", "无效的命令, 输入'/help perm'以获取帮助"},
18-
{"Failed to process the data file: {}", "处理数据文件失败: {}"},
19-
{"Failed to read the data file at {}", "处理位于 {} 的数据文件失败"},
20-
{"§b§lYour current permission status:", "§b§l你当前的权限状态:"},
21-
{"§b§l{}'s current permission status:", "§b§l{} 当前的权限状态:"},
22-
{"- §eRoles:", "- §e权限组:"},
23-
{"- §e$1bilities:", "- §e能力:"},
24-
{"[No description]", "[无描述]"},
25-
{"Role name '{}' contains invalid characters.", "权限组名 '{}' 包含无效字符"},
26-
{"Role name '{}' has been replaced with '{}'.", "权限组名 '{}' 已改为 '{}'"},
27-
{"Internal error. Please try again later.", "内部错误, 请稍后再试"},
28-
{"You don't have permission to use this command.", "您没有使用该命令的权限"},
29-
{"Role already exists.", "此权限组已存在"},
30-
{"Role created.", "权限组创建成功"},
31-
{"$1bility already exists.", "此能力已存在"},
32-
{"$1bility created.", "能力创建成功"},
33-
{"$1bility removed.", "能力删除成功"},
34-
{"Role removed.", "权限组删除成功"},
35-
{"Invalid role name.", "无效的权限组名"},
36-
{"Invalid $1bility name.", "无效的能力名"},
37-
{"$1bility name examples: 'Namespace:$1bilityName', 'a:b:c:d_e_f.g'", "能力名样例: '命名空间:能力名', 'a:b:c:d_e_f.g'"},
38-
{"Role does not exist.", "权限组不存在"},
39-
{"$1bility does not exist.", "能力不存在"},
40-
{"Role deleted.", "权限组删除成功"},
41-
{"$1bility deleted.", "能力删除成功"},
42-
{"No roles.", "无权限组"},
43-
{"No permissions.", "无能力"},
44-
{"Member", "成员"},
45-
{"Player not found", "找不到玩家"},
46-
{"+ §eMembers§r: None", "+ §e成员§r: 无"},
47-
{"+ §eMembers§r:", "+ §e成员§r:"},
48-
{"+ §eName§r: {}", "+ §e名称§r: {}"},
49-
{"+ §eDisplayName§r: {}", "+ §e显示名称§r: {}"},
50-
{"+ §ePriority§r: {}", "+ §e优先级§r: {}"},
51-
{"+ §e$1bilities§r: None", "+ §e能力§r: 无"},
52-
{"+ §e$1bilities§r:", "+ §e能力§r:"},
53-
{"※ {}§r is a special role. All the permissions will be enabled by default unless it has been disabled in the config.", "※ {}§r 是一个特殊的权限组, 所有的能力将会默认开启除非它在配置文件中被禁用"},
54-
{"※ {}§r is a special role. All players are members of this role.", "※ {}§r 是一个特殊的权限组, 所有的玩家都是这个权限组的成员"},
55-
{"The role is a everyone role. You cannot modify the members of it.", "这是一个\"所有人\"权限组, 你不能修改它的成员"},
56-
{"Member {}({}) added.", "成员 {}({}) 已添加"},
57-
{"Member {}({}) removed.", "成员 {}({}) 已移除"},
58-
{"$1bility {} added.", "能力 {} 已添加"},
59-
{"$1bility {} set to {}.", "能力 {} 已设置为 {}"},
60-
{"$1bility {} removed.", "能力 {} 已移除"},
61-
{"Missing argument: enabled", "找不到命令参数: enabled"},
62-
{"§aenabled", "§a已启用"},
63-
{"§cdisabled", "§c已禁用"},
64-
{"Priority set to {}.", "优先级已设置为 {}"},
65-
{"Display name set to {}.", "显示名称已设置为 {}"},
66-
{"JSON parsing error: {}", "JSON解析错误: {}"},
67-
{"§b§lRole List:", "§b§l权限组列表:"},
68-
{"§b§l$1bility List:", "§b§l权限能力列表:"},
69-
}}
70-
};
71-
*/
72-
7314
Mod::Mod()
7415
: logger(Logger("PermAPI")) {
7516
}

PermissionAPI/Resource.aps

140 Bytes
Binary file not shown.

PermissionAPI/Resource.rc

+6-5
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 0,1,0,0
55-
PRODUCTVERSION 0,1,0,0
54+
FILEVERSION 0,1,1,0
55+
PRODUCTVERSION 0,1,1,0
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -67,13 +67,14 @@ BEGIN
6767
BEGIN
6868
BLOCK "080404b0"
6969
BEGIN
70-
VALUE "FileDescription", "Permission API plugin based on LiteLoaderBDS for MCBDS"
71-
VALUE "FileVersion", "0.1.0.0"
70+
VALUE "CompanyName", "LiteLoaderBDS Development Team"
71+
VALUE "FileDescription", "Builtin & Powerful permission API for LiteLoaderBDS"
72+
VALUE "FileVersion", "0.1.1.0"
7273
VALUE "InternalName", "PermissionAPI.dll"
7374
VALUE "LegalCopyright", "Copyright (C) 2022 Jasonzyt and LiteLoaderBDS Dev Team. All rights reserved."
7475
VALUE "OriginalFilename", "PermissionAPI.dll"
7576
VALUE "ProductName", "PermissionAPI"
76-
VALUE "ProductVersion", "0.1.0.0"
77+
VALUE "ProductVersion", "0.1.1.0"
7778
END
7879
END
7980
BLOCK "VarFileInfo"

PermissionAPI/pch.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define PERMAPI extern "C" _declspec(dllexport)
1111
#define PERM_VER_MAJOR 0
1212
#define PERM_VER_MINOR 1
13-
#define PERM_VER_REV 0
13+
#define PERM_VER_REV 1
1414
#define PERM_VER_STATUS LL::Version::Beta
1515

1616
extern Logger& logger;
@@ -23,6 +23,5 @@ static LL::Version PERM_VER{PERM_VER_MAJOR,
2323
PERM_VER_STATUS};
2424
static const std::string PLUGIN_DIR = "./plugins/PermissionAPI/";
2525
static const std::string DATA_FILE = PLUGIN_DIR + "data.json";
26-
static const std::string LANG_FILE = PLUGIN_DIR + "lang.json";
2726

2827
#endif // PCH_H

RELEASENOTE.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
## PermissionAPI v0.1.0-Beta Release Note
1+
## PermissionAPI v0.1.1-Beta Release Note
22

33
### Overview
4-
PermissionAPI-0.1.0 has been released, adapted to LiteLoaderBDS-2.4.x, BDS-1.19.x
4+
PermissionAPI-0.1.1 has been released, adapted to LiteLoaderBDS-2.5.1, BDS-1.19.20
55

66
### Features
7-
All basic features, including
8-
- Command
9-
- I18N
10-
- Config
11-
- ExportAPI
7+
- Interface LiteLoader I18N
8+
- Refactor code(#1, #2)
129

1310
### LiteLoaderBDS New Forum
1411
[https://forum.litebds.com/](https://forum.litebds.com/)

0 commit comments

Comments
 (0)