1
This commit is contained in:
parent
3eaf47f0d4
commit
41a30b699a
@ -63,6 +63,7 @@ CREATE TABLE `user` (
|
||||
`daily_buy_times` int(11) NOT NULL DEFAULT '0' COMMENT '每日购买次数',
|
||||
`daily_time` int(11) NOT NULL DEFAULT '0' COMMENT '每日刷新时间',
|
||||
`pass_reward` mediumblob NOT NULL COMMENT '通关奖励信息',
|
||||
`demotank` int(11) NOT NULL DEFAULT '0' COMMENT '每日体验坦克',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `accountid` (`accountid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
@ -231,9 +231,11 @@ if __name__ == "__main__":
|
||||
|
||||
app = make_app()
|
||||
app.listen(conf['listen_port'])
|
||||
conf['rushtime'] = 300
|
||||
tornado.ioloop.IOLoop.current().call_later(conf['rushtime'],
|
||||
lambda : readMysqlData(conf['rushtime'])
|
||||
rushtime = 300
|
||||
if conf['rushtime']:
|
||||
rushtime = conf['rushtime']
|
||||
tornado.ioloop.IOLoop.current().call_later(rushtime,
|
||||
lambda : readMysqlData(rushtime)
|
||||
)
|
||||
|
||||
conf['day_rushtime'] = 5 * 3600
|
||||
|
@ -40,8 +40,8 @@ class RoleController{
|
||||
':accountid' => $account_id
|
||||
));
|
||||
if (!$row) {
|
||||
$ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, coin_num, create_time, modify_time, collect_status, kefu_status, sign_sum, diamond_num, pass_status, pass, energy, buy_data, tank_data, cumul_coin, off_time, battlecount, invite_status, life_times, new_info, daily_buy_times, daily_time, pass_reward) ' .
|
||||
' VALUES(:accountid, :user_name, :avatar_url, 100, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, :buy_data, :tank_data, 0, :off_time, 0, 0, 0, :new_info, 0, 0, :pass_reward)',
|
||||
$ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, coin_num, create_time, modify_time, collect_status, kefu_status, sign_sum, diamond_num, pass_status, pass, energy, buy_data, tank_data, cumul_coin, off_time, battlecount, invite_status, life_times, new_info, daily_buy_times, daily_time, pass_reward, demotank) ' .
|
||||
' VALUES(:accountid, :user_name, :avatar_url, 100, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, :buy_data, :tank_data, 0, :off_time, 0, 0, 0, :new_info, 0, 0, :pass_reward, 0)',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':user_name' => $user_name,
|
||||
@ -77,6 +77,7 @@ class RoleController{
|
||||
'new_info' => '',
|
||||
'daily_buy_times' => 0,
|
||||
'pass_reward' => '',
|
||||
'demotank' => 0,
|
||||
));
|
||||
} else {
|
||||
if ($user_name != $row['user_name']) {
|
||||
@ -102,12 +103,14 @@ class RoleController{
|
||||
$life_times = $row['life_times'];
|
||||
$daily_buy_times = $row['daily_buy_times'];
|
||||
$kefu_status = $row['kefu_status'];
|
||||
$demotank = $row['demotank'];
|
||||
if ($nowTime - phpcommon\getdayseconds($row['daily_time']) > 0) {
|
||||
$this->updateDaily($account_id);
|
||||
$invite_status = 0;
|
||||
$life_times = 0;
|
||||
$daily_buy_times = 0;
|
||||
$kefu_status = 0;
|
||||
$demotank = 0;
|
||||
}
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
@ -128,6 +131,7 @@ class RoleController{
|
||||
'new_info' => $row['new_info'],
|
||||
'daily_buy_times' => $daily_buy_times,
|
||||
'pass_reward' => $row['pass_reward'],
|
||||
'demotank' => $demotank
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -229,7 +233,7 @@ class RoleController{
|
||||
}
|
||||
//更新人物信息
|
||||
$ret = $conn->execScript('UPDATE user SET invite_status=0, life_times=0, daily_buy_times=0, ' .
|
||||
' modify_time=:modify_time, daily_time=:daily_time, kefu_status=0 WHERE accountid=:accountid;',
|
||||
' modify_time=:modify_time, daily_time=:daily_time, kefu_status=0, demotank=0 WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => time(),
|
||||
|
@ -238,10 +238,6 @@ class TankController{
|
||||
return;
|
||||
}
|
||||
}
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
));
|
||||
|
||||
if (isset($tankInfo['pass_reward'])) {
|
||||
$pass_reward = $tankInfo['pass_reward'];
|
||||
@ -257,6 +253,26 @@ class TankController{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($tankInfo['demotank'])) {
|
||||
$demotank = $tankInfo['demotank'];
|
||||
$ret = $conn->execScript('UPDATE user SET demotank=:demotank, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:account_id;',
|
||||
array(
|
||||
':account_id' => $account_id,
|
||||
':demotank' => $demotank,
|
||||
':modify_time' => time()
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
}
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user