本文整理汇总了PHP中save_debug函数的典型用法代码示例。如果您正苦于以下问题:PHP save_debug函数的具体用法?PHP save_debug怎么用?PHP save_debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了save_debug函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: end_script_combat
function end_script_combat($name = 0)
{
global $_SERVER;
show_debug($name);
mysql_close();
if (function_exists("save_debug")) {
save_debug();
}
}
示例2: show_debug
</table>
</td>
<td valign="bottom">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="' . $img . '/img/bot-back.gif">
<div style="width:100%" align="center"><img src="' . $img . '/img/bot-mid.gif" width="352" height="70"></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<center>';
include "../lib/banners.php";
echo '
</center>
</body>
</html>';
if ($_SERVER['REMOTE_ADDR'] == debug_ip) {
show_debug();
}
if (function_exists("save_debug")) {
save_debug();
}
示例3: take
public function take($id = 0, $place_id, $kol = 1)
{
$check1 = $this->init_res_nonuser($id, $place_id);
if ($check1 == 1) {
$kol = min($kol, $this->res_nonuser['col']);
//Даём ресурс игроку
$check2 = $this->add_user(0, $this->char['user_id'], $kol, $this->res_nonuser['dead_time']);
if ($check2 == 1) {
//Забираем ресурс с карты
$this->add_map(0, 0, -$kol);
} elseif ($this->message_type == 1) {
setLocation("act.php?errror=full_inv");
if (function_exists("save_debug")) {
save_debug();
}
exit;
}
}
}
示例4: attack_user
function attack_user($char, $player, $type, $turnir_type = 0)
{
$id = $player['user_id'];
$user_id = $char['user_id'];
$l_type = $type;
$map = mysql_fetch_array(myquery("SELECT * FROM game_maps WHERE id=" . $char['map_name'] . ""));
if ($l_type != 8 and $l_type != 9) {
if (check_attack($char, $player, $l_type, $map) != 1) {
if (function_exists("save_debug")) {
save_debug();
}
return 0;
}
}
if (clans_war == 1 and $map['dolina'] == 1 and clans_war_type > 0) {
$type = clans_war_type;
}
if (chaos_war == 1) {
$type = 5;
}
// Проверка на то, что игрок не нападает на другого более 2-ух раз за последний час
$kol_attacks = mysql_num_rows(myquery("SELECT count(*) as kol FROM game_combats_log WHERE user1_id = " . $user_id . " AND user2_id = " . $id . " AND time>=" . (time() - 60 * 60) . " HAVING kol>=2"));
// Создаём бой
$uid = create_combat($type, $char['map_name'], $char['map_xpos'], $char['map_ypos'], $turnir_type, $user_id, $id);
$side_char = $char['user_id'];
$side_player = $player['user_id'];
switch ($type) {
case 1:
$nam = 14;
break;
case 2:
$nam = 15;
break;
case 3:
$nam = 16;
break;
case 4:
$nam = 17;
$side_char = $char['clan_id'];
$side_player = $player['clan_id'];
break;
case 5:
$nam = 18;
break;
case 6:
$nam = 49;
$side_char = $char['sklon'];
$side_player = $player['sklon'];
break;
case 7:
$nam = 48;
$side_char = $char['race'];
$side_player = $player['race'];
break;
case 8:
$nam = 47;
break;
case 9:
$nam = 46;
break;
}
$skill = take_skills($char['user_id']);
$skill1 = take_skills($player['user_id']);
//Проверим нет ли на пострадавшем эффекта "Неуязвимости"
$check_effect = myquery("SELECT * FROM game_obelisk_users WHERE user_id='" . $player['user_id'] . "' AND type=6 AND time_end>" . time() . " ");
if ($turnir_type == 0 and $map['dolina'] != 1 and ($char['vsadnik'] < $player['vsadnik'] or mysql_num_rows($check_effect) > 0 or $kol_attacks > 0)) {
$func1 = 2;
$func2 = 1;
} else {
$func1 = 5;
$func2 = 5;
if ($type == 4) {
myquery("INSERT INTO game_log (message,date,FROMm,ob) VALUES ('" . iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-weight:900;font-size:14px;color:red;font-family:Verdana,Tahoma,Arial,Helvetica,sans-serif\"> ВНИМАНИЕ! <img align=\"center\" src=\"http://" . img_domain . "/clan/" . $char['clan_id'] . ".gif\"> " . mysql_result(myquery("SELECT nazv FROM game_clans WHERE clan_id=" . $char['clan_id'] . ""), 0, 0) . " и <img align=\"center\" src=\"http://" . img_domain . "/clan/" . $player['clan_id'] . ".gif\"> " . mysql_result(myquery("SELECT nazv FROM game_clans WHERE clan_id=" . $player['clan_id'] . ""), 0, 0) . " начинают бой: " . $map['name'] . "(" . $char['map_xpos'] . "; " . $char['map_ypos'] . ") </span>'") . "," . time() . ",-1,1)");
}
//Если на игрока напали против его воли, то, при наличии соответствующего навыка, выдадим его эффект неуязвимости
if ($type == 4 and $skill1['HIDE'] > 0 and mysql_num_rows($check_effect) == 0) {
$time_hide = time() + $skill1['HIDE'] * 3 * 60;
myquery("INSERT INTO game_obelisk_users (user_id,time_end,type) VALUES (" . $player['user_id'] . "," . $time_hide . ",6)");
}
}
//Снимем с атакующего игрока эффект неуязвимости
myquery("DELETE FROM game_obelisk_users WHERE user_id=" . $char['user_id'] . " AND type=6");
$hod = 1;
//Кидаем в бой игроков
combat_insert($char, 0, $uid, $type, $side_char, $hod, 0, 0, 0, $map['k_exp'] / 100, $map['k_gp'] / 100, $skill, $func1, $nam, 1);
combat_insert($player, 0, $uid, $type, $side_player, $hod, 0, 0, 0, $map['k_exp'] / 100, $map['k_gp'] / 100, $skill1, $func2, $nam, 1);
//Отработаем действие навыка "Убийца" для 1-ого игрока
if ($skill['SLAYER'] > 0) {
$r = mt_rand(1, 100);
if ($r <= $skill['SLAYER'] * 2 + 5) {
$effect = $skill['SLAYER'] * 5;
insert_fast_effect($char['user_id'], $player['user_id'], $uid, $hod, 42, $effect);
}
}
if ($l_type != 8 and $l_type != 9) {
$pismo = iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-style:italic;font-size:12px;color:gold;\">На тебя напал игрок <b>" . $char['name'] . "</b></span>");
myquery("INSERT INTO game_log (`message`,`date`,`FROMm`,`too`,`ptype`) VALUES ('" . mysql_real_escape_string($pismo) . "'," . time() . ",-1,{$id},1)");
} else {
$pismo = iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-style:italic;font-size:12px;color:gold;\">Начинается турнирная дуэль с игроком: <b>" . $char['name'] . "</b></span>");
myquery("INSERT INTO game_log (`message`,`date`,`FROMm`,`too`,`ptype`) VALUES ('" . mysql_real_escape_string($pismo) . "'," . time() . ",-1," . $player['user_id'] . ",1)");
//.........这里部分代码省略.........
示例5: take
public function take($id = 0, $count_item = 1)
{
global $_SESSION;
global $user_time;
//1. проверим находится ли данный предмет на одной гексе с игроком и чтобы у него priznak=2
//2. меняем предмету user_id, устанавливаем priznak=0,map_name=0,map_xpos=0,map_ypos=0
if ($id > 0) {
$this->init_item($id);
}
if ($this->item['map_name'] == $this->char['map_name'] and $this->item['map_xpos'] == $this->char['map_xpos'] and $this->item['map_ypos'] == $this->char['map_ypos'] and $this->item['priznak'] == 2) {
if ($this->fact['name'] == 'Зелье зарядки артефактов') {
myquery("DELETE FROM game_items WHERE id=" . $this->item['id'] . "");
$rand = mt_rand(10, 20);
$sel = myquery("SELECT game_items.id,game_items.item_id,game_items.count_item,game_items_factsheet.item_uselife FROM game_items,game_items_factsheet WHERE game_items.user_id=" . $this->char['user_id'] . " AND game_items.used=3 AND game_items.priznak=0 AND game_items.item_id=game_items_factsheet.id");
if ($sel != false) {
list($id_art, $ident_art, $cur_zar, $max_zar) = mysql_fetch_array($sel);
$new_zar = min($max_zar, $cur_zar + $rand);
myquery("UPDATE game_items SET count_item={$new_zar} WHERE id={$id_art}");
$rand = $new_zar - $cur_zar;
} else {
$rand = 0;
}
$_SESSION['getsunduk'] = 'Ты ' . echo_sex('зарядил', 'зарядила') . ' артефакт на ' . $rand . ' зарядов';
setLocation("act.php?getsunduk");
if (function_exists("save_debug")) {
save_debug();
}
exit;
} elseif ($this->fact['name'] == 'Сундук с сокровищами') {
myquery("DELETE FROM game_items WHERE id=" . $this->item['id'] . "");
myquery("UPDATE game_users SET GP=GP + " . $this->item['item_cost'] . " WHERE user_id=" . $this->char['user_id'] . "");
$_SESSION['getsunduk'] = 'Ты ' . echo_sex('нашел', 'нашла') . ' сундук с ' . $this->item['item_cost'] . ' монетами';
setGP($this->char['user_id'], $this->item['item_cost'], 5);
setLocation("act.php?getsunduk");
if (function_exists("save_debug")) {
save_debug();
}
exit;
} elseif ($this->fact['name'] == 'Кадка воды') {
myquery("DELETE FROM game_items WHERE id=" . $this->item['id'] . "");
$stm = mt_rand(20, 90);
if ($stm + $this->char['STM'] > $this->char['STM_MAX']) {
$stm = $this->char['STM_MAX'] - $this->char['STM'];
}
myquery("UPDATE game_users SET STM=STM + {$stm} WHERE user_id=" . $this->char['user_id'] . " LIMIT 1");
$_SESSION['getsunduk'] = 'Ты ' . echo_sex('выпил', 'выпила') . ' воду и твоя энергия изменилась на ' . $stm . ' единиц';
setLocation("act.php?getsunduk");
if (function_exists("save_debug")) {
save_debug();
}
exit;
} elseif ($this->fact['name'] == 'Кусок мяса') {
myquery("DELETE FROM game_items WHERE id=" . $this->item['id'] . "");
$stm = mt_rand(20, 90);
if ($stm + $this->char['HP'] > $this->char['HP_MAX']) {
$stm = $this->char['HP_MAX'] - $this->char['HP'];
}
myquery("UPDATE game_users SET HP=HP + {$stm} WHERE user_id=" . $this->char['user_id'] . " LIMIT 1");
$_SESSION['getsunduk'] = 'Ты ' . echo_sex('съел', 'съела') . ' мясо и твоя жизнь изменилась на ' . $stm . ' единиц';
setLocation("act.php?getsunduk");
if (function_exists("save_debug")) {
save_debug();
}
exit;
} elseif ($this->fact['name'] == 'Магический эликсир') {
myquery("DELETE FROM game_items WHERE id=" . $this->item['id'] . "");
$stm = mt_rand(10, 70);
if ($stm + $this->char['MP'] > $this->char['MP_MAX']) {
$stm = $this->char['MP_MAX'] - $this->char['MP'];
}
myquery("UPDATE game_users SET MP=MP + {$stm} WHERE user_id=" . $this->char['user_id'] . " LIMIT 1");
$_SESSION['getsunduk'] = 'Ты ' . echo_sex('выпил', 'выпила') . ' магический эликсир и твоя мана изменилась на ' . $stm . ' единиц';
setLocation("act.php?getsunduk");
if (function_exists("save_debug")) {
save_debug();
}
exit;
} elseif ($this->fact['name'] == 'Бутылка с голубым зельем') {
myquery("DELETE FROM game_items WHERE id=" . $this->item['id'] . "");
$hp = mt_rand(10, 50);
$mp = mt_rand(20, 60);
$stm = mt_rand(30, 70);
$r = mt_rand(1, 4);
if ($r == 1) {
$hp = -$hp;
if ($this->char['HP'] + $hp < 0) {
$hp = -$this->char['HP'];
}
} else {
if ($hp + $this->char['HP'] > $this->char['HP_MAX']) {
$hp = $this->char['HP_MAX'] - $this->char['HP'];
}
}
$r = mt_rand(1, 4);
if ($r == 1) {
$mp = -$mp;
if ($this->char['MP'] + $mp < 0) {
$mp = -$this->char['MP'];
}
} else {
//.........这里部分代码省略.........