示例#1
1
 function test_count_all()
 {
     //依数据库中已有一条记录而断言
     $this->assertEqual($this->base_model->count_all(), 1);
     //删除这条记录之后断言返回0
     $sql = "TRUNCATE TABLE `test_table`;";
     $this->assertTrue($this->_CI->db->query($sql));
     say('Truncate test_table ok.');
     $this->assertEqual($this->base_model->count_all(), 0);
 }
function process($user, $msg)
{
    $msg = unwrap($msg);
    // remove chr(0) and chr(255)
    say("< " . $msg);
    $parts = explode("|", $msg);
    // CHAT|NICK|MESSAGE
    $action = strtoupper($parts[0]);
    switch ($action) {
        case "HELO":
            welcome($user, $parts[1], $parts[2]);
            break;
            // HELO|NICK|AVATAR
        // HELO|NICK|AVATAR
        case "CHAT":
            chat($user, $parts[2]);
            break;
            // CHAT|NICK|MESSAGE
        // CHAT|NICK|MESSAGE
        case "PRIV":
            break;
            // TODO: private chat
        // TODO: private chat
        case "EXIT":
            goodbye($user);
            break;
            // EXIT|NICK
        // EXIT|NICK
        default:
            console($action . " not understood");
            break;
    }
}
示例#3
0
 function tearDown()
 {
     $sql = 'DROP TABLE IF EXISTS `solution`;';
     $this->assertTrue($this->_CI->db->query($sql));
     $sql = 'DROP TABLE IF EXISTS `forward`;';
     $this->assertTrue($this->_CI->db->query($sql));
     say('Delete test_tables ok.');
 }
示例#4
0
 public function setAliases()
 {
     if (!is_array($this->aliases)) {
         say("You must load your Aliases file in ./cmd");
         exit;
     }
     foreach ($this->aliases as $name => $path) {
         Yii::setAlias($name, $path);
     }
 }
示例#5
0
文件: Funciones.php 项目: cbunay/VRS
function fnShowMsg($title, $msg)
{
    //Construye mensaje en  una tabla
    say("<table width='2500'>");
    say("<tr>");
    say("<th align=center valing=middle>{$title}</th>");
    say("</tr>");
    say("<tr>");
    say("<td align=left valing=middle>{$msg}</td>");
    say("</tr>");
    say("</table>");
}
示例#6
0
function process($user_sent, $msg)
{
    global $sockets, $users;
    $ms = unwrap($msg);
    $obj = json_decode($ms);
    $action = $obj->msg;
    say("< " . $action);
    foreach ($users as &$user) {
        if ($user != $user_sent) {
            send($user->socket, $action);
        }
    }
}
function loop_tests($cmd, $line_func)
{
    global $results;
    $ftest = popen($cmd, 'r');
    if (!$ftest) {
        echo "Couldn't run test script\n";
        exit(1);
    }
    while (!feof($ftest)) {
        $line = fgets($ftest);
        $line_func($line);
    }
    say(array('op' => 'all_done', 'results' => $results));
    fclose($ftest);
}
示例#8
0
function f2($url)
{
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
    $json = curl_exec($ch);
    curl_close($ch);
    $ans = json_decode($json, true);
    $x = 0;
    foreach ($ans["sample"] as $key => $values) {
        say($ans["sample"][$x]["data"]);
        wait(500);
        $x++;
    }
}
function checkCorrectFileRights()
{
    say("Pruefe, ob die wichtigsten Schreibrechte gesetzt sind...");
    // Verzeichnisse, die geprueft werden sollen,
    // MUESSEN mit einem Slash enden!
    $asWritableFiles = array(DIR_SHOP_ROOT . 'bb.rpc.cookie', DIR_COMPILED, DIR_IMAGES, DIR_SETTINGS . 'global.ini', DIR_SRC_SCSS . '_ci.scss');
    $asUnwritableFiles = array();
    foreach ($asWritableFiles as $sPath) {
        // Dürfen bestehende Dateien überschrieben werden?
        if (file_exists($sPath)) {
            if (!is_writable($sPath)) {
                $asUnwritableFiles[] = $sPath;
            }
        } else {
            // Darf Verzeichnis erstellt werden?
            if (substr($sPath, -1) === '/') {
                if (!mkdir($sPath, 740)) {
                    $asUnwritableFiles[] = $sPath;
                }
                // Darf Datei erstellt werden?
            } else {
                if (!touch($sPath)) {
                    $asUnwritableFiles[] = $sPath;
                }
            }
        }
    }
    if (count($asUnwritableFiles)) {
        say('Bitte korrigieren Sie die Schreibrechte fuer folgende Dateien und Ordner: ');
        say($asUnwritableFiles);
        // Ist die global.ini nicht beschreibbar, so koennen wir gleich aufhören.
        if (in_array(DIR_SETTINGS . 'global.ini', $asUnwritableFiles)) {
            say(array('', 'Damit der Konfigurationsassistent kann nicht fortgefuehrt werden, ', 'da die global.ini nicht vom aktuellen PHP-Prozess beschrieben werden darf. ', '', 'Bitte setzen Sie die korrekten Schreibrechte fuer die settings/global.ini. ', 'Informationen hierzu erhalten Sie unter ', 'https://doku.premium-admin.eu/doku.php/handbuch/shop_2.0/installation/start#schreibrechte_setzen_optional'));
            exit(1);
        }
        return false;
    }
    return true;
}
示例#10
0
 function start_turnir()
 {
     $loc = array('0x0', '1x0', '2x0', '3x0', '4x0', '5x0', '6x0', '13x0', '6x1', '10x1', '11x1', '12x1', '13x1', '16x1', '17x1', '18x1', '19x1', '6x2', '10x2', '16x2', '0x3', '1x3', '2x3', '3x3', '4x3', '5x3', '6x3', '10x3', '13x3', '14x3', '15x3', '16x3', '0x4', '10x4', '13x4', '0x5', '1x5', '2x5', '8x5', '9x5', '10x5', '13x5', '14x5', '15x5', '16x5', '17x5', '18x5', '19x5', '2x6', '8x6', '19x6', '2x7', '8x7', '9x7', '10x7', '11x7', '19x7', '2x8', '11x8', '19x8', '2x9', '3x9', '4x9', '5x9', '6x9', '11x9', '15x9', '16x9', '17x9', '18x9', '19x9', '6x10', '11x10', '15x10', '19x10', '6x11', '11x11', '15x11', '19x11', '1x12', '2x12', '3x12', '4x12', '5x12', '6x12', '11x12', '12x12', '13x12', '14x12', '15x12', '16x12', '17x12', '1x13', '17x13', '1x14', '2x14', '3x14', '4x14', '5x14', '6x14', '7x14', '8x14', '9x14', '17x14', '1x15', '9x15', '17x15', '1x16', '9x16', '17x16', '18x16', '1x17', '2x17', '3x17', '4x17', '9x17', '10x17', '11x17', '12x17', '13x17', '14x17', '18x17', '1x18', '4x18', '5x18', '6x18', '14x18', '18x18', '1x19', '6x19', '7x19', '8x19', '9x19', '10x19', '11x19', '14x19', '15x19', '16x19', '17x19', '18x19');
     // вычисляем кто прошел в турнир
     $dat = mysql_query("SELECT dt.owner FROM `deztow_stavka` as dt, `online` as o WHERE o.login = dt.owner AND room = 'smert_room' ORDER by `kredit` DESC, dt.`time` ASC  LIMIT 20;");
     if (mysql_num_rows($dat)) {
         $have_bs = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = 1"));
         if (!$have_bs) {
             $stavka = mysql_fetch_array(mysql_query("SELECT SUM(`kredit`)*0.75 FROM `deztow_stavka`;"));
             while ($row = mysql_fetch_array($dat)) {
                 shuffle($loc);
                 $coord = $loc[0];
                 // пихаем учасников в БС
                 mysql_query("UPDATE users SET bs=1, location='" . $coord . "',vector=0 WHERE login='******'");
                 mysql_query("DELETE FROM labirint WHERE user_id='" . $row[0] . "'");
                 mysql_query("INSERT INTO labirint(user_id, location, vector, visit_time) VALUES('" . $row[0] . "', '" . $coord . "', '0', '" . time() . "')");
                 // список участников
                 $lors .= $comma . "<b>" . $row[0] . "</b>";
                 $comma = ", ";
             }
             say("toall_news", "<font color=red>Турнир Начался...Участники: {$lors}</font>", $_SESSION["login"]);
             // формируем лог и создаем запись о турнире
             $log = '<span class=date>' . date("d.m.y H:i") . '</span> Начало турнира. Участники: ' . $lors . '<BR>';
             mysql_query("INSERT `deztow_turnir` (`type`,`winner`,`coin`,`start_time`,`log`,`endtime`,`active`) values ('" . rand(1, 7) . "','','" . $stavka[0] . "','" . time() . "','" . $log . "','0','1');");
             shuffle($loc);
             $count_wmot = mysql_num_rows(mysql_query("SELECT id FROM bs_objects"));
             for ($i = 1; $i <= $count_wmot; $i++) {
                 mysql_query("UPDATE bs_objects SET coord='" . $loc[$i] . "' WHERE id={$i}");
             }
         }
     } else {
         mysql_query('DELETE FROM `deztow_turnir` WHERE `active` = TRUE');
         mysql_query('UPDATE `variables` SET `value` = \'' . (time() + 10 * 60) . '\' WHERE `var` = \'startbs\';');
         mysql_query("TRUNCATE TABLE `deztow_stavka`;");
     }
 }
