1
This commit is contained in:
parent
17cc2e2909
commit
f88386bbb7
@ -5,6 +5,9 @@ namespace classes;
|
||||
use phpcommon;
|
||||
|
||||
class AddReward {
|
||||
|
||||
private $itemTableCache = null;
|
||||
|
||||
protected function getMysql($account_id)
|
||||
{
|
||||
$mysql_conf = getMysqlConfig(crc32($account_id));
|
||||
@ -20,8 +23,10 @@ class AddReward {
|
||||
|
||||
protected function getItem($item_id)
|
||||
{
|
||||
$g_conf_item_cluster = require('../res/item@item.php');
|
||||
$item_conf = getItemConfig($g_conf_item_cluster, $item_id);
|
||||
if ($this->itemTableCache == null) {
|
||||
$this->itemTableCache = require('../res/item@item.php');
|
||||
}
|
||||
$item_conf = getItemConfig($this->itemTableCache, $item_id);
|
||||
$it = array(
|
||||
'id' => $item_conf['id'],
|
||||
'diamond' => $item_conf['diamond'],
|
||||
@ -95,6 +100,7 @@ class AddReward {
|
||||
if (!$i['type']) {
|
||||
return array();
|
||||
}
|
||||
error_log('type:' . $i['type']);
|
||||
if ($i['type'] == 1){
|
||||
$this->addCoin($item['item_id'], $item['item_num'], $account_id);
|
||||
} else if ($i['type'] == 2) {
|
||||
@ -356,6 +362,7 @@ class AddReward {
|
||||
|
||||
protected function addweizhuang($item_id, $item_num, $accountid)
|
||||
{
|
||||
$beginTick = phpcommon\getTickCount();
|
||||
$conn = $this->getMysql($accountid);
|
||||
if (!$conn) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
@ -424,6 +431,7 @@ class AddReward {
|
||||
die();
|
||||
}
|
||||
}
|
||||
error_log('weizhuan3:' . phpcommon\getTickCount() . ' costime:' . (phpcommon\getTickCount() - $beginTick)) ;
|
||||
}
|
||||
|
||||
protected function addticket($item_id, $item_num, $accountid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user