形象:作为物品获得
This commit is contained in:
@@ -8,7 +8,7 @@ import { calAllHeroCe } from './playerCeService';
|
||||
import { ItemModel } from '../db/Item';
|
||||
import { STATUS } from '../consts/statusCode';
|
||||
import { pinus } from 'pinus';
|
||||
import { addEquips, addBags, addSkins } from '../pubUtils/itemUtils';
|
||||
import { addEquips, addBags, addSkins, addFigure } from '../pubUtils/itemUtils';
|
||||
import { EquipInter, ItemInter, BagInter } from '../pubUtils/interface';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { uniq, indexOf, findIndex } from 'underscore';
|
||||
@@ -146,6 +146,15 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
|
||||
if (!!bagInfos.length)
|
||||
pinus.app.get('channelService').pushMessageByUids('onItemUpdate', resResult(STATUS.SUCCESS, {goods: bagInfos}), uids);
|
||||
|
||||
|
||||
let figureInfo = await addFigure(roleId, figures);
|
||||
for (let id of figures) {//皮肤推送
|
||||
showItems.push({id, count: 1});
|
||||
}
|
||||
if (!!figureInfo) {
|
||||
pinus.app.get('channelService').pushMessageByUids('onHeadChange', resResult(STATUS.SUCCESS, { ...figureInfo }), uids);
|
||||
}
|
||||
|
||||
let skinInfos = [];
|
||||
let addSkinIds = [];
|
||||
for (let skinId of skins) {//皮肤推送
|
||||
@@ -207,7 +216,7 @@ function sortItems (goods: Array<ItemInter>, bags: Array<BagInter>, skins: Array
|
||||
currencysMap[curname] = (currencysMap[curname]||0 )+ good.count;
|
||||
}
|
||||
} else {
|
||||
if (type == CONSUME_TYPE.SKIN) {
|
||||
if (type == CONSUME_TYPE.HEAD || type == CONSUME_TYPE.FRAME || type == CONSUME_TYPE.SPINE ) {
|
||||
let index = indexOf(figures, good.id);
|
||||
if (index == -1) {
|
||||
figures.push(good.id);
|
||||
|
||||
@@ -42,52 +42,52 @@ module.exports = {
|
||||
'required uInt32 code': 2,
|
||||
'required Data data': 3
|
||||
},
|
||||
'onHeroSkinChange': {
|
||||
'message Data': {
|
||||
"message SkinInfo": {
|
||||
"message Skin": {
|
||||
'required uInt32 id': 1,
|
||||
'required boolean enable': 2
|
||||
},
|
||||
'repeated Skin skins': 1,
|
||||
},
|
||||
'repeated SkinInfo skinInfos': 1
|
||||
},
|
||||
'required string msg': 1,
|
||||
'required uInt32 code': 2,
|
||||
'required Data data': 3
|
||||
},
|
||||
'onEquipAdd': {
|
||||
'message Data': {
|
||||
"message EquipInfo": {
|
||||
"message RandSe": {
|
||||
'required uInt32 id': 1,
|
||||
'required uInt32 seid': 2,
|
||||
'required int32 rand': 3,
|
||||
'required boolean locked': 4
|
||||
},
|
||||
"message Hole": {
|
||||
'required uInt32 id': 1,
|
||||
'required boolean isOpen': 2,
|
||||
'required uInt32 jewel': 3
|
||||
},
|
||||
'repeated Hole holes': 1,
|
||||
'repeated RandSe randSe': 2,
|
||||
'required uInt32 seqId': 3,
|
||||
'required uInt32 id': 4,
|
||||
'required uInt32 hid': 6,
|
||||
'required uInt32 count': 7,
|
||||
'required uInt32 quality': 8,
|
||||
'required uInt32 ePlaceId': 9,
|
||||
'required uInt32 suitId': 11,
|
||||
'required int32 randRange': 12
|
||||
},
|
||||
'repeated EquipInfo equipInfos': 1
|
||||
},
|
||||
'required string msg': 1,
|
||||
'required uInt32 code': 2,
|
||||
'required Data data': 3
|
||||
},
|
||||
// 'onHeroSkinChange': {
|
||||
// 'message Data': {
|
||||
// "message SkinInfo": {
|
||||
// "message Skin": {
|
||||
// 'required uInt32 id': 1,
|
||||
// 'required boolean enable': 2
|
||||
// },
|
||||
// 'repeated Skin skins': 1,
|
||||
// },
|
||||
// 'repeated SkinInfo skinInfos': 1
|
||||
// },
|
||||
// 'required string msg': 1,
|
||||
// 'required uInt32 code': 2,
|
||||
// 'required Data data': 3
|
||||
// },
|
||||
// 'onEquipAdd': {
|
||||
// 'message Data': {
|
||||
// "message EquipInfo": {
|
||||
// "message RandSe": {
|
||||
// 'required uInt32 id': 1,
|
||||
// 'required uInt32 seid': 2,
|
||||
// 'required int32 rand': 3,
|
||||
// 'required boolean locked': 4
|
||||
// },
|
||||
// "message Hole": {
|
||||
// 'required uInt32 id': 1,
|
||||
// 'required boolean isOpen': 2,
|
||||
// 'required uInt32 jewel': 3
|
||||
// },
|
||||
// 'repeated Hole holes': 1,
|
||||
// 'repeated RandSe randSe': 2,
|
||||
// 'required uInt32 seqId': 3,
|
||||
// 'required uInt32 id': 4,
|
||||
// 'required uInt32 hid': 6,
|
||||
// 'required uInt32 count': 7,
|
||||
// 'required uInt32 quality': 8,
|
||||
// 'required uInt32 ePlaceId': 9,
|
||||
// 'required uInt32 suitId': 11,
|
||||
// 'required int32 randRange': 12
|
||||
// },
|
||||
// 'repeated EquipInfo equipInfos': 1
|
||||
// },
|
||||
// 'required string msg': 1,
|
||||
// 'required uInt32 code': 2,
|
||||
// 'required Data data': 3
|
||||
// },
|
||||
'onEquipDel': {
|
||||
'message Data': {
|
||||
'repeated uInt32 equips': 1
|
||||
@@ -95,5 +95,20 @@ module.exports = {
|
||||
'required string msg': 1,
|
||||
'required uInt32 code': 2,
|
||||
'required Data data': 3
|
||||
}
|
||||
},
|
||||
// 'onHeadChange': {
|
||||
// 'message Data': {
|
||||
// "message FigureInfo": {
|
||||
// 'required int32 id': 1,
|
||||
// 'required bool enable': 2,
|
||||
// 'optional int32 time': 3
|
||||
// },
|
||||
// 'repeated FigureInfo heads': 1,
|
||||
// 'repeated FigureInfo frames': 2,
|
||||
// 'repeated FigureInfo spines': 3
|
||||
// },
|
||||
// 'required string msg': 1,
|
||||
// 'required uInt32 code': 2,
|
||||
// 'required Data data': 3
|
||||
// }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user