function HotUpdate_f($var, $gm, $serverid) { $hu_id = $var["hu_id"]; $type = intval($var["type"]); $code = $var["code"]; $file = $var["file"]; MySQLQuery("insert into tbl_hot_update_result(hu_id,hur_serverid) values({$hu_id},{$serverid})", "GMS"); $code_server = UTF82Local($code); $md5_code = str_replace("\\\"", "\"", $code_server); $md5_code = str_replace("\\\\", "\\", $md5_code); $md5_code = str_replace("\\'", "'", $md5_code); $param = array(); $param["type"] = $type; $param["filename"] = $file; $param["md5"] = md5($md5_code); $param["code"] = $code_server; global $tbl_game_server; $action = array("ID" => $hu_id, "type" => $type, "file" => $file); $gas_host = $tbl_game_server[$serverid][0]; $gas_port = $tbl_game_server[$serverid][1]; $ret = PostData($gas_host, $gas_port, "HotUpdate", $param); if ($ret == 200) { MySQLQuery("replace into tbl_hot_update_result values({$hu_id},{$serverid},1,now())", "GMS"); LogGMCommand($gm, $var["action_name"], $action, $serverid); PrintNotice(LogInfo($action, true)); } else { PrintNotice(LogInfo($action, false, $ret)); } return true; }
function GetFriends($var, $gm) { global $tbl_role_all_detail; echo "<h1>{$tbl_role_all_detail['16']}</h1>\n"; ReturnAndBack(); Reload(); $role_id = ArgRoleId(); echo "<table class='list_table'>\n"; echo sprintf("<tr><td>{$tbl_role_all_detail['18']}</td></tr>\n", ArgRoleName() . "(" . $role_id . ")"); echo "</table>\n"; global $tbl_role_friends, $tbl_camp, $tbl_class, $tbl_sex, $tbl_sys_msg; $serverid = $var["serverid"]; if (!$role_id) { return true; } echo "<h1>" . $tbl_role_friends[0] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th></tr>\n", $tbl_role_friends[1][0], $tbl_role_friends[1][1], $tbl_role_friends[1][2], $tbl_role_friends[1][3], $tbl_role_friends[1][4], $tbl_role_friends[1][5]); $rs = MySQLQuery("select c.c_sName, cs.cs_uCamp, cs.cs_uClass, cb.cb_uLevel, cs.cs_uSex, fc.fc_sName from tbl_player_friends pf, tbl_friends_class fc, tbl_char c, tbl_char_basic cb, tbl_char_static cs where pf.fc_uId = fc.fc_uId and pf.cs_uId = fc.cs_uId and pf.pf_uFriendId = c.cs_uId and fc.fc_uId<>2 and pf.cs_uId='{$role_id}' and cb.cs_uId = c.cs_uId and cs.cs_uId = c.cs_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { if ($row[5] == UTF82Local($tbl_role_friends[1][6])) { $row[5] = $tbl_role_friends[1][6]; } printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[5], $row[0], $tbl_camp[$row[1]], $tbl_class[$row[2]], $row[3], $tbl_sex[$row[4]]); } echo "</table>\n"; echo "<h1>" . $tbl_role_friends[2] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th></tr>\n", $tbl_role_friends[3][0], $tbl_role_friends[3][1], $tbl_role_friends[3][2], $tbl_role_friends[3][3], $tbl_role_friends[3][4]); $rs = MySQLQuery("select c.c_sName, cs.cs_uCamp, cs.cs_uClass, cb.cb_uLevel, cs.cs_uSex from tbl_player_friends pf, tbl_char c, tbl_char_basic cb, tbl_char_static cs where pf.pf_uFriendId = c.cs_uId and pf.cs_uId='{$role_id}' and pf.fc_uId=2 and cb.cs_uId = c.cs_uId and cs.cs_uId = c.cs_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[0], $tbl_camp[$row[1]], $tbl_class[$row[2]], $row[3], $tbl_sex[$row[4]]); } echo "</table>\n"; echo "<h1>" . $tbl_role_friends[4] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_role_friends[5][0], $tbl_role_friends[5][1], $tbl_role_friends[5][2]); $rs = MySQLQuery("select fg.fg_sName,gm1.gm_uIdentity,count(*) from tbl_group_manager gm1,tbl_group_manager gm2,tbl_friends_group fg where gm1.cs_uId='{$role_id}' and gm1.fg_uId = gm2.fg_uId and gm1.fg_uId = fg.fg_uId group by gm2.fg_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { printf("<tr><td>%s</td><td>%s</td><td>%d</td></tr>\n", $row[0], $tbl_role_friends[5][3][intval($row[1])], $row[2]); } echo "</table>\n"; echo "<h1>" . $tbl_role_friends[6] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_role_friends[7][0], $tbl_role_friends[7][1], $tbl_role_friends[7][2]); $rs = MySQLQuery("select t.t_sName, mt1.mt_sPosition, count(*) from tbl_member_tong mt1, tbl_tong t, tbl_member_tong mt2 where mt1.t_uId = t.t_uId and t.t_uId = mt2.t_uId and mt1.cs_uId = '{$role_id}' group by t.t_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { global $tbl_tong_pos; printf("<tr><td>%s</td><td>%s</td><td>%d</td></tr>\n", $row[0], $tbl_tong_pos[intval($row[1])], $row[2]); } echo "</table>\n"; return true; }
function SearchTaskInfo($var, $gm) { global $tbl_list_task; $serverid = $var["serverid"]; $role_id = ArgRoleId(); if (!$role_id) { return true; } $query_string = "select q_sName,q_state,FROM_UNIXTIME(q_tAcceptTime),FROM_UNIXTIME(q_tFinishTime) from tbl_quest where cs_uId=" . $role_id . " and q_sName = '" . UTF82Local($var["quest_name"]) . "'"; $result = MySQLQuery($query_string . " order by q_tAcceptTime", "Game", $serverid); $tbl_content = array(); while ($row = mysql_fetch_row($result)) { $row[1] = $tbl_list_task[intval($row[1])]; $tbl_size = count($tbl_content); $tbl_content[$tbl_size] = $row; } if (!IsDownload($var)) { RetGetTaskInfo($tbl_content, $role_name, $role_id); return true; } return true; }
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; }
function Lan_Tong_GetTechName($name, $level = "") { $ret = "<i>{$name}</i>"; if ($name == "") { return $ret; } $name .= $level; $param = array(); $param["name"] = UTF82Local($name); $xml_item = Lan_Load($param, "Lan_Tong_GetTechName"); if ($xml_item->getElementsByTagName("Tech")->length > 0) { $ret = $xml_item->getElementsByTagName("Tech")->item(0)->nodeValue; } return $ret; }
function DelItemInDepot($var, $gm) { $gm_name = mysql_escape_string($gm); $reason = $var["reason"]; $reason = mysql_escape_string($reason); $serverid = intval($var["serverid"]); $param = array(); GetItemInfo(mysql_escape_string($var["item_name"]), $item_type, $item_name); $param["item_name"] = UTF82Local($item_name); $param["item_type"] = $item_type; $item_num = intval($var["num"]); $param["item_num"] = $item_num; $param["role_name"] = $var["role_name"]; $action = array("role_name" => $var["role_name"], "item" => $item_name, "number" => $item_num, "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, "DelItemInDepot", $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; }
function scene($var, $gm) { global $tbl_class; global $tbl_camp; global $tbl_sys_msg; $scene_name = UTF82Local(mysql_escape_string($var["scene_name_"])); $query = "select us.us_sName,c.c_sName,ifnull(co_uOnServerId,0),cb.cb_uLevel,cs.cs_uClass,cs.cs_uCamp,cm.cm_uMoney,cm.cm_uBindingMoney, cb.cs_uId from tbl_char_position as cp,tbl_char as c,tbl_scene as ts,tbl_char_basic as cb,tbl_char_static as cs, tbl_user_static us, tbl_user_online uo,tbl_char_money cm left join tbl_char_online as co on cm.cs_uId = co.cs_uId\n\t\twhere \n\t\t\tcb.cs_uId = cs.cs_uId and cs.cs_uId = c.cs_uId and c.cs_uId = cm.cs_uId and \n\t\t\tc.cs_uId = cp.cs_uId and cp.sc_uId = ts.sc_uId and cs.us_uId = us.us_uId and us.us_uId = uo.us_uId\n\t\tand ts.sc_sSceneName = '" . $scene_name . "'"; page($var, $query, 21, "Game", $var["serverindex"], $result, $page, $desc); $tbl_content = array(); while ($row = mysql_fetch_row($result)) { $row[2] = intval($row[2]) > 0 ? $tbl_sys_msg["online"] : $tbl_sys_msg["offline"]; $row[4] = $tbl_class[intval($row[4])]; $row[5] = $tbl_camp[intval($row[5])]; $tbl_size = count($tbl_content); $tbl_content[$tbl_size] = $row; } echo $desc; RetGetRoles($tbl_content, $var, $page); }
function ShowVirWealthLog_ModulusChange($var, $gm) { global $tbl_log_db, $tbl_sys_msg, $tbl_serv_db, $page_main, $tbl_modulus_type; if ($var["download"] == "true") { $tname = gmmktime(); $filename = "../../" . $tname . ".csv"; $file = fopen($filename, "w"); } else { LastLogTime(); } $server_id = $var["serverid"]; $type = intval($var["type"]); $str = ""; if ($var["begin_time"] != null && $var["begin_time"] != "") { $str .= " and lcesm_dtChangeTime >= '" . $var["begin_time"] . "'"; } if ($var["end_time"] != null && $var["end_time"] != "") { $str .= " and lcesm_dtChangeTime <= '" . $var["end_time"] . "'"; } if ($type != 0) { $str .= " and lcesm_uModulusType = " . $type; } $role_id = ArgRoleId(); if (!$role_id) { return true; } if ($var["download"] == "true") { fwrite($file, "\"" . UTF82Local(implode("\",\"", array($tbl_sys_msg["time"], $page_main["type"], $page_main["number"])) . "\"\n")); } else { echo "<table class='list_table'>\n"; printf("<tr><th style='width:120px;'>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_sys_msg["time"], $page_main["type"], $page_main["number"]); } $qs = "select lcesm_dtChangeTime, lcesm_uModulusType, lcesm_uModulusValue from tbl_log_char_exp_soul_modulus where lcs_uId = {$role_id}" . $str . " order by lcesm_dtChangeTime"; $result = MySQLQuery($qs, "Log", $server_id); while ($row = mysql_fetch_row($result)) { if ($var["download"] == "true") { fwrite($file, UTF82Local("\"" . implode("\",\"", array($row[0], $tbl_modulus_type[$row[1]], $row[2])) . "\"\n")); } else { echo sprintf("<tr" . ($i++ % 2 == 0 ? "" : " class='even'") . "><td>%s</td><td>%s</td><td><pre>%s</pre></td></tr>\n", $row[0], $tbl_modulus_type[$row[1]], $row[2]); } } if ($var["download"] == "true") { global $page_action_name; fclose($file); echo "<script>\n"; echo "window.location.href='../../cgi-bin/gm_tools/download.php?file={$tname}&display=" . $page_action_name[$var["action_name"]] . "';\n"; echo "</script>\n"; } else { echo "</table>\n"; echo "<table class='list_table'><tr><td><a href='" . get_http_args() . "&download=true' target='_blank'>" . $tbl_sys_msg["download"] . "</a></td></tr></table>\n"; ReturnAndBack(); } return true; }
function ObjDropLimitCanel($var, $gm, $role_name, $arg1, $arg2, $reason) { global $tbl_gm_db, $tbl_sys_msg; $gm_name = mysql_escape_string($gm); $serverid = intval($var["serverid"]); $param = array(); $param["obj_name"] = UTF82Local($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, "DelObjDropLimit", $param); if (intval($ret) != 200) { PrintNotice(LogInfo($reason, false, $ret)); BackAndRefresh($tbl_sys_msg["success"]); return true; } if (LogGMCommand($gm_name, $var["action_name"] . ".0152", $reason, $serverid)) { PrintNotice(LogInfo($reason, true)); BackAndRefresh($tbl_sys_msg["success"]); return true; } return false; }