From ecc3290117ef7cab11919acd7da0fb4c90710417 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 09 四月 2025 15:54:51 +0800
Subject: [PATCH] 10367 【越南】【英语】【BT】【砍树】仙盟攻城战-服务端(查询区服仙盟;跨服仙盟攻城战相关榜单;)

---
 Common/CommFunc.php                                |   38 +++++++++
 GMToolClient/GMTManage/GMT_QueryBillboardCross.php |    4 
 index.php                                          |    1 
 Common/GMTRetCode.php                              |   17 ++++
 GMToolClient/queryFamilyByServerID.php             |  133 +++++++++++++++++++++++++++++++++
 GMToolClient/cfg/GMT_QueryBillboardCross.php       |    6 +
 Account/User.php                                   |    2 
 7 files changed, 200 insertions(+), 1 deletions(-)

diff --git a/Account/User.php b/Account/User.php
index 4811297..2bdc12e 100644
--- a/Account/User.php
+++ b/Account/User.php
@@ -67,6 +67,7 @@
 					Permission::P_GetPlayerForbid => array("Name" => \Lang\gettext("鏌ヨ鐜╁灏佺鐘舵��"), "GMTKey1" => array("GMT_GetPlayerForbid")),
 					Permission::P_GetForbidInfo => array("Name" => \Lang\gettext("鏌ヨ鍏ㄦ湇灏佺鍚嶅崟"), "GMTKey1" => array("GMT_GetForbidInfo")),
 					Permission::P_GetPlayerInfo => array("Name" => \Lang\gettext("鏌ヨ鐜╁"), "GMTKey1" => array("GMT_GetPlayerInfo", "GMT_PlayerItemInfo")),
+					Permission::P_GetFamilyByServerID => array("Name" => \Lang\gettext("鏌ヨ鍖烘湇浠欑洘"), "GMTKey1" => array("GMT_GetFamilyByServerID")),
 					Permission::P_GetFamilyInfo => array("Name" => \Lang\gettext("鏌ヨ浠欑洘"), "GMTKey1" => array("GMT_GetFamilyInfo")),
 					Permission::P_FamilyTransfer => array("Name" => \Lang\gettext("杞浠欑洘"), "GMTKey1" => array("GMT_FamilyTransfer"), "Log" => array("GMT_FamilyTransfer")),
 					Permission::P_FamilyDismiss => array("Name" => \Lang\gettext("瑙f暎浠欑洘"), "GMTKey1" => array("GMT_FamilyDismiss"), "Log" => array("GMT_FamilyDismiss")),
@@ -248,6 +249,7 @@
 	const P_GetForbidInfo = "P_GetForbidInfo";
 	const P_GetPlayerInfo = "P_GetPlayerInfo";
 	const P_GetFamilyInfo = "P_GetFamilyInfo";
+	const P_GetFamilyByServerID = "P_GetFamilyByServerID";
 	const P_FamilyTransfer = "P_FamilyTransfer";
 	const P_FamilyDismiss = "P_FamilyDismiss";
 	const P_QueryBillboard = "P_QueryBillboard";
diff --git a/Common/CommFunc.php b/Common/CommFunc.php
index cca777b..43aa0f0 100644
--- a/Common/CommFunc.php
+++ b/Common/CommFunc.php
@@ -1494,3 +1494,41 @@
 	}
 	// \Logging\LogInfo("find:" . json_encode($find));
 }
+
+// 缁勫悎鏈嶅姟鍣↖D鍒楄〃锛屾惌閰� common.js AddServerIDCondition 浣跨敤
+function MatchServerIDList(&$serverIDCondArray, &$serverIDList)
+{
+	if (!isset($serverIDCondArray)) {
+		$serverIDCondArray = array();
+	}
+	if (!isset($serverIDList)) {
+		$serverIDList = array();
+	}
+	$serverIDCondNumMax = 20;
+	for ($i = 1; $i < $serverIDCondNumMax + 1; $i++) {
+		if (!array_key_exists("ServerIDGTE" . $i, $_POST)) {
+			continue;
+		}
+		$eValue = intval($_POST["ServerIDE" . $i]);
+		$gteValue = intval($_POST["ServerIDGTE" . $i]);
+		$lteValue = intval($_POST["ServerIDLTE" . $i]);
+		// \Logging\LogInfo("serverIDCond." . $i . " : eValue:" . $eValue . " gteValue:" . $gteValue . " lteValue:" . $lteValue);
+		if ($eValue <= 0 && $gteValue <= 0 && $lteValue <= 0) {
+			continue;
+		}
+		if ($gteValue > 0 && $lteValue > 0 && $gteValue > $lteValue) {
+			continue;
+		}
+		if ($eValue > 0) {
+			array_push($serverIDList, array($eValue, $eValue));
+		}
+		if ($gteValue > 0 && $lteValue > 0) {
+			array_push($serverIDList, array($gteValue, $lteValue));
+		} else if ($gteValue > 0) {
+			array_push($serverIDList, array($gteValue, 10000));
+		} else if ($lteValue > 0) {
+			array_push($serverIDList, array(1, $lteValue));
+		}
+		array_push($serverIDCondArray, array($eValue, $gteValue, $lteValue));
+	}
+}
diff --git a/Common/GMTRetCode.php b/Common/GMTRetCode.php
index c20051d..aa33bf5 100644
--- a/Common/GMTRetCode.php
+++ b/Common/GMTRetCode.php
@@ -66,3 +66,20 @@
     }
     return $msg;
 }
+
+function ParseResult($ret, &$retMsg)
+{
+    if (!isset($ret)) {
+        return "閿欒 => 杩斿洖绌�";
+    }
+    if (array_key_exists("ResultType", $ret)) {
+        if ($ret["ResultType"] != 0) {
+            return "ResultType閿欒 => " . GetResultTypeMsg($ret["ResultType"]) . " (" . $ret["ResultType"] . ")";
+        }
+        $retMsg = $ret["ResultMsg"];
+        return "";
+    } else if (array_key_exists("ErrorNo", $ret)) {
+        return "ErrorNo閿欒 => " . GetErrorNoMsg($ret["ErrorNo"]) . " (" . $ret["ErrorNo"] . ")";
+    }
+    return "鏈煡閿欒";
+}
diff --git a/GMToolClient/GMTManage/GMT_QueryBillboardCross.php b/GMToolClient/GMTManage/GMT_QueryBillboardCross.php
index 5eb8475..4362ccf 100644
--- a/GMToolClient/GMTManage/GMT_QueryBillboardCross.php
+++ b/GMToolClient/GMTManage/GMT_QueryBillboardCross.php
@@ -73,7 +73,9 @@
 	}
 	return ($a[1] < $b[1]) ? -1 : 1;
 }
-usort($groupList, 'cmp');
+if ($groupList) {
+	usort($groupList, 'cmp');
+}
 ?>
 
 <br />
diff --git a/GMToolClient/cfg/GMT_QueryBillboardCross.php b/GMToolClient/cfg/GMT_QueryBillboardCross.php
index aebe450..3136f4f 100644
--- a/GMToolClient/cfg/GMT_QueryBillboardCross.php
+++ b/GMToolClient/cfg/GMT_QueryBillboardCross.php
@@ -32,6 +32,12 @@
 		'164' => array('BBName' => \Lang\gettext('璺ㄦ湇楠戝疇鍏绘垚'), 'CmpValue' => \Lang\gettext('绉垎')),
 		'165' => array('BBName' => \Lang\gettext('璺ㄦ湇绔炴妧鍦�'), 'CmpValue' => \Lang\gettext('绉垎'), 'Value2' => \Lang\gettext('娈典綅')),
 		'166' => array('BBName' => \Lang\gettext('璺ㄦ湇鐐煎櫒澶т細'), 'CmpValue' => \Lang\gettext('绉垎'), 'CmpValue2' => \Lang\gettext('鏈�楂樼瓑绾�')),
+		'167' => array('BBName' => \Lang\gettext('浠欑洘鏀诲煄鎴樹粰鐩熺Н鍒�'), 'CmpValue' => \Lang\gettext('绉垎')),
+		'168' => array('BBName' => \Lang\gettext('浠欑洘鏀诲煄鎴樼帺瀹朵激瀹�'), 'CmpValue' => \Lang\gettext('浼ゅ浜块儴鍒�'), 'CmpValue2' => \Lang\gettext('浼ゅ')),
+		'169' => array(
+			'BBName' => \Lang\gettext('浠欑洘鏀诲煄鎴樿疆娆′激瀹�'), 'CmpValue' => \Lang\gettext('浼ゅ浜块儴鍒�'), 'CmpValue2' => \Lang\gettext('浼ゅ'),
+			'Name1' => \Lang\gettext('浠欑洘鍚�'), 'ID2' => \Lang\gettext('鐩熶富ID'), 'Name2' => \Lang\gettext('鐩熶富'), 'Value5' => \Lang\gettext('鐩熸湇鍔″櫒ID')
+		),
 	);
 	return $billboardCh;
 }
diff --git a/GMToolClient/queryFamilyByServerID.php b/GMToolClient/queryFamilyByServerID.php
new file mode 100644
index 0000000..6403113
--- /dev/null
+++ b/GMToolClient/queryFamilyByServerID.php
@@ -0,0 +1,133 @@
+锘�<?php
+include_once "/Account/User.php";
+include_once "/language/lang.php";
+include_once "/Common/CommFunc.php";
+include_once "/Common/Logging.php";
+include_once "/Common/GMTRetCode.php";
+
+\Logging\CreateLogging("queryFamilyByServerID.php");
+$Permission = \User\Permission::P_GetFamilyByServerID;
+$spid = $_SESSION['spid'];
+$serverID = $_SESSION['serverID'];
+$user = new \User\User($_SESSION['UserAccount']);
+if (!$user->HavePermission($Permission)) {
+    exit;
+}
+\Logging\LogInfo("_SESSION:" . print_r($_SESSION, true));
+\Logging\LogInfo("_POST:" . print_r($_POST, true));
+
+\CommFunc\MatchServerIDList($serverIDCondArray, $serverIDList);
+\Logging\LogInfo("serverIDCondArray:" . print_r($serverIDCondArray, true));
+\Logging\LogInfo("serverIDList:" . print_r($serverIDList, true));
+
+$dataArray = null;
+$totalCnt = 0;
+if ($_POST["submit"]) {
+    $queryCnt = $_POST["queryCnt"];
+    $packData = array(
+        "serverIDList" => json_encode($serverIDList),
+        "queryCnt" => $queryCnt,
+    );
+    $retList = \CommFunc\SendGMTToGameServers(False, "GMT_GetFamilyByServerID", $packData, $spid, array($serverID));
+    \Logging\LogInfo("retList:" . print_r($retList, true));
+    if (!is_array($retList)) {
+        echo "杩斿洖閿欒锛屾病鏈夎繑鍥炰俊鎭�";
+        exit;
+    }
+
+    $ret = json_decode($retList[$serverID], true);
+    $errStr = ParseResult($ret, $retMsg);
+    if ($errStr != "") {
+        echo $errStr;
+        exit;
+    }
+    $dataArray = $retMsg["familyList"];
+    $totalCnt = $retMsg["totalCnt"];
+}
+
+//鏄剧ず琛ㄦ牸瀛楁閰嶇疆 key-鍙傛暟鍚嶏紝value-璇存槑
+$tableArray = array(
+    "Num" => array(\Lang\gettext("鎺掑悕"), "3%", "center"),
+    "ID" => array(\Lang\gettext("浠欑洘ID"), "5%", "center"),
+    "Name" => array(\Lang\gettext("浠欑洘鍚�"), "9%", "center"),
+    "FightPower" => array(\Lang\gettext("鎬绘垬鍔�"), "9%", "center"),
+    "LeaderID" => array(\Lang\gettext("鐩熶富ID"), "5%", "center"),
+    "LeaderName" => array(\Lang\gettext("鐩熶富鍚�"), "9%", "center"),
+    "LV" => array(\Lang\gettext("浠欑洘绛夌骇"), "3%", "center"),
+    "MemberCnt" => array(\Lang\gettext("鎴愬憳鏁�"), "3%", "center"),
+    "OnLineCnt" => array(\Lang\gettext("鍦ㄧ嚎鏁�"), "3%", "center"),
+    "ServerID" => array(\Lang\gettext("鍖烘湇ID"), "5%", "center"),
+);
+
+?>
+
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <title><?php echo \Lang\gettext("鏌ヨ鍖烘湇浠欑洘"); ?></title>
+    <link rel="stylesheet" type="text/css" href="/css/table.css">
+    <link rel="stylesheet" type="text/css" href="/css/button.css">
+    <link rel="gettext" type="application/x-po" href="../language/<?php echo \Lang\getLang(); ?>/LC_MESSAGES/<?php echo \Lang\getjspodomain(); ?>.po" />
+</head>
+
+<body>
+
+    <form method="post">
+
+        <center>
+            <dt><b><?php echo \Lang\gettext("鏌ヨ鍖烘湇浠欑洘"); ?></b></dt>
+        </center>
+        &nbsp;&nbsp;<input type="button" value="娣诲姞鏈嶅姟鍣↖D鏉′欢" onclick="AddServerIDCondition('', '', '')" />
+        &nbsp;&nbsp;<input type="button" value="閲嶇疆鏉′欢" onclick="ResetServerIDCondition()" />
+        &nbsp;&nbsp;<input type="number" name="queryCnt" value="100" />
+        &nbsp;&nbsp;<input type="submit" name="submit" value="<?php echo \Lang\gettext("鏌ヨ"); ?>" />
+        <div id="ServerIDCondition"></div>
+        <hr />
+        <?php
+        if (isset($dataArray)) {
+            echo "浠欑洘鎬绘暟: " . $totalCnt;
+            echo '<table width="100%">';
+            echo "<thead><tr>";
+            foreach ($tableArray as $value) {
+                echo "<th width=\"" . $value[1] . "\">" . $value[0] . "</td>";
+            }
+            echo "</tr></thead>";
+            $Num = $skip;
+            foreach ($dataArray as $info) {
+                $Num += 1;
+                echo "<tr class='trc'>";
+                foreach ($tableArray as $key => $value) {
+                    if (!$key) {
+                        continue;
+                    }
+                    $tdContent = $info[$key];
+                    if ($key == "Num") {
+                        $tdContent = $Num;
+                    }
+                    echo "<td align='" . $value[2] . "' style=\"display:table-cell; vertical-align:middle\">";
+                    echo "<div id='" . $key . "_" . $Num . "'>" . $tdContent . "</div>";
+                    echo "</td>";
+                }
+                echo "</tr>";
+            }
+            echo '</table>';
+            echo '<hr />';
+        } else if ($_POST["submit"]) {
+            echo \Lang\gettext("鏆傛棤鏁版嵁"), "<br/>";
+        }
+        ?>
+    </form>
+
+    <script type='text/javascript' src='/language/gettext.js'></script>
+    <script type='text/javascript' src="/js/common.js"></script>
+    <script type="text/javascript">
+        window.onload = function() {
+            LoadServerIDCondition('<?php echo json_encode($serverIDCondArray); ?>');
+
+        }
+    </script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/index.php b/index.php
index 44ca415..ff52948 100644
--- a/index.php
+++ b/index.php
@@ -72,6 +72,7 @@
 		array(\User\Permission::P_GetPlayerForbid, "GMToolClient/queryPunishInfo.php", \Lang\gettext("鏌ヨ鐜╁灏佺鐘舵��")),
 		array(\User\Permission::P_GetForbidInfo, "GMToolClient/queryServerPunishInfo.php", \Lang\gettext("鏌ヨ鍏ㄦ湇灏佺鍚嶅崟")),
 		array(\User\Permission::P_GetPlayerInfo, "GMToolClient/queryPlayerInfo.php", \Lang\gettext("鏌ヨ鐜╁")),
+		array(\User\Permission::P_GetFamilyByServerID, "GMToolClient/queryFamilyByServerID.php", \Lang\gettext("鏌ヨ鍖烘湇浠欑洘")),
 		array(\User\Permission::P_GetFamilyInfo, "GMToolClient/queryFamilyInfo.php", \Lang\gettext("鏌ヨ浠欑洘")),
 		array(\User\Permission::P_FamilyTransfer, "GMToolClient/familyTransfer.php", \Lang\gettext("杞浠欑洘")),
 		array(\User\Permission::P_FamilyDismiss, "GMToolClient/familyDismiss.php", \Lang\gettext("瑙f暎浠欑洘")),

--
Gitblit v1.8.0