koishi-plugin-ets2-tools-tmp 3.4.3 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command/tmpActivityService/tmpActivityServiceV1.js +197 -26
- package/lib/command/tmpActivityService.js +12 -3
- package/lib/command/tmpMileageRanking.js +1 -1
- package/lib/command/tmpVersionCheck.js +278 -12
- package/lib/command/tmpVtcMileageRanking.js +1 -1
- package/lib/database/guildBind.js +16 -9
- package/lib/database/model.js +1 -1
- package/lib/index.js +16 -5
- package/lib/resource/version-update.html +706 -0
- package/lib/util/tmpIdPicker.js +4 -4
- package/package.json +1 -1
package/lib/util/tmpIdPicker.js
CHANGED
|
@@ -45,8 +45,7 @@ async function pickAll(ctx, session, bindingRows) {
|
|
|
45
45
|
if (list.length === 0) {
|
|
46
46
|
return { ids: [], total: 0, truncated: false, hint: null };
|
|
47
47
|
}
|
|
48
|
-
//
|
|
49
|
-
await guildBind.ensureNames(ctx, list);
|
|
48
|
+
// 这里只用到 tmp_id(hint 只报数量,不显示名字)→ 不刷新名字,省接口
|
|
50
49
|
const { ids, total, truncated } = resolveAll(list);
|
|
51
50
|
return {
|
|
52
51
|
ids,
|
|
@@ -195,9 +194,10 @@ function register(ctx) {
|
|
|
195
194
|
*/
|
|
196
195
|
async function pick(ctx, session, bindings, opts = {}) {
|
|
197
196
|
if (!bindings || bindings.length === 0) return [];
|
|
198
|
-
//
|
|
199
|
-
await guildBind.ensureNames(ctx, bindings);
|
|
197
|
+
// 单绑定:不显示列表,直接返回 —— 此时没必要刷新名字(查询本身会显示真实名字)
|
|
200
198
|
if (bindings.length === 1) return [String(bindings[0].tmp_id)];
|
|
199
|
+
// 要显示序号列表了:查接口刷新名字,保证玩家改名后列表及时同步
|
|
200
|
+
await guildBind.refreshNames(ctx, bindings);
|
|
201
201
|
const allowMulti = opts.allowMulti !== false;
|
|
202
202
|
const allowAll = opts.allowAll !== false;
|
|
203
203
|
const max = allowMulti ? MAX_PICK : 1;
|