From f3ebf0b27c189303c5ec1e879643c721c41860aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ca=28HCO=E2=82=83=29=E2=82=82?= <143723419+kaguramaisakuya@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:19:34 +0800 Subject: [PATCH] =?UTF-8?q?4.4=E6=8E=A2=E7=B4=A2=E6=95=B0=E6=8D=AE=20(#367?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/apps/takeBirthdayPhoto.js | 8 +------- plugins/genshin/defSet/role/index.yaml | 12 ++++++------ plugins/genshin/model/mys/mysApi.js | 8 +------- plugins/genshin/model/mys/mysInfo.js | 11 ++--------- 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/plugins/genshin/apps/takeBirthdayPhoto.js b/plugins/genshin/apps/takeBirthdayPhoto.js index 3bb99b7..74848d4 100644 --- a/plugins/genshin/apps/takeBirthdayPhoto.js +++ b/plugins/genshin/apps/takeBirthdayPhoto.js @@ -96,13 +96,7 @@ export class takeBirthdayPhoto extends plugin { } async getServer(uid) { - let uidPrefix = uid.toString() - if (uidPrefix.length == 10) { - uidPrefix = uidPrefix.slice(0, 2) - } else { - uidPrefix = uidPrefix.slice(0, 1) - } - switch (uidPrefix) { + switch (String(uid).slice(0, -8)) { case '1': case '2': return 'cn_gf01' diff --git a/plugins/genshin/defSet/role/index.yaml b/plugins/genshin/defSet/role/index.yaml index ec48260..2531358 100644 --- a/plugins/genshin/defSet/role/index.yaml +++ b/plugins/genshin/defSet/role/index.yaml @@ -8,22 +8,22 @@ avatar: 79 level: 60 # 奇馈宝箱 -magic_chest: 221 +magic_chest: 241 # 华丽宝箱 -luxurious_chest: 242 +luxurious_chest: 259 # 珍贵宝箱 -precious_chest: 632 +precious_chest: 682 # 精致宝箱 -exquisite_chest: 2082 +exquisite_chest: 2219 # 普通宝箱 -common_chest: 2867 +common_chest: 2980 # 传送点 -way_point: 400 +way_point: 431 # 秘境 domain: 56 diff --git a/plugins/genshin/model/mys/mysApi.js b/plugins/genshin/model/mys/mysApi.js index 5b614ba..2e48f17 100644 --- a/plugins/genshin/model/mys/mysApi.js +++ b/plugins/genshin/model/mys/mysApi.js @@ -50,13 +50,7 @@ export default class MysApi { } getServer() { - let uidPrefix = this.uid.toString() - if (uidPrefix.length == 10) { - uidPrefix = uidPrefix.slice(0, 2) - } else { - uidPrefix = uidPrefix.slice(0, 1) - } - switch (uidPrefix) { + switch (String(this.uid).slice(0, -8)) { case '1': case '2': return this.isSr ? 'prod_gf_cn' : 'cn_gf01' // 官服 diff --git a/plugins/genshin/model/mys/mysInfo.js b/plugins/genshin/model/mys/mysInfo.js index ff44e97..5c18259 100644 --- a/plugins/genshin/model/mys/mysInfo.js +++ b/plugins/genshin/model/mys/mysInfo.js @@ -55,18 +55,11 @@ export default class MysInfo { return false } - let uidPrefix = mysInfo.uid.toString() - if (uidPrefix.length == 10) { - uidPrefix = uidPrefix.slice(0, 2) - } else { - uidPrefix = uidPrefix.slice(0, 1) - } - - if (!['1', '2', '3', '5', '6', '7', '8', '18', '9'].includes(uidPrefix)) { + if (!['1', '2', '3', '5', '6', '7', '8', '18', '9'].includes(String(mysInfo.uid).slice(0, -8))) { // e.reply('只支持查询国服uid') return false } - if (!['6', '7', '8', '18', '9'].includes(uidPrefix) && api === 'useCdk') { + if (!['6', '7', '8', '18', '9'].includes(String(mysInfo.uid).slice(0, -8)) && api === 'useCdk') { e.reply('兑换码使用只支持国际服uid') return false }