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