<?php
|
include_once '/Common/CommFunc.php';
|
include_once '/Common/Logging.php';
|
include_once "/Common/ServerOPS.php";
|
|
header("Content-type: text/html; charset=utf-8");
|
|
\Logging\CreateLogging("center.server_list.php");
|
// ?game=xbqy&flag=test_1_1.100.1
|
// \Logging\LogInfo("_GET: " . print_r($_GET, true));
|
|
$game = $_GET["game"];
|
$flag = $_GET["flag"];
|
|
$gameName = \CommFunc\GetGameName();
|
if ($game != $gameName || !$flag) {
|
\Logging\LogError("param error!" . print_r($_GET, true));
|
exit;
|
}
|
|
$flagInfo = explode("_", $flag);
|
if (count($flagInfo) != 3) {
|
\Logging\LogError("flag error!" . print_r($_GET, true));
|
exit;
|
}
|
|
$channel = $flagInfo[0];
|
$branch = intval($flagInfo[1]);
|
$versioncode = $flagInfo[2];
|
|
$VersionState = 0;
|
$JsonBranch = 0;
|
// 优先读指定版本信息
|
if (\DBOper\FindOne("GameVersion", array("Channel" => $channel, "BranchNum" => $branch, "Version" => $versioncode), $versionInfo)) {
|
$VersionState = $versionInfo["VersionState"] ? intval($versionInfo["VersionState"]) : 0;
|
}
|
|
// 版本状态
|
if ($VersionState > 0 && \DBOper\FindOne("GameVersionState", array("Channel" => $channel, "BranchNum" => $branch, "VersionState" => $VersionState), $stateInfo)) {
|
$JsonBranch = $stateInfo["JsonBranch"];
|
}
|
// 没有指定版本,默认取分支信息
|
else if (DBOper\FindOne("GamePackBranch", array("Channel" => $channel, "BranchNum" => $branch), $branchData)) {
|
$JsonBranch = $branchData["JsonBranch"];
|
}
|
|
if ($JsonBranch <= 0) {
|
\Logging\LogError("db JsonBranch value not set! channel:" . $channel . " branch:" . $branch . " versioncode:" . $versioncode);
|
exit;
|
}
|
|
$jsonFile = \ServerOPS\GetCommonServerlistJsonFileName($channel, $JsonBranch);
|
|
// http://pub.game.secondworld.net.cn:11000/common/xbqy_test.json||http://pub.game.secondworld.net.cn:11000/region_player/?game=xbqy&channel=test&branch=1
|
// 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
|
|
$httpHost = 'http://' . $_SERVER['HTTP_HOST'];
|
|
$ret = $httpHost . "/Common/serverjson/" . $jsonFile . "||"
|
. $httpHost . "/center/region_player.php?game=" . $game . "&channel=" . $channel . "&branch=" . $branch;
|
|
echo $ret;
|
exit;
|