| | |
| | | |
| | | $channelServerIDArray = array(); |
| | | $channelServerIniArray = array(); |
| | | $mixServerMap = array(); // 合服映射表 {mainServerID:[serverID, ...], ...} |
| | | foreach ($serverList as $serverInfo) { |
| | | $ServerID = $serverInfo["ServerID"]; |
| | | $ServerName = $serverInfo["ServerName"]; |
| | |
| | | } |
| | | $channelServerIniArray[$ServerName] = $optinArray; |
| | | array_push($channelServerIDArray, $ServerID); |
| | | |
| | | // 更新合服映射 |
| | | $mixMainServerID = $MainServerID > 0 ? $MainServerID : $ServerID; |
| | | if (!isset($mixServerMap[$mixMainServerID])) { |
| | | $mixServerMap[$mixMainServerID] = array(); |
| | | } |
| | | $mixServerIDList = $mixServerMap[$mixMainServerID]; |
| | | array_push($mixServerIDList, $ServerID); |
| | | $mixServerMap[$mixMainServerID] = $mixServerIDList; |
| | | } |
| | | |
| | | // 保存合服服务器映射表 |
| | | file_put_contents(GetServerMix($channel), json_encode($mixServerMap)); |
| | | |
| | | $serverIniFile = dirname(__FILE__) . "\\..\\Account\\Server\\Server_" . $channel . ".ini"; |
| | | // echo '$serverIniFile:', $serverIniFile, "<br/>"; |
| | |
| | | return $PlayerCenterRoot . "/Common/servergroup/" . $Channel . ".json"; |
| | | } |
| | | |
| | | // 合服映射表 |
| | | function GetServerMix($Channel) |
| | | { |
| | | if (!\CommFunc\GetConfig("ServerInfo", "PlayerCenterRoot", $PlayerCenterRoot)) { |
| | | return ""; |
| | | } |
| | | return $PlayerCenterRoot . "/Common/servermix/MixServerMap_" . $Channel . ".json"; |
| | | } |
| | | |
| | | function GetCommonServerlistJsonFileName($Channel, $JsonBranch) |
| | | { |
| | | $gameName = \CommFunc\GetGameName(); |