1
This commit is contained in:
parent
239d913436
commit
f396e0f650
@ -0,0 +1,47 @@
|
|||||||
|
const log = require('j7/log');
|
||||||
|
const utils = require('j7/utils');
|
||||||
|
const BaseEventProcess = require('../common/BaseEventProcess');
|
||||||
|
|
||||||
|
/*
|
||||||
|
操作成功的事件
|
||||||
|
event ItemSoldOut(
|
||||||
|
address indexed buyer,
|
||||||
|
uint256 indexed orderId,
|
||||||
|
address currency,
|
||||||
|
uint256 price
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ItemSoldOut extends BaseEventProcess {
|
||||||
|
|
||||||
|
async start() {
|
||||||
|
const returnValues = this.getReturnValues();
|
||||||
|
const transId = returnValues['orderId'];
|
||||||
|
const orderId = returnValues['orderId'];
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
'c': 'Callback',
|
||||||
|
'a': 'dispatch',
|
||||||
|
'action': 'gameItemMarketBuyOk',
|
||||||
|
'trans_id': transId,
|
||||||
|
'order_id': orderId,
|
||||||
|
};
|
||||||
|
await this.callGameApi
|
||||||
|
(params,
|
||||||
|
async (data) => {
|
||||||
|
if (!data) {
|
||||||
|
this.throwError('callGameApi error:' + data);
|
||||||
|
}
|
||||||
|
if (data['errcode'] == 0 ||
|
||||||
|
data['errcode'] == 1 ||
|
||||||
|
data['errcode'] == 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
await this.markOk();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = ItemSoldOut;
|
@ -26,6 +26,7 @@ async function init() {
|
|||||||
await add('BENftMarket.PriceUpdate', 'BENftMarket/price_update');
|
await add('BENftMarket.PriceUpdate', 'BENftMarket/price_update');
|
||||||
await add('BENftMarket.BuyOrder', 'BENftMarket/buy_order');
|
await add('BENftMarket.BuyOrder', 'BENftMarket/buy_order');
|
||||||
await add('GameItemMall.ItemSoldOut', 'GameItemMall/item_soldout');
|
await add('GameItemMall.ItemSoldOut', 'GameItemMall/item_soldout');
|
||||||
|
await add('GameItemMarket.ItemSoldOut', 'GameItemMarket/item_soldout');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEventHandle(eventProc) {
|
function getEventHandle(eventProc) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user