mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 22:48:13 +00:00
适配亚服新UID (#706)
This commit is contained in:
parent
3e3d976885
commit
942cac4fb2
@ -18,13 +18,13 @@ app.reg({
|
||||
name: '面板角色列表',
|
||||
desc: '查看当前已获取面板数据的角色列表',
|
||||
fn: ProfileList.render,
|
||||
rule: /^#(星铁|原神)?(面板角色|角色面板|面板)(列表)?\s*(\d{9})?$/
|
||||
rule: /^#(星铁|原神)?(面板角色|角色面板|面板)(列表)?\s*(\d{9,10})?$/
|
||||
},
|
||||
|
||||
profileDetail: {
|
||||
name: '角色面板',
|
||||
fn: ProfileDetail.detail,
|
||||
rule: /^#*([^#]+)\s*(详细|详情|面板|面版|圣遗物|武器[1-7]?|伤害([1-9]+\d*)?)\s*(\d{9})*(.*[换变改].*)?$/
|
||||
rule: /^#*([^#]+)\s*(详细|详情|面板|面版|圣遗物|武器[1-7]?|伤害([1-9]+\d*)?)\s*(\d{9,10})*(.*[换变改].*)?$/
|
||||
},
|
||||
|
||||
profileChange: {
|
||||
@ -66,7 +66,7 @@ app.reg({
|
||||
artisList: {
|
||||
name: '面板圣遗物列表',
|
||||
fn: profileArtisList,
|
||||
rule: /^#圣遗物列表\s*(\d{9})?$/
|
||||
rule: /^#圣遗物列表\s*(\d{9,10})?$/
|
||||
},
|
||||
|
||||
profileStat: {
|
||||
@ -87,7 +87,7 @@ app.reg({
|
||||
name: '角色查询',
|
||||
fn: ProfileStat.avatarList,
|
||||
rule: /^#喵喵(角色|查询)[ |0-9]*$/,
|
||||
yzRule: /^(#(五|四|5|4|星)*(角色|查询|查询角色|角色查询|人物)[ |0-9]*$)|(^(#*uid|#*UID)\+*[1|2|5-9][0-9]{8}$)|(^#[\+|+]*[1|2|5-9][0-9]{8})/,
|
||||
yzRule: /^(#(五|四|5|4|星)*(角色|查询|查询角色|角色查询|人物)[ |0-9]*$)|(^(#*uid|#*UID)\+*([1-9]|18)[0-9]{8}$)|(^#[\+|+]*([1-9]|18)[0-9]{8})/,
|
||||
yzCheck: () => Cfg.get('avatarList', false)
|
||||
},
|
||||
|
||||
@ -114,7 +114,7 @@ app.reg({
|
||||
name: '面板更新',
|
||||
describe: '【#角色】 获取游戏橱窗详情数据',
|
||||
fn: ProfileList.refresh,
|
||||
rule: /^#(星铁|原神)?(全部面板更新|更新全部面板|获取游戏角色详情|更新面板|面板更新)\s*(\d{9})?$/
|
||||
rule: /^#(星铁|原神)?(全部面板更新|更新全部面板|获取游戏角色详情|更新面板|面板更新)\s*(\d{9,10})?$/
|
||||
},
|
||||
|
||||
uploadImg: {
|
||||
@ -142,13 +142,13 @@ app.reg({
|
||||
name: '删除面板',
|
||||
describe: '【#角色】 删除游戏橱窗详情数据',
|
||||
fn: ProfileList.del,
|
||||
rule: /^#(删除全部面板|删除面板|删除面板数据)\s*(\d{9})?$/
|
||||
rule: /^#(删除全部面板|删除面板|删除面板数据)\s*(\d{9,10})?$/
|
||||
},
|
||||
|
||||
profileReload: {
|
||||
name: '重新加载面板',
|
||||
fn: ProfileList.reload,
|
||||
rule: /^#(星铁|原神)?(加载|重新加载|重载)面板\s*(\d{9})?$/
|
||||
rule: /^#(星铁|原神)?(加载|重新加载|重载)面板\s*(\d{9,10})?$/
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -25,7 +25,7 @@ const ProfileChange = {
|
||||
return false
|
||||
}
|
||||
msg = msg.toLowerCase().replace(/uid ?:? ?/, '').replace('', '')
|
||||
let regRet = /^#*(\d{9})?(.+?)(详细|详情|面板|面版|圣遗物|伤害[1-7]?)?\s*(\d{9})?[变换改](.+)/.exec(msg)
|
||||
let regRet = /^#*(\d{9,10})?(.+?)(详细|详情|面板|面版|圣遗物|伤害[1-7]?)?\s*(\d{9,10})?[变换改](.+)/.exec(msg)
|
||||
if (!regRet || !regRet[2]) {
|
||||
return false
|
||||
}
|
||||
@ -63,7 +63,7 @@ const ProfileChange = {
|
||||
keyTitleMap[v] = key
|
||||
})
|
||||
})
|
||||
const keyReg = new RegExp(`^(\\d{9})?\\s*(.+?)\\s*(\\d{9})?\\s*((?:${lodash.keys(keyTitleMap).join('|')}|\\+)+)$`)
|
||||
const keyReg = new RegExp(`^(\\d{9,10})?\\s*(.+?)\\s*(\\d{9,10})?\\s*((?:${lodash.keys(keyTitleMap).join('|')}|\\+)+)$`)
|
||||
|
||||
ret.char = char.id
|
||||
ret.mode = regRet[3] === '换' ? '面板' : regRet[3]
|
||||
|
@ -8,7 +8,7 @@ import { Character, MysApi, Player } from '#miao.models'
|
||||
* 获取面板查询的 目标uid
|
||||
* */
|
||||
const _getTargetUid = async function (e) {
|
||||
let uidReg = /[1-9][0-9]{8}/
|
||||
let uidReg = /([1-9]|18)[0-9]{8}/
|
||||
|
||||
if (e.uid && uidReg.test(e.uid)) {
|
||||
return e.uid
|
||||
|
@ -150,7 +150,7 @@ const ProfileList = {
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async del(e) {
|
||||
let ret = /^#(删除全部面板|删除面板|删除面板数据)\s*(\d{9})?$/.exec(e.msg)
|
||||
let ret = /^#(删除全部面板|删除面板|删除面板数据)\s*(\d{9,10})?$/.exec(e.msg)
|
||||
let uid = await getTargetUid(e)
|
||||
if (!uid) {
|
||||
return true
|
||||
|
@ -168,7 +168,7 @@ export default class ProfileRank {
|
||||
static async delUidInfo(uid) {
|
||||
let keys = await redis.keys('miao:rank:*')
|
||||
uid = uid + ''
|
||||
if (!/\d{9}/.test(uid)) {
|
||||
if (!/\d{9,10}/.test(uid)) {
|
||||
return false
|
||||
}
|
||||
for (let key of keys) {
|
||||
@ -208,7 +208,7 @@ export default class ProfileRank {
|
||||
let data = await Data.redisGet(key)
|
||||
let { qq, uidType } = data
|
||||
if (!users[qq]) continue
|
||||
let uidRet = /miao:rank:uid-info:(\d{9})/.exec(key)
|
||||
let uidRet = /miao:rank:uid-info:(\d{9,10})/.exec(key)
|
||||
if (qq && uidType && uidRet?.[1]) {
|
||||
add(qq, uidRet[1], uidType === 'ck' ? 'ck' : 'bind')
|
||||
}
|
||||
|
@ -33,7 +33,13 @@ const Serv = {
|
||||
let isGs = game === 'gs'
|
||||
|
||||
// 根据uid判断当前服务器类型。官服0 B服1 国际2
|
||||
let servType = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 2, 7: 2, 8: 2, 9: 2 }[uid[0]]
|
||||
let uidPrefix = uid.toString()
|
||||
if (uidPrefix.length == 10) {
|
||||
uidPrefix = uidPrefix.slice(0, 2)
|
||||
} else {
|
||||
uidPrefix = uidPrefix.slice(0, 1)
|
||||
}
|
||||
let servType = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 1, 6: 2, 7: 2, 8: 2, 18: 2, 9: 2 }[uidPrefix]
|
||||
|
||||
// 获取原神、星铁对应服务选择的配置
|
||||
let servCfg = (Cfg.get(isGs ? 'profileServer' : 'srProfileServer', '0') || '0').toString()
|
||||
|
@ -173,13 +173,14 @@ body, .container {
|
||||
background: rgba(255, 255, 255, .5);
|
||||
height: 80px;
|
||||
vertical-align: middle;
|
||||
margin: 15px 10px 0;
|
||||
margin: 15px 8px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.abyss-team {
|
||||
|
||||
display: flex;
|
||||
margin-right: -5px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.abyss-detail {
|
||||
|
Loading…
Reference in New Issue
Block a user