Merge branch 'star' of git.kingsome.cn:server/game2006api into star

This commit is contained in:
hujiabin 2023-07-03 22:15:05 +08:00
commit a91c844117
5 changed files with 502 additions and 272 deletions

View File

@ -403,6 +403,27 @@ class Market(object):
_common.RspHead()
]
},
{
'name': 'sell',
'desc': '出售NFT',
'group': 'Market',
'url': 'webapp/index.php?c=Market&a=sell',
'params': [
['account', '', '账号id'],
['token', '', 'token'],
['nft_token', '', 'nft_token'],
['item_id', '', '道具id,'],
['s_price', '', '出售价格USDT'],
['amount', 0, '出售数量'],
['payment_token_address', '', 'payment_token_address'],
['nonce', '', 'nonce'],
['signature', '', '签名soliditySha3(type, payment_token_address, price, nonce), 签名的replace客户端做处理'],
['net_id', '', '网络id'],
],
'response': [
_common.RspHead()
]
},
{
'name': 'buyNft',
'desc': '购买NFT',

View File

@ -187,7 +187,8 @@ class Shop(object):
'response': [
_common.RspHead(),
['idx', 0, '每日精选的索引'],
['cost', 0, '每日精选的当前刷新价格'],
['refresh_info', '', '每日精选的刷新信息(格式:刷新次数/可刷新总数)'],
['cost', 0, '每日精选的当前刷新价格,-1表示不可刷新'],
['!goods_list', [_common.DailySelectionGoods()], '每日精选列表'],
]
},

View File

@ -86,15 +86,19 @@ class BaseAuthedController extends BaseController {
}
$r = $this->_getRedis($this->_getAccountId());
$sessionId = $r->get(LAST_SESSION_KEY . $this->_getAccountId());
if (empty($sessionId)) {
$this->updateSession(myself()->_getAccountId(),
myself()->_getSessionId());
} else if ($sessionId != $this->_getSessionId()) {
error_log('session expiration' . json_encode(
$_REQUEST
));
phpcommon\sendError(1001, 'session expiration');
die();
// error_log('SERVER_ENV:' . SERVER_ENV . '_DEBUG:' . _DEBUG);
if (SERVER_ENV != _DEBUG)
{
if (empty($sessionId)) {
$this->updateSession(myself()->_getAccountId(),
myself()->_getSessionId());
} else if ($sessionId != $this->_getSessionId()) {
error_log('session expiration' . json_encode(
$_REQUEST
));
phpcommon\sendError(1001, 'session expiration');
die();
}
}
$this->_userLvRestriction();

File diff suppressed because it is too large Load Diff

View File

@ -418,11 +418,14 @@ class ShopController extends BaseAuthedController
$count = $this->countTodayRefreshTimes($address);
$costs = mt\Parameter::getByName('daily_selection_refresh_cost');
$arrCosts = explode('|', $costs['param_value']);
$cost = $count < count($arrCosts) ? $arrCosts[$count] : null;
$max_count = count($arrCosts);
$cost = $count < $max_count ? $arrCosts[$count] : -1;
$this->_rspData(
array(
'idx' => $selection['idx'],
'refresh_info' => "{$count}/{$max_count}",
'cost' => $cost,
'goods_list' => $goodsList,
)