function get_zone_name($map_id, $player_x, $player_y) { $zone = get_zone($map_id, $player_x, $player_y); return $zone[4]; }
include_once "../conf.php"; include_once "zone_tables.php"; mysql_connect($config['hostname'], $config['username'], $config['password']) or die("Невозможно создать соединение с базой сервера." . mysql_error()); mysql_select_db($config['dbName']) or die(mysql_error()); $id = intval(@$_REQUEST['id']); $where = @$_REQUEST['where']; $map = intval(@$_REQUEST['map']); $x = intval(@$_REQUEST['x']); $y = intval(@$_REQUEST['y']); if ($map != 0 and $map != 1 and $map != 530) { include "instance.php"; } else { echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"; $areaName = get_map_name($map); $zone = get_zone($map, $x, $y); if ($zone == 0) { echo "<center><table valign=\"bottom\"><tr><td><img src=\"../images/wowd.jpg\"></td></tr><tr><td><center>Неизвестная зона</center></td></tr></table></center>"; die; } $area = get_Area($zone[5]); if ($area == 0) { echo "<center><table valign=\"bottom\"><tr><td><img src=\"../images/wowd.jpg\"></td></tr><tr><td><center>Карта не найдена(</center></td></tr></table></center>"; die; } $background = "img/map_image/{$areaName}/{$area['3']}.jpg"; $mapID = $area[1]; $areaY1 = $area[4]; $areaY2 = $area[5]; $areaX1 = $area[6]; $areaX2 = $area[7];
if ($enemy_stat[$partic_step['lkick']] - $stag_count >= 2) { $sqlf = ', participants.damaged_' . $zone . '=participants.damaged_' . $zone . '-' . $stag_count; $enemy_stat[$partic_step['lkick']] -= $stag_count; } elseif ($enemy_stat[$partic_step['lkick']] > 1) { $sqlf = ', participants.damaged_' . $zone . '=2'; $enemy_stat[$partic_step['lkick']] = 2; } } else { if ($damage[1] > 0) { $hands[] = 'lkick'; } if ($damage[0] > 0) { $hands[] = 'rkick'; } foreach ($hands as $kickc) { $zone = get_zone($partic_step[$kickc]); if ($enemy_stat[$partic_step[$kickc]] - 1 >= 2) { $sqlf .= ', participants.damaged_' . $zone . '=participants.damaged_' . $zone . '-1'; $enemy_stat[$partic_step[$kickc]] -= 1; } } } } $enemy_stat['hp_now'] -= $damage[0] + $damage[1]; mysql_query("UPDATE battles_stat SET a=a+{$upd_udar}, u=u+{$upd_uv}, k=k+{$upd_krit} WHERE u_id = " . $partic_stat['id']); mysql_query("UPDATE battles_stat SET d=d+{$upd_block} WHERE u_id=" . $enemy_stat['id']); mysql_query("UPDATE players,participants SET players.hp_now=" . $enemy_stat['hp_now'] . ",participants.hp=" . $enemy_stat['hp_now'] . "{$sqlf} WHERE players.id=" . $enemy_stat['id'] . " AND participants.id=" . $enemy_stat['id'] . ' and participants.hp>0 and participants.time=' . $stat['battle']); mysql_query("UPDATE participants SET damage=damage+" . ($damage[0] + $damage[1]) . " WHERE id=" . $partic_stat['id'] . ' and time=' . $stat['battle']); //+ mysql_query("UPDATE battles SET type=1, damage=" . ($damage[0] + $damage[1]) . ", comment2='{$cmnt2}',comment1='{$cmnt1}' WHERE offer='" . $stat['battle'] . "' AND id='" . $partic_step['id'] . "' AND attacker='" . $partic_step['attacker'] . "'"); //+
function update_zone() { check_authorization(); global $mysql, $zoneid; $oldstats = get_zone(); extract($oldstats); $fields = ''; if ($zoneidnumber != $_POST['zoneidnumber']) { $fields .= "zoneidnumber=\"" . $_POST['zoneidnumber'] . "\", "; } if ($short_name != $_POST['short_name']) { $fields .= "short_name=\"" . $_POST['short_name'] . "\", "; } if ($file_name != $_POST['file_name']) { $fields .= "file_name=\"" . $_POST['file_name'] . "\", "; } if ($long_name != $_POST['long_name']) { $fields .= "long_name=\"" . $_POST['long_name'] . "\", "; } if ($safe_x != $_POST['safe_x']) { $fields .= "safe_x=\"" . $_POST['safe_x'] . "\", "; } if ($safe_y != $_POST['safe_y']) { $fields .= "safe_y=\"" . $_POST['safe_y'] . "\", "; } if ($safe_z != $_POST['safe_z']) { $fields .= "safe_z=\"" . $_POST['safe_z'] . "\", "; } if ($underworld != $_POST['underworld']) { $fields .= "underworld=\"" . $_POST['underworld'] . "\", "; } if ($timezone != $_POST['timezone']) { $fields .= "timezone=\"" . $_POST['timezone'] . "\", "; } if ($time_type != $_POST['time_type']) { $fields .= "time_type=\"" . $_POST['time_type'] . "\", "; } if ($note != $_POST['note']) { $fields .= "note=\"" . $_POST['note'] . "\", "; } if ($shutdowndelay != $_POST['shutdowndelay']) { $fields .= "shutdowndelay=\"" . $_POST['shutdowndelay'] . "\", "; } if ($graveyard_id != $_POST['graveyard_id']) { $fields .= "graveyard_id=\"" . $_POST['graveyard_id'] . "\", "; } if ($ztype != $_POST['ztype']) { $fields .= "ztype=\"" . $_POST['ztype'] . "\", "; } if ($zone_exp_multiplier != $_POST['zone_exp_multiplier']) { $fields .= "zone_exp_multiplier=\"" . $_POST['zone_exp_multiplier'] . "\", "; } if ($walkspeed != $_POST['walkspeed']) { $fields .= "walkspeed=\"" . $_POST['walkspeed'] . "\", "; } if ($min_level != $_POST['min_level']) { $fields .= "min_level=\"" . $_POST['min_level'] . "\", "; } if ($min_status != $_POST['min_status']) { $fields .= "min_status=\"" . $_POST['min_status'] . "\", "; } if ($maxclients != $_POST['maxclients']) { $fields .= "maxclients=\"" . $_POST['maxclients'] . "\", "; } if ($flag_needed != $_POST['flag_needed']) { $fields .= "flag_needed=\"" . $_POST['flag_needed'] . "\", "; } if ($canlevitate != $_POST['canlevitate']) { $fields .= "canlevitate=\"" . $_POST['canlevitate'] . "\", "; } if ($castoutdoor != $_POST['castoutdoor']) { $fields .= "castoutdoor=\"" . $_POST['castoutdoor'] . "\", "; } if ($cancombat != $_POST['cancombat']) { $fields .= "cancombat=\"" . $_POST['cancombat'] . "\", "; } if ($peqzone != $_POST['peqzone']) { $fields .= "peqzone=\"" . $_POST['peqzone'] . "\", "; } if ($canbind != $_POST['canbind']) { $fields .= "canbind=\"" . $_POST['canbind'] . "\", "; } if ($sky != $_POST['sky']) { $fields .= "sky=\"" . $_POST['sky'] . "\", "; } if ($minclip != $_POST['minclip']) { $fields .= "minclip=\"" . $_POST['minclip'] . "\", "; } if ($maxclip != $_POST['maxclip']) { $fields .= "maxclip=\"" . $_POST['maxclip'] . "\", "; } if ($fog_minclip != $_POST['fog_minclip']) { $fields .= "fog_minclip=\"" . $_POST['fog_minclip'] . "\", "; } if ($fog_maxclip != $_POST['fog_maxclip']) { $fields .= "fog_maxclip=\"" . $_POST['fog_maxclip'] . "\", "; } if ($fog_blue != $_POST['fog_blue']) { $fields .= "fog_blue=\"" . $_POST['fog_blue'] . "\", "; } if ($fog_red != $_POST['fog_red']) { $fields .= "fog_red=\"" . $_POST['fog_red'] . "\", "; } if ($fog_green != $_POST['fog_green']) { $fields .= "fog_green=\"" . $_POST['fog_green'] . "\", "; } if ($fog_minclip1 != $_POST['fog_minclip1']) { $fields .= "fog_minclip1=\"" . $_POST['fog_minclip1'] . "\", "; } if ($fog_maxclip1 != $_POST['fog_maxclip1']) { $fields .= "fog_maxclip1=\"" . $_POST['fog_maxclip1'] . "\", "; } if ($fog_blue1 != $_POST['fog_blue1']) { $fields .= "fog_blue1=\"" . $_POST['fog_blue1'] . "\", "; } if ($fog_red1 != $_POST['fog_red1']) { $fields .= "fog_red1=\"" . $_POST['fog_red1'] . "\", "; } if ($fog_green1 != $_POST['fog_green1']) { $fields .= "fog_green1=\"" . $_POST['fog_green1'] . "\", "; } if ($fog_minclip2 != $_POST['fog_minclip2']) { $fields .= "fog_minclip2=\"" . $_POST['fog_minclip2'] . "\", "; } if ($fog_maxclip2 != $_POST['fog_maxclip2']) { $fields .= "fog_maxclip2=\"" . $_POST['fog_maxclip2'] . "\", "; } if ($fog_blue2 != $_POST['fog_blue2']) { $fields .= "fog_blue2=\"" . $_POST['fog_blue2'] . "\", "; } if ($fog_red2 != $_POST['fog_red2']) { $fields .= "fog_red2=\"" . $_POST['fog_red2'] . "\", "; } if ($fog_green2 != $_POST['fog_green2']) { $fields .= "fog_green2=\"" . $_POST['fog_green2'] . "\", "; } if ($fog_minclip3 != $_POST['fog_minclip3']) { $fields .= "fog_minclip3=\"" . $_POST['fog_minclip3'] . "\", "; } if ($fog_maxclip3 != $_POST['fog_maxclip3']) { $fields .= "fog_maxclip3=\"" . $_POST['fog_maxclip3'] . "\", "; } if ($fog_blue3 != $_POST['fog_blue3']) { $fields .= "fog_blue3=\"" . $_POST['fog_blue3'] . "\", "; } if ($fog_red3 != $_POST['fog_red3']) { $fields .= "fog_red3=\"" . $_POST['fog_red3'] . "\", "; } if ($fog_green3 != $_POST['fog_green3']) { $fields .= "fog_green3=\"" . $_POST['fog_green3'] . "\", "; } if ($fog_minclip4 != $_POST['fog_minclip4']) { $fields .= "fog_minclip4=\"" . $_POST['fog_minclip4'] . "\", "; } if ($fog_maxclip4 != $_POST['fog_maxclip4']) { $fields .= "fog_maxclip4=\"" . $_POST['fog_maxclip4'] . "\", "; } if ($fog_blue4 != $_POST['fog_blue4']) { $fields .= "fog_blue4=\"" . $_POST['fog_blue4'] . "\", "; } if ($fog_red4 != $_POST['fog_red4']) { $fields .= "fog_red4=\"" . $_POST['fog_red4'] . "\", "; } if ($fog_green4 != $_POST['fog_green4']) { $fields .= "fog_green4=\"" . $_POST['fog_green4'] . "\", "; } if ($ruleset != $_POST['ruleset']) { $fields .= "ruleset=\"" . $_POST['ruleset'] . "\", "; } if ($version != $_POST['version']) { $fields .= "version=\"" . $_POST['version'] . "\", "; } if ($map_file_name != $_POST['map_file_name']) { $fields .= "map_file_name=\"" . $_POST['map_file_name'] . "\", "; } if ($fog_density != $_POST['fog_density']) { $fields .= "fog_density=\"" . $_POST['fog_density'] . "\", "; } if ($expansion != $_POST['expansion']) { $fields .= "expansion=\"" . $_POST['expansion'] . "\", "; } if ($suspendbuffs != $_POST['suspendbuffs']) { $fields .= "suspendbuffs=\"" . $_POST['suspendbuffs'] . "\", "; } if ($type != $_POST['type']) { $fields .= "type=\"" . $_POST['type'] . "\", "; } if ($rain_chance1 != $_POST['rain_chance1']) { $fields .= "rain_chance1=\"" . $_POST['rain_chance1'] . "\", "; } if ($rain_chance2 != $_POST['rain_chance2']) { $fields .= "rain_chance2=\"" . $_POST['rain_chance2'] . "\", "; } if ($rain_chance3 != $_POST['rain_chance3']) { $fields .= "rain_chance3=\"" . $_POST['rain_chance3'] . "\", "; } if ($rain_chance4 != $_POST['rain_chance4']) { $fields .= "rain_chance4=\"" . $_POST['rain_chance4'] . "\", "; } if ($rain_duration1 != $_POST['rain_duration1']) { $fields .= "rain_duration1=\"" . $_POST['rain_duration1'] . "\", "; } if ($rain_duration2 != $_POST['rain_duration2']) { $fields .= "rain_duration2=\"" . $_POST['rain_duration2'] . "\", "; } if ($rain_duration3 != $_POST['rain_duration3']) { $fields .= "rain_duration3=\"" . $_POST['rain_duration3'] . "\", "; } if ($rain_duration4 != $_POST['rain_duration4']) { $fields .= "rain_duration4=\"" . $_POST['rain_duration4'] . "\", "; } if ($snow_chance1 != $_POST['snow_chance1']) { $fields .= "snow_chance1=\"" . $_POST['snow_chance1'] . "\", "; } if ($snow_chance2 != $_POST['snow_chance2']) { $fields .= "snow_chance2=\"" . $_POST['snow_chance2'] . "\", "; } if ($snow_chance3 != $_POST['snow_chance3']) { $fields .= "snow_chance3=\"" . $_POST['snow_chance3'] . "\", "; } if ($snow_chance4 != $_POST['snow_chance4']) { $fields .= "snow_chance4=\"" . $_POST['snow_chance4'] . "\", "; } if ($snow_duration1 != $_POST['snow_duration1']) { $fields .= "snow_duration1=\"" . $_POST['snow_duration1'] . "\", "; } if ($snow_duration2 != $_POST['snow_duration2']) { $fields .= "snow_duration2=\"" . $_POST['snow_duration2'] . "\", "; } if ($snow_duration3 != $_POST['snow_duration3']) { $fields .= "snow_duration3=\"" . $_POST['snow_duration3'] . "\", "; } if ($snow_duration4 != $_POST['snow_duration4']) { $fields .= "snow_duration4=\"" . $_POST['snow_duration4'] . "\", "; } $fields = rtrim($fields, ", "); if ($fields != '') { $query = "UPDATE zone SET {$fields} WHERE id={$zoneid}"; $mysql->query_no_result($query); } }
curl_close($ch); // 切换 ip 地址 $ip2long = ip2long($ip); ++$ip2long; $ip = long2ip($ip2long); // 第三次请求,转到登录后的首页 $header = substr($content, 0, $head); echo $header; $resp = substr($content, $head); print_r(json_decode($resp, true)); echo "\n============= Third Response =============\n"; $cookie = get_cookie($header); echo 'Cookie: ', $cookie, "\n\n"; $ch = curl_init("http://172.16.100.213/?q=overview&zone={$zone}"); curl_setopt($ch, CURLOPT_HTTPHEADER, $request_header); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_COOKIE, $cookie); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 120); $content = curl_exec($ch); $head = curl_getinfo($ch, CURLINFO_HEADER_SIZE); curl_close($ch); ++$ip2long; $header = substr($content, 0, $head); echo $header; $resp = substr($content, $head); //echo $resp, "\n"; $zone = get_zone($resp); echo 'zone=', $zone, "\n"; }
tep_redirect(HTTPS_SERVER . '/' . sprintf($return_link, $insert_id)); } } else { // By MegaJim if (!isset($order)) { $order = new order(); } if ($order->delivery['zone_id'] > 0) { $ship_zone_id = $order->delivery['zone_id']; } elseif ($order->delivery['state'] != '' && is_numeric($order->delivery['country']['id'])) { $ship_zone_id = get_zone($order->delivery['country']['id'], $order->delivery['state']); } if ($order->billing['zone_id'] > 0) { $bill_zone_id = $order->billing['zone_id']; } elseif ($order->billing['state'] != '' && is_numeric($order->billing['country']['id'])) { $bill_zone_id = get_zone($order->billing['country']['id'], $order->billing['state']); } $payment_modules = new payment(); } if (!tep_session_is_registered('comments')) { tep_session_register('comments'); } // $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CHECKOUT, '', 'SSL')); $customer = array(); if (tep_session_is_registered('customer_id')) { $customer_query = tep_db_query("SELECT c.*, ab.* FROM " . TABLE_CUSTOMERS . " c LEFT JOIN " . TABLE_ADDRESS_BOOK . " ab ON (c.customers_default_address_id = ab.address_book_id) WHERE c.customers_id = '" . (int) $_SESSION['customer_id'] . "'"); $customer = tep_db_fetch_array($customer_query); } // By MegaJim - Feed from preview // foreach (Array(c=>'entry_country_id',s=>'entry_zone_id',p=>'entry_postcode') AS $post => $cst) { // if (isset($HTTP_GET_VARS[$post])) $customer[$cst]=$HTTP_GET_VARS[$post];