| | |
| | | \Logging\LogError("game server clearState error." . print_r($serverInfo, true)); |
| | | continue; |
| | | } |
| | | |
| | | // 进一步检查最新服务器开服状态是否正常 |
| | | $checkUrl = 'http://' . $_SERVER['HTTP_HOST'] . "/serverops/checkOpenServer.php"; |
| | | $retStr = \CommFunc\DoGet($checkUrl, array("channel" => $Channel, "serverID" => $ServerID)); |
| | | $checkRet = json_decode($retStr, true); |
| | | if (!isset($checkRet) || !array_key_exists("errMsg", $checkRet) || $checkRet["errMsg"] != "OK") { |
| | | \Logging\LogError("checkOpenServer error. Channel:" . $Channel . " ServerID:" . $ServerID . " ret:" . print_r($checkRet, true)); |
| | | continue; |
| | | } |
| | | $JsonBranch = $serverInfo["JsonBranch"]; |
| | | |
| | | $find = array("Channel" => $Channel, "ServerID" => $ServerID); |
| | | $set = array( |
| | | "RunningStatus" => \ServerOPS\ServerRunningStatus::Light, |
| | | "Statue" => \ServerOPS\ServerStatue::Open, |
| | | "Recommend" => 1, // 新开放入口服默认推荐 |
| | | ); |
| | | if (\DBOper\Update("GameServers", $find, $set)) { |
| | | \Logging\LogInfo("set server open ok." . print_r($serverInfo, true)); |
| | | // 其他服设置为不推荐 |
| | | \DBOper\Update("GameServers", array( |
| | | "Channel" => $Channel, |
| | | "ServerID" => array('$nin' => array($ServerID)) |
| | | ), array("Recommend" => 0), false, false, true); |
| | | } else { |
| | | \Logging\LogError("set server open error." . print_r($serverInfo, true)); |
| | | } |