Commit 690dcea4 authored by luluxia's avatar luluxia

update: 更新新前端接口内容;

parent e697083b
......@@ -412,6 +412,18 @@
}
return $check;
}
/** 合并物品列表 */
function mergeList() {
$sameitem = array();
for ($i=1; $i<=6; $i++) {
global $itm0, $itme0;
global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i};
if (${'itms'.$i} && ($itm0 == ${'itm'.$i}) && ($itme0 == ${'itme'.$i}) && (preg_match('/^(H|P)/',${'itmk'.$i}))) {
$sameitem[] = 'item'.$i;
}
}
return $sameitem;
}
echo (json_encode(array(
"page" => "game",
/** 玩家状态 */
......@@ -464,7 +476,7 @@
/** 当前称号 */
"nowGiftId" => $club,
/** 可选称号 */
"giftList" => $clubavl,
"giftList" => !$club ? array_merge(valid_getclublist_t2($udata), valid_getclublist_t1($udata)) : null,
/** 称号类型 */
"type" => $clubinfo,
),
......@@ -494,6 +506,13 @@
/** 姿态tips */
"tips" => $posetips,
),
/** 战术界面 */
"horizon" => array(
/** 当前战术界面id */
"nowHorizonId" => $horizon,
/** 可选战术界面 */
"type" => $horizoninfo,
),
/** 攻击力 */
"attack" => $atkinfo,
/** 防御力 */
......@@ -753,6 +772,7 @@
"quality" => $itme0,
"durability" => $itms0,
"canMerge" => checkMerge(),
"mergeList" => mergeList(),
) : null,
/** 发现敌人 */
"findEnemy" => $tdata['nameinfo'] ? array(
......@@ -795,7 +815,7 @@
/** 敌方道具 */
"items" => $battle_title === "发现尸体" ? getCorpseItems($tdata) : null,
/** 敌方技能 */
"skill" => $tdata['clbpara']['skill'] ? getEnemySkillPage($tdata) : null,
"skill" => isset($tdata['clbpara']['skill']) ? getEnemySkillPage($tdata) : null,
/** 战斗技能 */
"battleSkills" => $battle_skills ? getBattleSkills($battle_skills) : null,
) : null,
......
......@@ -791,7 +791,7 @@ $jgamedata = compatible_json_encode($gamedata);
//$json = new Services_JSON();
//$jgamedata = $json->encode($gamedata);
//if(!strstr($_SERVER['HTTP_REFERER'], 'php')) {
if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if (isset($_GET['is_new'])) {
include './api.php';
} else {
echo $jgamedata;
......
......@@ -170,7 +170,7 @@ if(isset($opendialog))
}
//if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if ($udata['u_templateid'] == 1 && !strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if (isset($_GET['is_new'])) {
include './api.php';
} else {
include template('game');
......
......@@ -61,13 +61,25 @@ if(!isset($cmd)){
if(isset($error)){$gamedata['innerHTML']['error'] = $error;}
ob_clean();
$jgamedata = compatible_json_encode($gamedata);
echo $jgamedata;
if (isset($_GET['is_new'])) {
echo json_encode(array(
"info" => $gamedata['innerHTML']['info'],
));
} else {
echo $jgamedata;
}
ob_end_flush();
}else{
ob_clean();
if(isset($error)){$gamedata['innerHTML']['error'] = $error;}
$jgamedata = compatible_json_encode($gamedata);
echo $jgamedata;
if (isset($_GET['is_new'])) {
echo json_encode(array(
"info" => $gamedata['innerHTML']['info'],
));
} else {
echo $jgamedata;
}
ob_end_flush();
}
}
......
......@@ -327,10 +327,11 @@ if($mode == 'enter') {
$select_icon = $icon;
if (isset($_GET['is_new'])) {
// 获取可选称号
$nickList = array_map(function($val) use ($titles_list) {
$nickList = array_map(function($val) use ($titles_list, $title_desc) {
return array(
'id' => $val,
'title' => $titles_list[$val]
'title' => $titles_list[$val],
'desc' => $title_desc[$val]['title'],
);
}, $nicksrev['nicks']);
// 获取可选普通内定称号
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment