Example #1
0
 function createMenu($access_token)
 {
     $cJSON = self::menuData();
     $BackRes = PostData("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" . $access_token, $cJSON);
     $BackAy = json_decode($BackRes, true);
     if ($BackAy["errcode"] == 0) {
         echo "菜单设置成功!";
     } else {
         echo "菜单设置失败!";
     }
     exit;
 }
Example #2
0
function Main()
{
    echo Date("Y-m-d h:i:s") . "==============================\n";
    global $tbl_gm_db, $tbl_serv_db, $tbl_game_server;
    $dbinfo = $tbl_gm_db[0];
    $Conn = mysql_connect($dbinfo[2], $dbinfo[0], $dbinfo[1]);
    mysql_select_db($dbinfo[3], $Conn);
    mysql_query("delete from tbl_rush_role_servers where rrs_dEndDate < curdate()") or print mysql_error();
    $query = "select rrs_uServerId from tbl_rush_role_servers";
    $result = mysql_query($query) or print mysql_error();
    while ($row = mysql_fetch_row($result)) {
        echo "Server: " . $row[0] . "\t" . $tbl_game_server[$row[0]][2] . "\n";
        $dbinfo = $tbl_serv_db[$row[0]];
        $Conn = mysql_connect($dbinfo[2], $dbinfo[0], $dbinfo[1]);
        mysql_select_db($dbinfo[3], $Conn);
        $qs = "select sc_sVarValue from tbl_conf_server where sc_sVarName = 'MaxRushRoleNumPerCamp' and sc_sVarValue < (select ceil(sc_sVarValue)/3 from tbl_conf_server where sc_sVarName = 'MaxRushRoleNumPerServer')";
        $rs = mysql_query($qs) or print mysql_error();
        if ($r = mysql_fetch_row($rs)) {
            echo "MaxRushRoleNumPerCamp: " . $r[0] . "\n";
            $Camp = $r[0];
        } else {
            echo "MaxRushRoleNumPerCamp > 1/3 MaxRushRoleNumPerServer.\n";
            continue;
        }
        $qs = "select cs.cs_uCamp, count(*) c from tbl_char c, tbl_char_static cs where c.cs_uId = cs.cs_uId group by cs.cs_uCamp having c >= " . $Camp;
        $rs = mysql_query($qs) or print mysql_error();
        if (mysql_num_rows($rs) < 2) {
            echo "Only [" . mysql_num_rows($rs) . "] Camp(s) with MaxRushRoleNumPerCamp.\n";
            continue;
        }
        $qs = "select cs.cs_uCamp, count(*) c from tbl_char c, tbl_char_static cs where c.cs_uId = cs.cs_uId group by cs.cs_uCamp having c > " . ($Camp - 800);
        $rs = mysql_query($qs) or print mysql_error();
        if (mysql_num_rows($rs) < 3) {
            echo "Only [" . mysql_num_rows($rs) . "] Camps with MaxRushRoleNumPerCamp - 800.\n";
            continue;
        }
        echo "Need to change args:\n";
        $param = array();
        $param["name"] = "MaxRushRoleNumPerCamp";
        $param["value"] = $Camp + 500;
        echo "Number: " . $param["value"] . "\n";
        echo "Result: " . PostData($tbl_game_server[$row[0]][0], $tbl_game_server[$row[0]][1], "SetConfServer", $param) . "\n\n";
    }
}
Example #3
0
function CancelForbidTalk()
{
    $qs = "select * from tbl_forbid_talk where end_date < now()";
    $result = mysql_query($qs);
    while ($row = mysql_fetch_row($result)) {
        $id = $row[0];
        $role_name = $row[1];
        $channel_id = $row[2];
        $serv_id = $row[4];
        $param = array();
        global $tbl_game_server;
        $gas_host = $tbl_game_server[$serv_id][0];
        $gas_port = $tbl_game_server[$serv_id][1];
        $param["role_name"] = $role_name;
        $param["channel_id"] = $channel_id;
        $ret .= PostData($gas_host, $gas_port, "CancelShutUp", $param);
        mysql_query("delete from tbl_forbid_talk where id = {$id}") or print mysql_error();
        echo "Cancel Forbid Talk: \tServer:" . $serv_id . "\tRole Name:" . $role_name . "\tChannel:" . $channel_id . "\n";
    }
}
Example #4
0
function GetBackEquipFun($var, $gm)
{
    $attr = $var["attr"];
    $item_type = intval($var["item_type"]);
    $server_id = intval($var["serverid"]);
    $role_name = $var["role_name"];
    $reason = $var["reason"];
    $attr_array = explode(";", $attr);
    $temp = explode(",", $attr_array[0]);
    $item_name = $temp[0];
    $item_type = $temp[1];
    $item_id = $temp[2];
    $param = array();
    $param["role_name"] = $role_name;
    $param["item_name"] = UTF82Local($item_name);
    $param["item_type"] = $item_type;
    SetParamInfo($param, explode(",", $attr_array[1]), "St");
    SetParamInfo($param, explode(",", $attr_array[2]), "SA");
    SetParamInfo($param, explode(",", $attr_array[3]), "Ad");
    SetParamInfo($param, explode(",", $attr_array[4]), "Ar1");
    SetParamInfo($param, explode(",", $attr_array[5]), "Ar2");
    SetParamInfo($param, explode(",", $attr_array[6]), "Ar3");
    SetParamInfo($param, explode(",", $attr_array[7]), "Ar4");
    SetParamInfo($param, explode(",", $attr_array[8]), "In");
    SetParamInfo($param, explode(",", $attr_array[9]), "IAA");
    SetParamInfo($param, explode(",", $attr_array[10]), "Du");
    SetParamInfo($param, explode(",", $attr_array[11]), "Bd");
    SetParamInfo($param, explode(",", $attr_array[12]), "Su");
    global $tbl_game_server;
    $gas_host = $tbl_game_server[$server_id][0];
    $gas_port = $tbl_game_server[$server_id][1];
    $ret = PostData($gas_host, $gas_port, "GetBackEquip", $param);
    $action = array("role_name" => $role_name, "type" => $item_type, "item" => $item_name, "item_id" => $item_id, "reason" => $reason);
    if (intval($ret) != 200) {
        PrintNotice(LogInfo($action, false, $ret));
        BackAndRefresh($tbl_sys_msg["success"]);
        return true;
    }
    if (LogGMCommand($gm, $var["action_name"], $action, $server_id)) {
        PrintNotice(LogInfo($action, true));
        BackAndRefresh($tbl_sys_msg["success"]);
        return true;
    }
    return false;
}
Example #5
0
 /**
  * 名称:  删除用户
  */
 public function delAction()
 {
     Yaf_Dispatcher::getInstance()->autoRender(FALSE);
     $userinfo = PostData($this->UserDel_Url, array('ids' => $_GET['id']));
     echo json_encode(array('status' => 1, 'msg' => "ok"));
 }
Example #6
0
function UpdateJointSalesList()
{
    global $tbl_serv_partition;
    foreach ($tbl_serv_partition[$_REQUEST["gameId"]] as $group) {
        foreach ($group as $server) {
            PostData($server[0], $server[1], "UpdateJointSalesList", array());
        }
    }
}
Example #7
0
function CancelUserTrust($var, $gm)
{
    $role_name = $var["role_name"];
    $reason = $var["reason"];
    $serverid = $var["serverid"];
    $param = array();
    $param["role_name"] = $role_name;
    $action = array("role_name" => $role_name, "reason" => $reason);
    global $tbl_game_server;
    $gas_host = $tbl_game_server[$serverid][0];
    $gas_port = $tbl_game_server[$serverid][1];
    $ret = PostData($gas_host, $gas_port, "CancelUserTrust", $param);
    if (intval($ret) != 200) {
        PrintNotice(LogInfo($action, false, $ret));
        BackAndRefresh();
        return true;
    }
    if (LogGMCommand($gm_name, $var["action_name"], $action, $serverid)) {
        PrintNotice(LogInfo($action, true));
        BackAndRefresh();
        return true;
    }
    return false;
}
Example #8
0
function ChangeTongLevel($var, $gm)
{
    global $tbl_game_server;
    $level = $var["new_name"];
    $id = $var["id"];
    $serverid = $var["serverid"];
    $reason = $var["reason"];
    $row = mysql_fetch_row(MySQLQuery("select t_sName from tbl_tong where t_uId = {$id}", "Game", $serverid));
    $tong_name = $row[0];
    $param = array();
    $param["id"] = $id;
    $param["level"] = $level;
    $gas_host = $tbl_game_server[$serverid][0];
    $gas_port = $tbl_game_server[$serverid][1];
    $ret = PostData($gas_host, $gas_port, "ChangeTongLevel", $param);
    $action = array("tong" => $tong_name, "level" => $level, "reason" => $reason);
    if (intval($ret) != 200) {
        PrintNotice(LogInfo($action, false, $ret));
        BackAndRefresh();
        return true;
    }
    if (LogGMCommand($gm, $var["action_name"], $action, $serverid)) {
        PrintNotice(LogInfo($action, true));
        BackAndRefresh();
        return true;
    }
    return false;
}
Example #9
0
function NpcInfo($var, $gm)
{
    if ($var["serverindex"] == null || $var["serverindex"] == "") {
        $ret = eachServerFrame($var, $gm);
        return $ret;
    }
    global $tbl_npc_info, $tbl_camp, $bid2type, $tbl_jifen, $tbl_sys_msg, $page_main;
    $gm_name = mysql_escape_string($gm);
    $serverid = intval($var["serverindex"]);
    $action = "";
    $npc_name = $var["npc_name"];
    if ($npc_name == "") {
        PrintNotice($tbl_sys_msg["nobody"]);
        return false;
    }
    $npc_name = str_replace(" ", "+", $npc_name);
    $param = array();
    $param["npc_name"] = Base642Local($npc_name);
    global $tbl_game_server;
    $gas_host = $tbl_game_server[$serverid][0];
    $gas_port = $tbl_game_server[$serverid][1];
    $ret = PostData($gas_host, $gas_port, "GetNpcInfo", $param);
    $xml = new DOMDocument();
    $xml->loadXML(Local2UTF8($ret));
    $root = $xml->getElementsByTagName("root")->item(0);
    $npc = $root->getElementsByTagName("npc")->item(0);
    echo "<h2>" . $tbl_npc_info[0] . "</h2>\n";
    echo "<table class='form_table'>\n";
    $npc_name = $npc->getElementsByTagName("npc-name")->item(0)->nodeValue;
    echo "<tr><th>" . $page_main["npc_name"] . "</th><td>" . Lan_Npc_GetDisplayName($npc_name, false) . "</td></tr>\n";
    echo "<tr><th>" . $page_main["real_name"] . "</th><td>" . $npc_name . "</td></tr>\n";
    echo "<tr><th>Base 64</th><td>" . UTF82Base64($npc_name) . "</td></tr>\n";
    echo "<tr><th>" . $tbl_sys_msg["camp"] . "</th><td>" . $tbl_camp[intval($npc->getElementsByTagName("npc-camp")->item(0)->nodeValue)] . "</td></tr>\n";
    echo "</table>\n";
    $questset = $npc->getElementsByTagName("npc-quests")->item(0);
    if ($questset) {
        echo "<h2>" . $tbl_npc_info[1] . "</h2>\n";
        $npc_pos = $questset->getElementsByTagName("npc-quest-pos")->item(0);
        echo "<table class='list_table'>\n";
        echo "<tr><th>" . $page_main["scene"] . "</th><th>" . $page_main["pos"] . "</th></tr>\n";
        echo "<tr><td>" . Lan_Scene_GetDisplayName($npc_pos->getAttribute("scene")) . "</td><td>" . $npc_pos->getAttribute("x") . "," . $npc_pos->getAttribute("y") . "</td></tr>\n";
        echo "</table>\n";
        echo "<table class='list_table'>\n";
        echo "<tr><th>" . $page_main["task"] . "</th></tr>\n";
        $npc_quests = $questset->getElementsByTagName("npc-quest");
        foreach ($npc_quests as $quest) {
            echo "<tr><td>" . Lan_Quest_GetDisplayName($quest->nodeValue) . "</td></tr>\n";
        }
        echo "</table>\n";
    }
    $shop = $npc->getElementsByTagName("npc-shop")->item(0);
    if ($shop) {
        echo "<h2>" . $tbl_npc_info[4] . "</h2>\n";
        echo "<table class='form_table'>\n";
        $shop_pay = $shop->getElementsByTagName("npc-shop-pay")->item(0);
        if ($shop_pay) {
            echo "<tr><th>" . $page_main["category"] . "</th><td>" . $tbl_jifen[intval($shop_pay->nodeValue)] . "</td></tr>\n";
        }
        echo "</table>\n";
        echo "<table class='list_table'>\n";
        echo "<tr><th>" . $page_main["type"] . "</th><th>" . $page_main["item"] . "</th></tr>\n";
        $shop_items = $shop->getElementsByTagName("npc-shop-items")->item(0)->getElementsByTagName("npc-shop-item");
        foreach ($shop_items as $shop_item) {
            echo "<tr><td>" . $bid2type[intval($shop_item->getAttribute("type"))] . "</td><td>" . Lan_Item_GetDisplayName($shop_item->nodeValue) . "</td></tr>\n";
        }
    }
    $drop = $npc->getElementsByTagName("npc-drop")->item(0);
    if ($drop) {
        echo "<h2>" . $tbl_npc_info[2] . "</h2>\n";
        echo "<table class='form_table'>\n";
        $drop_scene = $drop->getElementsByTagName("npc-drop-scene")->item(0)->nodeValue;
        if ($drop_scene) {
            echo "<tr><th>" . $page_main["scene"] . "</th><td>" . Lan_Scene_GetDisplayName($drop_scene) . "</td></tr>\n";
        }
        $drop_level = $drop->getElementsByTagName("npc-drop-level")->item(0)->nodeValue;
        if ($drop_level) {
            echo "<tr><th>" . $page_main["level"] . "</th><td>" . $drop_level . "</td></tr>\n";
        }
        echo "</table>\n";
        $drop_teams = $drop->getElementsByTagName("npc-drop-team");
        foreach ($drop_teams as $drop_team) {
            $group_rate = $drop_team->getAttribute("rate");
            $drop_team_num = $drop_team->getElementsByTagName("npc-drop-team-num")->item(0);
            $group_number = $drop_team_num->getAttribute("min") . "-" . $drop_team_num->getAttribute("max");
            echo "<table class='list_table'>\n";
            echo "<tr><th style='width:50%'>" . $page_main["item"] . "</th><th style='width:25%;'>" . $tbl_npc_info[3] . "</th><th>" . $page_main["number"] . "</th></tr>\n";
            $drop_items = $drop_team->getElementsByTagName("npc-drop-team-item");
            foreach ($drop_items as $drop_item) {
                echo "<tr><td>" . Lan_Item_GetDisplayName($drop_item->nodeValue) . "</td><td>" . $group_rate . "*" . $drop_item->getAttribute("rate") . "</td><td>" . $group_number . "</td></tr>\n";
            }
            echo "</table>\n";
        }
    }
    return true;
}
Example #10
0
function ChangeTongMemberFun($tong_id, $role_id, $position, $tong_name, $role_name, $serverid, $reason, $gm, $o_position)
{
    global $tbl_game_server, $tbl_tong_pos, $ChangeTongMember;
    $param = array();
    $param["tong_id"] = $tong_id;
    $param["role_id"] = $role_id;
    $param["position"] = $position;
    $param["msg"] = sprintf($ChangeTongMember[0], $tbl_tong_pos[$o_position], $role_name, $tbl_tong_pos[$position]);
    $gas_host = $tbl_game_server[$serverid][0];
    $gas_port = $tbl_game_server[$serverid][1];
    $ret = PostData($gas_host, $gas_port, "ChangeTongMember", $param);
    $action = array("tong" => $tong_name, "role_name" => $role_name, "pos" => $position, "reason" => $reason);
    if (intval($ret) != 200) {
        PrintNotice(LogInfo($action, false, $ret));
        BackAndRefresh();
        return true;
    }
    if (LogGMCommand($gm, 171, $action, $serverid)) {
        PrintNotice(LogInfo($action, true));
        BackAndRefresh();
        return true;
    }
}
Example #11
0
function AddHonorToTong($var, $gm, $role_name, $arg1, $arg2, $reason)
{
    $gm_name = mysql_escape_string($gm);
    $serverid = intval($var["serverid"]);
    $param = array();
    $param["tong_name"] = $role_name;
    $param["add_honor"] = $arg1;
    global $tbl_game_server;
    $gas_host = $tbl_game_server[$serverid][0];
    $gas_port = $tbl_game_server[$serverid][1];
    $ret = PostData($gas_host, $gas_port, "AddHonorToTong", $param);
    if (intval($ret) != 200) {
        PrintNotice(LogInfo($reason, false, $ret));
        BackAndRefresh($tbl_sys_msg["success"]);
        return true;
    }
    if (LogGMCommand($gm_name, $var["action_name"] . ".0250", $reason, $serverid)) {
        PrintNotice(LogInfo($reason, true));
        BackAndRefresh($tbl_sys_msg["success"]);
        return true;
    }
    return false;
}
Example #12
0
function SetMaxOnLineUserNum($var, $gm)
{
    global $tbl_game_server;
    $servers = $var["server_id"];
    $param = array();
    $param["type"] = $var["type"];
    $param["newMaxOnLineUserNum"] = $var["newMaxOnLineUserNum"];
    $param["user_name"] = $var["user_name"];
    $param["game_id"] = $var["game_id"];
    $action = array("type" => $var["type"], "number" => $var["newMaxOnLineUserNum"], "user_name" => $var["user_name"], "game id" => $var["game_id"]);
    foreach ($servers as $server) {
        $gas_host = $tbl_game_server[$server][0];
        $gas_port = $tbl_game_server[$server][1];
        $ret = PostData($gas_host, $gas_port, "SetMaxOnLineUserNum", $param);
        echo "<h2>" . $tbl_game_server[$server][2] . "</h2>\n";
        if ($ret == 200) {
            PrintNotice(LogInfo($action, true));
            LogGMCommand($gm, $var["action_name"], $action, $server);
        } else {
            PrintNotice(LogInfo($action, false, $ret));
        }
    }
    return true;
}