商城 - StoreService

商城业务接口

sgt.StoreService.getDefaultStore(playerId, callback)

playerId:string 角色id
获取默认的商城

sgt.StoreService.getStore(storeId, playerId, callback)

根据商城ID获得商城,包含了商城中的所有物品,但物品购买冷却时间未设置

sgt.StoreService.purchase(playerId, storeId, itemId, amounts, ckret, callback)

playerId: string 角色id
storeId: string 商城id
itemId: string 物品id
amouts: number 购买数量
ckret: boolean 如果为true, 则需要返回一个订单id(即did), 网友一般需要来操作
购买指定的商品,如果使用游戏币购买,那么在购买前需要同步服务器端的游戏币

sgt.StoreService.countStoreOrdersByPlayerId(playerId, storeId, callback)

获取角色在指定商店的购买次数

sgt.StoreService.countItemOrdersByPlayerId(playerId, storeId, itemId, callback)

获取角色购买某个商品的次数

sgt.StoreService.getOrderById(storeId, callback)

查询购买记录

sgt.StoreService.getLastPurchaseTimeMillis(playerId, storeId, itemId, callback)

获取角色最近购买某个商品的时间的毫秒数

sgt.StoreService.updateOrderStatus(did, success, callbackMessage, callback)

支付回调接口,对订单状态进行更新