mirror of
https://github.com/XeroAlpha/CA.git
synced 2024-11-22 17:26:16 +00:00
feat: 更新命令库与拓展包至1.20.20.22;支持识别网易版2.7.5.227362;支持版本区间右侧开区间
This commit is contained in:
parent
4b0a3ee2a6
commit
a1ef8c0055
@ -351,6 +351,17 @@
|
||||
}
|
||||
stack.length = l;
|
||||
}
|
||||
var iterateObject = function(o, keyIter, valueIter) {
|
||||
var l = stack.length, k;
|
||||
checkObject(o);
|
||||
stack.length = l + 1;
|
||||
for (k in o) {
|
||||
stack[l] = k;
|
||||
keyIter(k);
|
||||
valueIter(v)
|
||||
}
|
||||
stack.length = l;
|
||||
}
|
||||
return function(a) {
|
||||
var i;
|
||||
stack = ["根"]; last = a;
|
||||
@ -366,7 +377,11 @@
|
||||
stack[1] = "版本(version)";
|
||||
iterateArray(a.version, checkUnsignedInt);
|
||||
stack[1] = "前提包(require)";
|
||||
iterateArray(a.require, checkNotEmptyString);
|
||||
try {
|
||||
iterateArray(a.require, checkNotEmptyString);
|
||||
} catch(err) {
|
||||
iterateObject(a.require, checkNotEmptyString, checkObject);
|
||||
}
|
||||
}
|
||||
})(),
|
||||
checkPackVer : (function() {
|
||||
@ -388,9 +403,10 @@
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
var inRange = function(min, max) {
|
||||
var inRange = function(min, max, exclusiveMax) {
|
||||
if (min && compare(min) < 0) return -1;
|
||||
if (max && compare(max) > 0) return 1;
|
||||
if (exclusiveMax && compare(exclusiveMax) >= 0) return 1;
|
||||
return 0;
|
||||
}
|
||||
return function(o) {
|
||||
@ -398,7 +414,7 @@
|
||||
if (this.ignoreVersion) return 0;
|
||||
a = getMinecraftVersion().split(".");
|
||||
if (o.minSupportVer || o.maxSupportVer) {
|
||||
r = inRange(o.minSupportVer, o.maxSupportVer);
|
||||
r = inRange(o.minSupportVer, o.maxSupportVer, null);
|
||||
if (r != 0) return r; //这两个参数是总范围
|
||||
}
|
||||
if (Array.isArray(o.supportVer)) {
|
||||
@ -406,7 +422,7 @@
|
||||
r = 1;
|
||||
for (i = 0; i < n; i++) {
|
||||
e = o.supportVer[i];
|
||||
r = Math.min(r, inRange(e.min, e.max)); //趋向返回游戏版本过低
|
||||
r = Math.min(r, inRange(e.min, e.max, e.exclusiveMax)); //趋向返回游戏版本过低
|
||||
if (r == 0) return 0; //这段只要存在一个范围符合条件就返回0
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,11 @@ MapScript.loadModule("NeteaseAdapter", {
|
||||
getNeteaseVersion : function(packageName) {
|
||||
var c = ctx.getPackageManager().getPackageInfo(packageName, 0).versionCode;
|
||||
this.supportWS = c >= 840035545 && c < 840094571;
|
||||
if (c >= 840217492) { // 2.5.5.217492
|
||||
if (c >= 840227362) { // 2.7.5.227362
|
||||
return "1.18.32.0.0";
|
||||
} else if (c >= 840223715) { // 2.6.5.223715
|
||||
return "1.18.31.0.0";
|
||||
} else if (c >= 840217492) { // 2.5.5.217492
|
||||
return "1.18.30.0.0";
|
||||
} else if (c >= 840213405) { // 2.4.5.213405
|
||||
return "1.18.2.0.0";
|
||||
|
@ -4,10 +4,10 @@
|
||||
"author": "CA制作组",
|
||||
"description": "该命令库是默认命令库的补充,包括了与核心玩法无关的命令。",
|
||||
"uuid": "590cdcb5-3cdf-42fa-902c-b578779335ab",
|
||||
"version": [1, 0, 0],
|
||||
"version": [1, 20, 20, 22],
|
||||
"require": ["acf728c5-dd5d-4a38-b43d-7c4f18149fbd"],
|
||||
"minSupportVer": "0.16.0",
|
||||
"minCAVersion": "2022-10-02",
|
||||
"minCAVersion": "2023-07-23",
|
||||
"commands": {},
|
||||
"enums": {
|
||||
"gametest_rotation": {
|
||||
@ -98,8 +98,12 @@
|
||||
"help": "https://wiki.biligame.com/mc/%E5%91%BD%E4%BB%A4/transferserver"
|
||||
}
|
||||
},
|
||||
"minSupportVer": "1.0.3.0",
|
||||
"maxSupportVer": "1.3.*"
|
||||
"supportVer": [
|
||||
{
|
||||
"min": "1.0.3.0",
|
||||
"exclusiveMax": "1.2.0.2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"1.1": {
|
||||
"commands": {
|
||||
@ -175,11 +179,11 @@
|
||||
"supportVer": [
|
||||
{
|
||||
"min": "1.2.5.12",
|
||||
"max": "1.16.210.52.*"
|
||||
"exclusiveMax": "1.16.210.53"
|
||||
},
|
||||
{
|
||||
"min": "1.16.210.54",
|
||||
"max": "1.16.210.57.*"
|
||||
"exclusiveMax": "1.16.210.58"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,10 @@
|
||||
"author": "CA制作组",
|
||||
"description": "该命令库包含了需要打开教育版选项才能出现的命令。",
|
||||
"uuid": "f9216c72-76a6-4963-b4c8-7959e5c7487a",
|
||||
"version": [1, 0, 0],
|
||||
"version": [1, 20, 20, 22],
|
||||
"require": ["acf728c5-dd5d-4a38-b43d-7c4f18149fbd"],
|
||||
"minSupportVer": "1.2.20.1",
|
||||
"minCAVersion": "2022-10-02",
|
||||
"minCAVersion": "2023-07-23",
|
||||
"commands": {},
|
||||
"enums": {
|
||||
"block": {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,11 +12,17 @@
|
||||
"pattern": "^((\\+|-)?\\d+|\\*)(\\.((\\+|-)?\\d+|\\*))*$",
|
||||
"description": "版本区间所能包括的最高版本(包含)。\n只有当版本介于版本区间时才会进行加载。\n星号(*)表示匹配任意数字。\n例如某个功能在1.0.0加入,在1.0.1移除,那么区间就是['1.0.0', '1.0.0.*']。"
|
||||
},
|
||||
"exclusiveMaximumVersion": {
|
||||
"type": "string",
|
||||
"pattern": "^((\\+|-)?\\d+)(\\.(\\+|-)?\\d+)*$",
|
||||
"description": "版本区间所能包括的最高版本(不包含)。\n只有当版本介于版本区间时才会进行加载。\n\n需要命令助手至少为 1.2.14-Beta-13-Preview-3 (2023-07-23) 版本。"
|
||||
},
|
||||
"versionRange": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"min": { "$ref": "#/definitions/minimumVersion" },
|
||||
"max": { "$ref": "#/definitions/maximumVersion" }
|
||||
"max": { "$ref": "#/definitions/maximumVersion" },
|
||||
"exclusiveMax": { "$ref": "#/definitions/exclusiveMaximumVersion" }
|
||||
},
|
||||
"minProperties": 1
|
||||
},
|
||||
@ -26,6 +32,12 @@
|
||||
"minItems": 1,
|
||||
"description": "复合版本区间。\n由多个版本区间组成,表示它们的并集。\n只有当版本介于其中至少一个版本区间时才会进行加载。\n可与minSupportVer或maxSupportVer同时使用,命令助手会优先测试这两者是否满足条件。"
|
||||
},
|
||||
"packVersion": {
|
||||
"type": "array",
|
||||
"items": { "type": "number" },
|
||||
"minItems": 1,
|
||||
"description": "版本号。\n用于判断拓展包是否需要更新。\n比较版本号时会先从较前的项开始比较,如果共有的项均相等则比较项的数量。例如[1, 0, 0]大于[1, 0]。版本号的每一项都应当是数字,但更推荐使用正整数。"
|
||||
},
|
||||
"filterFlag": {
|
||||
"const": null,
|
||||
"description": "过滤标志。\n表示对此对象进行过滤。"
|
||||
@ -991,9 +1003,7 @@
|
||||
"description": "唯一ID。\n用于提示拓展包是否重复加载。\n不同的拓展包应使用不同的唯一ID,仅当是拓展包的不同版本时除外。唯一ID可以不遵守RFC 4122规范,但推荐直接使用生成的UUID。"
|
||||
},
|
||||
"version": {
|
||||
"type": "array",
|
||||
"items": { "type": "number" },
|
||||
"minItems": 1,
|
||||
"$ref": "#/definitions/packVersion",
|
||||
"description": "版本号。\n用于判断拓展包是否需要更新。\n比较版本号时会先从较前的项开始比较,如果共有的项均相等则比较项的数量。例如[1, 0, 0]大于[1, 0]。版本号的每一项都应当是数字,但更推荐使用正整数。"
|
||||
},
|
||||
"require": {
|
||||
@ -1011,7 +1021,7 @@
|
||||
{ "$ref": "#/definitions/versionRanges" }
|
||||
]
|
||||
},
|
||||
"description": "依赖包列表。\n所有依赖包的UUID与版本要求组成的键值对。\n只有所有的依赖包均已加载且满足要求时才会将加载此命令库。\n\n需要命令助手至少为 1.2.14-Beta-13 版本。"
|
||||
"description": "依赖包列表。\n所有依赖包的UUID与版本要求组成的键值对。\n只有所有的依赖包均已加载且满足要求时才会将加载此命令库。\n\n需要命令助手至少为 1.2.14-Beta-14 版本。"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user