示例#11
0
文件: molch15.php 项目: ehmedov/www
        $hours = floor(SILENT / 60);
        $minutes = SILENT - $hours * 60;
        if ($hours > 0) {
            if ($hours == 2 || $hours == 24) {
                $hours_d = "{$hours} часа";
            } else {
                $hours_d = "{$hours} часов";
            }
            $minutes_d = "";
        } else {
            $hours_d = "";
            $minutes_d = "{$minutes} минут";
        }
        $pref = $db["sex"];
        if ($pref == "female") {
            $prefix = "а";
        } else {
            $prefix = "";
        }
        if ($reason != "") {
            $reson = "<b>Причина:</b> <i>" . $reason . "</i>";
        } else {
            $reson = "";
        }
        say("toall", "Представитель порядка <b>&laquo;" . $login . "&raquo;</b> использовал{$prefix} заклятие молчания на персонажа <b>&laquo;" . $res['login'] . "&raquo;</b> на {$hours_d} {$minutes_d}. {$reson}", $login);
        history($target, "Молчанка на 15 мин.", $reson, $ip, $login);
        history($login, "Молчанка на 15 мин.", $reson, $ip, $target);
        $time_d = $hours_d . "  " . $minutes_d;
        echo "Кляп засунут в рот <b>" . $target . "</b>. Он будет молчать " . $time_d;
    }
}
示例#12
0
文件: functions.php 项目: ehmedov/www
function lose($team, $battle, $phrase)
{
    $date = date("H:i");
    $sql_bat = mysql_query("SELECT zayavka.type,battles.creator_id FROM `battles` LEFT JOIN zayavka on zayavka.creator=battles.creator_id WHERE battles.id={$battle}");
    $B_DAT = mysql_fetch_array($sql_bat);
    mysql_free_result($sql_bat);
    $cr = $B_DAT["creator_id"];
    $zay_type = $B_DAT["type"];
    $boylar = array(3, 4, 101, 5, 6, 102, 11);
    $T = mysql_query("SELECT player,hitted FROM teams WHERE battle_id='" . $cr . "' AND over=0 and team='" . $team . "'");
    while ($DATA = mysql_fetch_array($T)) {
        $player = $DATA["player"];
        $hitted_win = $DATA["hitted"];
        if ($zay_type == 15) {
            mysql_query('UPDATE labirint SET location="29x15", vector="180" WHERE user_id="' . $player . '"');
        }
        if ($zay_type == 88) {
            mysql_query('UPDATE labirint SET location="29x2", vector="180", lose=lose+1 WHERE user_id="' . $player . '"');
        }
        if ($zay_type == 89) {
            mysql_query('UPDATE labirint SET lose=lose+1 WHERE user_id="' . $player . '"');
        }
        //-------------------------------------------------------------------------------------
        $LOSER_QUERY_D = mysql_query("SELECT users.*,zver.energy FROM users LEFT join zver on zver.owner=users.id and zver.sleep=0 WHERE login='******'");
        $LOSER_DATA = mysql_fetch_array($LOSER_QUERY_D);
        mysql_free_result($LOSER_QUERY_D);
        $objects = array();
        $objects[0] = $LOSER_DATA["amulet"];
        $objects[1] = $LOSER_DATA["hand_r"];
        $objects[2] = $LOSER_DATA["armour"];
        $objects[3] = $LOSER_DATA["poyas"];
        $objects[4] = $LOSER_DATA["ring1"];
        $objects[5] = $LOSER_DATA["ring2"];
        $objects[6] = $LOSER_DATA["ring3"];
        $objects[7] = $LOSER_DATA["helmet"];
        $objects[8] = $LOSER_DATA["perchi"];
        $objects[9] = $LOSER_DATA["hand_l"];
        $objects[10] = $LOSER_DATA["boots"];
        $objects[11] = $LOSER_DATA["naruchi"];
        $objects[12] = $LOSER_DATA["rubaxa"];
        $objects[13] = $LOSER_DATA["plash"];
        $objects[14] = $LOSER_DATA["mask"];
        $objects[15] = $LOSER_DATA["pants"];
        $objects[16] = $LOSER_DATA["masdrikon"];
        $objects[17] = $LOSER_DATA["rukavic"];
        $damage = 0;
        shuffle($objects);
        foreach ($objects as $key => $value) {
            if ($value == 0) {
                unset($objects[$key]);
            }
        }
        $new_array = array_values($objects);
        $damage = $new_array[0];
        if ($damage != 0) {
            $GET_F_INV = mysql_query("SELECT paltar.name,inv.iznos_max,inv.iznos FROM inv LEFT JOIN paltar on paltar.id=inv.object_id WHERE inv.id=" . $damage);
            $GET_D = mysql_fetch_array($GET_F_INV);
            mysql_free_result($GET_F_INV);
            $iznos_all = $GET_D["iznos_max"];
            $iznos = $GET_D["iznos"] + 1;
            $obj_name = $GET_D["name"];
            $krit_iznos = $iznos_all - 2;
            if ($iznos >= $krit_iznos && $iznos < $iznos_all) {
                talk($player, "Предмет <b>" . $obj_name . "</b> в критическом состоянии!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
            }
            if ($iznos <= $iznos_all) {
                mysql_query("UPDATE inv SET iznos =iznos+1 WHERE id = '" . $damage . "'");
            }
            if ($iznos_all == 1) {
                unWear($player, $damage);
                mysql_query("DELETE FROM inv WHERE id='" . $damage . "'");
                history($player, 'Пришел в негодность', $obj_name, $LOSER_DATA["remote_ip"], "Бой " . $battle);
                talk($player, "Предмет <b>" . $obj_name . "</b> сломался", $LOSER_DATA);
            } else {
                if ($iznos == $iznos_all) {
                    unWear($player, $damage);
                    talk($player, "Предмет <b>" . $obj_name . "</b> нуждается в ремонте!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
                }
            }
        }
        if ($zay_type == 29) {
            #Пещера Воинов
            mysql_query("UPDATE users SET zayava=0 WHERE login='******'");
            mysql_query("UPDATE war_team SET lose=1 WHERE player='" . $player . "'");
            say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
        }
        if ($zay_type == 99 || $zay_type == 66) {
            mysql_query("UPDATE users SET bs=0,location='', vector='' WHERE login='******'");
            $str = "<span class=date>" . date("d.m.y H:i") . "</span> <script>drwfl('" . $LOSER_DATA['login'] . "','" . $LOSER_DATA['id'] . "','" . $LOSER_DATA['level'] . "','" . $LOSER_DATA['dealer'] . "','" . $LOSER_DATA['orden'] . "','" . $LOSER_DATA['admin_level'] . "','" . $LOSER_DATA['clan_short'] . "','" . $LOSER_DATA['clan'] . "');</script> повержен и выбывает из турнира<BR>";
            mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,"' . $str . '") WHERE `active` = TRUE');
            mysql_Query("DELETE FROM labirint WHERE user_id='" . $player . "'");
            mysql_Query("UPDATE bs_objects SET bs=0,owner='',coord='" . $LOSER_DATA["location"] . "' WHERE owner='" . $player . "'");
            mysql_query("DELETE FROM inv WHERE owner='" . $player . "' and object_razdel='thing' and object_id=24 LIMIT 1");
            say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
        }
        if ($zay_type == 19) {
            //Таинственный Маяк
            $have_hell = mysql_fetch_Array(mysql_Query("SELECT * FROM hellround_pohod WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";"));
            $count_wood = $have_hell["volna"];
            for ($i = 0; $i < $count_wood; $i++) {
                mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('" . $LOSER_DATA['login'] . "', '139','wood','thing','0','1');");
            }
            $count_redkiy = $have_hell["unikal_count"] - 1;
            if ($count_redkiy > 0) {
                for ($i = 0; $i < $count_redkiy; $i++) {
                    mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('" . $LOSER_DATA['login'] . "', '140','wood','thing','0','1');");
                }
                $str_redkiy = "<b>Редкий Образец</b> x{$count_redkiy}.";
            }
            say("toroom", "<b>" . $LOSER_DATA['login'] . "</b> создал предмет <b>Образец</b> x{$count_wood}. {$str_redkiy}", $LOSER_DATA['login']);
            mysql_Query("UPDATE hellround_pohod SET `end` = 1, `date_out` = " . time() . " WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";");
        }
        /*if(in_array($zay_type,$boylar))
        		{
        			//new year
        			//mysql_Query("INSERT INTO inv (owner, object_id, object_type, object_razdel, gift, gift_author, iznos, iznos_max, term) VALUES('".$LOSER_DATA['login']."', '60', 'scroll', 'magic', '1', 'WWW.MEYDAN.AZ', '0', '1', '".(time()+30*24*3600)."');");
        			//talk($LOSER_DATA["login"],"Вы нашли <b>Снежок</b>",$LOSER_DATA);
        			
        			//novruz
        			mysql_Query("INSERT INTO inv (owner, object_id, object_type, object_razdel, gift, gift_author, iznos, iznos_max, term) VALUES('".$LOSER_DATA['login']."', '262', 'scroll', 'magic', '1', 'WWW.MEYDAN.AZ', '0', '1', '".(time()+30*24*3600)."');");
        			talk($LOSER_DATA["login"],"Вы нашли <b>Праздничные яйца</b>",$LOSER_DATA);
        		}*/
        if ($LOSER_DATA["zver_on"]) {
            $exp_minus = rand(1, 4);
            if ($LOSER_DATA["energy"] < $exp_minus) {
                $exp_minus = rand(1, $LOSER_DATA["energy"]);
            }
            mysql_query("UPDATE zver SET energy=energy-{$exp_minus} WHERE owner=" . $LOSER_DATA["id"] . " and sleep=0 ");
        }
        $krov = array("100", "101", "102", "11");
        if (in_array($zay_type, $krov)) {
            $travm = rand(1, 3);
            getTravm($player, $travm);
            include "travm_dis.php";
            $travm_dis = array();
            $travm_dis[1] = $ushib_d_h[rand(0, count($ushib_d_h) - 1)];
            $travm_dis[2] = $ushib_d_c[rand(0, count($ushib_d_c) - 1)];
            $travm_dis[3] = $ushib_d_l[rand(0, count($ushib_d_l) - 1)];
            $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>" . $travm_dis[$travm] . "</font>.<BR>";
            battle_log($battle, $phrase);
        }
        if ($zay_type == 20) {
            getTravm($player, 4);
            $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>Неличимая травма</font>.<BR>";
            battle_log($battle, $phrase);
        }
        if ($phrase == 0) {
            talk($player, "Бой окончен! Вы проиграли бой. Всего вами нанесено: <b>" . $hitted_win . " HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
        } else {
            if ($phrase == 1) {
                talk($player, "Бой окончен! Ничья! Всего вами нанесено: <b>" . $hitted_win . " HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
            } else {
                if ($phrase == 2) {
                    $travm = rand(1, 3);
                    getTravm($player, $travm);
                    include "travm_dis.php";
                    $travm_dis = array();
                    $travm_dis[1] = $ushib_d_h[rand(0, count($ushib_d_h) - 1)];
                    $travm_dis[2] = $ushib_d_c[rand(0, count($ushib_d_c) - 1)];
                    $travm_dis[3] = $ushib_d_l[rand(0, count($ushib_d_l) - 1)];
                    $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>" . $travm_dis[$travm] . "</font>.<BR>";
                    battle_log($battle, $phrase);
                    talk($player, "Бой окончен! Вы проиграли бой. Всего вами нанесено: <b>{$hitted_win} HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
                } else {
                    if ($phrase == 11) {
                        talk($player, "Бой окончен по таймауту! Ничья! Всего вами нанесено: <b>{$hitted_win} HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA);
                    }
                }
            }
        }
        $all_hp = $LOSER_DATA["hp_all"];
        if ($LOSER_DATA["level"] < 4) {
            setHP($player, $all_hp, $all_hp);
        } else {
            setHP($player, '0', $all_hp);
        }
        $cur_m = $LOSER_DATA["mana"];
        $all_m = $LOSER_DATA["mana_all"];
        setMN($player, $cur_m, $all_m);
    }
    mysql_query("UPDATE users,(SELECT player FROM teams WHERE battle_id='" . $cr . "' AND team='" . $team . "') as upd SET battle='0', " . ($phrase == 1 || $phrase == 11 ? "nich=nich+1" : "lose=lose+1") . ", zayavka=0, battle_opponent='', battle_pos='', battle_team='',fwd='',zver_on=0,oslab=" . (time() + 5 * 60) . " WHERE login=upd.player");
    mysql_query("UPDATE teams SET over = 1 WHERE battle_id='" . $cr . "' and team={$team}");
}
$result = prompt("Hello.  Please enter your 5 digit ZIP code", array("choices" => "[5 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// Digits work with speech or touch-tone input...
$result = prompt("Hello.  Please say or enter your 5 digit ZIP code", array("choices" => "[5 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// ask for 1 to 6 digit long an account ID
$result = prompt("Please enter your account ID followed by the pound key.", array("choices" => "[1-6 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// ask for a US phone number (7 digits without area code, 10 digits with)
$result = prompt("Please enter your 7 to 10 digit U.S. phone number", array("choices" => "[7-10 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// digit collection also supports all other prompt properties and event handlers
_log("\$***********************result name " . $result->name);
while ($result->name != 'hangup') {
    // collect 3 digits.  Reprompt up to 3 times.  Use a 7 second timeout...
    $result = prompt("Now please enter a number between 1 and 999", array("choices" => "[1-3 DIGITS]", "repeat" => 3, "timeout" => 7, "onBadChoice" => create_function('$event', 'say("I am sorry, I did not understand what you said.");'), "onTimeout" => create_function('$event', 'say("I am sorry.  I didn\'t hear anything.");')));
    _log("{$result} name " . $result->name);
    _log("number is " . $result->value);
    if ($result->name == 'choice') {
        say("Great, you said " . $result->value);
    }
}
hangup();
示例#14
0
function send($client, $msg)
{
    say("> " . $msg);
    $msg = wrap($msg);
    socket_write($client, $msg, strlen($msg));
}
示例#15
0
文件: blok.php 项目: ehmedov/www
    $q = mysql_query("select * from users where login='******'");
    $res = mysql_fetch_array($q);
    if (!$res) {
        echo "ѕерсонаж <B>" . $target . "</B> не найден в базе данных.";
        die;
    }
    if ($res['login'] == "—ќ«ƒј“≈Ћ№") {
        echo "–едактирование богов запрещено высшей силой!";
        die;
    }
    if ($db["adminsite"] != 5) {
        if ($res['adminsite'] >= 5 || $res["admin_level"] >= 9) {
            echo "ѕерсонаж <B>{$target}</B> не найден в базе данных.";
            die;
        }
    }
    $chas = date("H");
    $vaxt = date("d.m.Y H:i:s", mktime($chas - $GSM));
    mysql_query("UPDATE users SET blok='1',blok_reason='" . $reason . " (" . $vaxt . ", " . $login . ")',metka='' WHERE login='******'");
    mysql_query("DELETE FROM online WHERE login='******'");
    $pref = $db["sex"];
    if ($pref == "female") {
        $prefix = "а";
    } else {
        $prefix = "";
    }
    say("toall", "<font color=#40404A>—мерть ƒуши <b>&laquo;" . $login . "&raquo;</b> отрубил{$prefix} голову персонажа <b>&laquo;" . $target . "&raquo;</b></font>.", $login);
    echo "ѕерсонаж <B>{$target}</B> казнен.";
    history($_POST['target'], " ј«Ќ≈Ќ", $reson, $ip, $login);
    history($login, " ј«Ќ»Ћ персонажа {$target}", $reson, $ip, $target);
}
示例#16
0
<?php

// С помощью undef можно разопределить функцию.
def('say', function () {
    echo "one\n";
});
say();
def('say', function () {
    echo "two\n";
});
say();
undef('say');
say();
?>
---
one
two
one
示例#17
0
function success($words)
{
    say($words, 'green');
}
示例#18
0
文件: kupon.php 项目: ehmedov/www
            case 1:
                $max_win = 1000;
                $object_id = 427;
                $kupon_type = 1;
                $str_his = "10AZN";
                break;
        }
        $str = "Выигрышный Купон: Вы являетесь Участником Новогоднего Джекпота. Максимальный Выигрыш " . $max_win . " Пл. У Вас " . $kupon_count . " купона...";
        for ($i = 1; $i <= $kupon_count; $i++) {
            mysql_query("INSERT INTO inv (owner, object_id, object_type, object_razdel, msg, gift, gift_author, term) VALUES ('" . $res['login'] . "', '" . $object_id . "', 'flower', 'other', 'Вы являетесь Участником Джекпота', 1, 'WWW.Oldmeydan.Pe.Hu', '" . (time() + 3600 * 24 * 30) . "')");
            mysql_Query("INSERT INTO bank_member (user_id, type) VALUES ('" . $res["id"] . "', '" . $kupon_type . "');");
        }
        history($res["login"], 'Купон -$str_his', $str, $res["remote_ip"], 'Купон-$str_his');
        mysql_query("INSERT INTO pochta(user, whom, text, subject) VALUES ('Путешественник','" . $res["login"] . "','" . $str . "','Выигрышный Купон')");
        say($res["login"], $str, $res["login"]);
        say("toall_news", "Воин <b>" . $res["login"] . "</b> получил {$kupon_count} выигрышных купонов!", $res["login"]);
        echo "ok";
    } else {
        echo "User Not Found";
    }
} else {
    ?>
	<br>
	<br>
	<form name='action' action='main.php?act=inkviz&spell=kupon' method='post'>
		<table border=0 width=500>
			<tr><td>Логин:</td><td><input type=text name="target" class=new size=30></td></tr>
			<tr><td>Количество купонов:</td><td><input type=text name="kupon_count" class=new size=30></td></tr>
			<tr><td>Тип лотереи:</td><td>
			<select name='kupon_type'>
				<option value="0">100AZN</option>
示例#19
0
文件: prokl.php 项目: ehmedov/www
 $zaman = time() + 2 * 3600;
 $my_id = $db["id"];
 $type = 'prokl';
 $phrase = "";
 $if_bot = mysql_fetch_Array(mysql_query("SELECT count(*) FROM `bot_temp` WHERE battle_id='" . $db["battle"] . "' AND bot_name='" . $target . "'"));
 if (!$if_bot[0]) {
     $res = mysql_fetch_array(mysql_query("SELECT id, login FROM users WHERE login='******'"));
     if (!$res) {
         say($login, "Персонаж <B>" . $target . "</B> не найден в базе данных.", $login);
     } else {
         mysql_query("UPDATE inv SET iznos = iznos+1 WHERE id='" . $id . "'");
         $DAT = mysql_fetch_array(mysql_query("SELECT iznos,iznos_max FROM inv WHERE id = '" . $id . "'"));
         if ($DAT["iznos"] == $DAT["iznos_max"]) {
             mysql_query("UPDATE users SET slot" . $slot . "=0 WHERE login='******'");
             mysql_query("DELETE FROM inv WHERE id = '" . $id . "'");
             say($login, "Заклинание <b>&laquo;" . $name . "&raquo;</b> полностью использован!", $login);
         }
         switch ($mtype) {
             case "silach":
                 $add = -30;
                 $v_type = "Сила";
                 $remove = "add_sila";
                 break;
             case "uvarot":
                 $add = -30;
                 $v_type = "Ловкость";
                 $remove = "add_lovkost";
                 break;
             case "krit":
                 $add = -30;
                 $v_type = "Удача";
<?php

// -----------
// handling wrong things the right way - introducing event handlers
// -----------
answer();
$result = ask("For sales, just say sales or press 1. For support, say support or press 2.", array("choices" => "sales( 1, sales), support( 2, support)", "repeat" => 3, "onBadChoice" => create_function('$event', 'say( "I am sorry I did not understand what you said." );')));
if ($result->name == "choice") {
    if ($result->value == "sales") {
        say("Ok, let me transfer you to sales.");
        transfer("tel:+14129272358");
    }
    if ($result->value == "support") {
        say("Sure, let me get support.  Please hold.");
        transfer("tel:+14129272341");
    }
}
示例#21
0
文件: 1.php 项目: ehmedov/www
                                    if ($res["hp"] < 0.3 * $res["hp_all"]) {
                                        $err = "Персонаж <B>" . $target . "</B> слишком ослаблен, чтобы применить к нему это заклинание.";
                                    } else {
                                        $drink_hp = $res["hp"];
                                        if ($res["hp"] + $db["hp"] >= $db["hp_all"]) {
                                            $drink_hp = $db["hp_all"];
                                        }
                                        setHP($login, $drink_hp, $db["hp_all"]);
                                        setHP($target, 1, $res["hp_all"]);
                                        if ($db["sex"] == "female") {
                                            $pref = "а";
                                        } else {
                                            $pref = "";
                                        }
                                        $err = "Заклятие прокастовано удачно. Вы удачно выпили энергию из персонажа &quot{$target}&quot";
                                        say($target, "Вампир <b>&quot{$login}&quot</b> выпил{$pref} часть вашей энергии!", $target);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    } else {
        $err = "Вы в бою!. Заклятие не действует";
    }
}
if ($err != "") {
    echo "<font style='color:#ff0000'>{$err}</font>";
}
示例#22
0
        foreach ($eliks[$id_sund] as $table => $take_array) {
            $take_id = $take_array[rand(0, count($take_array) - 1)];
            $eliksir = mysql_fetch_array(mysql_query("SELECT * FROM {$table} WHERE id=" . $take_id));
            if ($eliksir) {
                if ($table == "scroll") {
                    $take_time = $eliksir["del_time"] > 0 ? time() + $eliksir["del_time"] * 24 * 3600 : "";
                    mysql_query("INSERT INTO inv(owner,object_id,object_type,object_razdel,wear,iznos,iznos_max,term) VALUES ('" . $login . "','" . $eliksir["id"] . "','scroll','magic','0','0','" . $eliksir["iznos_max"] . "','" . $take_time . "')");
                } else {
                    if ($table == "paltar") {
                        mysql_query("LOCK TABLES inv WRITE");
                        mysql_query("INSERT INTO `inv` (`id`, `owner`, `img`, `object_id`, `object_type`, `object_razdel`, `name`,  `mass`, `price`, `gos_price`, `min_sila`, `min_lovkost`, `min_udacha`, `min_power`, `min_intellekt`, `min_vospriyatie`, `min_level`, `min_sword_vl`, `min_staff_vl`, `min_axe_vl`, `min_fail_vl`, `min_knife_vl`, `min_spear_vl`,`min_fire`,`min_water`,`min_air`,`min_earth`,`min_svet`,`min_tma`,`min_gray`,`add_fire`, `add_water`, `add_air`, `add_earth`, `add_svet`, `add_tma`, `add_gray`, `add_sila`, `add_lovkost`, `add_udacha`, `add_intellekt`, `add_duxovnost`, `add_hp`, `add_mana`, `protect_head`, `protect_arm`, `protect_corp`, `protect_poyas`, `protect_legs`, `protect_rej`, `protect_drob`, `protect_kol`, `protect_rub`, `protect_fire`, `protect_water`, `protect_air`, `protect_earth`, `protect_svet`, `protect_tma`, `protect_gray`,`protect_mag`,`protect_udar`, `shieldblock`, `krit`, `akrit`, `uvorot`, `auvorot`, `parry`, `counter`, `add_rej`, `add_drob`, `add_kol`, `add_rub`, `ms_udar`, `ms_krit`, `ms_mag`, `ms_fire`, `ms_water`, `ms_air`, `ms_earth`, `ms_svet`, `ms_tma`, `ms_gray`, `ms_rej`, `ms_drob`, `ms_kol`, `ms_rub`, `iznos_max`, `min_attack`, `max_attack`, `proboy`, `add_oruj`, `add_sword_vl`, `add_staff_vl`, `add_axe_vl`, `add_fail_vl`, `add_knife_vl`, `add_spear_vl`, `need_orden`, `sex`, `art`, `podzemka`, `is_personal`, `personal_owner`, `noremont`, `two_hand`, `second_hand`,  `add_fire_att`, `add_air_att`, `add_watet_att`, `add_earth_att`, `edited`) \n\t\t\t\t\t\tVALUES (NULL, '" . $login . "','" . $eliksir["img"] . "' ,'" . $eliksir["id"] . "', '" . $eliksir["object"] . "', 'obj', '" . $eliksir["name"] . "', '" . $eliksir["mass"] . "', '" . $eliksir["price"] . "', '" . $eliksir["price"] . "', '" . $eliksir["min_sila"] . "', '" . $eliksir["min_lovkost"] . "', '" . $eliksir["min_udacha"] . "', '" . $eliksir["min_power"] . "', '" . $eliksir["min_intellekt"] . "', '" . $eliksir["min_vospriyatie"] . "', '" . $eliksir["min_level"] . "', '" . $eliksir["min_sword_vl"] . "', '" . $eliksir["min_staff_vl"] . "', '" . $eliksir["min_axe_vl"] . "', '" . $eliksir["min_fail_vl"] . "', '" . $eliksir["min_knife_vl"] . "', '" . $eliksir["min_spear_vl"] . "', '" . $eliksir["min_fire"] . "','" . $eliksir["min_water"] . "','" . $eliksir["min_air"] . "','" . $eliksir["min_earth"] . "','" . $eliksir["min_svet"] . "','" . $eliksir["min_tma"] . "','" . $eliksir["min_gray"] . "', '" . $eliksir["add_fire"] . "', '" . $eliksir["add_water"] . "', '" . $eliksir["add_air"] . "', '" . $eliksir["add_earth"] . "', '" . $eliksir["add_svet"] . "', '" . $eliksir["add_tma"] . "', '" . $eliksir["add_gray"] . "', '" . $eliksir["add_sila"] . "', '" . $eliksir["add_lovkost"] . "', '" . $eliksir["add_udacha"] . "', '" . $eliksir["add_intellekt"] . "', '" . $eliksir["add_duxovnost"] . "', '" . $eliksir["add_hp"] . "', '" . $eliksir["add_mana"] . "', '" . $eliksir["protect_head"] . "', '" . $eliksir["protect_arm"] . "', '" . $eliksir["protect_corp"] . "', '" . $eliksir["protect_poyas"] . "', '" . $eliksir["protect_legs"] . "', '" . $eliksir["protect_rej"] . "', '" . $eliksir["protect_drob"] . "', '" . $eliksir["protect_kol"] . "', '" . $eliksir["protect_rub"] . "', '" . $eliksir["protect_fire"] . "', '" . $eliksir["protect_water"] . "', '" . $eliksir["protect_air"] . "', '" . $eliksir["protect_earth"] . "', '" . $eliksir["protect_svet"] . "', '" . $eliksir["protect_tma"] . "', '" . $eliksir["protect_gray"] . "', '" . $eliksir["protect_mag"] . "', '" . $eliksir["protect_udar"] . "','" . $eliksir["shieldblock"] . "','" . $eliksir["krit"] . "', '" . $eliksir["akrit"] . "', '" . $eliksir["uvorot"] . "', '" . $eliksir["auvorot"] . "', '" . $eliksir["parry"] . "', '" . $eliksir["counter"] . "', '" . $eliksir["add_rej"] . "', '" . $eliksir["add_drob"] . "', '" . $eliksir["add_kol"] . "', '" . $eliksir["add_rub"] . "', '" . $eliksir["ms_udar"] . "', '" . $eliksir["ms_krit"] . "', '" . $eliksir["ms_mag"] . "', '" . $eliksir["ms_fire"] . "', '" . $eliksir["ms_water"] . "', '" . $eliksir["ms_air"] . "', '" . $eliksir["ms_earth"] . "', '" . $eliksir["ms_svet"] . "', '" . $eliksir["ms_tma"] . "', '" . $eliksir["ms_gray"] . "', '" . $eliksir["ms_rej"] . "', '" . $eliksir["ms_drob"] . "', '" . $eliksir["ms_kol"] . "', '" . $eliksir["ms_rub"] . "', '" . $eliksir["iznos_max"] . "', '" . $eliksir["min_attack"] . "', '" . $eliksir["max_attack"] . "', '" . $eliksir["proboy"] . "','" . $eliksir["add_oruj"] . "' ,'" . $eliksir["add_sword_vl"] . "', '" . $eliksir["add_staff_vl"] . "', '" . $eliksir["add_axe_vl"] . "', '" . $eliksir["add_fail_vl"] . "', '" . $eliksir["add_knife_vl"] . "', '" . $eliksir["add_spear_vl"] . "', '" . $eliksir["need_orden"] . "', '" . $eliksir["sex"] . "', '" . $eliksir["art"] . "', '" . $eliksir["podzemka"] . "', '" . $eliksir["is_personal"] . "', '" . $eliksir["personal_owner"] . "', '" . $eliksir["noremont"] . "', '" . $eliksir["two_hand"] . "', '" . $eliksir["second_hand"] . "',  '" . $eliksir["add_fire_att"] . "', '" . $eliksir["add_air_att"] . "', '" . $eliksir["add_watet_att"] . "', '" . $eliksir["add_earth_att"] . "', '" . $eliksir["edited"] . "');");
                        mysql_query("UNLOCK TABLES");
                    }
                }
                mysql_query("INSERT INTO crypt_setting VALUES (0,'" . $id_sund . "','" . $login . "','" . $group_id . "','2','sunduk','')");
                say("toroom", "<b>" . $logins . "</b> открыл <b>«Сундук»</b> и нашол в нем «<b>" . $eliksir["name"] . "</b>» 1шт.! Поздравляем!", $login);
                $msg = "Вы нашли «" . $eliksir["name"] . "» 1шт.! Поздравляем!";
            } else {
                mysql_query("INSERT INTO crypt_setting VALUES (0,'" . $id_sund . "','" . $login . "','" . $group_id . "','2','sunduk','')");
                $msg = "Волшебный сундук пуст!";
            }
        }
    } else {
        $msg = "Кто-то быстрее...";
    }
}
//------------------------------------------------------------------
# Декорации
foreach ($Items_Array as $item_info) {
    if (in_array($step2["left_cord"], $item_info)) {
        $draw_item_left = $item_info["type"];
示例#23
0
文件: lovkost.php 项目: ehmedov/www
    case "lovkost10":
        $add = 10;
        $type = 'stat';
        $zaman = time() + 6 * 60 * 60;
        break;
    case "lovkost15":
        $add = 15;
        $type = 'stat';
        $zaman = time() + 6 * 60 * 60;
        break;
    case "lovkost22":
        $add = 22;
        $type = 'stat_mf';
        $zaman = time() + 2 * 60 * 60;
        break;
    case "lovkost100":
        $add = 100;
        $type = 'stat';
        $zaman = time() + 6 * 60 * 60;
        break;
}
$my_id = $db["id"];
if ($db["battle"]) {
    say($login, "¬ы не можете кастовать это закл¤тие наход¤сь в бою!", $login);
} else {
    mysql_query("DELETE FROM effects WHERE user_id=" . $my_id . " and type='" . $type . "'");
    mysql_query("INSERT INTO effects (user_id,type,elik_id,add_lovkost,end_time) VALUES ('{$my_id}','{$type}','{$elik_id}','{$add}','{$zaman}')");
    $_SESSION["message"] = "¬ы удачно прокастовали заклинание <b>&laquo;" . $name . "&raquo;</b>";
    drop($spell, $DATA);
}
echo "<script>location.href='main.php?act=inv&otdel=magic'</script>";
示例#24
0
文件: group.php 项目: ehmedov/www
                         echo ($team1_players ? $team1_players : "(группа не набрана)") . " <font color='#666666'><i>против</i></font> " . ($team2_players ? $team2_players : "(группа не набрана)") . ($DATA["comment"] ? " (<i>Комментария: " . $DATA["comment"] . "</i>)" : "");
                         echo " <img src='http://www.meydan.az/img/battletype/" . ($DATA["type"] == 4 || $DATA["type"] == 11 ? "1.gif' alt='Бой с оружием'" : ($DATA["type"] == 101 ? "3.gif' alt='Кровавый бой'" : "2.gif' alt='Кулачный бой'")) . " border='0' />";
                         echo "&nbsp;  (таймаут " . $DATA["timeout"] . " мин.) ";
                         echo "<i style='color:#666666;'>Бой начнется через " . $left_min . " мин. " . $left_sec . " сек. </i>";
                         echo "</div>";
                         if ($team2_count == $DATA["limit2"] && $team1_count == $DATA["limit1"] && $mine_z == 1) {
                             startBattle($creator);
                         }
                     } else {
                         $Q_T2 = mysql_query("SELECT * FROM teams WHERE battle_id='" . $creator . "' and team=2");
                         if (!mysql_num_rows($Q_T2)) {
                             $Q_T1 = mysql_query("SELECT * FROM teams WHERE battle_id='" . $creator . "' and team=1");
                             while ($Q_T1DAT = mysql_fetch_array($Q_T1)) {
                                 $cur_player = $Q_T1DAT["player"];
                                 mysql_query("UPDATE users SET zayavka=0 WHERE login='******'");
                                 say($cur_player, "Ваш поединок не может состояться по причине: У вас отсутствуют противники.", $cur_player);
                             }
                             mysql_query("DELETE FROM zayavka WHERE creator={$creator}");
                             mysql_query("DELETE FROM teams WHERE battle_id={$creator}");
                         } else {
                             if ($mine_z == 1) {
                                 startBattle($creator);
                             }
                         }
                     }
                 }
                 echo "</form>";
             }
         }
     }
 }
示例#25
0
 } else {
     if (!$db["battle"]) {
         $res = mysql_fetch_array(mysql_query("SELECT users.battle, users.last_ip, war_team.*, labirint.location FROM `users` LEFT JOIN war_team ON war_team.player=users.login LEFT JOIN labirint ON labirint.user_id=users.login WHERE id = '" . $char_id . "'"));
         if (!$res) {
             $msg = "Персонаж не найден.";
         } else {
             if ($res['lose']) {
                 $msg = "Боец \"" . $res["player"] . "\" уже проиграл!";
             } else {
                 if ($db["zayavka"] == 1) {
                     $msg = "Сначала отзовите текущую заявку...</b>";
                 } else {
                     if ($step1['fwd'] == $res["location"]) {
                         if ($res["battle"] == 0) {
                             $timeout = time() + 3 * 60;
                             say("toroom", "<b>" . $login . "</b> напал на <b>" . $res["player"] . "</b>", $login);
                             mysql_query("INSERT INTO zayavka(status,type,timeout,creator) VALUES('3','" . $battle_type . "','3','" . $mine_id . "')");
                             mysql_query("INSERT INTO teams(player,team,ip,battle_id) VALUES('" . $db["login"] . "','2','" . $db["last_ip"] . "','" . $mine_id . "')");
                             mysql_query("INSERT INTO teams(player,team,ip,battle_id) VALUES('" . $res["player"] . "','1','" . $res["last_ip"] . "','" . $mine_id . "')");
                             mysql_query("INSERT INTO battles(type, creator_id, lasthit) VALUES('" . $battle_type . "', '" . $mine_id . "', '" . $timeout . "')");
                             goBattle($db["login"]);
                             goBattle($res["player"]);
                         } else {
                             if ($res["battle"] != 0) {
                                 $D = mysql_fetch_array(mysql_query("SELECT * FROM teams WHERE player='" . $res["player"] . "'"));
                                 if ($D) {
                                     mysql_query("INSERT INTO teams(player, team, ip, battle_id) VALUES('" . $login . "','" . ($D["team"] == 1 ? 2 : 1) . "','" . $db["last_ip"] . "','" . $D["battle_id"] . "')");
                                     $att = "<span class=date2>{$date}</span> <script>drwfl('" . $db['login'] . "','" . $db['id'] . "','" . $db['level'] . "','" . $db['dealer'] . "','" . $db['orden'] . "','" . $db['admin_level'] . "','" . $db['clan_short'] . "','" . $db['clan'] . "');</script> вмешался в поединок!</b><hr>";
                                     battle_log($res['battle'], $att);
                                     goBattle($login);
                                 }
示例#26
0
<?php

include "key.php";
$login = $_SESSION['login'];
$ip = $db["remote_ip"];
$news = htmlspecialchars(addslashes($_POST['news']));
$news = str_replace("&amp;", "&", $news);
if ($news != "") {
    say("toall_news", "<font color=\"#ff0000\">Объявления:</font> <font color=darkblue><b>{$news}</b></font>", $login);
    history($login, "Новость добавлена", $news, $ip, $login);
    echo "<b>Новость добавлена<b>";
}
示例#27
0
include "key.php";
$login = $_SESSION['login'];
if ($db["orden"] == 1 && $db["admin_level"] >= 10) {
    if ($_POST["startBattle"]) {
        $query = mysql_fetch_Array(mysql_query("SELECT count(*) FROM zayavka WHERE type=23"));
        if ($query[0]) {
            echo "Поединок идет...";
        } else {
            $res = mysql_fetch_Array(mysql_query("SELECT users.login,id,level,users.remote_ip FROM online LEFT JOIN users on users.login=online.login WHERE users.battle=0 and zayavka=0 and online.room='room4' and level>=9 ORDER BY level DESC LIMIT 1"));
            if ($res) {
                $prototype = "Исчадие Хаоса";
                mysql_query("INSERT INTO zayavka(status,type,timeout,creator) VALUES('3','23','3','" . $res["id"] . "')");
                mysql_query("INSERT INTO teams(player,team,ip,battle_id,hitted,over,leader) VALUES('" . $res["login"] . "','1','" . $res["remote_ip"] . "','" . $res["id"] . "','0','0','1')");
                addBot($res["login"], $res["id"], $prototype, $prototype);
                goBattle($res["login"]);
                say("toall_news", "<font color=\"#ff0000\">Объявления:</font> <font color=darkblue><b>Началась Битва между " . $res["login"] . " и Исчадием Хаоса</b></font>", $res["login"]);
                echo "OK";
            } else {
                echo "NO USERS";
            }
        }
    }
    if ($_POST["heal"]) {
        $query = mysql_fetch_Array(mysql_query("SELECT * FROM zayavka WHERE type=23"));
        if ($query) {
            $res = mysql_fetch_array(mysql_Query("SELECT * FROM battles WHERE creator_id=" . $query["creator"]));
            $have_bot = mysql_fetch_array(mysql_Query("SELECT * FROM bot_temp WHERE battle_id=" . $res["id"] . " and team=2"));
            $hp_add = 50000;
            $new_hp = $have_bot["hp"] + $hp_add;
            if ($new_hp > $have_bot["hp_all"]) {
                $new_hp = $have_bot["hp_all"];
<?php

/**
 * Autoren: Edenhofer, Ragg
 * 
 * Dies ist ein einfaches Loginfeld. Es wird in index.php verwendet
 */
say('FORM_LOGIN.php # ZEIGE DIE LOGINFORM.', 2);
echo '
		<form action="index.php" method="post">
		  <table>
		    <tr>
		      <td>Nickname:</td>
		      <td>
		 			<input type="text" name="login_nickname" value="" size="20" maxlength="12"/>
		 	  </td>
		    </tr>
		    <tr>
		      <td>Passwort:</td>
		      <td>
		  			<input type="password" name="login_passwort" size="20"/>
		   	  </td>
		    </tr>   
		    <tr>
		    	<td colspan="2">	
		  			<input type="submit" name="" value="Einloggen"/>
		    	</td>
		    </tr>
		  </table>
		</form>';
示例#29
0
        case 'choice':
            if ($require_pin && !array_key_exists($response->value, $pins)) {
                // This conference only allows specific conference IDs, and the one
                // entered isn't on the list.
                say('Sorry, that is not a valid conference ID.', array('voice' => $voice));
                break;
            }
            if (array_key_exists($response->value, $pins) && !empty($pins[$response->value])) {
                // Send an alert that someone has entered the conference
                message($currentCall->callerID . ' has entered conference ' . $response->value, array('to' => $pins[$response->value], 'network' => 'SMS'));
            }
            say('<speak>Conference ID <say-as interpret-as="vxml:digits">' . $response->value . '</say-as> accepted.</speak>', array('voice' => $voice));
            say('You will now be placed into the conference. Please announce yourself. To exit the conference without disconnecting, press pound.', array('voice' => $voice));
            conference($response->value, array('terminator' => '#'));
            say('You have left the conference.', array('voice' => $voice));
            if (array_key_exists($response->value, $pins) && !empty($pins[$response->value])) {
                // Send an alert that someone has entered the conference
                message($currentCall->callerID . ' has left conference ' . $response->value, array('to' => $pins[$response->value], 'network' => 'SMS'));
            }
            // Pause a moment before asking for another conference.
            sleep(1);
            break;
        case 'badChoice':
            say('Sorry, that is not a valid conference ID.', array('voice' => $voice));
            break;
        case 'silenceTimeout':
        case 'timeout':
            say('Sorry, I didn\'t hear anything.', array('voice' => $voice));
            break;
    }
}
示例#30
0
文件: war.php 项目: ehmedov/www
}
if ($db["clan_take"] == 1 || $db["glava"] == 1) {
    if ($_POST['unwar']) {
        if ($db['money'] >= 1000) {
            $_POST["clan_names"] = htmlspecialchars(addslashes($_POST["clan_names"]));
            if ($clan_s == $_POST["clan_names"]) {
                $msg = "Ќападение на самого себ¤ - это уже мазохизм...";
            } else {
                $hava_clan = mysql_fetch_Array(mysql_query("SELECT * FROM clan WHERE name_short='" . $_POST["clan_names"] . "'"));
                $res = mysql_fetch_Array(mysql_query("SELECT * FROM clan_battle WHERE defender='" . $clan_s . "' and attacker='" . $_POST["clan_names"] . "'"));
                if ($res) {
                    if ($res["type"] == 1) {
                        $battle_id = $res["id"];
                        mysql_query("UPDATE clan_battle SET type=2 WHERE defender='" . $clan_s . "' and attacker='" . $_POST["clan_names"] . "'");
                        mysql_Query("UPDATE users SET money=money-1000 WHERE login='******'");
                        say("toall_news", "<font color=#990000>’анства <b>" . $clan_t . "</b> прин¤л вызов ѕротив ’анства <b>" . $hava_clan["name"] . "</b></font>", $login);
                        $msg = "Ѕитва объ¤влена";
                        $log = '<span class=date>' . date("d.m.y H:i") . '</span> ’анства ' . $clan_t . ' прин¤л вызов ѕротив ’анства ' . $hava_clan["name"] . '<BR>';
                        mysql_query('UPDATE `clan_history` SET `log` = CONCAT(`log`,\'' . $log . '\') WHERE  clan_id="' . $battle_id . '"');
                    } else {
                        $msg = "Ѕитва уже объ¤влен";
                    }
                } else {
                    $msg = "¬ы должны ќбъ¤вит войну ’анству " . $hava_clan["name"];
                }
            }
        } else {
            $msg = "” ¬ас нет такой суммы - 1000.00 «л.";
        }
    }
}