From 97830745ea29613aca81e9e8c4f9d0539e6cb136 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 23 十月 2024 11:24:40 +0800
Subject: [PATCH] 10162 后台优化(修改合服主服支持勾选同步修改为主服地址;刷新服务器增加导出合服表;)
---
Common/ServerOPS.php | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/Common/ServerOPS.php b/Common/ServerOPS.php
index bf9b4e6..6478fb2 100644
--- a/Common/ServerOPS.php
+++ b/Common/ServerOPS.php
@@ -70,6 +70,7 @@
$channelServerIDArray = array();
$channelServerIniArray = array();
+ $mixServerMap = array(); // 鍚堟湇鏄犲皠琛� {mainServerID:[serverID, ...], ...}
foreach ($serverList as $serverInfo) {
$ServerID = $serverInfo["ServerID"];
$ServerName = $serverInfo["ServerName"];
@@ -90,7 +91,19 @@
}
$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/>";
@@ -273,6 +286,15 @@
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();
--
Gitblit v1.8.0