From 48e656e65289c5f25d193cfb81ebc267fd5fba22 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 20 Dec 2023 19:17:17 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E6=A1=86=EF=BC=8C=E9=80=A0=E5=9E=8B=EF=BC=8C=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=EF=BC=8C=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=A2=9E=E5=8A=A0model?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/user/ApiChangeInfo.ts | 23 ++++++++++++++++------- src/shared/public/user.ts | 8 ++++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/api_s2c/user/ApiChangeInfo.ts b/src/api_s2c/user/ApiChangeInfo.ts index 4d221d3..012bb9f 100644 --- a/src/api_s2c/user/ApiChangeInfo.ts +++ b/src/api_s2c/user/ApiChangeInfo.ts @@ -1,16 +1,25 @@ -import { ApiCall } from "tsrpc"; -import { PlayerFun } from '../../public/player'; -import { ReqChangeInfo, ResChangeInfo } from "../../shared/protocols/user/PtlChangeInfo"; -import { ResLogin } from '../../shared/protocols/user/PtlLogin'; -import { UserShared } from '../../shared/public/user'; +import {ApiCall} from "tsrpc"; +import {PlayerFun} from '../../public/player'; +import {ReqChangeInfo, ResChangeInfo} from "../../shared/protocols/user/PtlChangeInfo"; +import {ResLogin} from '../../shared/protocols/user/PtlLogin'; +import {UserShared} from '../../shared/public/user'; export default async function (call: ApiCall) { if (call.req.type == 'model' && !call.req.pos) return call.error(globalThis.lng.shiwu_6); - const active = (await G.mongodb.collection('playerInfo', 'playerInfo').findOne({ uid: call.uid, type: 'playerInfo' }))?.active || {}; + const active = (await G.mongodb.collection('playerInfo', 'playerInfo').findOne({ + uid: call.uid, + type: 'playerInfo' + }))?.active || {}; const fmtId = UserShared.getInfoId(call.req.type, call.req.id, call.req.pos || ''); - const isMeet = UserShared.chechIsActive(fmtId, { lv: call.conn.gud.lv, vip: call.conn.gud.vip, lsyx: call.conn.lshd.hero, active: active }); + const isMeet = UserShared.chechIsActive(fmtId, { + lv: call.conn.gud.lv, + vip: call.conn.gud.vip, + lsyx: call.conn.lshd.hero, + model: call.conn.gud.model, + active: active + }); if (!isMeet && call.req.type != 'headFrame' && call.req.type != 'chatFrame') return call.error(globalThis.lng.user_1); diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index 086fed9..55361c3 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -1,15 +1,14 @@ - - export class UserShared { /**获取头像之类id */ static getInfoId(type: 'head' | 'headFrame' | 'chatFrame' | 'model', id: string, pos?: string) { return Array.from(arguments).filter(s => s != '').join('_'); } + /** - * 判断头像之类是否激活 + * 判断头像之类是否激活 * @param id 请使用 UserShared.getInfo 转化后的id */ - static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v, active: k_v; }>) { + static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v, model: k_v, active: k_v; }>) { const [type, id, pos] = fmtId.split('_'); const jsonName = 'player' + type.slice(0, 1).toLocaleUpperCase() + type.slice(1); @@ -20,6 +19,7 @@ export class UserShared { else if (conf.cond[0] == 'vip') return collection.vip >= conf.cond[1]; else if (conf.cond[0] == 'hero') return collection.lsyx[conf.cond[1]] > 0; else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; + else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i=>i.id==conf.cond[1]); else return false; } } \ No newline at end of file From 715f564848c6209ce25866af8d2218df8e93268b Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 20 Dec 2023 21:59:23 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E9=80=A0=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/item/ApiUse.ts | 13 +- src/json/item.json | 44 +++++- src/json/playerHead.json | 108 ++++++++----- src/json/playerHeadFrame.json | 17 ++ src/json/playerModel.json | 138 ++++++++-------- src/json/tuisonglibao.json | 288 ++++++++++++++++++++++++++++++++-- src/jsonType.ts | 4 +- src/public/user.ts | 118 ++++++++++---- 8 files changed, 565 insertions(+), 165 deletions(-) diff --git a/src/api_s2c/item/ApiUse.ts b/src/api_s2c/item/ApiUse.ts index 7b850e0..65f786c 100644 --- a/src/api_s2c/item/ApiUse.ts +++ b/src/api_s2c/item/ApiUse.ts @@ -6,7 +6,7 @@ import {PublicShared} from '../../shared/public/public'; import {TanXianShared} from '../../shared/public/tanxian'; import {event_dldh_addPrize} from '../event/diaoluoduihuan/ApiOpen'; import {getEventPrize} from '../tanxian/ApiEvent'; -import { getItemByItemId } from "../../public/item"; +import {getItemByItemId} from "../../public/item"; const iType = { 3: 'hero', @@ -15,10 +15,10 @@ const iType = { }; export default async function (call: ApiCall) { - - //ȥ��item Redis��� - let itemInfo = await getItemByItemId(call.uid,call.req.itemId); //call.conn.item[call.req.itemId]; - if(!itemInfo[call.req.itemId]) return call.error(globalThis.lng.item_1); + + //ȥ��item Redis��� + let itemInfo = await getItemByItemId(call.uid, call.req.itemId); //call.conn.item[call.req.itemId]; + if (!itemInfo[call.req.itemId]) return call.error(globalThis.lng.item_1); let item = itemInfo[call.req.itemId]; let useNum = call.req.useNum; @@ -105,8 +105,9 @@ export default async function (call: ApiCall) { n: useNum } ]; - } else if ([7, 8].includes(itemConf.type)) { + } else if ([6, 7, 8].includes(itemConf.type)) { if (useNum > item.num) return call.error(globalThis.lng.item_3); + if (itemConf.type == 6) UserFun.activeModel(call.uid, itemConf.diaoluo.toString(), useNum); if (itemConf.type == 7) UserFun.activeHeadFrame(call.uid, itemConf.diaoluo.toString(), useNum); if (itemConf.type == 8) UserFun.activeChatFrame(call.uid, itemConf.diaoluo.toString(), useNum); diff --git a/src/json/item.json b/src/json/item.json index 1802cff..a5551b3 100644 --- a/src/json/item.json +++ b/src/json/item.json @@ -3860,6 +3860,7 @@ "way": [], "go": "", "icon": "txk_019", + "sicon": "txk_019", "describe": "intr_item_describe_50001", "diaoluo": 3, "useNeed": [], @@ -3878,6 +3879,7 @@ "way": [], "go": "", "icon": "txk_016", + "sicon": "txk_016", "describe": "intr_item_describe_50002", "diaoluo": 4, "useNeed": [], @@ -3896,6 +3898,7 @@ "way": [], "go": "", "icon": "txk_023", + "sicon": "txk_023", "describe": "intr_item_describe_50003", "diaoluo": 6, "useNeed": [], @@ -3914,6 +3917,7 @@ "way": [], "go": "", "icon": "txk_009", + "sicon": "txk_009", "describe": "intr_item_describe_50004", "diaoluo": 7, "useNeed": [], @@ -3932,6 +3936,7 @@ "way": [], "go": "", "icon": "txk_026", + "sicon": "txk_026", "describe": "intr_item_describe_50005", "diaoluo": 8, "useNeed": [], @@ -3950,6 +3955,7 @@ "way": [], "go": "", "icon": "txk_018", + "sicon": "txk_018", "describe": "intr_item_describe_50006", "diaoluo": 9, "useNeed": [], @@ -3968,6 +3974,7 @@ "way": [], "go": "", "icon": "txk_014", + "sicon": "txk_014", "describe": "intr_item_describe_50007", "diaoluo": 10, "useNeed": [], @@ -3986,6 +3993,7 @@ "way": [], "go": "", "icon": "txk_022", + "sicon": "txk_022", "describe": "intr_item_describe_50008", "diaoluo": 11, "useNeed": [], @@ -4004,6 +4012,7 @@ "way": [], "go": "", "icon": "txk_028", + "sicon": "txk_028", "describe": "intr_item_describe_50009", "diaoluo": 23, "useNeed": [], @@ -4012,6 +4021,24 @@ "payId": "", "advancedEffects": "" }, + "50010": { + "id": 50010, + "name": "playerheadFrame_name_24", + "type": 7, + "sort": 1, + "colour": 4, + "way": [], + "go": "", + "icon": "txk_025", + "sicon": "txk_025", + "describe": "intr_item_describe_50010", + "diaoluo": 24, + "useNeed": [], + "usePrize": [], + "selecPrize": [], + "payId": "", + "advancedEffects": "" + }, "50101": { "id": 50101, "name": "playerChatFrame_name_6", @@ -4022,6 +4049,7 @@ "way": [], "go": "", "icon": "lt_dhk11", + "sicon": "lt_dhk11", "describe": "intr_item_describe_50101", "diaoluo": 6, "useNeed": [], @@ -4040,6 +4068,7 @@ "way": [], "go": "", "icon": "lt_dhk10", + "sicon": "lt_dhk10", "describe": "intr_item_describe_50102", "diaoluo": 7, "useNeed": [], @@ -4058,6 +4087,7 @@ "way": [], "go": "", "icon": "txk_020", + "sicon": "txk_020", "describe": "intr_item_describe_50103", "diaoluo": 15, "useNeed": [], @@ -4076,6 +4106,7 @@ "way": [], "go": "", "icon": "lt_dhk14", + "sicon": "lt_dhk14", "describe": "intr_item_describe_50104", "diaoluo": 8, "useNeed": [], @@ -4094,6 +4125,7 @@ "way": [], "go": "", "icon": "txk_017", + "sicon": "txk_017", "describe": "intr_item_describe_50201", "diaoluo": 16, "useNeed": [], @@ -4112,6 +4144,7 @@ "way": [], "go": "", "icon": "txk_011", + "sicon": "txk_011", "describe": "intr_item_describe_50202", "diaoluo": 17, "useNeed": [], @@ -4130,6 +4163,7 @@ "way": [], "go": "", "icon": "txk_005", + "sicon": "txk_005", "describe": "intr_item_describe_50203", "diaoluo": 18, "useNeed": [], @@ -4148,6 +4182,7 @@ "way": [], "go": "", "icon": "txk_004", + "sicon": "txk_004", "describe": "intr_item_describe_50204", "diaoluo": 19, "useNeed": [], @@ -4166,6 +4201,7 @@ "way": [], "go": "", "icon": "txk_024", + "sicon": "txk_024", "describe": "intr_item_describe_50205", "diaoluo": 20, "useNeed": [], @@ -4184,6 +4220,7 @@ "way": [], "go": "", "icon": "txk_013", + "sicon": "txk_013", "describe": "intr_item_describe_50206", "diaoluo": 21, "useNeed": [], @@ -4202,6 +4239,7 @@ "way": [], "go": "", "icon": "txk_021", + "sicon": "txk_021", "describe": "intr_item_describe_50207", "diaoluo": 22, "useNeed": [], @@ -4220,7 +4258,8 @@ "way": [], "go": "", "icon": 100011, - "describe": "intr_item_describe_50208", + "sicon": 100011, + "describe": "intr_item_describe_50301", "diaoluo": 3, "useNeed": [], "usePrize": [], @@ -4238,7 +4277,8 @@ "way": [], "go": "", "icon": 100021, - "describe": "intr_item_describe_50209", + "sicon": 100021, + "describe": "intr_item_describe_50302", "diaoluo": 4, "useNeed": [], "usePrize": [], diff --git a/src/json/playerHead.json b/src/json/playerHead.json index 04f1367..37bf3c9 100644 --- a/src/json/playerHead.json +++ b/src/json/playerHead.json @@ -29,6 +29,36 @@ "colour": 1, "ani": "" }, + "3": { + "id": 3, + "name": "intr_playerinfo_name_3", + "undefined": "获得圣诞活动皮肤【圣诞庆典:男】后解锁", + "img": 100011, + "cond": [ + "model", + 3 + ], + "intr": "intr_playerinfo_intr_3", + "sort": 3, + "buff": {}, + "colour": 1, + "ani": "" + }, + "4": { + "id": 4, + "name": "intr_playerinfo_name_4", + "undefined": "获得圣诞活动皮肤【圣诞庆典:女】后解锁", + "img": 100021, + "cond": [ + "model", + 4 + ], + "intr": "intr_playerinfo_intr_4", + "sort": 4, + "buff": {}, + "colour": 1, + "ani": "" + }, "1001": { "id": 1001, "name": "intr_playerinfo_name_1001", @@ -39,7 +69,7 @@ 1001 ], "intr": "intr_playerinfo_intr_1001", - "sort": 40, + "sort": 42, "buff": {}, "colour": 1, "ani": "" @@ -54,7 +84,7 @@ 1002 ], "intr": "intr_playerinfo_intr_1002", - "sort": 41, + "sort": 43, "buff": {}, "colour": 1, "ani": "" @@ -69,7 +99,7 @@ 2001 ], "intr": "intr_playerinfo_intr_2001", - "sort": 38, + "sort": 40, "buff": {}, "colour": 1, "ani": "" @@ -84,7 +114,7 @@ 2002 ], "intr": "intr_playerinfo_intr_2002", - "sort": 39, + "sort": 41, "buff": {}, "colour": 1, "ani": "" @@ -99,7 +129,7 @@ 3001 ], "intr": "intr_playerinfo_intr_3001", - "sort": 23, + "sort": 25, "buff": {}, "colour": 1, "ani": "" @@ -114,7 +144,7 @@ 3002 ], "intr": "intr_playerinfo_intr_3002", - "sort": 24, + "sort": 26, "buff": {}, "colour": 1, "ani": "" @@ -129,7 +159,7 @@ 3003 ], "intr": "intr_playerinfo_intr_3003", - "sort": 25, + "sort": 27, "buff": {}, "colour": 1, "ani": "" @@ -144,7 +174,7 @@ 3004 ], "intr": "intr_playerinfo_intr_3004", - "sort": 26, + "sort": 28, "buff": {}, "colour": 1, "ani": "" @@ -159,7 +189,7 @@ 3005 ], "intr": "intr_playerinfo_intr_3005", - "sort": 27, + "sort": 29, "buff": {}, "colour": 1, "ani": "" @@ -174,7 +204,7 @@ 3006 ], "intr": "intr_playerinfo_intr_3006", - "sort": 28, + "sort": 30, "buff": {}, "colour": 1, "ani": "" @@ -189,7 +219,7 @@ 3007 ], "intr": "intr_playerinfo_intr_3007", - "sort": 29, + "sort": 31, "buff": {}, "colour": 1, "ani": "" @@ -204,7 +234,7 @@ 3008 ], "intr": "intr_playerinfo_intr_3008", - "sort": 30, + "sort": 32, "buff": {}, "colour": 1, "ani": "" @@ -219,7 +249,7 @@ 3009 ], "intr": "intr_playerinfo_intr_3009", - "sort": 31, + "sort": 33, "buff": {}, "colour": 1, "ani": "" @@ -234,7 +264,7 @@ 3010 ], "intr": "intr_playerinfo_intr_3010", - "sort": 32, + "sort": 34, "buff": {}, "colour": 1, "ani": "" @@ -249,7 +279,7 @@ 3011 ], "intr": "intr_playerinfo_intr_3011", - "sort": 33, + "sort": 35, "buff": {}, "colour": 1, "ani": "" @@ -264,7 +294,7 @@ 3012 ], "intr": "intr_playerinfo_intr_3012", - "sort": 34, + "sort": 36, "buff": {}, "colour": 1, "ani": "" @@ -279,7 +309,7 @@ 3013 ], "intr": "intr_playerinfo_intr_3013", - "sort": 35, + "sort": 37, "buff": {}, "colour": 1, "ani": "" @@ -294,7 +324,7 @@ 3014 ], "intr": "intr_playerinfo_intr_3014", - "sort": 36, + "sort": 38, "buff": {}, "colour": 1, "ani": "" @@ -309,7 +339,7 @@ 3015 ], "intr": "intr_playerinfo_intr_3015", - "sort": 37, + "sort": 39, "buff": {}, "colour": 1, "ani": "" @@ -324,7 +354,7 @@ 4001 ], "intr": "intr_playerinfo_intr_4001", - "sort": 8, + "sort": 10, "buff": {}, "colour": 1, "ani": "" @@ -339,7 +369,7 @@ 4002 ], "intr": "intr_playerinfo_intr_4002", - "sort": 9, + "sort": 11, "buff": {}, "colour": 1, "ani": "" @@ -354,7 +384,7 @@ 4003 ], "intr": "intr_playerinfo_intr_4003", - "sort": 10, + "sort": 12, "buff": {}, "colour": 1, "ani": "" @@ -369,7 +399,7 @@ 4004 ], "intr": "intr_playerinfo_intr_4004", - "sort": 11, + "sort": 13, "buff": {}, "colour": 1, "ani": "" @@ -384,7 +414,7 @@ 4005 ], "intr": "intr_playerinfo_intr_4005", - "sort": 12, + "sort": 14, "buff": {}, "colour": 1, "ani": "" @@ -399,7 +429,7 @@ 4006 ], "intr": "intr_playerinfo_intr_4006", - "sort": 13, + "sort": 15, "buff": {}, "colour": 1, "ani": "" @@ -414,7 +444,7 @@ 4007 ], "intr": "intr_playerinfo_intr_4007", - "sort": 14, + "sort": 16, "buff": {}, "colour": 1, "ani": "" @@ -429,7 +459,7 @@ 4008 ], "intr": "intr_playerinfo_intr_4008", - "sort": 15, + "sort": 17, "buff": {}, "colour": 1, "ani": "" @@ -444,7 +474,7 @@ 4009 ], "intr": "intr_playerinfo_intr_4009", - "sort": 16, + "sort": 18, "buff": {}, "colour": 1, "ani": "" @@ -459,7 +489,7 @@ 4010 ], "intr": "intr_playerinfo_intr_4010", - "sort": 17, + "sort": 19, "buff": {}, "colour": 1, "ani": "" @@ -474,7 +504,7 @@ 4011 ], "intr": "intr_playerinfo_intr_4011", - "sort": 18, + "sort": 20, "buff": {}, "colour": 1, "ani": "" @@ -489,7 +519,7 @@ 4012 ], "intr": "intr_playerinfo_intr_4012", - "sort": 19, + "sort": 21, "buff": {}, "colour": 1, "ani": "" @@ -504,7 +534,7 @@ 4013 ], "intr": "intr_playerinfo_intr_4013", - "sort": 20, + "sort": 22, "buff": {}, "colour": 1, "ani": "" @@ -519,7 +549,7 @@ 4014 ], "intr": "intr_playerinfo_intr_4014", - "sort": 21, + "sort": 23, "buff": {}, "colour": 1, "ani": "" @@ -534,7 +564,7 @@ 4015 ], "intr": "intr_playerinfo_intr_4015", - "sort": 22, + "sort": 24, "buff": {}, "colour": 1, "ani": "" @@ -549,7 +579,7 @@ 5001 ], "intr": "intr_playerinfo_intr_5001", - "sort": 3, + "sort": 5, "buff": {}, "colour": 1, "ani": "" @@ -564,7 +594,7 @@ 5002 ], "intr": "intr_playerinfo_intr_5002", - "sort": 4, + "sort": 6, "buff": {}, "colour": 1, "ani": "" @@ -579,7 +609,7 @@ 5003 ], "intr": "intr_playerinfo_intr_5003", - "sort": 5, + "sort": 7, "buff": {}, "colour": 1, "ani": "" @@ -594,7 +624,7 @@ 5004 ], "intr": "intr_playerinfo_intr_5004", - "sort": 6, + "sort": 8, "buff": {}, "colour": 1, "ani": "" @@ -609,7 +639,7 @@ 5005 ], "intr": "intr_playerinfo_intr_5005", - "sort": 7, + "sort": 9, "buff": {}, "colour": 1, "ani": "" diff --git a/src/json/playerHeadFrame.json b/src/json/playerHeadFrame.json index 485c541..a52191d 100644 --- a/src/json/playerHeadFrame.json +++ b/src/json/playerHeadFrame.json @@ -391,5 +391,22 @@ }, "colour": 4, "ani": "" + }, + "24": { + "id": 24, + "name": "playerheadFrame_name_24", + "undefined": "消费竞赛活动前三名获得,解锁后伤害加成+1%(限时7天)", + "img": "txk_025", + "cond": [ + "time", + 604800 + ], + "intr": "playerheadFrame_des_24", + "sort": 24, + "buff": { + "dpspro": 0.01 + }, + "colour": 5, + "ani": "" } } \ No newline at end of file diff --git a/src/json/playerModel.json b/src/json/playerModel.json index dcf972b..634d211 100644 --- a/src/json/playerModel.json +++ b/src/json/playerModel.json @@ -1,76 +1,74 @@ { "1": { - "1": { - "type": 1, - "id": 1, - "name": "playerModel_name_1", - "head": 10001, - "img": "zhu_10001", - "cond": [ - "lv", - 1 - ], - "intr": "playerModel_des_1", - "sort": 1, - "buff": {}, - "colour": 1, - "mwSpine": "ani_mingwangnan", - "fireHead": "img_lih2" + "id": 1, + "type": 1, + "name": "playerModel_name_1", + "head": 10001, + "img": "zhu_10001", + "cond": [ + "lv", + 1 + ], + "intr": "playerModel_des_1", + "sort": 1, + "buff": {}, + "colour": 1, + "mwSpine": "ani_mingwangnan", + "fireHead": "img_lih2" + }, + "2": { + "id": 2, + "type": 1, + "name": "playerModel_name_2", + "head": 10002, + "img": "zhu_10002", + "cond": [ + "lv", + 1 + ], + "intr": "playerModel_des_2", + "sort": 2, + "buff": {}, + "colour": 1, + "mwSpine": "ani_mingwangnv", + "fireHead": "img_lih1" + }, + "3": { + "id": 3, + "type": 1, + "name": "playerModel_name_3", + "head": 100011, + "img": 100011, + "cond": [ + "time", + -1 + ], + "intr": "playerModel_des_3", + "sort": 3, + "buff": { + "defpro": 0.02 }, - "2": { - "type": 1, - "id": 2, - "name": "playerModel_name_2", - "head": 10002, - "img": "zhu_10002", - "cond": [ - "lv", - 1 - ], - "intr": "playerModel_des_2", - "sort": 2, - "buff": {}, - "colour": 1, - "mwSpine": "ani_mingwangnv", - "fireHead": "img_lih1" + "colour": 5, + "mwSpine": "ani_mingwangnan", + "fireHead": "img_lih21" + }, + "4": { + "id": 4, + "type": 1, + "name": "playerModel_name_4", + "head": 100021, + "img": 100021, + "cond": [ + "time", + -1 + ], + "intr": "playerModel_des_4", + "sort": 4, + "buff": { + "atkpro": 0.02 }, - "3": { - "type": 1, - "id": 3, - "name": "playerModel_name_3", - "head": 100011, - "img": 100011, - "cond": [ - "time", - -1 - ], - "intr": "playerModel_des_3", - "sort": 3, - "buff": { - "defpro": 0.02 - }, - "colour": 5, - "mwSpine": "ani_mingwangnan", - "fireHead": "img_lih21" - }, - "4": { - "type": 1, - "id": 4, - "name": "playerModel_name_4", - "head": 100021, - "img": 100021, - "cond": [ - "time", - -1 - ], - "intr": "playerModel_des_4", - "sort": 4, - "buff": { - "atkpro": 0.02 - }, - "colour": 5, - "mwSpine": "ani_mingwangnv", - "fireHead": "img_lih11" - } + "colour": 5, + "mwSpine": "ani_mingwangnv", + "fireHead": "img_lih11" } } \ No newline at end of file diff --git a/src/json/tuisonglibao.json b/src/json/tuisonglibao.json index 737dbc1..20f6783 100644 --- a/src/json/tuisonglibao.json +++ b/src/json/tuisonglibao.json @@ -2,6 +2,7 @@ "1": { "id": 1, "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 5 ], @@ -17,6 +18,7 @@ "2": { "id": 2, "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 10 ], @@ -31,6 +33,7 @@ "3": { "id": 3, "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 20 ], @@ -44,7 +47,8 @@ }, "4": { "id": 4, - "type": 2, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ { "a": "item", @@ -61,7 +65,8 @@ }, "5": { "id": 5, - "type": 2, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ { "a": "item", @@ -78,7 +83,8 @@ }, "6": { "id": 6, - "type": 2, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ { "a": "attr", @@ -96,7 +102,8 @@ }, "7": { "id": 7, - "type": 3, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 1 ], @@ -111,7 +118,8 @@ }, "8": { "id": 8, - "type": 4, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 3 ], @@ -126,7 +134,8 @@ }, "9": { "id": 9, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 31 ], @@ -139,7 +148,8 @@ }, "10": { "id": 10, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 45 ], @@ -152,7 +162,8 @@ }, "11": { "id": 11, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 50 ], @@ -165,7 +176,8 @@ }, "12": { "id": 12, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 53 ], @@ -178,7 +190,8 @@ }, "13": { "id": 13, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 56 ], @@ -191,7 +204,8 @@ }, "14": { "id": 14, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 60 ], @@ -204,7 +218,8 @@ }, "15": { "id": 15, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 63 ], @@ -217,7 +232,8 @@ }, "16": { "id": 16, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 66 ], @@ -230,7 +246,8 @@ }, "17": { "id": 17, - "type": 5, + "type": 1, + "typeName": "tuisonglibao_name_2", "num": [ 68 ], @@ -243,7 +260,233 @@ }, "18": { "id": 18, + "type": 1, + "typeName": "tuisonglibao_name_2", + "num": [ + 760 + ], + "payId": [ + "guanqialibao_1", + "guanqialibao_2", + "guanqialibao_4" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "101": { + "id": 101, + "type": 2, + "typeName": "tuisonglibao_name_3", + "num": [ + { + "a": "item", + "t": "9" + } + ], + "payId": [ + "daojulibao_1", + "daojulibao_2", + "daojulibao_3" + ], + "time": 3600, + "displayCD": 86400, + "scale": 3000 + }, + "102": { + "id": 102, + "type": 2, + "typeName": "tuisonglibao_name_3", + "num": [ + { + "a": "item", + "t": "28" + } + ], + "payId": [ + "daojulibao_4", + "daojulibao_5", + "daojulibao_6" + ], + "time": 3600, + "displayCD": 86400, + "scale": 3000 + }, + "103": { + "id": 103, + "type": 2, + "typeName": "tuisonglibao_name_3", + "num": [ + { + "a": "item", + "t": "18" + } + ], + "payId": [ + "daojulibao_7", + "daojulibao_8", + "daojulibao_9" + ], + "time": 3600, + "displayCD": 86400, + "scale": 3000 + }, + "104": { + "id": 104, + "type": 2, + "typeName": "tuisonglibao_name_3", + "num": [ + { + "a": "item", + "t": "19" + } + ], + "payId": [ + "daojulibao_10", + "daojulibao_11", + "daojulibao_12" + ], + "time": 3600, + "displayCD": 86400, + "scale": 3000 + }, + "401": { + "id": 401, "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 15 + ], + "payId": [ + "lv15" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "402": { + "id": 402, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 25 + ], + "payId": [ + "lv25" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "403": { + "id": 403, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 40 + ], + "payId": [ + "lv40", + "lv40_1" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "404": { + "id": 404, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 50 + ], + "payId": [ + "lv50_1", + "lv50_2" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "405": { + "id": 405, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 55 + ], + "payId": [ + "lv55", + "lv55_1" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "406": { + "id": 406, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 60 + ], + "payId": [ + "lv60", + "lv60_1" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "407": { + "id": 407, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 63 + ], + "payId": [ + "lv63", + "lv63_1" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "408": { + "id": 408, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 66 + ], + "payId": [ + "lv66", + "lv66_1" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "409": { + "id": 409, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 69 + ], + "payId": [ + "lv69", + "lv69_1" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 + }, + "410": { + "id": 410, + "type": 5, + "typeName": "tuisonglibao_name_1", "num": [ 70 ], @@ -252,6 +495,21 @@ ], "time": 3600, "displayCD": 3600, - "scale": 1800 + "scale": 3000 + }, + "411": { + "id": 411, + "type": 5, + "typeName": "tuisonglibao_name_1", + "num": [ + 82 + ], + "payId": [ + "lv82_1", + "lv82_2" + ], + "time": 3600, + "displayCD": 3600, + "scale": 3000 } } \ No newline at end of file diff --git a/src/jsonType.ts b/src/jsonType.ts index 43654a4..e822019 100644 --- a/src/jsonType.ts +++ b/src/jsonType.ts @@ -1032,7 +1032,7 @@ type gc_playerLv = k_v<{ 'tujianlv': number }>; -type gc_playerModel = k_v>; +}>; type gc_pmd = { "get_hero_star5_pmd": string, "glkb_pmd": string, "jinjie_peijian": string, "guild_pmd": string, "tlsd_pmd": string, "hbzb_pmd1": string, "hbzb_pmd2": string, "hbzb_pmd3": string, [x: string]: any } diff --git a/src/public/user.ts b/src/public/user.ts index 0189473..ff9dcc1 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -1,14 +1,14 @@ import CryptoJS from 'crypto-js'; -import { ObjectId, OptionalId, WithId } from 'mongodb'; -import { BaseConnection } from 'tsrpc'; -import { Wjjl } from '../module/collection_wjjl'; -import { ServiceType } from '../shared/protocols/serviceProto'; -import { ReqLogin, ResLogin, playerAppend, playerAttr, playerInfo } from '../shared/protocols/user/PtlLogin'; -import { player } from '../shared/protocols/user/type'; -import { PublicShared } from '../shared/public/public'; -import { PlayerFun } from './player'; -import { ZhanLingTasks } from './zhanling'; -import { getGud, setGud } from './gud'; +import {ObjectId, OptionalId, WithId} from 'mongodb'; +import {BaseConnection} from 'tsrpc'; +import {Wjjl} from '../module/collection_wjjl'; +import {ServiceType} from '../shared/protocols/serviceProto'; +import {ReqLogin, ResLogin, playerAppend, playerAttr, playerInfo} from '../shared/protocols/user/PtlLogin'; +import {player} from '../shared/protocols/user/type'; +import {PublicShared} from '../shared/public/public'; +import {PlayerFun} from './player'; +import {ZhanLingTasks} from './zhanling'; +import {getGud, setGud} from './gud'; export const defaultUserInfo: playerInfo = { lv: 1, @@ -30,14 +30,12 @@ export const defaultUserAttr: playerAttr = { export const defaultUserAppend: playerAppend = { name: '', tujianLv: 0, - head: { id: "1", time: -1 }, - headFrame: { id: "1", time: -1 }, - chatFrame: { id: "1", time: -1 }, + head: {id: "1", time: -1}, + headFrame: {id: "1", time: -1}, + chatFrame: {id: "1", time: -1}, model: { - 1: { id: "1", time: -1 }, - 2: { id: "1", time: -1 }, - 3: { id: "1", time: -1 }, - 4: { id: "1", time: -1 }, + 1: {id: "1", time: -1}, + 2: {id: "2", time: -1} }, renown: 0, wxcLv: { @@ -60,12 +58,12 @@ export const defaultUserAppend: playerAppend = { ghId: '', ghName: '', ghLevel: 0, - ghwz: { 1: 0, 2: 0, 3: 0, 4: 0 } + ghwz: {1: 0, 2: 0, 3: 0, 4: 0} }; export class UserFun { static create(bUid: string) { - let { bindUid, ...userInfo } = defaultUserInfo; + let {bindUid, ...userInfo} = defaultUserInfo; return { bindUid: bUid, @@ -73,6 +71,7 @@ export class UserFun { ...defaultUserAttr }; } + static async check(gud: ResLogin['gud'], req: ReqLogin) { let obj: k_v = {}; let add: k_v = {}; @@ -126,14 +125,14 @@ export class UserFun { if (h_ids.length < 1) { gud.fightHeros = []; } else { - let dHeros = await G.mongodb.collection('hero').find({ _id: { $in: h_ids.map(id => G.mongodb.conversionId(id)) } }).toArray(); + let dHeros = await G.mongodb.collection('hero').find({_id: {$in: h_ids.map(id => G.mongodb.conversionId(id))}}).toArray(); gud.fightHeros = dHeros.map(h => h.heroId.toString()); } add.fightHeros = gud.fightHeros; } if (!gud.matrixPos) { - gud.matrixPos = Object.fromEntries(Object.keys(G.gc.fightPlan).map(pos => [pos, { ...gud.heroPos }])); + gud.matrixPos = Object.fromEntries(Object.keys(G.gc.fightPlan).map(pos => [pos, {...gud.heroPos}])); add.matrixPos = gud.matrixPos; } @@ -197,7 +196,7 @@ export class UserFun { add.loginTime = G.time; if (Object.keys(add).length > 0) { - G.mongodb.collection('user').updateOne({ bindUid: gud.bindUid,sid:gud.sid }, { + G.mongodb.collection('user').updateOne({bindUid: gud.bindUid, sid: gud.sid}, { $set: { ...add } @@ -211,24 +210,25 @@ export class UserFun { return obj; } - + // 检查空数据并修复 static async checkUidOrName() { - let users = await G.mongodb.collection('user').findOne({$or: [{uid: {$in:['', null]}},{name: {$in: ['', null]}}]}) - if(users) { + let users = await G.mongodb.collection('user').findOne({$or: [{uid: {$in: ['', null]}}, {name: {$in: ['', null]}}]}) + if (users) { let {bindUid, sid, _id} = users let uid = users.uid || (sid + '_' + _id) // 随机创建name let b64 = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(bindUid + sid)); let name = users.name || `temp_${b64}`.toLocaleLowerCase(); - await G.mongodb.collection('user').updateOne({ bindUid, sid }, { + await G.mongodb.collection('user').updateOne({bindUid, sid}, { $set: { uid, name } }); } - return + return } + /**创建账号数据 */ static async createUser(client: BaseConnection, bindUid: string, sid: number): Promise>> { // 开启事务 @@ -258,14 +258,17 @@ export class UserFun { // session.endSession() // 结束事务 return gud as WithId>; } + /**获取玩家附带的buff加成 */ static getOtherBuff(gud: ResLogin['gud']) { return gud; } + static async getGud(uid: string) { //return await G.redis.get('user', uid); return await getGud(uid); } + /**激活头像框 */ static async activeHeadFrame(uid: string, k: string, v: number) { let gud: player; @@ -312,11 +315,12 @@ export class UserFun { } if (change) { - PlayerFun.changeAttr(uid, { headFrames: gud.headFrames }); - G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', { headFrames: gud.headFrames }); + PlayerFun.changeAttr(uid, {headFrames: gud.headFrames}); + G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {headFrames: gud.headFrames}); G.server.uid_connections[uid]?.refreshPower(); } } + /**激活聊天框 */ static async activeChatFrame(uid: string, k: string, v: number) { let gud: player; @@ -363,8 +367,60 @@ export class UserFun { } if (change) { - PlayerFun.changeAttr(uid, { chatFrames: gud.chatFrames }); - G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', { chatFrames: gud.chatFrames }); + PlayerFun.changeAttr(uid, {chatFrames: gud.chatFrames}); + G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {chatFrames: gud.chatFrames}); + G.server.uid_connections[uid]?.refreshPower(); + } + } + + /**激活造型 */ + static async activeModel(uid: string, k: string, v: number) { + let gud: player; + // if (G.server.uid_connections[uid]) { + // gud = G.server.uid_connections[uid].gud; + // } else { + // gud = await G.redis.get('user', uid); + // } + gud = await getGud(uid); + + let change = false; + let model = G.gc.playerModel; + let checks = Object.values(model).filter(v => v.cond[0] == k); + if (checks.length > 0) { + checks.forEach(conf => { + let val = v; + if (k == 'wxcLv') val = gud.wxcLv.lv; + else if (gud[k] != undefined) val = gud[k]; + + if (k == 'jjc_rank' && !gud.model[conf.id] && val <= conf.cond[1]) { + gud.model[conf.id] = {id: conf.id + '', time: -1}; + change = true; + } else if (!gud.model[conf.id] && val >= conf.cond[1]) { + gud.model[conf.id] = {id: conf.id + '', time: -1}; + change = true; + } + }); + } else { + let conf = model[k]; + if (conf?.cond?.[0] == 'time') { + let val = conf.cond[1]; + + if (val == -1 && gud.model[conf.id]) { + change = true; + gud.model[conf.id] = {id: conf.id + '', time: -1}; + } else if (!gud.model[conf.id] || gud.model[conf.id].time < G.time) { + change = true; + gud.model[conf.id] = {id: conf.id + '', time: G.time + val * v}; + } else { + change = true; + gud.model[conf.id] = {id: conf.id + '', time: gud.model[conf.id].time += val * v} + } + } + } + + if (change) { + PlayerFun.changeAttr(uid, {model: gud.model}); + G.server.sendMsgByUid(uid, 'msg_s2c/PlayerChange', {model: gud.model}); G.server.uid_connections[uid]?.refreshPower(); } } From d633d52d80f1a9a3b53fbad0a021ea5fea21cca9 Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 21 Dec 2023 10:14:21 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E9=80=A0=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/user/ApiChangeInfo.ts | 6 +++--- src/shared/public/user.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api_s2c/user/ApiChangeInfo.ts b/src/api_s2c/user/ApiChangeInfo.ts index 012bb9f..fdb78f5 100644 --- a/src/api_s2c/user/ApiChangeInfo.ts +++ b/src/api_s2c/user/ApiChangeInfo.ts @@ -6,13 +6,13 @@ import {UserShared} from '../../shared/public/user'; export default async function (call: ApiCall) { - if (call.req.type == 'model' && !call.req.pos) return call.error(globalThis.lng.shiwu_6); + // if (call.req.type == 'model' && !call.req.pos) return call.error(globalThis.lng.shiwu_6); const active = (await G.mongodb.collection('playerInfo', 'playerInfo').findOne({ uid: call.uid, type: 'playerInfo' }))?.active || {}; - const fmtId = UserShared.getInfoId(call.req.type, call.req.id, call.req.pos || ''); + const fmtId = UserShared.getInfoId(call.req.type, call.req.id); const isMeet = UserShared.chechIsActive(fmtId, { lv: call.conn.gud.lv, vip: call.conn.gud.vip, @@ -27,7 +27,7 @@ export default async function (call: ApiCall) { if (call.req.type == 'model') { let d = JSON.parse(JSON.stringify(call.conn.gud.model)); - d[call.req.pos] = { + d[call.req.id] = { id: call.req.id, time: active[fmtId] || -1 }; diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index 55361c3..26b3bc5 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -10,10 +10,10 @@ export class UserShared { */ static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v, model: k_v, active: k_v; }>) { - const [type, id, pos] = fmtId.split('_'); + const [type, id] = fmtId.split('_'); const jsonName = 'player' + type.slice(0, 1).toLocaleUpperCase() + type.slice(1); const json = G.gc[jsonName] as any; - const conf: _gcType['playerHead'][''] = pos ? json[pos][id] : json[id]; + const conf: _gcType['playerHead'] = json[id]; if (conf.cond[0] == 'lv') return collection.lv >= conf.cond[1]; else if (conf.cond[0] == 'vip') return collection.vip >= conf.cond[1]; From 552da7995190a7d365d2589c2b5a9d69a14df1ec Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 21 Dec 2023 11:32:15 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E9=80=A0=E5=9E=8B=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/user/ApiChangeInfo.ts | 4 +++- src/shared/public/user.ts | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/api_s2c/user/ApiChangeInfo.ts b/src/api_s2c/user/ApiChangeInfo.ts index fdb78f5..cc04798 100644 --- a/src/api_s2c/user/ApiChangeInfo.ts +++ b/src/api_s2c/user/ApiChangeInfo.ts @@ -8,11 +8,13 @@ export default async function (call: ApiCall) { // if (call.req.type == 'model' && !call.req.pos) return call.error(globalThis.lng.shiwu_6); - const active = (await G.mongodb.collection('playerInfo', 'playerInfo').findOne({ + let active = (await G.mongodb.collection('playerInfo', 'playerInfo').findOne({ uid: call.uid, type: 'playerInfo' }))?.active || {}; const fmtId = UserShared.getInfoId(call.req.type, call.req.id); + if (R.values(active).length == 0) active = UserShared.getActive(fmtId, call.conn.gud, call.req.type, call.req.id) + const isMeet = UserShared.chechIsActive(fmtId, { lv: call.conn.gud.lv, vip: call.conn.gud.vip, diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index 26b3bc5..11fcf6c 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -4,6 +4,22 @@ export class UserShared { return Array.from(arguments).filter(s => s != '').join('_'); } + // todo active始终为空,暂时获取对应的avtive,解决打包上线的圣诞版本, + // 后续要理清数据格式,填入playerinfo的active,包括user/infoOpen接口的返回 + static getActive(fmtId, player, type, id?) { + switch (type) { + case 'head': + return {[fmtId]: player.head?.time} + case 'headFrame': + return {[fmtId]: player.headFrames[id]} + case 'chatFrame': + return {[fmtId]: player.chatFrames[id]} + case 'model': + return {[fmtId]: player.model?.[id]?.time} + } + return {} + } + /** * 判断头像之类是否激活 * @param id 请使用 UserShared.getInfo 转化后的id @@ -18,8 +34,9 @@ export class UserShared { if (conf.cond[0] == 'lv') return collection.lv >= conf.cond[1]; else if (conf.cond[0] == 'vip') return collection.vip >= conf.cond[1]; else if (conf.cond[0] == 'hero') return collection.lsyx[conf.cond[1]] > 0; - else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; - else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i=>i.id==conf.cond[1]); + // else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; + else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active[fmtId] > G.time; + else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i => i.id == conf.cond[1]); else return false; } } \ No newline at end of file From 4ceaeb8a5ec0955e14f858d053859117305e2294 Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 21 Dec 2023 11:36:53 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E9=80=A0=E5=9E=8B=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/public/user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/public/user.ts b/src/shared/public/user.ts index 11fcf6c..fe19f59 100644 --- a/src/shared/public/user.ts +++ b/src/shared/public/user.ts @@ -35,7 +35,7 @@ export class UserShared { else if (conf.cond[0] == 'vip') return collection.vip >= conf.cond[1]; else if (conf.cond[0] == 'hero') return collection.lsyx[conf.cond[1]] > 0; // else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time; - else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active[fmtId] > G.time; + else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active?.[fmtId] > G.time; else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i => i.id == conf.cond[1]); else return false; } From 3194dc6449c2df11547be198f61ab67f2c64d46f Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 21 Dec 2023 12:37:39 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E9=80=A0=E5=9E=8B=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/user/ApiChangeInfo.ts | 6 +- src/cross/protocols/serviceProto.ts | 85 ++++++--- src/monopoly/protocols/serviceProto.ts | 85 ++++++--- src/shared/protocols/serviceProto.ts | 255 ++++++++++++++++--------- src/shared/protocols/user/PtlLogin.ts | 9 +- 5 files changed, 282 insertions(+), 158 deletions(-) diff --git a/src/api_s2c/user/ApiChangeInfo.ts b/src/api_s2c/user/ApiChangeInfo.ts index cc04798..5bfac14 100644 --- a/src/api_s2c/user/ApiChangeInfo.ts +++ b/src/api_s2c/user/ApiChangeInfo.ts @@ -29,10 +29,12 @@ export default async function (call: ApiCall) { if (call.req.type == 'model') { let d = JSON.parse(JSON.stringify(call.conn.gud.model)); - d[call.req.id] = { + let changeItem = { id: call.req.id, time: active[fmtId] || -1 - }; + } + d[call.req.id] = changeItem + change.upModel = changeItem change.model = d; } else { change[call.req.type] = { diff --git a/src/cross/protocols/serviceProto.ts b/src/cross/protocols/serviceProto.ts index 8dcedb7..e99cd52 100644 --- a/src/cross/protocols/serviceProto.ts +++ b/src/cross/protocols/serviceProto.ts @@ -875,6 +875,29 @@ export const serviceProto: ServiceProto = { }, { "id": 5, + "name": "upModel", + "type": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "time", + "type": { + "type": "Number" + } + } + ] + } + }, + { + "id": 6, "name": "model", "type": { "type": "Interface", @@ -903,14 +926,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 6, + "id": 7, "name": "renown", "type": { "type": "Number" } }, { - "id": 7, + "id": 8, "name": "wxcLv", "type": { "type": "Interface", @@ -936,14 +959,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 8, + "id": 9, "name": "mapId", "type": { "type": "Number" } }, { - "id": 9, + "id": 10, "name": "shoucangping", "type": { "type": "Interface", @@ -956,14 +979,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 10, + "id": 11, "name": "useTujianLvPoint", "type": { "type": "Number" } }, { - "id": 11, + "id": 12, "name": "skills", "type": { "type": "Interface", @@ -976,7 +999,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 12, + "id": 13, "name": "fightSkills", "type": { "type": "Interface", @@ -989,7 +1012,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 13, + "id": 14, "name": "heroPos", "type": { "type": "Interface", @@ -1002,21 +1025,21 @@ export const serviceProto: ServiceProto = { } }, { - "id": 14, + "id": 15, "name": "ghId", "type": { "type": "String" } }, { - "id": 15, + "id": 16, "name": "ghName", "type": { "type": "String" } }, { - "id": 16, + "id": 17, "name": "ghLevel", "type": { "type": "Reference", @@ -1024,7 +1047,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 17, + "id": 18, "name": "ghwz", "type": { "type": "Interface", @@ -1038,7 +1061,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 18, + "id": 19, "name": "ghExitTime", "type": { "type": "Number" @@ -1046,7 +1069,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 19, + "id": 20, "name": "loginTime", "type": { "type": "Number" @@ -1054,7 +1077,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 20, + "id": 21, "name": "logoutTime", "type": { "type": "Number" @@ -1062,7 +1085,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 21, + "id": 22, "name": "cTime", "type": { "type": "Number" @@ -1070,7 +1093,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 22, + "id": 23, "name": "loginDays", "type": { "type": "Number" @@ -1078,7 +1101,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 23, + "id": 24, "name": "serverName", "type": { "type": "String" @@ -1086,7 +1109,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 24, + "id": 25, "name": "sid", "type": { "type": "Number" @@ -1094,7 +1117,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 25, + "id": 26, "name": "onlineTime", "type": { "type": "Number" @@ -1102,7 +1125,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 26, + "id": 27, "name": "newonlinetime", "type": { "type": "Number" @@ -1110,7 +1133,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 27, + "id": 28, "name": "isNpc", "type": { "type": "Boolean" @@ -1118,7 +1141,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 28, + "id": 29, "name": "matrix", "type": { "type": "Interface", @@ -1132,7 +1155,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 29, + "id": 30, "name": "matrixPos", "type": { "type": "Interface", @@ -1152,7 +1175,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 30, + "id": 31, "name": "selectMatrix", "type": { "type": "String" @@ -1160,7 +1183,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 31, + "id": 32, "name": "fightHeros", "type": { "type": "Array", @@ -1171,7 +1194,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 32, + "id": 33, "name": "helpHeros", "type": { "type": "Array", @@ -1248,7 +1271,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 33, + "id": 34, "name": "changeNameNum", "type": { "type": "Number" @@ -1256,7 +1279,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 34, + "id": 35, "name": "peijianUnlock", "type": { "type": "Interface", @@ -1270,7 +1293,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 35, + "id": 36, "name": "headFrames", "type": { "type": "Interface", @@ -1284,7 +1307,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 36, + "id": 37, "name": "chatFrames", "type": { "type": "Interface", diff --git a/src/monopoly/protocols/serviceProto.ts b/src/monopoly/protocols/serviceProto.ts index 782cc14..9eea14e 100644 --- a/src/monopoly/protocols/serviceProto.ts +++ b/src/monopoly/protocols/serviceProto.ts @@ -2145,6 +2145,29 @@ export const serviceProto: ServiceProto = { }, { "id": 5, + "name": "upModel", + "type": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "time", + "type": { + "type": "Number" + } + } + ] + } + }, + { + "id": 6, "name": "model", "type": { "type": "Interface", @@ -2173,14 +2196,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 6, + "id": 7, "name": "renown", "type": { "type": "Number" } }, { - "id": 7, + "id": 8, "name": "wxcLv", "type": { "type": "Interface", @@ -2206,14 +2229,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 8, + "id": 9, "name": "mapId", "type": { "type": "Number" } }, { - "id": 9, + "id": 10, "name": "shoucangping", "type": { "type": "Interface", @@ -2226,14 +2249,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 10, + "id": 11, "name": "useTujianLvPoint", "type": { "type": "Number" } }, { - "id": 11, + "id": 12, "name": "skills", "type": { "type": "Interface", @@ -2246,7 +2269,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 12, + "id": 13, "name": "fightSkills", "type": { "type": "Interface", @@ -2259,7 +2282,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 13, + "id": 14, "name": "heroPos", "type": { "type": "Interface", @@ -2272,21 +2295,21 @@ export const serviceProto: ServiceProto = { } }, { - "id": 14, + "id": 15, "name": "ghId", "type": { "type": "String" } }, { - "id": 15, + "id": 16, "name": "ghName", "type": { "type": "String" } }, { - "id": 16, + "id": 17, "name": "ghLevel", "type": { "type": "Reference", @@ -2294,7 +2317,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 17, + "id": 18, "name": "ghwz", "type": { "type": "Interface", @@ -2308,7 +2331,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 18, + "id": 19, "name": "ghExitTime", "type": { "type": "Number" @@ -2316,7 +2339,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 19, + "id": 20, "name": "loginTime", "type": { "type": "Number" @@ -2324,7 +2347,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 20, + "id": 21, "name": "logoutTime", "type": { "type": "Number" @@ -2332,7 +2355,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 21, + "id": 22, "name": "cTime", "type": { "type": "Number" @@ -2340,7 +2363,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 22, + "id": 23, "name": "loginDays", "type": { "type": "Number" @@ -2348,7 +2371,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 23, + "id": 24, "name": "serverName", "type": { "type": "String" @@ -2356,7 +2379,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 24, + "id": 25, "name": "sid", "type": { "type": "Number" @@ -2364,7 +2387,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 25, + "id": 26, "name": "onlineTime", "type": { "type": "Number" @@ -2372,7 +2395,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 26, + "id": 27, "name": "newonlinetime", "type": { "type": "Number" @@ -2380,7 +2403,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 27, + "id": 28, "name": "isNpc", "type": { "type": "Boolean" @@ -2388,7 +2411,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 28, + "id": 29, "name": "matrix", "type": { "type": "Interface", @@ -2402,7 +2425,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 29, + "id": 30, "name": "matrixPos", "type": { "type": "Interface", @@ -2422,7 +2445,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 30, + "id": 31, "name": "selectMatrix", "type": { "type": "String" @@ -2430,7 +2453,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 31, + "id": 32, "name": "fightHeros", "type": { "type": "Array", @@ -2441,7 +2464,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 32, + "id": 33, "name": "helpHeros", "type": { "type": "Array", @@ -2518,7 +2541,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 33, + "id": 34, "name": "changeNameNum", "type": { "type": "Number" @@ -2526,7 +2549,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 34, + "id": 35, "name": "peijianUnlock", "type": { "type": "Interface", @@ -2540,7 +2563,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 35, + "id": 36, "name": "headFrames", "type": { "type": "Interface", @@ -2554,7 +2577,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 36, + "id": 37, "name": "chatFrames", "type": { "type": "Interface", diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index c60ab37..62ac7ca 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -3954,6 +3954,29 @@ export const serviceProto: ServiceProto = { }, { "id": 5, + "name": "upModel", + "type": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "time", + "type": { + "type": "Number" + } + } + ] + } + }, + { + "id": 6, "name": "model", "type": { "type": "Interface", @@ -3982,14 +4005,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 6, + "id": 7, "name": "renown", "type": { "type": "Number" } }, { - "id": 7, + "id": 8, "name": "wxcLv", "type": { "type": "Interface", @@ -4015,14 +4038,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 8, + "id": 9, "name": "mapId", "type": { "type": "Number" } }, { - "id": 9, + "id": 10, "name": "shoucangping", "type": { "type": "Interface", @@ -4035,14 +4058,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 10, + "id": 11, "name": "useTujianLvPoint", "type": { "type": "Number" } }, { - "id": 11, + "id": 12, "name": "skills", "type": { "type": "Interface", @@ -4055,7 +4078,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 12, + "id": 13, "name": "fightSkills", "type": { "type": "Interface", @@ -4068,7 +4091,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 13, + "id": 14, "name": "heroPos", "type": { "type": "Interface", @@ -4081,21 +4104,21 @@ export const serviceProto: ServiceProto = { } }, { - "id": 14, + "id": 15, "name": "ghId", "type": { "type": "String" } }, { - "id": 15, + "id": 16, "name": "ghName", "type": { "type": "String" } }, { - "id": 16, + "id": 17, "name": "ghLevel", "type": { "type": "Reference", @@ -4103,7 +4126,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 17, + "id": 18, "name": "ghwz", "type": { "type": "Interface", @@ -4117,7 +4140,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 18, + "id": 19, "name": "ghExitTime", "type": { "type": "Number" @@ -4125,7 +4148,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 19, + "id": 20, "name": "loginTime", "type": { "type": "Number" @@ -4133,7 +4156,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 20, + "id": 21, "name": "logoutTime", "type": { "type": "Number" @@ -4141,7 +4164,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 21, + "id": 22, "name": "cTime", "type": { "type": "Number" @@ -4149,7 +4172,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 22, + "id": 23, "name": "loginDays", "type": { "type": "Number" @@ -4157,7 +4180,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 23, + "id": 24, "name": "serverName", "type": { "type": "String" @@ -4165,7 +4188,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 24, + "id": 25, "name": "sid", "type": { "type": "Number" @@ -4173,7 +4196,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 25, + "id": 26, "name": "onlineTime", "type": { "type": "Number" @@ -4181,7 +4204,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 26, + "id": 27, "name": "newonlinetime", "type": { "type": "Number" @@ -4189,7 +4212,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 27, + "id": 28, "name": "isNpc", "type": { "type": "Boolean" @@ -4197,7 +4220,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 28, + "id": 29, "name": "matrix", "type": { "type": "Interface", @@ -4211,7 +4234,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 29, + "id": 30, "name": "matrixPos", "type": { "type": "Interface", @@ -4231,7 +4254,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 30, + "id": 31, "name": "selectMatrix", "type": { "type": "String" @@ -4239,7 +4262,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 31, + "id": 32, "name": "fightHeros", "type": { "type": "Array", @@ -4250,7 +4273,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 32, + "id": 33, "name": "helpHeros", "type": { "type": "Array", @@ -4327,7 +4350,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 33, + "id": 34, "name": "changeNameNum", "type": { "type": "Number" @@ -4335,7 +4358,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 34, + "id": 35, "name": "peijianUnlock", "type": { "type": "Interface", @@ -4349,7 +4372,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 35, + "id": 36, "name": "headFrames", "type": { "type": "Interface", @@ -4363,7 +4386,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 36, + "id": 37, "name": "chatFrames", "type": { "type": "Interface", @@ -5175,6 +5198,29 @@ export const serviceProto: ServiceProto = { }, { "id": 5, + "name": "upModel", + "type": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "time", + "type": { + "type": "Number" + } + } + ] + } + }, + { + "id": 6, "name": "model", "type": { "type": "Interface", @@ -5203,14 +5249,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 6, + "id": 7, "name": "renown", "type": { "type": "Number" } }, { - "id": 7, + "id": 8, "name": "wxcLv", "type": { "type": "Interface", @@ -5236,14 +5282,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 8, + "id": 9, "name": "mapId", "type": { "type": "Number" } }, { - "id": 9, + "id": 10, "name": "shoucangping", "type": { "type": "Interface", @@ -5256,14 +5302,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 10, + "id": 11, "name": "useTujianLvPoint", "type": { "type": "Number" } }, { - "id": 11, + "id": 12, "name": "skills", "type": { "type": "Interface", @@ -5276,7 +5322,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 12, + "id": 13, "name": "fightSkills", "type": { "type": "Interface", @@ -5289,7 +5335,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 13, + "id": 14, "name": "heroPos", "type": { "type": "Interface", @@ -5302,21 +5348,21 @@ export const serviceProto: ServiceProto = { } }, { - "id": 14, + "id": 15, "name": "ghId", "type": { "type": "String" } }, { - "id": 15, + "id": 16, "name": "ghName", "type": { "type": "String" } }, { - "id": 16, + "id": 17, "name": "ghLevel", "type": { "type": "Reference", @@ -5324,7 +5370,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 17, + "id": 18, "name": "ghwz", "type": { "type": "Interface", @@ -5338,7 +5384,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 18, + "id": 19, "name": "ghExitTime", "type": { "type": "Number" @@ -5346,7 +5392,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 19, + "id": 20, "name": "loginTime", "type": { "type": "Number" @@ -5354,7 +5400,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 20, + "id": 21, "name": "logoutTime", "type": { "type": "Number" @@ -5362,7 +5408,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 21, + "id": 22, "name": "cTime", "type": { "type": "Number" @@ -5370,7 +5416,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 22, + "id": 23, "name": "loginDays", "type": { "type": "Number" @@ -5378,7 +5424,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 23, + "id": 24, "name": "serverName", "type": { "type": "String" @@ -5386,7 +5432,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 24, + "id": 25, "name": "sid", "type": { "type": "Number" @@ -5394,7 +5440,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 25, + "id": 26, "name": "onlineTime", "type": { "type": "Number" @@ -5402,7 +5448,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 26, + "id": 27, "name": "newonlinetime", "type": { "type": "Number" @@ -5410,7 +5456,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 27, + "id": 28, "name": "isNpc", "type": { "type": "Boolean" @@ -5418,7 +5464,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 28, + "id": 29, "name": "matrix", "type": { "type": "Interface", @@ -5432,7 +5478,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 29, + "id": 30, "name": "matrixPos", "type": { "type": "Interface", @@ -5452,7 +5498,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 30, + "id": 31, "name": "selectMatrix", "type": { "type": "String" @@ -5460,7 +5506,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 31, + "id": 32, "name": "fightHeros", "type": { "type": "Array", @@ -5471,7 +5517,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 32, + "id": 33, "name": "helpHeros", "type": { "type": "Array", @@ -5548,7 +5594,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 33, + "id": 34, "name": "changeNameNum", "type": { "type": "Number" @@ -5556,7 +5602,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 34, + "id": 35, "name": "peijianUnlock", "type": { "type": "Interface", @@ -5570,7 +5616,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 35, + "id": 36, "name": "headFrames", "type": { "type": "Interface", @@ -5584,7 +5630,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 36, + "id": 37, "name": "chatFrames", "type": { "type": "Interface", @@ -22862,6 +22908,29 @@ export const serviceProto: ServiceProto = { }, { "id": 5, + "name": "upModel", + "type": { + "type": "Interface", + "properties": [ + { + "id": 0, + "name": "id", + "type": { + "type": "String" + } + }, + { + "id": 1, + "name": "time", + "type": { + "type": "Number" + } + } + ] + } + }, + { + "id": 6, "name": "model", "type": { "type": "Interface", @@ -22890,14 +22959,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 6, + "id": 7, "name": "renown", "type": { "type": "Number" } }, { - "id": 7, + "id": 8, "name": "wxcLv", "type": { "type": "Interface", @@ -22923,14 +22992,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 8, + "id": 9, "name": "mapId", "type": { "type": "Number" } }, { - "id": 9, + "id": 10, "name": "shoucangping", "type": { "type": "Interface", @@ -22943,14 +23012,14 @@ export const serviceProto: ServiceProto = { } }, { - "id": 10, + "id": 11, "name": "useTujianLvPoint", "type": { "type": "Number" } }, { - "id": 11, + "id": 12, "name": "skills", "type": { "type": "Interface", @@ -22963,7 +23032,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 12, + "id": 13, "name": "fightSkills", "type": { "type": "Interface", @@ -22976,7 +23045,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 13, + "id": 14, "name": "heroPos", "type": { "type": "Interface", @@ -22989,21 +23058,21 @@ export const serviceProto: ServiceProto = { } }, { - "id": 14, + "id": 15, "name": "ghId", "type": { "type": "String" } }, { - "id": 15, + "id": 16, "name": "ghName", "type": { "type": "String" } }, { - "id": 16, + "id": 17, "name": "ghLevel", "type": { "type": "Reference", @@ -23011,7 +23080,7 @@ export const serviceProto: ServiceProto = { } }, { - "id": 17, + "id": 18, "name": "ghwz", "type": { "type": "Interface", @@ -23025,7 +23094,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 18, + "id": 19, "name": "ghExitTime", "type": { "type": "Number" @@ -23033,7 +23102,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 19, + "id": 20, "name": "loginTime", "type": { "type": "Number" @@ -23041,7 +23110,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 20, + "id": 21, "name": "logoutTime", "type": { "type": "Number" @@ -23049,7 +23118,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 21, + "id": 22, "name": "cTime", "type": { "type": "Number" @@ -23057,7 +23126,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 22, + "id": 23, "name": "loginDays", "type": { "type": "Number" @@ -23065,7 +23134,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 23, + "id": 24, "name": "serverName", "type": { "type": "String" @@ -23073,7 +23142,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 24, + "id": 25, "name": "sid", "type": { "type": "Number" @@ -23081,7 +23150,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 25, + "id": 26, "name": "onlineTime", "type": { "type": "Number" @@ -23089,7 +23158,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 26, + "id": 27, "name": "newonlinetime", "type": { "type": "Number" @@ -23097,7 +23166,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 27, + "id": 28, "name": "isNpc", "type": { "type": "Boolean" @@ -23105,7 +23174,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 28, + "id": 29, "name": "matrix", "type": { "type": "Interface", @@ -23119,7 +23188,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 29, + "id": 30, "name": "matrixPos", "type": { "type": "Interface", @@ -23139,7 +23208,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 30, + "id": 31, "name": "selectMatrix", "type": { "type": "String" @@ -23147,7 +23216,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 31, + "id": 32, "name": "fightHeros", "type": { "type": "Array", @@ -23158,7 +23227,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 32, + "id": 33, "name": "helpHeros", "type": { "type": "Array", @@ -23235,7 +23304,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 33, + "id": 34, "name": "changeNameNum", "type": { "type": "Number" @@ -23243,7 +23312,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 34, + "id": 35, "name": "peijianUnlock", "type": { "type": "Interface", @@ -23257,7 +23326,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 35, + "id": 36, "name": "headFrames", "type": { "type": "Interface", @@ -23271,7 +23340,7 @@ export const serviceProto: ServiceProto = { "optional": true }, { - "id": 36, + "id": 37, "name": "chatFrames", "type": { "type": "Interface", diff --git a/src/shared/protocols/user/PtlLogin.ts b/src/shared/protocols/user/PtlLogin.ts index 3ac09f0..49f56e3 100644 --- a/src/shared/protocols/user/PtlLogin.ts +++ b/src/shared/protocols/user/PtlLogin.ts @@ -19,7 +19,7 @@ export type ResLogin = { /** * 开服天数 */ - openDay:number; + openDay: number; /**当前时间 */ curTime: number; /**是否第一次登录 */ @@ -94,6 +94,13 @@ export type playerAppend = { }; /**名字 */ name: string; + /**正在使用的造型 */ + upModel: { + /**id */ + id: string, + /**到期时间戳 -1:永久 */ + time: number; + }; /**造型 */ model: { [k: string]: { From 54c483bed09c3281444c6c243161c63dd1a8804e Mon Sep 17 00:00:00 2001 From: dy Date: Thu, 21 Dec 2023 12:43:25 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=80=A0=E5=9E=8B=E6=9B=B4=E6=8D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/user.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/public/user.ts b/src/public/user.ts index ff9dcc1..a5cb191 100644 --- a/src/public/user.ts +++ b/src/public/user.ts @@ -33,6 +33,7 @@ export const defaultUserAppend: playerAppend = { head: {id: "1", time: -1}, headFrame: {id: "1", time: -1}, chatFrame: {id: "1", time: -1}, + upModel: {id: "1", time: -1}, model: { 1: {id: "1", time: -1}, 2: {id: "2", time: -1}