This commit is contained in:
aozhiwei 2020-08-15 00:34:50 +08:00
parent d46e3e7f9a
commit 1b79cee577
18 changed files with 870 additions and 392 deletions

View File

@ -96,6 +96,6 @@ require 'config_loader.php';
function needSpecConfig($channel) function needSpecConfig($channel)
{ {
return $channel == 6001; return $channel == 6002;
} }

View File

@ -18,9 +18,14 @@ class AddReward {
return $conn; return $conn;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
@ -31,9 +36,14 @@ class AddReward {
return $it; return $it;
} }
protected function getBag($bag_id) protected function getBag($bag_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_bag_cluster = require("../res/$channel/bag@bag.php");
} else {
$g_conf_bag_cluster = require('../res/bag@bag.php'); $g_conf_bag_cluster = require('../res/bag@bag.php');
}
$bag_conf = getBagConfig($g_conf_bag_cluster, $bag_id); $bag_conf = getBagConfig($g_conf_bag_cluster, $bag_id);
$b = array( $b = array(
'id' => $bag_conf['id'], 'id' => $bag_conf['id'],
@ -56,9 +66,14 @@ class AddReward {
return $arr; return $arr;
} }
protected function getEquip($equip_id) protected function getEquip($equip_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_equip_cluster = require("../res/$channel/equip@equip.php");
} else {
$g_conf_equip_cluster = require('../res/equip@equip.php'); $g_conf_equip_cluster = require('../res/equip@equip.php');
}
$equip_conf = getEquipConfig($g_conf_equip_cluster, $equip_id); $equip_conf = getEquipConfig($g_conf_equip_cluster, $equip_id);
if (!$equip_conf) { if (!$equip_conf) {
return null; return null;
@ -78,7 +93,7 @@ class AddReward {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
die(); die();
} }
$it = $this->getItem($item_id); $it = $this->getItem($item_id, $account_id);
if (!$it) { if (!$it) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
die(); die();
@ -91,7 +106,7 @@ class AddReward {
)); ));
foreach ($item_list as $item) { foreach ($item_list as $item) {
$i = $this->getItem($item['item_id']); $i = $this->getItem($item['item_id'], $account_id);
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) {
@ -201,7 +216,7 @@ class AddReward {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
die(); die();
} }
$it = $this->getItem($item_id); $it = $this->getItem($item_id, $accountid);
$status = 1; $status = 1;
$sum = 0; $sum = 0;
if ($it['type'] == 10) { if ($it['type'] == 10) {
@ -210,7 +225,7 @@ class AddReward {
':accountid' => $accountid, ':accountid' => $accountid,
)); ));
foreach ($rows as $r) { foreach ($rows as $r) {
$it = $this->getItem($r['id']); $it = $this->getItem($r['id'], $accountid);
if ($r['status'] == 0 && $it['type'] == 10) { if ($r['status'] == 0 && $it['type'] == 10) {
$sum++; $sum++;
} }
@ -407,8 +422,13 @@ class AddReward {
public function getStatus($item_id, $status, $accountid) public function getStatus($item_id, $status, $accountid)
{ {
$s = $status; $s = $status;
$b = $this->getBag($item_id); $b = $this->getBag($item_id, $accountid);
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$bag_meta_table = require("../res/$channel/bag@bag.php");
} else {
$bag_meta_table = require('../res/bag@bag.php'); $bag_meta_table = require('../res/bag@bag.php');
}
//正在装备的道具 //正在装备的道具
$flag = 0; $flag = 0;
$conn = $this->getMysql($accountid); $conn = $this->getMysql($accountid);
@ -419,7 +439,7 @@ class AddReward {
if ($b['fuction'] != 5) { if ($b['fuction'] != 5) {
foreach ($bag_meta_table as $bag_info) { foreach ($bag_meta_table as $bag_info) {
$id = $bag_info['id']; $id = $bag_info['id'];
$bag = $this->getBag($id); $bag = $this->getBag($id, $accountid);
if ($bag['fuction'] != $b['fuction']) { if ($bag['fuction'] != $b['fuction']) {
continue; continue;
} }
@ -443,7 +463,7 @@ class AddReward {
$emoji_num = 0; $emoji_num = 0;
foreach ($bag_meta_table as $bag_info) { foreach ($bag_meta_table as $bag_info) {
$id = $bag_info['id']; $id = $bag_info['id'];
$bag = $this->getBag($id); $bag = $this->getBag($id, $accountid);
if ($bag['fuction'] != $b['fuction']) { if ($bag['fuction'] != $b['fuction']) {
continue; continue;
} }
@ -472,13 +492,18 @@ class AddReward {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$b = $this->getBag($item_id); $b = $this->getBag($item_id, $accountid);
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$bag_meta_table = require("../res/$channel/bag@bag.php");
} else {
$bag_meta_table = require('../res/bag@bag.php'); $bag_meta_table = require('../res/bag@bag.php');
}
//正在装备的道具 //正在装备的道具
if ($b['fuction'] != 5) { if ($b['fuction'] != 5) {
foreach ($bag_meta_table as $bag_info) { foreach ($bag_meta_table as $bag_info) {
$id = $bag_info['id']; $id = $bag_info['id'];
$bag = $this->getBag($id); $bag = $this->getBag($id, $accountid);
if ($bag['fuction'] != $b['fuction']) { if ($bag['fuction'] != $b['fuction']) {
continue; continue;
} }
@ -560,7 +585,7 @@ class AddReward {
)); ));
} else { } else {
//转化碎片 //转化碎片
$e = $this->getEquip($item_id); $e = $this->getEquip($item_id, $accountid);
if (!$e) { if (!$e) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备');
die(); die();
@ -578,7 +603,7 @@ class AddReward {
public function getRealIndexid($id, $accountid) { public function getRealIndexid($id, $accountid) {
$e = $this->getEquip($id); $e = $this->getEquip($id, $accountid);
if (!$e || $e['real_index_id'] == '' || !$e['real_index_id']) { if (!$e || $e['real_index_id'] == '' || !$e['real_index_id']) {
return intval($id); return intval($id);
} }

View File

@ -19,9 +19,14 @@ class Quest{
return $conn; return $conn;
} }
protected function getQuest($quest_id) protected function getQuest($quest_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_quest_cluster = require("../res/$channel/task@task.php");
} else {
$g_conf_quest_cluster = require('../res/task@task.php'); $g_conf_quest_cluster = require('../res/task@task.php');
}
$quest_conf = getQuestConfig($g_conf_quest_cluster, $quest_id); $quest_conf = getQuestConfig($g_conf_quest_cluster, $quest_id);
$q = array( $q = array(
'id' => $quest_conf['id'], 'id' => $quest_conf['id'],
@ -39,7 +44,7 @@ class Quest{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$q = $this->getQuest($quest_id); $q = $this->getQuest($quest_id, $account_id);
if (!$q) { if (!$q) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务');
return; return;

View File

@ -30,9 +30,14 @@ class ActivityController{
return $r; return $r;
} }
protected function getBox($box_id) protected function getBox($box_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$box_meta_table = require("../res/$channel/box@box.php");
} else {
$box_meta_table = require('../res/box@box.php'); $box_meta_table = require('../res/box@box.php');
}
$box_meta = getBoxConfig($box_meta_table, $box_id); $box_meta = getBoxConfig($box_meta_table, $box_id);
$b = array( $b = array(
'box_id' => $box_meta['box_type'], 'box_id' => $box_meta['box_type'],
@ -45,9 +50,14 @@ class ActivityController{
return $b; return $b;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
@ -57,9 +67,14 @@ class ActivityController{
return $p; return $p;
} }
protected function getDrop($drop_id) protected function getDrop($drop_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$drop_meta_table = require("../res/$channel/drop@drop.php");
} else {
$drop_meta_table = require('../res/drop@drop.php'); $drop_meta_table = require('../res/drop@drop.php');
}
$drop_meta = getDropConfig($drop_meta_table, $drop_id); $drop_meta = getDropConfig($drop_meta_table, $drop_id);
$d = array( $d = array(
'drop_id' => $drop_meta['drop_id'], 'drop_id' => $drop_meta['drop_id'],
@ -85,9 +100,14 @@ class ActivityController{
return $arr; return $arr;
} }
protected function getLottery($lot_id) protected function getLottery($lot_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lottery@lottery.php");
} else {
$g_conf_lot_cluster = require('../res/lottery@lottery.php'); $g_conf_lot_cluster = require('../res/lottery@lottery.php');
}
$lot_conf = getLotteryConfig($g_conf_lot_cluster, $lot_id); $lot_conf = getLotteryConfig($g_conf_lot_cluster, $lot_id);
$l = array( $l = array(
'id' => $lot_conf['id'], 'id' => $lot_conf['id'],
@ -102,9 +122,14 @@ class ActivityController{
return $l; return $l;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
@ -116,9 +141,14 @@ class ActivityController{
return $it; return $it;
} }
protected function getDrawTableConfig($id) protected function getDrawTableConfig($id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lotterydraw@lotterydraw.php");
} else {
$g_conf_lot_cluster = require('../res/lotterydraw@lotterydraw.php'); $g_conf_lot_cluster = require('../res/lotterydraw@lotterydraw.php');
}
$lot_conf = getLotteryConfig($g_conf_lot_cluster, $id); $lot_conf = getLotteryConfig($g_conf_lot_cluster, $id);
$l = array( $l = array(
'id' => $lot_conf['id'], 'id' => $lot_conf['id'],
@ -132,9 +162,14 @@ class ActivityController{
return $l; return $l;
} }
protected function getreward($re_id) protected function getreward($re_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_re_cluster = require("../res/$channel/randreward@randreward.php");
} else {
$g_conf_re_cluster = require('../res/randreward@randreward.php'); $g_conf_re_cluster = require('../res/randreward@randreward.php');
}
$re_conf = getRandrewardConfig($g_conf_re_cluster, $re_id); $re_conf = getRandrewardConfig($g_conf_re_cluster, $re_id);
$re = array( $re = array(
'id' => $re_conf['id'], 'id' => $re_conf['id'],
@ -145,9 +180,14 @@ class ActivityController{
return $re; return $re;
} }
protected function getRecommend($rec_id) protected function getRecommend($rec_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_rec_cluster = require("../res/$channel/recommend@recommend.php");
} else {
$g_conf_rec_cluster = require('../res/recommend@recommend.php'); $g_conf_rec_cluster = require('../res/recommend@recommend.php');
}
$rec_conf = getRecommendConfig($g_conf_rec_cluster, $rec_id); $rec_conf = getRecommendConfig($g_conf_rec_cluster, $rec_id);
$rec = array( $rec = array(
'pool' => $rec_conf['pool'], 'pool' => $rec_conf['pool'],
@ -226,8 +266,8 @@ class ActivityController{
return; return;
} }
//刷新次数 //刷新次数
$p_free = $this->getParameter(FREELOTTERY_TIME); $p_free = $this->getParameter(FREELOTTERY_TIME, $account_id);
$p_video = $this->getParameter(VIDEOLOTTERY_TIME); $p_video = $this->getParameter(VIDEOLOTTERY_TIME, $account_id);
$free_times = $p_free['value']; $free_times = $p_free['value'];
$video_times = $p_video['value']; $video_times = $p_video['value'];
$row = $conn->execQueryOne('SELECT free_times, video_times FROM activity WHERE accountid=:accountid;', $row = $conn->execQueryOne('SELECT free_times, video_times FROM activity WHERE accountid=:accountid;',
@ -330,16 +370,21 @@ class ActivityController{
} }
//随机确认奖励 //随机确认奖励
$weight_sum = 0; $weight_sum = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lotterydraw@lotterydraw.php");
} else {
$g_conf_lot_cluster = require('../res/lotterydraw@lotterydraw.php'); $g_conf_lot_cluster = require('../res/lotterydraw@lotterydraw.php');
}
for ($i = 1; $i <= count($g_conf_lot_cluster); $i++) { for ($i = 1; $i <= count($g_conf_lot_cluster); $i++) {
$l = $this->getDrawTableConfig($i); $l = $this->getDrawTableConfig($i, $account_id);
$weight_sum += $l['jilv']; $weight_sum += $l['jilv'];
} }
$random = Rand(0, $weight_sum); $random = Rand(0, $weight_sum);
$weight = 0; $weight = 0;
$key = 0; $key = 0;
for ($ii = 1; $ii <= count($g_conf_lot_cluster); $ii++) { for ($ii = 1; $ii <= count($g_conf_lot_cluster); $ii++) {
$l = $this->getDrawTableConfig($ii); $l = $this->getDrawTableConfig($ii, $account_id);
$weight += $l['jilv']; $weight += $l['jilv'];
if ($weight >= $random) { if ($weight >= $random) {
$key = $ii; $key = $ii;
@ -435,7 +480,12 @@ class ActivityController{
} }
//随机确认奖励 //随机确认奖励
$weight_sum = 0; $weight_sum = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lottery@lottery.php");
} else {
$g_conf_lot_cluster = require('../res/lottery@lottery.php'); $g_conf_lot_cluster = require('../res/lottery@lottery.php');
}
$lot_array = array(); $lot_array = array();
$draw_uuid = $_REQUEST['draw_uuid']; $draw_uuid = $_REQUEST['draw_uuid'];
$item_id = 0; $item_id = 0;
@ -456,9 +506,14 @@ class ActivityController{
} }
if ($row['free_times'] + $row['video_times'] + 1 == 5) { if ($row['free_times'] + $row['video_times'] + 1 == 5) {
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lottery@lottery.php");
} else {
$g_conf_lot_cluster = require('../res/lottery@lottery.php'); $g_conf_lot_cluster = require('../res/lottery@lottery.php');
}
for($g = 1; $g <= count($g_conf_lot_cluster); $g++) { for($g = 1; $g <= count($g_conf_lot_cluster); $g++) {
$l = $this->getLottery($g); $l = $this->getLottery($g, $account_id);
if ($l['jilv'] == 0) { if ($l['jilv'] == 0) {
array_push($lot_array, array( array_push($lot_array, array(
'key' => $g 'key' => $g
@ -466,7 +521,7 @@ class ActivityController{
} }
} }
for ($i1 = 0; $i1 < count($lot_array); $i1++) { for ($i1 = 0; $i1 < count($lot_array); $i1++) {
$l = $this->getLottery($lot_array[$i1]['key']); $l = $this->getLottery($lot_array[$i1]['key'], $account_id);
$weight_sum += $l['jilv']; $weight_sum += $l['jilv'];
} }
$random = Rand(0, 100); $random = Rand(0, 100);
@ -496,14 +551,14 @@ class ActivityController{
} }
for ($i = 0; $i < count($lot_array); $i++) { for ($i = 0; $i < count($lot_array); $i++) {
$l = $this->getLottery($lot_array[$i]['key']); $l = $this->getLottery($lot_array[$i]['key'], $account_id);
$weight_sum += $l['jilv']; $weight_sum += $l['jilv'];
} }
$random = Rand(1, $weight_sum); $random = Rand(1, $weight_sum);
// error_log($random); // error_log($random);
for ($ii = 0; $ii < count($lot_array); $ii++) { for ($ii = 0; $ii < count($lot_array); $ii++) {
$l = $this->getLottery($lot_array[$ii]['key']); $l = $this->getLottery($lot_array[$ii]['key'], $account_id);
$weight += $l['jilv']; $weight += $l['jilv'];
if ($weight >= $random) { if ($weight >= $random) {
@ -552,7 +607,7 @@ class ActivityController{
)); ));
if ($_REQUEST['type'] == 0) { if ($_REQUEST['type'] == 0) {
$p_flush = $this->getParameter(FREELOTTERY_TIME); $p_flush = $this->getParameter(FREELOTTERY_TIME, $account_id);
if ($p_flush['value'] <= $row['free_times']) { if ($p_flush['value'] <= $row['free_times']) {
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满'); phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
return; return;
@ -572,7 +627,7 @@ class ActivityController{
} }
} }
if ($_REQUEST['type'] == 1) { if ($_REQUEST['type'] == 1) {
$p_flush = $this->getParameter(VIDEOLOTTERY_TIME); $p_flush = $this->getParameter(VIDEOLOTTERY_TIME, $account_id);
if ($p_flush['value'] <= $row['video_times']) { if ($p_flush['value'] <= $row['video_times']) {
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满'); phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
return; return;
@ -629,7 +684,7 @@ class ActivityController{
return; return;
} }
//增加奖励 //增加奖励
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['value'] - 1; $times = $p['value'] - 1;
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$addreward->addReward($row['item_id'], $row['item_num'] * $times, $account_id,0,0); $addreward->addReward($row['item_id'], $row['item_num'] * $times, $account_id,0,0);
@ -646,10 +701,20 @@ class ActivityController{
$draw_list = array(); $draw_list = array();
$g_conf_lot_cluster = array(); $g_conf_lot_cluster = array();
if ($type == 1) { if ($type == 1) {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lottery@lottery.php");
} else {
$g_conf_lot_cluster = require('../res/lottery@lottery.php'); $g_conf_lot_cluster = require('../res/lottery@lottery.php');
}
} else {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_lot_cluster = require("../res/$channel/lotterydraw@lotterydraw.php");
} else { } else {
$g_conf_lot_cluster = require('../res/lotterydraw@lotterydraw.php'); $g_conf_lot_cluster = require('../res/lotterydraw@lotterydraw.php');
} }
}
$day = 1; $day = 1;
if ($type == 1 && phpcommon\extractChannel($accountid) == 6006) { if ($type == 1 && phpcommon\extractChannel($accountid) == 6006) {
$day = date('w', time()); $day = date('w', time());
@ -664,9 +729,9 @@ class ActivityController{
$key = 0; $key = 0;
$l = array(); $l = array();
if ($type == 1) { if ($type == 1) {
$l = $this->getLottery($i); $l = $this->getLottery($i, $accountid);
} else { } else {
$l = $this->getDrawTableConfig($i); $l = $this->getDrawTableConfig($i, $accountid);
} }
//确定商品id和数量 //确定商品id和数量
$weight_sum = 0; $weight_sum = 0;
@ -718,7 +783,7 @@ class ActivityController{
return; return;
} }
$pool = $_REQUEST['pool']; $pool = $_REQUEST['pool'];
$rec = $this->getRecommend($pool); $rec = $this->getRecommend($pool, $account_id);
$reward_id = 0; $reward_id = 0;
$item_list = array(); $item_list = array();
$all_item_list = array(); $all_item_list = array();
@ -730,7 +795,7 @@ class ActivityController{
for($i = 0; $i < $rec['reward']; $i++) { for($i = 0; $i < $rec['reward']; $i++) {
$item_num = 1; $item_num = 1;
$time = $this->randtime($rec['time']); $time = $this->randtime($rec['time']);
$reward_id = $this->randlottery($reward_array, $pool); $reward_id = $this->randlottery($reward_array, $pool, $account_id);
array_push($reward_array, array( array_push($reward_array, array(
'id' => $reward_id 'id' => $reward_id
)); ));
@ -805,15 +870,20 @@ class ActivityController{
return $key; return $key;
} }
protected function randlottery($id, $pool) protected function randlottery($id, $pool, $accountid)
{ {
$weight_sum = 0; $weight_sum = 0;
$rand_array = array(); $rand_array = array();
$po = $pool - 1; $po = $pool - 1;
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
foreach($g_conf_item_cluster as $items) { foreach($g_conf_item_cluster as $items) {
$flag = 0; $flag = 0;
$it = $this->getItem($items['id']); $it = $this->getItem($items['id'], $accountid);
if ($it['id'] != 0) { if ($it['id'] != 0) {
foreach ($id as $ids) { foreach ($id as $ids) {
if ($it['id'] == $ids['id']) { if ($it['id'] == $ids['id']) {
@ -871,10 +941,10 @@ class ActivityController{
$daily_order1 = $row['daily_order1']; $daily_order1 = $row['daily_order1'];
$daily_order2 = $row['daily_order2']; $daily_order2 = $row['daily_order2'];
$daily_order3 = $row['daily_order3']; $daily_order3 = $row['daily_order3'];
$p1 = $this->getParameter(LOGINBOX_TIME1); $p1 = $this->getParameter(LOGINBOX_TIME1, $account_id);
$p2 = $this->getParameter(LOGINBOX_TIME2); $p2 = $this->getParameter(LOGINBOX_TIME2, $account_id);
$p3 = $this->getParameter(LOGINBOX_TIME3); $p3 = $this->getParameter(LOGINBOX_TIME3, $account_id);
$p = $this->getParameter(LOGINBOX_TIME); $p = $this->getParameter(LOGINBOX_TIME, $account_id);
$pt1 = $p1['value']; $pt1 = $p1['value'];
$pt2 = $p2['value']; $pt2 = $p2['value'];
$pt3 = $p3['value']; $pt3 = $p3['value'];

View File

@ -14,22 +14,33 @@ class AdditemController{
return $conn; return $conn;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
'diamond' => $item_conf['diamond'], 'diamond' => $item_conf['diamond'],
'type' => $item_conf['fuction'], 'type' => $item_conf['fuction'],
'diamond_hour' => $item_conf['diamond_hour'] 'diamond_hour' => $item_conf['diamond_hour'],
'pool_weight' => $item_conf['pool_weight'],
); );
return $it; return $it;
} }
protected function getBag($bag_id) protected function getBag($bag_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_bag_cluster = require("../res/$channel/bag@bag.php");
} else {
$g_conf_bag_cluster = require('../res/bag@bag.php'); $g_conf_bag_cluster = require('../res/bag@bag.php');
}
$bag_conf = getBagConfig($g_conf_bag_cluster, $bag_id); $bag_conf = getBagConfig($g_conf_bag_cluster, $bag_id);
$b = array( $b = array(
'id' => $bag_conf['id'], 'id' => $bag_conf['id'],
@ -52,9 +63,14 @@ class AdditemController{
return $arr; return $arr;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
@ -79,7 +95,7 @@ class AdditemController{
die(); die();
return; return;
} }
$it = $this->getItem($item_id); $it = $this->getItem($item_id, $accountid);
if (!$it) { if (!$it) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
die(); die();
@ -212,7 +228,7 @@ class AdditemController{
return; return;
} }
$p = $this->getParameter(DIAMONDTOCOIN_NUM); $p = $this->getParameter(DIAMONDTOCOIN_NUM, $accountid);
$estr = explode('|', $p['param_value']); $estr = explode('|', $p['param_value']);
$addnum = floor($estr[1] / $estr[0] * $num); $addnum = floor($estr[1] / $estr[0] * $num);
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num, diamond_num=:diamond_num, modify_time=:modify_time ' . $ret = $conn->execScript('UPDATE user SET coin_num=:coin_num, diamond_num=:diamond_num, modify_time=:modify_time ' .

View File

@ -18,9 +18,14 @@ class BagController{
return $conn; return $conn;
} }
protected function getBag($bag_id) protected function getBag($bag_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_bag_cluster = require("../res/$channel/bag@bag.php");
} else {
$g_conf_bag_cluster = require('../res/bag@bag.php'); $g_conf_bag_cluster = require('../res/bag@bag.php');
}
$bag_conf = getBagConfig($g_conf_bag_cluster, $bag_id); $bag_conf = getBagConfig($g_conf_bag_cluster, $bag_id);
$b = array( $b = array(
'id' => $bag_conf['id'], 'id' => $bag_conf['id'],
@ -30,28 +35,38 @@ class BagController{
return $b; return $b;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
'diamond' => $item_conf['diamond'], 'diamond' => $item_conf['diamond'],
'dprice' => $item_conf['dprice'],
'type' => $item_conf['fuction'], 'type' => $item_conf['fuction'],
'diamond_hour' => $item_conf['diamond_hour'] 'diamond_hour' => $item_conf['diamond_hour'],
'pool_weight' => $item_conf['pool_weight'],
); );
return $it; return $it;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$g_conf_para_cluster = require('../res/parameter@parameter.php'); $channel = phpcommon\extractChannel($accountid);
$para_conf = getParameterConfig($g_conf_para_cluster, $para_id); if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $para_conf['id'], 'id' => $parameter_meta['id'],
'param_name' => $para_conf['param_name'], 'param_name' => $parameter_meta['param_name'],
'param_value' => $para_conf['param_value'], 'param_value' => $parameter_meta['param_value'],
); );
return $p; return $p;
} }
@ -156,13 +171,18 @@ class BagController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$b = $this->getBag($item_id); $b = $this->getBag($item_id, $account_id);
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$bag_meta_table = require("../res/$channel/bag@bag.php");
} else {
$bag_meta_table = require('../res/bag@bag.php'); $bag_meta_table = require('../res/bag@bag.php');
}
//正在装备的道具 //正在装备的道具
if ($b['fuction'] != 5 && $b['fuction'] != 6) { if ($b['fuction'] != 5 && $b['fuction'] != 6) {
foreach ($bag_meta_table as $bag_info) { foreach ($bag_meta_table as $bag_info) {
$id = $bag_info['id']; $id = $bag_info['id'];
$bag = $this->getBag($id); $bag = $this->getBag($id, $account_id);
if ($bag['fuction'] != $b['fuction']) { if ($bag['fuction'] != $b['fuction']) {
continue; continue;
} }
@ -239,7 +259,7 @@ class BagController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$b = $this->getBag($item_id); $b = $this->getBag($item_id,$account_id);
$row = $conn->execQueryOne('SELECT status,active_time FROM bag WHERE accountid=:accountid AND id=:id;', $row = $conn->execQueryOne('SELECT status,active_time FROM bag WHERE accountid=:accountid AND id=:id;',
array( array(
@ -327,7 +347,7 @@ class BagController{
return; return;
} }
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$ptime = $this->getParameter(RECOMMEND_TIME); $ptime = $this->getParameter(RECOMMEND_TIME, $account_id);
$addreward->addReward($item_id, 1, $account_id, $ptime['param_value'], 0); $addreward->addReward($item_id, 1, $account_id, $ptime['param_value'], 0);
echo json_encode(array( echo json_encode(array(
'errcode' => 0, 'errcode' => 0,
@ -354,8 +374,8 @@ class BagController{
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$random = Rand(0, 10000); $random = Rand(0, 10000);
$time = 1; $time = 1;
$p = $this->getParameter(RECOMMEND_FOREVER_WEIGHT); $p = $this->getParameter(RECOMMEND_FOREVER_WEIGHT, $account_id);
$ptime = $this->getParameter(RECOMMEND_TIME); $ptime = $this->getParameter(RECOMMEND_TIME, $account_id);
if ($random < $p['param_value']) { if ($random < $p['param_value']) {
$time = 0; $time = 0;
} else { } else {

View File

@ -18,35 +18,60 @@ class EquipController{
return $conn; return $conn;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
'diamond' => $item_conf['diamond'], 'diamond' => $item_conf['diamond'],
//'dprice' => $item_conf['dprice'],
'type' => $item_conf['fuction'], 'type' => $item_conf['fuction'],
'diamond_hour' => $item_conf['diamond_hour'] 'diamond_hour' => $item_conf['diamond_hour'],
'pool_weight' => $item_conf['pool_weight'],
); );
return $it; return $it;
} }
protected function getParameter($para_id)
protected function getParameter($para_id, $accountid)
{ {
$g_conf_para_cluster = require('../res/parameter@parameter.php'); $channel = phpcommon\extractChannel($accountid);
$para_conf = getParameterConfig($g_conf_para_cluster, $para_id); if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $para_conf['id'], 'id' => $parameter_meta['id'],
'param_name' => $para_conf['param_name'], 'param_name' => $parameter_meta['param_name'],
'param_value' => $para_conf['param_value'], 'param_value' => $parameter_meta['param_value'],
); );
return $p; return $p;
} }
protected function getEquip($equip_id)
protected function getEquip($equip_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_equip_cluster = require("../res/$channel/equip@equip.php");
} else {
$g_conf_equip_cluster = require('../res/equip@equip.php'); $g_conf_equip_cluster = require('../res/equip@equip.php');
}
$equip_conf = getEquipConfig($g_conf_equip_cluster, $equip_id); $equip_conf = getEquipConfig($g_conf_equip_cluster, $equip_id);
if (!$equip_conf) { if (!$equip_conf) {
return null; return null;
@ -166,16 +191,22 @@ class EquipController{
die(); die();
return; return;
} }
$e = $this->getEquip($row['id']); $e = $this->getEquip($row['id'], $account_id);
if ($e['upgrade_priority'] == '') { if ($e['upgrade_priority'] == '') {
$flag = 1; $flag = 1;
} }
} }
if ($flag == 0) { if ($flag == 0) {
//更新老玩家数据 //更新老玩家数据
$g_conf_lot_cluster = require('../res/equip@equip.php'); $channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_equip_cluster = require("../res/$channel/equip@equip.php");
} else {
$g_conf_equip_cluster = require('../res/equip@equip.php');
}
for ($i = 0; $i < count($g_conf_lot_cluster); $i++) { for ($i = 0; $i < count($g_conf_lot_cluster); $i++) {
$e = $this->getEquip(12100 + $i); $e = $this->getEquip(12100 + $i, $account_id);
if (!$e || $e['id'] >= $row['id'] || $e['upgrade_priority'] == '') { if (!$e || $e['id'] >= $row['id'] || $e['upgrade_priority'] == '') {
continue; continue;
} }
@ -250,9 +281,15 @@ class EquipController{
)); ));
if (!$row) { if (!$row) {
$id = 0; $id = 0;
$g_conf_lot_cluster = require('../res/equip@equip.php'); $channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_equip_cluster = require("../res/$channel/equip@equip.php");
} else {
$g_conf_equip_cluster = require('../res/equip@equip.php');
}
for ($i = 0; $i < count($g_conf_lot_cluster); $i++) { for ($i = 0; $i < count($g_conf_lot_cluster); $i++) {
$e = $this->getEquip(12100 + $i); $e = $this->getEquip(12100 + $i, $account_id);
if (!$e) { if (!$e) {
continue; continue;
} }
@ -355,7 +392,7 @@ class EquipController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$e = $this->getEquip($row['id']); $e = $this->getEquip($row['id'], $account_id);
if (!$e) { if (!$e) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备');
return; return;
@ -395,9 +432,15 @@ class EquipController{
':account_id' => $account_id ':account_id' => $account_id
)); ));
$max_p = $e['upgrade_priority']; $max_p = $e['upgrade_priority'];
$g_conf_lot_cluster = require('../res/equip@equip.php'); $channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_equip_cluster = require("../res/$channel/equip@equip.php");
} else {
$g_conf_equip_cluster = require('../res/equip@equip.php');
}
for ($i = 0; $i < count($g_conf_lot_cluster); $i++) { for ($i = 0; $i < count($g_conf_lot_cluster); $i++) {
$ec = $this->getEquip(12100 + $i); $ec = $this->getEquip(12100 + $i, $account_id);
if (!$ec) { if (!$ec) {
continue; continue;
} }
@ -503,12 +546,20 @@ class EquipController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$e1 = $this->getEquip($row['id']); $e1 = $this->getEquip($row['id'], $account_id);
$last_id = $e1['upgrade_priority']; $last_id = $e1['upgrade_priority'];
$id = 0; $id = 0;
$g_conf_lot_cluster = require('../res/equip@equip.php'); $channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_equip_cluster = require("../res/$channel/equip@equip.php");
} else {
$g_conf_equip_cluster = require('../res/equip@equip.php');
}
for ($i = 0; $i < count($g_conf_lot_cluster); $i++) { for ($i = 0; $i < count($g_conf_lot_cluster); $i++) {
$ec = $this->getEquip(12100 + $i); $ec = $this->getEquip(12100 + $i, $account_id);
if (!$ec || empty($ec['upgrade_priority'])) { if (!$ec || empty($ec['upgrade_priority'])) {
continue; continue;
} }
@ -517,7 +568,7 @@ class EquipController{
break; break;
} }
} }
$e = $this->getEquip($id); $e = $this->getEquip($id, $account_id);
if (!$e) { if (!$e) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备');
return; return;
@ -693,7 +744,7 @@ class EquipController{
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
return; return;
} }
$e = $this->getEquip($equip_id); $e = $this->getEquip($equip_id, $account_id);
if (!$e) { if (!$e) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备');
return; return;
@ -754,7 +805,7 @@ class EquipController{
} }
} }
foreach ($arr3 as $ar) { foreach ($arr3 as $ar) {
$it = $this->getItem($ar[0]); $it = $this->getItem($ar[0],$account_id);
if (!$it) { if (!$it) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
return; return;
@ -839,7 +890,7 @@ class EquipController{
return; return;
} }
$it = $this->getItem($item_id); $it = $this->getItem($item_id, $account_id);
if (!$it) { if (!$it) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
die(); die();
@ -919,7 +970,7 @@ class EquipController{
} }
$lv = $row['lv']; $lv = $row['lv'];
$e = $this->getEquip($equip_id); $e = $this->getEquip($equip_id, $account_id);
if (!$e) { if (!$e) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个装备');
return; return;
@ -933,14 +984,22 @@ class EquipController{
} }
$arr2 = array(); $arr2 = array();
$flag = 0; $flag = 0;
for ($a = 0; $a < count($arr); $a++) { $valexp = 0;
$str = $arr[$a][0]; if ($lv == 0) {
$str = $arr[$lv][0];
$estr = explode(';', $str); $estr = explode(';', $str);
if ($estr[1][0] > $row['exp']) { $valexp = $estr[1];
} else {
$str1 = $arr[$lv][0];
$estr1 = explode(';', $str1);
$str = $arr[$lv - 1][0];
$estr = explode(';', $str);
$valexp = $estr1[1] - $estr[1];
}
if ($valexp > $row['exp']) {
phpcommon\sendError(ERR_USER_BASE + 4, '未达到进阶需求'); phpcommon\sendError(ERR_USER_BASE + 4, '未达到进阶需求');
return; return;
} }
}
if ($lv >= $e['max_level']) { if ($lv >= $e['max_level']) {
phpcommon\sendError(ERR_USER_BASE + 5, '达到最大等级'); phpcommon\sendError(ERR_USER_BASE + 5, '达到最大等级');
return; return;

View File

@ -17,9 +17,14 @@ class FriendController{
)); ));
return $conn; return $conn;
} }
protected function getSeasonPoint($seaPoint_id) protected function getSeasonPoint($seaPoint_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/parameter@parameter.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
$seaPoint = array( $seaPoint = array(
'id' => $seaPoint_meta['id'], 'id' => $seaPoint_meta['id'],
@ -48,9 +53,14 @@ class FriendController{
} }
$rank = 1; $rank = 1;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/parameter@parameter.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $seaPoint['max'] == -1) { || $seaPoint['max'] == -1) {
$rank = $ii; $rank = $ii;

View File

@ -31,22 +31,6 @@ class GameOverController{
} }
protected function getBox($box_id)
{
$box_meta_table = require('../res/box@box.php');
$box_meta = getBoxConfig($box_meta_table, $box_id);
$b = array(
'box_id' => $box_meta['box_type'],
'item_id' => $box_meta['item_id'],
'num' => $box_meta['num'],
'weight' => $box_meta['weight'],
'type' => $box_meta['type'],
'time' => $box_meta['time'],
'count' => $box_meta['count'],
);
return $b;
}
protected function getExplode($string) protected function getExplode($string)
{ {
$delim = "|"; $delim = "|";
@ -60,27 +44,15 @@ class GameOverController{
return $arr; return $arr;
} }
protected function getEquip($equip_id)
{
$g_conf_equip_cluster = require('../res/equip@equip.php');
$equip_conf = getEquipConfig($g_conf_equip_cluster, $equip_id);
$e = array(
'id' => $equip_conf['id'],
'upgrade_priority' => $equip_conf['upgrade_priority'],
'equip_upgrade' => $equip_conf['equip_upgrade'],
'level_gold_cost' => $equip_conf['level_gold_cost'],
'max_level' => $equip_conf['max_level'],
'equip_upgradematerial' => $equip_conf['equip_upgradematerial'],
'equip_upgradetime' => $equip_conf['equip_upgradetime'],
'diamond_cost' => $equip_conf['diamond_cost'],
'drop_id' => $equip_conf['drop_id']
);
return $e;
}
protected function getDrop($drop_id) protected function getDrop($drop_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$drop_meta_table = require("../res/$channel/drop@drop.php");
} else {
$drop_meta_table = require('../res/drop@drop.php'); $drop_meta_table = require('../res/drop@drop.php');
}
$drop_meta = getDropConfig($drop_meta_table, $drop_id); $drop_meta = getDropConfig($drop_meta_table, $drop_id);
$d = array( $d = array(
'drop_id' => $drop_meta['drop_id'], 'drop_id' => $drop_meta['drop_id'],
@ -92,21 +64,34 @@ class GameOverController{
return $d; return $d;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
'name' => $parameter_meta['param_name'], 'name' => $parameter_meta['param_name'],
'param_value' => $parameter_meta['param_value'], 'param_value' => $parameter_meta['param_value'],
); );
return $p; return $p;
} }
protected function getRankReward($rank)
protected function getRankReward($rank, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$rank_meta_table = require("../res/$channel/rankReward@rankReward.php");
} else {
$rank_meta_table = require('../res/rankReward@rankReward.php'); $rank_meta_table = require('../res/rankReward@rankReward.php');
}
$rank_meta = getRankRewardConfig($rank_meta_table, $rank); $rank_meta = getRankRewardConfig($rank_meta_table, $rank);
$d = array( $d = array(
'rank' => $rank_meta['rank'], 'rank' => $rank_meta['rank'],
@ -147,11 +132,11 @@ class GameOverController{
if (isset($_REQUEST['type'])) { if (isset($_REQUEST['type'])) {
$type = $_REQUEST['type']; $type = $_REQUEST['type'];
} }
$p = $this->getParameter(EQUIPREWARD_PARAMETER); $p = $this->getParameter(EQUIPREWARD_PARAMETER, $account_id);
$par = $p['param_value']; $par = $p['param_value'];
if ($type == 1) { if ($type == 1) {
$ar = $this->getRankReward($rank); $ar = $this->getRankReward($rank, $account_id);
$coin = $ar['zbmode_param']; $coin = $ar['zbmode_param'];
$num = ceil($ar['zbmode_param'] / $par); $num = ceil($ar['zbmode_param'] / $par);
if (isset($_REQUEST['kills'])) { if (isset($_REQUEST['kills'])) {
@ -171,7 +156,7 @@ class GameOverController{
'time' => 0, 'time' => 0,
)); ));
} else { } else {
$first_list = $this->randomReward($rank, $type); $first_list = $this->randomReward($rank, $type, $account_id);
} }
$first_db = array( $first_db = array(
'first_uuid' => $first_uuid, 'first_uuid' => $first_uuid,
@ -270,14 +255,14 @@ class GameOverController{
return $item_list; return $item_list;
} }
protected function randomReward($rank,$type) protected function randomReward($rank,$type, $accountid)
{ {
//随机奖励 //随机奖励
$r = $this->getRankReward($rank); $r = $this->getRankReward($rank, $accountid);
$b = $this->getDrop($r['ad_drop']); $b = $this->getDrop($r['ad_drop'], $accountid);
$count = $r['ad_num']; $count = $r['ad_num'];
if ($type == 1) { if ($type == 1) {
$b = $this->getDrop($r['js_drop']); $b = $this->getDrop($r['js_drop'], $accountid);
$count = $r['js_num']; $count = $r['js_num'];
} }
$item_list = array(); $item_list = array();

View File

@ -28,22 +28,37 @@ class HangController{
return $arr; return $arr;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
'name' => $parameter_meta['param_name'], 'name' => $parameter_meta['param_name'],
'value' => $parameter_meta['param_value'], 'value' => $parameter_meta['param_value'],
); );
return $p; return $p;
} }
protected function getSeason($season_id)
protected function getSeason($season_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
$season_meta = getSeasonConfig($season_meta_table, $season_id); $season_meta = getSeasonConfig($season_meta_table, $season_id);
$season = array( $season = array(
'number' => $season_meta['season_number'], 'number' => $season_meta['season_number'],
@ -55,9 +70,14 @@ class HangController{
return $season; return $season;
} }
protected function getSeasonPoint($seaPoint_id) protected function getSeasonPoint($seaPoint_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
$seaPoint = array( $seaPoint = array(
'id' => $seaPoint_meta['id'], 'id' => $seaPoint_meta['id'],
@ -142,9 +162,15 @@ class HangController{
$end_time = 0; $end_time = 0;
$sea_reward = array(); $sea_reward = array();
$rank_status = 0; $rank_status = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
$open_time = strtotime($season['open_time']); $open_time = strtotime($season['open_time']);
$end_time = strtotime($season['end_time']); $end_time = strtotime($season['end_time']);
@ -221,9 +247,17 @@ class HangController{
} }
$pass_status = $row['pass_status']; $pass_status = $row['pass_status'];
$rank_status = 0; $rank_status = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) || $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1)
{ {
@ -336,10 +370,10 @@ class HangController{
$daily_order1 = $row['daily_order1']; $daily_order1 = $row['daily_order1'];
$daily_order2 = $row['daily_order2']; $daily_order2 = $row['daily_order2'];
$daily_order3 = $row['daily_order3']; $daily_order3 = $row['daily_order3'];
$p1 = $this->getParameter(LOGINBOX_TIME1); $p1 = $this->getParameter(LOGINBOX_TIME1, $account_id);
$p2 = $this->getParameter(LOGINBOX_TIME2); $p2 = $this->getParameter(LOGINBOX_TIME2, $account_id);
$p3 = $this->getParameter(LOGINBOX_TIME3); $p3 = $this->getParameter(LOGINBOX_TIME3, $account_id);
$p = $this->getParameter(LOGINBOX_TIME); $p = $this->getParameter(LOGINBOX_TIME, $account_id);
$pt1 = $p1['value']; $pt1 = $p1['value'];
$pt2 = $p2['value']; $pt2 = $p2['value'];
$pt3 = $p3['value']; $pt3 = $p3['value'];

View File

@ -31,9 +31,14 @@ class PassController{
return $arr; return $arr;
} }
protected function getSeason($season_id) protected function getSeason($season_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
$season_meta = getSeasonConfig($season_meta_table, $season_id); $season_meta = getSeasonConfig($season_meta_table, $season_id);
$season = array( $season = array(
'number' => $season_meta['season_number'], 'number' => $season_meta['season_number'],
@ -46,9 +51,14 @@ class PassController{
return $season; return $season;
} }
protected function getSeasonPoint($seaPoint_id) protected function getSeasonPoint($seaPoint_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
$seaPoint = array( $seaPoint = array(
'id' => $seaPoint_meta['id'], 'id' => $seaPoint_meta['id'],
@ -81,9 +91,17 @@ class PassController{
$end_time = 0; $end_time = 0;
$sea_reward = array(); $sea_reward = array();
$rank_status = 0; $rank_status = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
$open_time = strtotime($season['open_time']); $open_time = strtotime($season['open_time']);
$end_time = strtotime($season['end_time']); $end_time = strtotime($season['end_time']);
@ -148,9 +166,17 @@ class PassController{
return; return;
} }
$rank_status = 0; $rank_status = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) || $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1)
{ {
@ -260,9 +286,17 @@ class PassController{
//$delim = ':'; //$delim = ':';
//$drop_multiply = explode($delim, $seaPoint['reward']); //$drop_multiply = explode($delim, $seaPoint['reward']);
$season = array(); $season = array();
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
break; break;
} }
@ -346,16 +380,29 @@ class PassController{
$reward = array(); $reward = array();
$level = 0; $level = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) || $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1)
{ {
$season = array(); $season = array();
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
break; break;
} }
@ -449,9 +496,17 @@ class PassController{
$reward = array(); $reward = array();
$level = 0; $level = 0;
//积分结算 //积分结算
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['season_end_score'] >= $seaPoint['min'] && $row['season_end_score'] <= $seaPoint['max'] if ($row['season_end_score'] >= $seaPoint['min'] && $row['season_end_score'] <= $seaPoint['max']
|| $row['season_end_score'] >= $seaPoint['min'] && $seaPoint['max'] == -1) || $row['season_end_score'] >= $seaPoint['min'] && $seaPoint['max'] == -1)
{ {
@ -460,10 +515,18 @@ class PassController{
} }
} }
//奖励结算 //奖励结算
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
$id = 0; $id = 0;
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
$open_time = strtotime($season['open_time']); $open_time = strtotime($season['open_time']);
$end_time = strtotime($season['end_time']); $end_time = strtotime($season['end_time']);
@ -471,7 +534,7 @@ class PassController{
break; break;
} }
} }
$s = $this->getSeason($id); $s = $this->getSeason($id, $account_id);
if ($s) { if ($s) {
$delim1 = '|'; $delim1 = '|';

View File

@ -18,10 +18,15 @@ class PayController{
return $conn; return $conn;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$item_meta_table = require('../res/item@item.php'); $channel = phpcommon\extractChannel($accountid);
$item_meta = getItemConfig($item_meta_table, $item_id); if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php');
}
$item_meta = getItemConfig($g_conf_item_cluster, $item_id);
$item = array( $item = array(
'id' => $item_meta['id'], 'id' => $item_meta['id'],
'name' => $item_meta['name'], 'name' => $item_meta['name'],
@ -34,9 +39,14 @@ class PayController{
return $item; return $item;
} }
protected function getVip($vip_id) protected function getVip($vip_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$vip_meta_table = require("../res/$channel/vip@vip.php");
} else {
$vip_meta_table = require('../res/vip@vip.php'); $vip_meta_table = require('../res/vip@vip.php');
}
$vip_meta = getVipConfig($vip_meta_table, $vip_id); $vip_meta = getVipConfig($vip_meta_table, $vip_id);
$vip = array( $vip = array(
'level' => $vip_meta['level'], 'level' => $vip_meta['level'],
@ -48,9 +58,14 @@ class PayController{
return $vip; return $vip;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
@ -80,9 +95,14 @@ class PayController{
} }
protected function getDrop($drop_id) protected function getDrop($drop_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$drop_meta_table = require("../res/$channel/drop@drop.php");
} else {
$drop_meta_table = require('../res/drop@drop.php'); $drop_meta_table = require('../res/drop@drop.php');
}
$drop_meta = getDropConfig($drop_meta_table, $drop_id); $drop_meta = getDropConfig($drop_meta_table, $drop_id);
$d = array( $d = array(
'drop_id' => $drop_meta['drop_id'], 'drop_id' => $drop_meta['drop_id'],
@ -107,9 +127,9 @@ class PayController{
return $arr; return $arr;
} }
protected function getItemInfo($itemid) protected function getItemInfo($itemid, $accountid)
{ {
$d = $this->getDrop($itemid); $d = $this->getDrop($itemid, $accountid);
if (!$d) { if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
die(); die();
@ -161,8 +181,8 @@ class PayController{
$diamond_meta_table = require('../res/diamondshop@diamondshop.php'); $diamond_meta_table = require('../res/diamondshop@diamondshop.php');
for ($i = 1; $i <= count($diamond_meta_table); $i++) { for ($i = 1; $i <= count($diamond_meta_table); $i++) {
$diamond = $this->getDiamondShop($i); $diamond = $this->getDiamondShop($i);
$item = $this->getItem($diamond['item_id']); $item = $this->getItem($diamond['item_id'], $account_id);
$item_list = $this->getItemInfo($item['fuctionindex']); $item_list = $this->getItemInfo($item['fuctionindex'], $account_id);
if (!$item || !$diamond) { if (!$item || !$diamond) {
continue; continue;
} }
@ -192,7 +212,7 @@ class PayController{
$open_time = '-1'; $open_time = '-1';
$end_time = '-1'; $end_time = '-1';
if ($diamond['coin_type'] != 0) { if ($diamond['coin_type'] != 0) {
$sub_item = $this->getItem($diamond['coin_type']); $sub_item = $this->getItem($diamond['coin_type'], $account_id);
$coin_icon = $sub_item['icon']; $coin_icon = $sub_item['icon'];
} else { } else {
//免费金币钻石领取次数及有效时间 //免费金币钻石领取次数及有效时间
@ -269,7 +289,7 @@ class PayController{
for ($i = 0; $i < count($vip_meta_table); $i++) { for ($i = 0; $i < count($vip_meta_table); $i++) {
$vip_status = 0; $vip_status = 0;
$vip_today_status = 0; $vip_today_status = 0;
$vip = $this->getVip($i); $vip = $this->getVip($i, $account_id);
if ($row['vip_score'] >= $vip['require']) { if ($row['vip_score'] >= $vip['require']) {
$vip_level = $vip['level']; $vip_level = $vip['level'];
$vip_icon = $vip['vipicon']; $vip_icon = $vip['vipicon'];
@ -284,8 +304,8 @@ class PayController{
$vip_status = $rowVip['reward_status']; $vip_status = $rowVip['reward_status'];
$vip_today_status = $rowVip['today_reward_status']; $vip_today_status = $rowVip['today_reward_status'];
} }
$vip_item_list = $this->getVipItemInfo($vip['reward']); $vip_item_list = $this->getVipItemInfo($vip['reward'], $account_id);
$vip_today_item_list = $this->getVipItemInfo($vip['dailyreward']); $vip_today_item_list = $this->getVipItemInfo($vip['dailyreward'], $account_id);
array_push($vip_list, array( array_push($vip_list, array(
'vip_id' => $vip['level'], 'vip_id' => $vip['level'],
'require' => $vip['require'], 'require' => $vip['require'],
@ -295,7 +315,7 @@ class PayController{
'vip_today_item_list' => $vip_today_item_list, 'vip_today_item_list' => $vip_today_item_list,
)); ));
} }
$v = $this->getVip($vip_level + 1); $v = $this->getVip($vip_level + 1, $account_id);
$sum = $v['require']; $sum = $v['require'];
$coin_num = $sum - $row['vip_score']; $coin_num = $sum - $row['vip_score'];
echo json_encode(array( echo json_encode(array(
@ -309,14 +329,14 @@ class PayController{
)); ));
} }
protected function getVipItemInfo($id) protected function getVipItemInfo($id, $acoount_id)
{ {
$item = $this->getItem($id); $item = $this->getItem($id, $account_id);
if (!$item) { if (!$item) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
die(); die();
} }
$d = $this->getDrop($item['fuctionindex']); $d = $this->getDrop($item['fuctionindex'], $account_id);
if (!$d) { if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
die(); die();
@ -358,7 +378,7 @@ class PayController{
$vip_id = $_REQUEST['vip_id']; $vip_id = $_REQUEST['vip_id'];
$type = $_REQUEST['reward_type']; $type = $_REQUEST['reward_type'];
$status = 0; $status = 0;
$vip = $this->getVip($vip_id); $vip = $this->getVip($vip_id, $account_id);
if (!$vip) { if (!$vip) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
return; return;
@ -416,10 +436,10 @@ class PayController{
//发送奖励 //发送奖励
$item_list = array(); $item_list = array();
if ($type == 2) { if ($type == 2) {
$item_list = $this->getVipItemInfo($vip['reward']); $item_list = $this->getVipItemInfo($vip['reward'], $account_id);
} }
if ($type == 1) { if ($type == 1) {
$item_list = $this->getVipItemInfo($vip['dailyreward']); $item_list = $this->getVipItemInfo($vip['dailyreward'], $account_id);
} }
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
foreach ($item_list as $item) { foreach ($item_list as $item) {
@ -444,7 +464,7 @@ class PayController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$vip = $this->getVip($vipid); $vip = $this->getVip($vipid, $accountid);
if (!$vip) { if (!$vip) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
return; return;
@ -487,8 +507,12 @@ class PayController{
} }
$itemid = $_REQUEST['itemid']; $itemid = $_REQUEST['itemid'];
$itemnum = $_REQUEST['itemnum']; $itemnum = $_REQUEST['itemnum'];
$channel = phpcommon\extractChannel($_REQUEST['account_id']);
if (needSpecConfig($channel)) {
$item_meta_table = require("../res/$channel/item@item.php");
} else {
$item_meta_table = require('../res/item@item.php'); $item_meta_table = require('../res/item@item.php');
}
$item_meta = getItemConfig($item_meta_table, $itemid); $item_meta = getItemConfig($item_meta_table, $itemid);
if (!$item_meta || $item_meta['rmbprice'] < 0.001) { if (!$item_meta || $item_meta['rmbprice'] < 0.001) {
phpcommon\sendError(ERR_USER_BASE + 2, '参数错误'); phpcommon\sendError(ERR_USER_BASE + 2, '参数错误');
@ -577,7 +601,7 @@ class PayController{
continue; continue;
} }
$item = $this->getItem($diamond['item_id']); $item = $this->getItem($diamond['item_id']);
$item_list = $this->getItemInfo($item['fuctionindex']); $item_list = $this->getItemInfo($item['fuctionindex'], $account_id);
if (!$item_list) { if (!$item_list) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
return; return;
@ -682,15 +706,15 @@ class PayController{
if ($item_id != $diamond['item_id']) { if ($item_id != $diamond['item_id']) {
continue; continue;
} }
$item = $this->getItem($diamond['item_id']); $item = $this->getItem($diamond['item_id'], $account_id);
$item_list = $this->getItemInfo($item['fuctionindex']); $item_list = $this->getItemInfo($item['fuctionindex'], $account_id);
if (!$item_list) { if (!$item_list) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个道具');
return; return;
} }
} }
//添加道具 //添加道具
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['value'] - 1; $times = $p['value'] - 1;
foreach ($item_list as $item) { foreach ($item_list as $item) {
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
@ -726,9 +750,9 @@ class PayController{
return; return;
} }
$newhand = $row['newhand']; $newhand = $row['newhand'];
$p1 = $this->getParameter(NEWHAND_NUM1); $p1 = $this->getParameter(NEWHAND_NUM1, $account_id);
$fight_times = $p1['value']; $fight_times = $p1['value'];
$p2 = $this->getParameter(NEWHAND_NUM2); $p2 = $this->getParameter(NEWHAND_NUM2, $account_id);
$view_times = $p2['value']; $view_times = $p2['value'];
if ($row['game_times'] >= $fight_times && $row['vip_score'] + 1 == $view_times && $newhand == 0) { if ($row['game_times'] >= $fight_times && $row['vip_score'] + 1 == $view_times && $newhand == 0) {
$newhand = 1; $newhand = 1;
@ -778,7 +802,7 @@ class PayController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$item = $this->getItem(10005); $item = $this->getItem(10005, $account_id);
if (!$item) { if (!$item) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个道具');
return; return;

View File

@ -18,9 +18,14 @@ class QuestController{
return $conn; return $conn;
} }
protected function getQuest($quest_id) protected function getQuest($quest_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_quest_cluster = require("../res/$channel/task@task.php");
} else {
$g_conf_quest_cluster = require('../res/task@task.php'); $g_conf_quest_cluster = require('../res/task@task.php');
}
$quest_conf = getQuestConfig($g_conf_quest_cluster, $quest_id); $quest_conf = getQuestConfig($g_conf_quest_cluster, $quest_id);
$q = array( $q = array(
'id' => $quest_conf['id'], 'id' => $quest_conf['id'],
@ -33,9 +38,14 @@ class QuestController{
return $q; return $q;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
@ -59,10 +69,18 @@ class QuestController{
return $arr; return $arr;
} }
protected function getDrop($drop_id) protected function getDrop($drop_id, $accountid)
{ {
$g_conf_drop_cluster = require('../res/drop@drop.php'); $channel = phpcommon\extractChannel($accountid);
$drop_conf = getDropConfig($g_conf_drop_cluster, $drop_id); if (needSpecConfig($channel)) {
$drop_meta_table = require("../res/$channel/drop@drop.php");
} else {
$drop_meta_table = require('../res/drop@drop.php');
}
$drop_conf = getDropConfig($drop_meta_table, $drop_id);
$d = array( $d = array(
'drop_id' => $drop_conf['drop_id'], 'drop_id' => $drop_conf['drop_id'],
'item_id' => $drop_conf['item_id'], 'item_id' => $drop_conf['item_id'],
@ -133,7 +151,7 @@ class QuestController{
} }
$quest_id = $_REQUEST['quest_id']; $quest_id = $_REQUEST['quest_id'];
$quest_type = $_REQUEST['type']; $quest_type = $_REQUEST['type'];
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['value'] - 1; $times = $p['value'] - 1;
//发奖励 //发奖励
if ($quest_type == 0) { if ($quest_type == 0) {
@ -142,7 +160,7 @@ class QuestController{
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务');
return; return;
} }
$d = $this->getDrop($t['reward']); $d = $this->getDrop($t['reward'], $account_id);
if (!$d) { if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
return; return;
@ -169,7 +187,7 @@ class QuestController{
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$addreward->addReward($item_id, $item_num, $account_id, 0, 0); $addreward->addReward($item_id, $item_num, $account_id, 0, 0);
} else { } else {
$q = $this->getQuest($quest_id); $q = $this->getQuest($quest_id, $account_id);
if (!$q) { if (!$q) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务');
return; return;
@ -240,7 +258,7 @@ class QuestController{
} }
//发奖励 //发奖励
$q = $this->getQuest($quest_id); $q = $this->getQuest($quest_id, $account_id);
if (!$q) { if (!$q) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个任务');
return; return;

View File

@ -27,9 +27,14 @@ class RankController{
return $r; return $r;
} }
protected function getSeasonPoint($seaPoint_id) protected function getSeasonPoint($seaPoint_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
$seaPoint = array( $seaPoint = array(
'id' => $seaPoint_meta['id'], 'id' => $seaPoint_meta['id'],
@ -74,7 +79,7 @@ class RankController{
if ($row) { if ($row) {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $seaPoint['max'] == -1) { || $seaPoint['max'] == -1) {
$rank = $ii; $rank = $ii;
@ -251,7 +256,7 @@ class RankController{
$rank = 0; $rank = 0;
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($integral_db[$i][8] >= $seaPoint['min'] && $integral_db[$i][8] <= $seaPoint['max'] if ($integral_db[$i][8] >= $seaPoint['min'] && $integral_db[$i][8] <= $seaPoint['max']
|| $integral_db[$i][8] >= $seaPoint['min'] && $seaPoint['max'] == -1) || $integral_db[$i][8] >= $seaPoint['min'] && $seaPoint['max'] == -1)
{ {

View File

@ -30,9 +30,14 @@ class RoleController{
return $r; return $r;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
@ -42,26 +47,14 @@ class RoleController{
return $p; return $p;
} }
protected function getActivityRewardConfig($activityReward_id) protected function getDrop($drop_id, $accountid)
{
$g_conf_activityReward_cluster = require('../res/activityReward@activityReward.php');
$activityReward_conf = getActivityRewardConfig($g_conf_activityReward_cluster, $activityReward_id);
$act = array(
'id' => $activityReward_conf['id'],
'activity_id' => $activityReward_conf['activity_id'],
'condition' => $activityReward_conf['condition'],
'parameter' => $activityReward_conf['parameter'],
'start_end_time' => $activityReward_conf['start_end_time'],
'activity_reward' => $activityReward_conf['activity_reward'],
'exchange_num' => $activityReward_conf['exchange_num'],
'exchange_item' => $activityReward_conf['exchange_item']
);
return $act;
}
protected function getDrop($drop_id)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_drop_cluster = require("../res/$channel/drop@drop.php");
} else {
$g_conf_drop_cluster = require('../res/drop@drop.php'); $g_conf_drop_cluster = require('../res/drop@drop.php');
}
$drop_conf = getDropConfig($g_conf_drop_cluster, $drop_id); $drop_conf = getDropConfig($g_conf_drop_cluster, $drop_id);
$d = array( $d = array(
'drop_id' => $drop_conf['drop_id'], 'drop_id' => $drop_conf['drop_id'],
@ -73,9 +66,14 @@ class RoleController{
return $d; return $d;
} }
protected function getEquipUp($equipUp_id) protected function getEquipUp($equipUp_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_equipUp_cluster = require("../res/$channel/equipUpgrade@equipUpgrade.php");
} else {
$g_conf_equipUp_cluster = require('../res/equipUpgrade@equipUpgrade.php'); $g_conf_equipUp_cluster = require('../res/equipUpgrade@equipUpgrade.php');
}
$equipUp_conf = getEquipUpgradeConfig($g_conf_equipUp_cluster, $equipUp_id); $equipUp_conf = getEquipUpgradeConfig($g_conf_equipUp_cluster, $equipUp_id);
$e = array( $e = array(
'id' => $equipUp_conf['id'], 'id' => $equipUp_conf['id'],
@ -97,9 +95,14 @@ class RoleController{
return $arr; return $arr;
} }
protected function getSeason($season_id) protected function getSeason($season_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
$season_meta = getSeasonConfig($season_meta_table, $season_id); $season_meta = getSeasonConfig($season_meta_table, $season_id);
$season = array( $season = array(
'number' => $season_meta['season_number'], 'number' => $season_meta['season_number'],
@ -111,9 +114,14 @@ class RoleController{
return $season; return $season;
} }
protected function getSeasonPoint($seaPoint_id) protected function getSeasonPoint($seaPoint_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
$seaPoint = array( $seaPoint = array(
'id' => $seaPoint_meta['id'], 'id' => $seaPoint_meta['id'],
@ -126,9 +134,14 @@ class RoleController{
return $seaPoint; return $seaPoint;
} }
protected function getRankReward($rank) protected function getRankReward($rank, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$rank_meta_table = require("../res/$channel/rankReward@rankReward.php");
} else {
$rank_meta_table = require('../res/rankReward@rankReward.php'); $rank_meta_table = require('../res/rankReward@rankReward.php');
}
$rank_meta = getRankRewardConfig($rank_meta_table, $rank); $rank_meta = getRankRewardConfig($rank_meta_table, $rank);
$d = array( $d = array(
'rank' => $rank_meta['rank'], 'rank' => $rank_meta['rank'],
@ -176,16 +189,21 @@ class RoleController{
//$newInfo = array(); //$newInfo = array();
if (!$row) { if (!$row) {
$season_time = 0; $season_time = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
$season_time = strtotime($season['end_time']); $season_time = strtotime($season['end_time']);
break; break;
} }
} }
$ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, game_times, win_times, kills, harm, add_HP, alive_time, coin_num, integral, kill_his, alive_time_his, harm_his, add_HP_his, act_share_time, act_share_status, create_time, modify_time, first_fight, collect_status, keys_num, battle_re_times, shop_flush_times, kefu_status, sign_sum, box_num, diamond_num, sum_coin, pass_status, score, season_status, recharge_times_total, first_gift, season_time, free_coin, free_diamond, season_end_score, kill_modifytime, win_modifytime, rank_modifytime, vip_score, first_login, daily_first_login, daily_time, free_box, update_time, season_games, season_win, sea_max_kill, sea_max_hart, sea_avg_kill, free_lot_ticket, free_dou_lot_ticket, daily_order1, daily_order2, daily_order3, first_bee, newhand, coin_times, newInfo, first_day_ad, share_video_times, share_video_sums, act_video_status, act_ad_status, biogame_times) ' . $ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, game_times, win_times, kills, harm, add_HP, alive_time, coin_num, integral, kill_his, alive_time_his, harm_his, add_HP_his, act_share_time, act_share_status, create_time, modify_time, first_fight, collect_status, keys_num, battle_re_times, shop_flush_times, kefu_status, sign_sum, box_num, diamond_num, sum_coin, pass_status, score, season_status, recharge_times_total, first_gift, season_time, free_coin, free_diamond, season_end_score, kill_modifytime, win_modifytime, rank_modifytime, vip_score, first_login, daily_first_login, daily_time, free_box, update_time, season_games, season_win, sea_max_kill, sea_max_hart, sea_avg_kill, free_lot_ticket, free_dou_lot_ticket, daily_order1, daily_order2, daily_order3, first_bee, newhand, coin_times, newInfo, first_day_ad, share_video_times, share_video_sums, act_video_status, act_ad_status, biogame_times) ' .
' VALUES(:accountid, :user_name, :avatar_url, 0, 0, 0, 0, 0, 0, 3000, 0, 0, 0, 0, 0, 0, 0, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, :season_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, :daily_time, 0,:update_time,0,0,0,0,0,0,0,0,0,0,0,0,0,:newInfo,0,0,0,0,0,0) ' . ' VALUES(:accountid, :user_name, :avatar_url, 0, 0, 0, 0, 0, 0, 5000, 0, 0, 0, 0, 0, 0, 0, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, :season_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, :daily_time, 0,:update_time,0,0,0,0,0,0,0,0,0,0,0,0,0,:newInfo,0,0,0,0,0,0) ' .
' ON DUPLICATE KEY UPDATE accountid=:accountid, user_name=:user_name, avatar_url=:avatar_url, game_times=0, win_times=0, kills=0, harm=0, add_HP=0, alive_time=0, coin_num=0, integral=0, kill_his=0, alive_time_his=0, harm_his=0, add_HP_his=0, act_share_time=0, act_share_status=0, modify_time=:modify_time, first_fight=0, collect_status=0, keys_num=0, battle_re_times=0, shop_flush_times=0, kefu_status=0, sign_sum=0, box_num=0, diamond_num=0, sum_coin=0, pass_status=0, score=0, season_status=1, recharge_times_total=0, first_gift=0, season_time=:season_time, free_coin=0, free_diamond=0, season_end_score=0, kill_modifytime=0, win_modifytime=0, rank_modifytime=0, vip_score=0, first_login=0, daily_first_login=0, daily_time=:daily_time, free_box=0, update_time=:update_time, season_games=0, season_win=0, sea_max_kill=0, sea_max_hart=0, sea_avg_kill=0, free_lot_ticket=0, free_dou_lot_ticket=0, daily_order1=0, daily_order2=0, daily_order3=0, first_bee=0, newhand=0, coin_times=0, newInfo=:newInfo, first_day_ad=0, share_video_times=0, share_video_sums=0, act_video_status=0, act_ad_status=0, biogame_times=0;', ' ON DUPLICATE KEY UPDATE accountid=:accountid, user_name=:user_name, avatar_url=:avatar_url, game_times=0, win_times=0, kills=0, harm=0, add_HP=0, alive_time=0, coin_num=0, integral=0, kill_his=0, alive_time_his=0, harm_his=0, add_HP_his=0, act_share_time=0, act_share_status=0, modify_time=:modify_time, first_fight=0, collect_status=0, keys_num=0, battle_re_times=0, shop_flush_times=0, kefu_status=0, sign_sum=0, box_num=0, diamond_num=0, sum_coin=0, pass_status=0, score=0, season_status=1, recharge_times_total=0, first_gift=0, season_time=:season_time, free_coin=0, free_diamond=0, season_end_score=0, kill_modifytime=0, win_modifytime=0, rank_modifytime=0, vip_score=0, first_login=0, daily_first_login=0, daily_time=:daily_time, free_box=0, update_time=:update_time, season_games=0, season_win=0, sea_max_kill=0, sea_max_hart=0, sea_avg_kill=0, free_lot_ticket=0, free_dou_lot_ticket=0, daily_order1=0, daily_order2=0, daily_order3=0, first_bee=0, newhand=0, coin_times=0, newInfo=:newInfo, first_day_ad=0, share_video_times=0, share_video_sums=0, act_video_status=0, act_ad_status=0, biogame_times=0;',
array( array(
':accountid' => $account_id, ':accountid' => $account_id,
@ -213,7 +231,7 @@ class RoleController{
'harm' => 0, 'harm' => 0,
'add_HP' => 0, 'add_HP' => 0,
'alive_time' => 0, 'alive_time' => 0,
'coin_num' => 3000, 'coin_num' => 5000,
'first_fight' => 0, 'first_fight' => 0,
'collect_status' => 0, 'collect_status' => 0,
'keys_num' => 0, 'keys_num' => 0,
@ -377,19 +395,29 @@ class RoleController{
':accountid' => $account_id, ':accountid' => $account_id,
)); ));
if (time() > $rowUser['season_time'] && $rowUser['season_time'] != 0) { if (time() > $rowUser['season_time'] && $rowUser['season_time'] != 0) {
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
$end_time = 0; $end_time = 0;
for ($i = 1; $i <= count($season_meta_table); $i++) { for ($i = 1; $i <= count($season_meta_table); $i++) {
$season = $this->getSeason($i); $season = $this->getSeason($i, $account_id);
if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) { if (time() >= strtotime($season['open_time']) && time() <= strtotime($season['end_time'])) {
$end_time = strtotime($season['end_time']); $end_time = strtotime($season['end_time']);
break; break;
} }
} }
$season_point_table = require('../res/seasomPoint@seasomPoint.php'); $channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_point_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_point_table = require('../res/seasomPoint@seasomPoint.php');
}
$integral = 0; $integral = 0;
for ($j = 1; $j <= count($season_point_table); $j++) { for ($j = 1; $j <= count($season_point_table); $j++) {
$seasonpoint = $this->getSeasonPoint($j); $seasonpoint = $this->getSeasonPoint($j, $account_id);
if ($rowUser['integral'] <= $seasonpoint['max'] || if ($rowUser['integral'] <= $seasonpoint['max'] ||
$seasonpoint['max'] == -1) { $seasonpoint['max'] == -1) {
$integral = $seasonpoint['topoint']; $integral = $seasonpoint['topoint'];
@ -474,9 +502,14 @@ class RoleController{
$min_score = 0; $min_score = 0;
$update_score = $integral + $row['integral']; $update_score = $integral + $row['integral'];
$is_pro = 0; $is_pro = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) { || $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) {
$is_pro = $seaPoint['is_protect']; $is_pro = $seaPoint['is_protect'];
@ -558,9 +591,9 @@ class RoleController{
} }
$daily_first_login = $row['daily_first_login']; $daily_first_login = $row['daily_first_login'];
$newhand = $row['newhand']; $newhand = $row['newhand'];
$p1 = $this->getParameter(NEWHAND_NUM1); $p1 = $this->getParameter(NEWHAND_NUM1, $account_id);
$fight_times = $p1['param_value']; $fight_times = $p1['param_value'];
$p2 = $this->getParameter(NEWHAND_NUM2); $p2 = $this->getParameter(NEWHAND_NUM2, $account_id);
$view_times = $p2['param_value']; $view_times = $p2['param_value'];
if ($row['game_times'] + 1 == $fight_times && $row['vip_score'] >= $view_times) { if ($row['game_times'] + 1 == $fight_times && $row['vip_score'] >= $view_times) {
$newhand = 1; $newhand = 1;
@ -628,7 +661,7 @@ class RoleController{
return; return;
} }
$rank = $_REQUEST['rank']; $rank = $_REQUEST['rank'];
$ar = $this->getRankReward($rank); $ar = $this->getRankReward($rank, $account_id);
$coin_num = $ar['zbmode_param']; $coin_num = $ar['zbmode_param'];
$row = $conn->execQueryOne('SELECT daily_time, coin_num, biogame_times FROM user WHERE accountid=:accountid;', $row = $conn->execQueryOne('SELECT daily_time, coin_num, biogame_times FROM user WHERE accountid=:accountid;',
array( array(
@ -764,9 +797,14 @@ class RoleController{
$min_score = 0; $min_score = 0;
$update_score = $integral + $row['integral']; $update_score = $integral + $row['integral'];
$is_pro = 0; $is_pro = 0;
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) { for ($ii = 1; $ii <= count($seaPoint_meta_table); $ii++) {
$seaPoint = $this->getSeasonPoint($ii); $seaPoint = $this->getSeasonPoint($ii, $account_id);
if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max'] if ($row['integral'] >= $seaPoint['min'] && $row['integral'] <= $seaPoint['max']
|| $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) { || $row['integral'] >= $seaPoint['min'] && $seaPoint['max'] == -1) {
$is_pro = $seaPoint['is_protect']; $is_pro = $seaPoint['is_protect'];
@ -829,9 +867,9 @@ class RoleController{
}*/ }*/
$newhand = $row['newhand']; $newhand = $row['newhand'];
$p1 = $this->getParameter(NEWHAND_NUM1); $p1 = $this->getParameter(NEWHAND_NUM1, $account_id);
$fight_times = $p1['param_value']; $fight_times = $p1['param_value'];
$p2 = $this->getParameter(NEWHAND_NUM2); $p2 = $this->getParameter(NEWHAND_NUM2, $account_id);
$view_times = $p2['param_value']; $view_times = $p2['param_value'];
if ($row['game_times'] + 1 == $fight_times && $row['vip_score'] >= $view_times) { if ($row['game_times'] + 1 == $fight_times && $row['vip_score'] >= $view_times) {
$newhand = 1; $newhand = 1;
@ -1013,7 +1051,7 @@ class RoleController{
die(); die();
return; return;
} }
$d = $this->getDrop(24003); $d = $this->getDrop(24003,$account_id);
if (!$d) { if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
return; return;
@ -1058,7 +1096,7 @@ class RoleController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$d = $this->getDrop(24003); $d = $this->getDrop(24003,$account_id);
if (!$d) { if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
return; return;
@ -1068,7 +1106,7 @@ class RoleController{
$weight_array = $this->getExplode($d['weight']); $weight_array = $this->getExplode($d['weight']);
$i = 0; $i = 0;
$item_list = array(); $item_list = array();
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['param_value'] - 1; $times = $p['param_value'] - 1;
foreach ($weight_array as $item) { foreach ($weight_array as $item) {
if ($item[0] >= Rand(0, 10000)) { if ($item[0] >= Rand(0, 10000)) {
@ -1186,7 +1224,7 @@ class RoleController{
$reward_id = $_REQUEST['reward_id']; $reward_id = $_REQUEST['reward_id'];
$reward_num = $_REQUEST['reward_num']; $reward_num = $_REQUEST['reward_num'];
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$p = $this->getParameter(GAMEOVER_REWARD_TIMES); $p = $this->getParameter(GAMEOVER_REWARD_TIMES, $account_id);
$times = $p['param_value'] - 1; $times = $p['param_value'] - 1;
$addreward->addReward(10001, $coin_num * $times, $account_id, 0, 0); $addreward->addReward(10001, $coin_num * $times, $account_id, 0, 0);
if ($reward_id != 0) { if ($reward_id != 0) {
@ -1232,7 +1270,7 @@ class RoleController{
die(); die();
return; return;
} }
$d = $this->getDrop(29001); $d = $this->getDrop(29001,$account_id);
if (!$d) { if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
return; return;
@ -1339,14 +1377,14 @@ class RoleController{
} }
$coin_times = $rowUser['coin_times']; $coin_times = $rowUser['coin_times'];
$p1 = $this->getParameter(DAILYCOIN_TIMES); $p1 = $this->getParameter(DAILYCOIN_TIMES, $account_id);
$max_times = $p1['param_value']; $max_times = $p1['param_value'];
$p2 = $this->getParameter(DAILYCOIN_DECAY); $p2 = $this->getParameter(DAILYCOIN_DECAY, $account_id);
$val = $p2['param_value']; $val = $p2['param_value'];
$p3 = $this->getParameter(DAILYCOIN_NUM); $p3 = $this->getParameter(DAILYCOIN_NUM, $account_id);
$num = $p3['param_value']; $num = $p3['param_value'];
$e = $this->getEquipUp($rowEquip['id']); $e = $this->getEquipUp($rowEquip['id'], $account_id);
if (!$e) { if (!$e) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个装备'); phpcommon\sendError(ERR_USER_BASE + 3, '没有这个装备');
return; return;
@ -1485,7 +1523,7 @@ class RoleController{
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return; return;
} }
$p = $this->getParameter(SHARE_VIDEO_REWARD); $p = $this->getParameter(SHARE_VIDEO_REWARD, $account_id);
$num = $p['param_value']; $num = $p['param_value'];
$ret = $conn->execScript('UPDATE user SET diamond_num=:diamond_num, share_video_times=:share_video_times, modify_time=:modify_time ' . $ret = $conn->execScript('UPDATE user SET diamond_num=:diamond_num, share_video_times=:share_video_times, modify_time=:modify_time ' .

View File

@ -30,9 +30,14 @@ class ShareController{
return $r; return $r;
} }
protected function getDrop($drop_id) protected function getDrop($drop_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$drop_meta_table = require("../res/$channel/drop@drop.php");
} else {
$drop_meta_table = require('../res/drop@drop.php'); $drop_meta_table = require('../res/drop@drop.php');
}
$drop_meta = getDropConfig($drop_meta_table, $drop_id); $drop_meta = getDropConfig($drop_meta_table, $drop_id);
$d = array( $d = array(
'drop_id' => $drop_meta['drop_id'], 'drop_id' => $drop_meta['drop_id'],
@ -44,24 +49,14 @@ class ShareController{
return $d; return $d;
} }
protected function getBox($box_id) protected function getShare($share_id, $accountid)
{
$box_meta_table = require('../res/box@box.php');
$box_meta = getBoxConfig($box_meta_table, $box_id);
$b = array(
'box_id' => $box_meta['box_type'],
'item_id' => $box_meta['item_id'],
'num' => $box_meta['num'],
'weight' => $box_meta['weight'],
'type' => $box_meta['type'],
'time' => $box_meta['time'],
);
return $b;
}
protected function getShare($share_id)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$share_meta_table = require("../res/$channel/share@share.php");
} else {
$share_meta_table = require('../res/share@share.php'); $share_meta_table = require('../res/share@share.php');
}
$share_meta = getShareConfig($share_meta_table, $share_id); $share_meta = getShareConfig($share_meta_table, $share_id);
$sh = array( $sh = array(
'id' => $share_meta['id'], 'id' => $share_meta['id'],
@ -84,10 +79,15 @@ class ShareController{
return $arr; return $arr;
} }
protected function getParameter($para_id, $accountid)
protected function getParameter($para_id)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php'); $parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id); $parameter_meta = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $parameter_meta['id'], 'id' => $parameter_meta['id'],
@ -255,7 +255,7 @@ class ShareController{
$diamond_num = 0; $diamond_num = 0;
if ($free != 0) { if ($free != 0) {
if ($row['free_dou_lot_ticket'] <= 0) { if ($row['free_dou_lot_ticket'] <= 0) {
$p = $this->getParameter(DIAMONDBOX10); $p = $this->getParameter(DIAMONDBOX10, $account_id);
$diamond_num = $p['param_value']; $diamond_num = $p['param_value'];
} else { } else {
$ret = $conn->execScript('UPDATE user SET free_dou_lot_ticket=:free_dou_lot_ticket, ' . $ret = $conn->execScript('UPDATE user SET free_dou_lot_ticket=:free_dou_lot_ticket, ' .
@ -390,7 +390,7 @@ class ShareController{
phpcommon\sendError(ERR_USER_BASE + 1,'session失效'); phpcommon\sendError(ERR_USER_BASE + 1,'session失效');
return; return;
} }
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['param_value'] - 1; $times = $p['param_value'] - 1;
foreach ($user_db['boxreward_list'] as $boxreward) { foreach ($user_db['boxreward_list'] as $boxreward) {
//增加奖励 //增加奖励
@ -426,7 +426,15 @@ class ShareController{
array( array(
':accountid' => $account_id ':accountid' => $account_id
)); ));
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$share_meta_table = require("../res/$channel/share@share.php");
} else {
$share_meta_table = require('../res/share@share.php'); $share_meta_table = require('../res/share@share.php');
}
if (count($rows) == 0) { if (count($rows) == 0) {
$num = count($rows) + 1; $num = count($rows) + 1;
for ($i = $num; $i <= count($share_meta_table); $i++) { for ($i = $num; $i <= count($share_meta_table); $i++) {
@ -453,7 +461,7 @@ class ShareController{
)); ));
foreach ($rows as $row) { foreach ($rows as $row) {
$item_list = array(); $item_list = array();
$sh = $this->getShare($row['ach_id']); $sh = $this->getShare($row['ach_id'], $account_id);
$array = $this->getExplode($sh['rewards']); $array = $this->getExplode($sh['rewards']);
for ($i = 0; $i < count($array); $i++) { for ($i = 0; $i < count($array); $i++) {
array_push($item_list, array( array_push($item_list, array(
@ -526,7 +534,7 @@ class ShareController{
//领取奖励 //领取奖励
$data = json_decode($response, true); $data = json_decode($response, true);
$peo_num = $data['invitee_num']; $peo_num = $data['invitee_num'];
$sh = $this->getShare($ach_id); $sh = $this->getShare($ach_id, $account_id);
if ($peo_num < $sh['people']) { if ($peo_num < $sh['people']) {
phpcommon\sendError(ERR_USER_BASE + 4, '未达到人数要求'); phpcommon\sendError(ERR_USER_BASE + 4, '未达到人数要求');
return; return;
@ -603,12 +611,12 @@ class ShareController{
//领取奖励 //领取奖励
$data = json_decode($response, true); $data = json_decode($response, true);
$peo_num = $data['invitee_num']; $peo_num = $data['invitee_num'];
$sh = $this->getShare($ach_id); $sh = $this->getShare($ach_id, $account_id);
if ($peo_num < $sh['people']) { if ($peo_num < $sh['people']) {
phpcommon\sendError(ERR_USER_BASE + 4, '未达到人数要求'); phpcommon\sendError(ERR_USER_BASE + 4, '未达到人数要求');
return; return;
} }
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['param_value'] - 1; $times = $p['param_value'] - 1;
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
if ($ach_id != 6) { if ($ach_id != 6) {
@ -767,7 +775,7 @@ class ShareController{
phpcommon\sendError(ERR_USER_BASE + 1,'session失效'); phpcommon\sendError(ERR_USER_BASE + 1,'session失效');
return; return;
} }
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['param_value'] - 1; $times = $p['param_value'] - 1;
foreach ($user_db['kefureward_list'] as $kefureward) { foreach ($user_db['kefureward_list'] as $kefureward) {
//增加奖励 //增加奖励

View File

@ -28,9 +28,21 @@ class ShopController{
)); ));
return $conn; return $conn;
} }
protected function getItem($item_id)
protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
@ -65,9 +77,14 @@ class ShopController{
return $it; return $it;
} }
protected function getShop($shop_id) protected function getShop($shop_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_shop_cluster = require("../res/$channel/shop@shop.php");
} else {
$g_conf_shop_cluster = require('../res/shop@shop.php'); $g_conf_shop_cluster = require('../res/shop@shop.php');
}
$shop_conf = getShopConfig($g_conf_shop_cluster, $shop_id); $shop_conf = getShopConfig($g_conf_shop_cluster, $shop_id);
$s = array( $s = array(
'shop_id' => $shop_conf['shop_id'], 'shop_id' => $shop_conf['shop_id'],
@ -84,10 +101,15 @@ class ShopController{
return $s; return $s;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$g_conf_para_cluster = require('../res/parameter@parameter.php'); $channel = phpcommon\extractChannel($accountid);
$para_conf = getParameterConfig($g_conf_para_cluster, $para_id); if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$para_conf = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $para_conf['id'], 'id' => $para_conf['id'],
'param_name' => $para_conf['param_name'], 'param_name' => $para_conf['param_name'],
@ -109,7 +131,7 @@ class ShopController{
return $arr; return $arr;
} }
protected function getShopInfo($shop_uuid) protected function getShopInfo($shop_uuid, $accountid)
{ {
$r = $this->getRedis($shop_uuid); $r = $this->getRedis($shop_uuid);
if (!$r) { if (!$r) {
@ -119,7 +141,7 @@ class ShopController{
$shop_list = array(); $shop_list = array();
$user_db_str = $r->get($shop_uuid); $user_db_str = $r->get($shop_uuid);
if (empty($user_db_str)) { if (empty($user_db_str)) {
$shop_list = $this->randomShop(1); $shop_list = $this->randomShop(1, $accountid);
$shop_db = array( $shop_db = array(
'shop_uuid' => $shop_uuid, 'shop_uuid' => $shop_uuid,
'shop_list' => $shop_list, 'shop_list' => $shop_list,
@ -165,11 +187,16 @@ class ShopController{
$shop_uuid = 'game2004api_shop_uuid: ' . md5($_REQUEST['account_id']); $shop_uuid = 'game2004api_shop_uuid: ' . md5($_REQUEST['account_id']);
$diamond_shop_uuid = 'game2004api_diamond_shop_uuid:' . md5($_REQUEST['account_id']); $diamond_shop_uuid = 'game2004api_diamond_shop_uuid:' . md5($_REQUEST['account_id']);
//商店信息 //商店信息
$shop_list = $this->getShopInfo($shop_uuid); $shop_list = $this->getShopInfo($shop_uuid, $account_id);
$rand_coinshop = array(); $rand_coinshop = array();
$rand_diamondshop = array(); $rand_diamondshop = array();
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$rows = $conn->execQuery('SELECT * FROM bag WHERE accountid=:accountid;', $rows = $conn->execQuery('SELECT * FROM bag WHERE accountid=:accountid;',
array( array(
':accountid' => $account_id ':accountid' => $account_id
@ -275,7 +302,7 @@ class ShopController{
if (count($rand_coinshop) >= 1) { if (count($rand_coinshop) >= 1) {
$random_coin = Rand(0, count($rand_coinshop) - 1); $random_coin = Rand(0, count($rand_coinshop) - 1);
$randcoin_id = $rand_coinshop[$random_coin]['id']; $randcoin_id = $rand_coinshop[$random_coin]['id'];
$cinfo = $this->getItem($randcoin_id); $cinfo = $this->getItem($randcoin_id, $account_id);
$coin_discount = $this->randdiscount($cinfo['discount']); $coin_discount = $this->randdiscount($cinfo['discount']);
} }
@ -284,7 +311,7 @@ class ShopController{
if (count($rand_diamondshop) >= 1) { if (count($rand_diamondshop) >= 1) {
$random_diamond = Rand(0, count($rand_diamondshop) - 1); $random_diamond = Rand(0, count($rand_diamondshop) - 1);
$randdiamnod_id = $rand_diamondshop[$random_diamond]['id']; $randdiamnod_id = $rand_diamondshop[$random_diamond]['id'];
$dinfo = $this->getItem($randdiamnod_id); $dinfo = $this->getItem($randdiamnod_id, $account_id);
$dia_discount = $this->randdiscount($dinfo['discount']); $dia_discount = $this->randdiscount($dinfo['discount']);
} }
@ -392,7 +419,7 @@ class ShopController{
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
return; return;
} }
$i = $this->getItem($id); $i = $this->getItem($id, $account_id);
$price = 0; $price = 0;
if ($i['shop_type'] == 1) { if ($i['shop_type'] == 1) {
$row_c = $conn->execQueryOne('SELECT * FROM shop WHERE accountid=:accountid AND coin_id=:id;', $row_c = $conn->execQueryOne('SELECT * FROM shop WHERE accountid=:accountid AND coin_id=:id;',
@ -484,14 +511,14 @@ class ShopController{
':id' => $id ':id' => $id
)); ));
if ($row) { if ($row) {
$it = $this->getItem($id); $it = $this->getItem($id, $account_id);
if ($row['status'] != 2 && $row['active_time'] == 0 && $it['Isbug_again'] != 1) { if ($row['status'] != 2 && $row['active_time'] == 0 && $it['Isbug_again'] != 1) {
phpcommon\sendError(ERR_USER_BASE + 4, '商品已购买'); phpcommon\sendError(ERR_USER_BASE + 4, '商品已购买');
return; return;
} }
} }
//扣除货币 //扣除货币
$i = $this->getItem($id); $i = $this->getItem($id, $account_id);
$price = 0; $price = 0;
$num = 1; $num = 1;
if ($i['shop_type'] == 1) { if ($i['shop_type'] == 1) {
@ -624,7 +651,7 @@ class ShopController{
return; return;
} }
//增加奖励 //增加奖励
$p = $this->getParameter(REWARD_TIMES); $p = $this->getParameter(REWARD_TIMES, $account_id);
$times = $p['param_value'] - 1; $times = $p['param_value'] - 1;
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$addreward->addReward($item_id, $item_num * $times, $account_id, $time, 0); $addreward->addReward($item_id, $item_num * $times, $account_id, $time, 0);
@ -654,9 +681,9 @@ class ShopController{
$shop_list = array(); $shop_list = array();
$flush_times = 0; $flush_times = 0;
if ($_REQUEST['type'] == 3) { if ($_REQUEST['type'] == 3) {
$p = $this->getParameter(RAND_SHOP_GOLD); $p = $this->getParameter(RAND_SHOP_GOLD, $account_id);
if ($shop_type == 2) { if ($shop_type == 2) {
$p = $this->getParameter(RAND_DIAMONDSHOP_GOLD); $p = $this->getParameter(RAND_DIAMONDSHOP_GOLD, $account_id);
} }
$this->SubCoin($p['param_value'], $account_id, $_REQUEST['type']); $this->SubCoin($p['param_value'], $account_id, $_REQUEST['type']);
} }
@ -674,7 +701,7 @@ class ShopController{
return; return;
} }
if ($shop_type == 1) { if ($shop_type == 1) {
$p_flush = $this->getParameter(MAX_SHOP_REFRESH); $p_flush = $this->getParameter(MAX_SHOP_REFRESH, $account_id);
if ($p_flush['param_value'] <= $row['shop_flush_times']) { if ($p_flush['param_value'] <= $row['shop_flush_times']) {
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满'); phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
return; return;
@ -693,7 +720,7 @@ class ShopController{
$flush_times = $row['shop_flush_times'] + 1; $flush_times = $row['shop_flush_times'] + 1;
} }
if ($shop_type == 2) { if ($shop_type == 2) {
$p_flush = $this->getParameter(RAND_DIAMONDSHOP_TIME); $p_flush = $this->getParameter(RAND_DIAMONDSHOP_TIME, $account_id);
if ($p_flush['param_value'] <= $row['diamond_shop_flush_times']) { if ($p_flush['param_value'] <= $row['diamond_shop_flush_times']) {
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满'); phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
return; return;
@ -723,7 +750,7 @@ class ShopController{
return; return;
} }
unset($user_db['shop_list']); unset($user_db['shop_list']);
$shop_list = $this->randomShop($shop_type); $shop_list = $this->randomShop($shop_type, $account_id);
$user_db['shop_list'] = $shop_list; $user_db['shop_list'] = $shop_list;
$r -> set($shop_uuid, json_encode($user_db)); $r -> set($shop_uuid, json_encode($user_db));
$r -> pexpire($shop_uuid, 1000 * 3600 * 24); $r -> pexpire($shop_uuid, 1000 * 3600 * 24);
@ -741,17 +768,22 @@ class ShopController{
)); ));
} }
protected function randomShop($type) protected function randomShop($type, $accountid)
{ {
$shop_list = array(); $shop_list = array();
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_shop_cluster = require("../res/$channel/shop@shop.php");
} else {
$g_conf_shop_cluster = require('../res/shop@shop.php'); $g_conf_shop_cluster = require('../res/shop@shop.php');
}
$coin_len = 0; $coin_len = 0;
$diamond_len = 0; $diamond_len = 0;
$len = 0; $len = 0;
$id = 0; $id = 0;
for ($i = 1; $i <= count($g_conf_shop_cluster); $i++) for ($i = 1; $i <= count($g_conf_shop_cluster); $i++)
{ {
$s = $this->getShop($i); $s = $this->getShop($i, $accountid);
$coin_len++; $coin_len++;
} }
if ($type == 1) { if ($type == 1) {
@ -769,7 +801,7 @@ class ShopController{
$discount = 0; $discount = 0;
$price = 0; $price = 0;
$key = 0; $key = 0;
$s = $this->getShop($i); $s = $this->getShop($i, $accountid);
//确定商品id和数量 //确定商品id和数量
$weight_sum = 0; $weight_sum = 0;
$weight_array = $this->getExplode($s['item_weight']); $weight_array = $this->getExplode($s['item_weight']);

View File

@ -18,9 +18,14 @@ class SignController{
return $conn; return $conn;
} }
protected function getSign($sign_id) protected function getSign($sign_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_sign_cluster = require("../res/$channel/signDaily@signDaily.php");
} else {
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php'); $g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
}
$sign_conf = getSignConfig($g_conf_sign_cluster, $sign_id); $sign_conf = getSignConfig($g_conf_sign_cluster, $sign_id);
$s = array( $s = array(
'sign_id' => $sign_conf['sign_id'], 'sign_id' => $sign_conf['sign_id'],
@ -45,9 +50,17 @@ class SignController{
return $arr; return $arr;
} }
protected function getItem($item_id) protected function getItem($item_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$g_conf_item_cluster = require("../res/$channel/item@item.php");
} else {
$g_conf_item_cluster = require('../res/item@item.php'); $g_conf_item_cluster = require('../res/item@item.php');
}
$item_conf = getItemConfig($g_conf_item_cluster, $item_id); $item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array( $it = array(
'id' => $item_conf['id'], 'id' => $item_conf['id'],
@ -61,9 +74,14 @@ class SignController{
} }
protected function getSeason($season_id) protected function getSeason($season_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$season_meta_table = require("../res/$channel/season@season.php");
} else {
$season_meta_table = require('../res/season@season.php'); $season_meta_table = require('../res/season@season.php');
}
$season_meta = getSeasonConfig($season_meta_table, $season_id); $season_meta = getSeasonConfig($season_meta_table, $season_id);
$season = array( $season = array(
'number' => $season_meta['season_number'], 'number' => $season_meta['season_number'],
@ -73,9 +91,17 @@ class SignController{
return $season; return $season;
} }
protected function getSeasonPoint($seaPoint_id) protected function getSeasonPoint($seaPoint_id, $accountid)
{ {
$channel = phpcommon\extractChannel($accountid);
if (needSpecConfig($channel)) {
$seaPoint_meta_table = require("../res/$channel/seasomPoint@seasomPoint.php");
} else {
$seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php');
}
$seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id);
$seaPoint = array( $seaPoint = array(
'id' => $seaPoint_meta['id'], 'id' => $seaPoint_meta['id'],
@ -88,10 +114,18 @@ class SignController{
return $seaPoint; return $seaPoint;
} }
protected function getParameter($para_id) protected function getParameter($para_id, $accountid)
{ {
$g_conf_para_cluster = require('../res/parameter@parameter.php'); $channel = phpcommon\extractChannel($accountid);
$para_conf = getParameterConfig($g_conf_para_cluster, $para_id); if (needSpecConfig($channel)) {
$parameter_meta_cluster = require("../res/$channel/parameter@parameter.php");
} else {
$parameter_meta_cluster = require('../res/parameter@parameter.php');
}
$para_conf = getParameterConfig($parameter_meta_cluster, $para_id);
$p = array( $p = array(
'id' => $para_conf['id'], 'id' => $para_conf['id'],
'param_name' => $para_conf['param_name'], 'param_name' => $para_conf['param_name'],
@ -237,14 +271,22 @@ class SignController{
$week = ceil($rowUser['sign_sum'] / 7); $week = ceil($rowUser['sign_sum'] / 7);
$dayid = ($week - 1) * 7; $dayid = ($week - 1) * 7;
//如果大于配置表最后一周,按最后一周奖励 //如果大于配置表最后一周,按最后一周奖励
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_sign_cluster = require("../res/$channel/signDaily@signDaily.php");
} else {
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php'); $g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
}
if ($dayid + 1 > count($g_conf_sign_cluster)) { if ($dayid + 1 > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7; $dayid = count($g_conf_sign_cluster) - 7;
} }
//error_log($dayid); //error_log($dayid);
for ($day = $dayid + 1; $day <= $dayid + 7; $day++) for ($day = $dayid + 1; $day <= $dayid + 7; $day++)
{ {
$s = $this->getSign($day + 90000); $s = $this->getSign($day + 90000, $account_id);
array_push($item_list, array( array_push($item_list, array(
'item_id' => $s['item_id'], 'item_id' => $s['item_id'],
'item_num' => $s['num'], 'item_num' => $s['num'],
@ -307,12 +349,20 @@ class SignController{
$week = ceil($rowUser['sign_sum'] / 7); $week = ceil($rowUser['sign_sum'] / 7);
$dayid = ($week - 1) * 7 + $_REQUEST['sign_id']; $dayid = ($week - 1) * 7 + $_REQUEST['sign_id'];
//如果大于配置表最后一周,按最后一周奖励 //如果大于配置表最后一周,按最后一周奖励
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_sign_cluster = require("../res/$channel/signDaily@signDaily.php");
} else {
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php'); $g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
}
if ($dayid > count($g_conf_sign_cluster)) { if ($dayid > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7; $dayid = count($g_conf_sign_cluster) - 7;
} }
//$dayid = $_REQUEST['sign_id']; //$dayid = $_REQUEST['sign_id'];
$s = $this->getSign($dayid + 90000); $s = $this->getSign($dayid + 90000, $account_id);
$item_id_array = $this->getExplode($s['item_id']); $item_id_array = $this->getExplode($s['item_id']);
$num_array = $this->getExplode($s['num']); $num_array = $this->getExplode($s['num']);
$time_array = $this->getExplode($s['time']); $time_array = $this->getExplode($s['time']);
@ -397,13 +447,21 @@ class SignController{
$week = ceil($rowUser['sign_sum'] / 7); $week = ceil($rowUser['sign_sum'] / 7);
$dayid = ($week - 1) * 7 + $_REQUEST['sign_id']; $dayid = ($week - 1) * 7 + $_REQUEST['sign_id'];
//如果大于配置表最后一周,按最后一周奖励 //如果大于配置表最后一周,按最后一周奖励
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_sign_cluster = require("../res/$channel/signDaily@signDaily.php");
} else {
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php'); $g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
}
if ($dayid > count($g_conf_sign_cluster)) { if ($dayid > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7; $dayid = count($g_conf_sign_cluster) - 7;
} }
//$dayid = $_REQUEST['sign_id']; //$dayid = $_REQUEST['sign_id'];
$s = $this->getSign($dayid + 90000); $s = $this->getSign($dayid + 90000, $account_id);
$item_id_array = $this->getExplode($s['item_id']); $item_id_array = $this->getExplode($s['item_id']);
$num_array = $this->getExplode($s['num']); $num_array = $this->getExplode($s['num']);
$time_array = $this->getExplode($s['time']); $time_array = $this->getExplode($s['time']);
@ -636,20 +694,28 @@ class SignController{
$dayid = ($week - 1) * 7; $dayid = ($week - 1) * 7;
$day = $rowUser['sign_sum'] % 7; $day = $rowUser['sign_sum'] % 7;
//如果大于配置表最后一周,按最后一周奖励 //如果大于配置表最后一周,按最后一周奖励
$channel = phpcommon\extractChannel($account_id);
if (needSpecConfig($channel)) {
$g_conf_sign_cluster = require("../res/$channel/signDaily@signDaily.php");
} else {
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php'); $g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
}
if ($dayid + 1 > count($g_conf_sign_cluster)) { if ($dayid + 1 > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7; $dayid = count($g_conf_sign_cluster) - 7;
} }
$sign_sum = $rowUser['sign_sum']; $sign_sum = $rowUser['sign_sum'];
$item_num = 0; $item_num = 0;
$item_name = ''; $item_name = '';
$item = $this->getSign(90000 + $day + $dayid); $item = $this->getSign(90000 + $day + $dayid, $account_id);
if ($rowUser['sign_sum'] == 3) { if ($rowUser['sign_sum'] == 3) {
$item_name = '咸鱼套装(永久)'; $item_name = '咸鱼套装(永久)';
} else if ($rowUser['sign_sum'] == 7) { } else if ($rowUser['sign_sum'] == 7) {
$item_name = '神秘宝箱'; $item_name = '神秘宝箱';
} else { } else {
$it = $this->getItem($item['item_id']); $it = $this->getItem($item['item_id'], $account_id);
$item_name = $it['name']; $item_name = $it['name'];
$item_num = $item['num']; $item_num = $item['num'];
} }