宝石合成并穿戴

This commit is contained in:
mamengke01
2020-12-24 11:38:29 +08:00
parent 6a11bfb170
commit c3a1d68aae
3 changed files with 46 additions and 27 deletions
@@ -207,4 +207,13 @@ function sortItems (goods: Array<ItemInter>, bags: Array<BagInter>, skins: Array
}
}
}
}
export async function decreaseItems(roleId: string, sid: string, bags: Array<{id: number, count:number, ratio?: number}>) {
let uids = [{uid: roleId, sid}];
if(bags.length > 0) {
let {hasError, result} = await ItemModel.decreaseItems(roleId, bags);
if(hasError) return true;
pinus.app.get('channelService').pushMessageByUids('onItemUpdate', resResult(STATUS.SUCCESS, {goods: result} ), uids);
}
}