Пример #1
0
    echo 'You ask the bartender for some water and you quickly down it.<br>You dont feel quite so intoxicated anymore.<br>';
    $db2->query('DELETE FROM player_has_drinks WHERE game_id=' . $player->game_id . ' AND account_id=' . $player->account_id . ' LIMIT 1');
} else {
    $random = mt_rand(1, 20);
    //only get Azool or Spock drink if they are very lucky
    if ($random != 1) {
        $db->query("SELECT * FROM bar_drink WHERE drink_id != 1 && drink_id != 11 ORDER BY rand() LIMIT 1");
    } else {
        $db->query("SELECT * FROM bar_drink ORDER BY rand() LIMIT 1");
    }
    if ($db->next_record()) {
        $drink_name = $db->f("drink_name");
        $drink_id = $db->f("drink_id");
        $db2->query("SELECT * FROM player_has_drinks WHERE game_id = " . SmrSession::$game_id . " ORDER by drink_id DESC LIMIT 1");
        if ($db2->next_record()) {
            $curr_drink_id = $db2->f("drink_id") + 1;
        } else {
            $curr_drink_id = 1;
        }
        if ($drink_id != 11 && $drink_id != 1) {
            print "You have bought a {$drink_name} for \$10";
            $db2->query("INSERT INTO player_has_drinks (account_id, game_id, drink_id, time) VALUES ({$player->account_id}, " . SmrSession::$game_id . ", {$curr_drink_id}, {$time})");
        } else {
            print "The bartender says, Ive got something special for ya.<br>";
            print "The bartender turns around for a minute and whips up a {$drink_name}.<br>";
            if ($drink_id == 1) {
                print "The bartender says that Spock himself gave him the directions to make this drink.<br>";
            }
            print "You drink the {$drink_name} and feel like like you have been drinking for hours.<br>";
            if ($drink_id == 11) {
                print "After drinking the {$drink_name} you feel like nothing can bring you down and like you are the best trader in the universe.<br>";
Пример #2
0
        echo '<div align=center>';
        echo '<table cellspacing="0" cellpadding="0" class="standard inset" ><tr><th>ID</th><th>Password</th><th>Last Transaction</th><th>Balance</th><th>Option</th></tr>';
        $container = array();
        $container["url"] = "skeleton.php";
        $container["body"] = "bank_anon.php";
        $db2 = new SmrMySqlDatabase();
        while ($db->next_record()) {
            $db2->query('SELECT MAX(time) FROM anon_bank_transactions
						WHERE game_id=' . $player->game_id . '
						AND anon_id=' . $db->f('anon_id') . ' LIMIT 1');
            echo '<tr><td class="shrink center">';
            echo $db->f("anon_id");
            echo '</td><td>';
            echo $db->f("password");
            echo '</td><td class="shrink nowrap">';
            if ($db2->next_record() && $db2->f('MAX(time)')) {
                echo date('n/j/Y g:i:s A', $db2->f('MAX(time)'));
            } else {
                echo 'No transactions';
            }
            echo '</td><td class="right shrink">';
            echo $db->f("amount");
            echo '</td><td class="button">';
            $container["account_num"] = $db->f("anon_id");
            $container["password"] = $db->f("password");
            print_button($container, 'Access Account');
            echo '</td></tr>';
        }
        echo '</table></div><br>';
    }
    $container = array();
Пример #3
0
        $port_info[$good_id] = $transaction;
    }
    //insert the last port
    $db2->query("REPLACE INTO player_visited_port (account_id, game_id, sector_id, visited, port_info) " . "VALUES({$account_id}, {$game_id}, {$current_sector_id}, {$current_time}, '" . addslashes(serialize($port_info)) . "')");
    //offer another drink and such
    print "<div align=center>Galaxy Info has been added.  Enjoy!</div><br>";
    include get_file_loc("bar_opening.php");
} else {
    //find what gal they want
    $container = array();
    $container["url"] = "skeleton.php";
    $container["body"] = "bar_main.php";
    $container["script"] = "bar_galmap_buy.php";
    $container["process"] = "yes";
    print "<div align=center>What galaxy do you want info on?<br>";
    print_form($container);
    print "<select type=select name=gal_id>";
    print "<option value=0>[Select a galaxy]</option>";
    $db->query("SELECT galaxy_id FROM sector WHERE game_id = {$player->game_id} GROUP BY galaxy_id ORDER BY galaxy_id ASC");
    $db2 = new SmrMySqlDatabase();
    while ($db->next_record()) {
        $gal_id = $db->f("galaxy_id");
        $db2->query("SELECT * FROM galaxy WHERE galaxy_id = {$gal_id}");
        if ($db2->next_record()) {
            print "<option value={$gal_id}>" . $db2->f("galaxy_name") . "</option>";
        }
    }
    print "</select><br>";
    print_submit("Buy the map");
    print "</form></div>";
}
Пример #4
0
    return;
}
print_topic("Confirmation");
print "Are you sure you want to transfer {$amount} credits to<br>";
$db->query("SELECT * FROM account WHERE account_id = {$account_id}");
if ($db->next_record()) {
    $login = $db->f("login");
}
$db->query("SELECT * FROM player WHERE account_id = {$account_id}");
if ($db->nf()) {
    while ($db->next_record()) {
        $player_name = stripslashes($db->f("player_name"));
        $game_id = $db->f("game_id");
        $db2->query("SELECT * FROM game WHERE game_id = {$game_id}");
        if ($db2->next_record()) {
            $game_name = $db2->f("game_name");
        }
        print "{$player_name} in game {$game_name}({$game_id})<br>";
    }
} else {
    print "Player with login name {$login}?<br>";
}
print "<p>&nbsp;</p>";
$container = array();
$container["url"] = "preferences_processing.php";
$container["account_id"] = $account_id;
$container["amount"] = $amount;
print_form($container);
print_submit("Yes");
print "&nbsp;&nbsp;";
print_submit("No");
Пример #5
0
     $curr_attacker->relations[$port->race_id] = -500;
 }
 // save what we got so far
 $curr_attacker->update();
 // disable cloak
 $curr_attacker_ship->disable_cloak();
 // the damage this attacker is going to do
 $attacker_damage = 0;
 // and his message array
 $damage_msg = array();
 $weapon = new SmrMySqlDatabase();
 $weapon->query("SELECT * FROM ship_has_weapon NATURAL JOIN weapon_type " . "WHERE account_id = {$curr_attacker->account_id} AND " . "game_id = {$curr_attacker->game_id} " . "ORDER BY order_id");
 // iterate over all existing weapons
 while ($weapon->next_record()) {
     //vars
     $weapon_name = $weapon->f("weapon_name");
     $shield_damage = $weapon->f("shield_damage");
     $armor_damage = $weapon->f("armor_damage");
     $accuracy = $weapon->f("accuracy");
     // calc accuracy for this weapon
     $hit = round($accuracy + $curr_attacker->level_id - $port->level / 2);
     // did we hit with this weapon?
     if (mt_rand(0, 100) < $hit) {
         // does the port has shields?
         if ($port->shields > 0) {
             if ($shield_damage > 0) {
                 // do we do more damage than shields left?
                 if ($shield_damage > $port->shields) {
                     $shield_damage = $port->shields;
                 }
                 // accumulate the attacker_damage
Пример #6
0
    print_topic("FEDERAL HQ");
}
// header menue
include get_file_loc('menue.inc');
print_hq_menue();
// secondary db object
$db2 = new SmrMySqlDatabase();
if (isset($location_type_id)) {
    print "<div align=\"center\">We are at WAR with<br><br>";
    $db->query("SELECT * FROM race_has_relation WHERE game_id = {$player->game_id} AND race_id_1 = {$race_id}");
    while ($db->next_record()) {
        $relation = $db->f("relation");
        $race_2 = $db->f("race_id_2");
        $db2->query("SELECT * FROM race WHERE race_id = {$race_2}");
        $db2->next_record();
        $race_name = $db2->f("race_name");
        if ($relation <= -300) {
            print "<span style=\"color:red;\">The {$race_name}<br></span>";
        }
    }
    print "<br>The government will PAY for the destruction of their ships!";
}
$db->query("SELECT * FROM bounty WHERE game_id = {$player->game_id} AND type = 'HQ' AND claimer_id = 0 ORDER BY amount DESC");
print "<p>&nbsp;</p>";
if ($db->nf()) {
    print "<div align=\"center\">Most Wanted by Federal Government</div><br>";
    print_table();
    print "<tr>";
    print "<th>Player Name</th>";
    print "<th>Bounty Amount</th>";
    print "</tr>";
Пример #7
0
 print "<tr>";
 print "<th align=\"center\">Rank</th>";
 print "<th align=\"center\">Player</th>";
 print "<th align=\"center\">{$second_display}</th>";
 print "</tr>";
 $count = 1;
 while ($db->next_record()) {
     //get the account
     $curr_account = new SMR_ACCOUNT();
     $curr_account->get_by_id($db->f("account_id"));
     $name = stripslashes($curr_account->HoF_name);
     $db2 = new SmrMySqlDatabase();
     if ($id == 'donation') {
         $db2->query("SELECT sum(amount) FROM account_donated WHERE account_id = {$curr_account->account_id}");
         $db2->next_record();
         $stat = $db2->f("sum(amount)");
     } else {
         $stat = $db->f("{$id}");
     }
     print "<tr>";
     print "<td align=\"center\">{$count}</td>";
     print "<td align=center>{$name}</td>";
     if ($action != "Experience Gained") {
         print "<td align=center> " . number_format($stat) . " </td>";
     } else {
         print "<td align=center> " . number_format($stat / 4, 2) . " </td>";
     }
     $count++;
     print "</tr>";
 }
 print "</table>";
Пример #8
0
         if ($planet->build()) {
             print "{$planet->current_building_name}<br>";
             print print_time($planet->time_left);
         } else {
             print "Nothing";
         }
         print "</td>";
         print "<td align=\"center\">{$planet->shields}</td>";
         print "<td align=\"center\">{$planet->drones}</td>";
         print "<td align=\"left\">";
         $supply = false;
         foreach ($planet->stockpile as $id => $amount) {
             if ($amount > 0) {
                 $db2->query("SELECT * FROM good WHERE good_id = {$id}");
                 if ($db2->next_record()) {
                     print $db2->f("good_name") . ": {$amount}<br>";
                 }
                 $supply = true;
             }
         }
         if (!$supply) {
             print "none";
         }
         print "</td>";
     }
     print "</table>";
     print "</div>";
 } elseif ($planet_sec == 0) {
     print "Your alliance has no claimed planets!";
 } else {
     print "Your planet is the only planet in the alliance!";
Пример #9
0
 $db2->query("SELECT * FROM message WHERE account_id = {$player->account_id} AND message_type_id = " . MSG_POLITICAL . " AND game_id = {$player->game_id}");
 if (onCouncil($player->race_id) || $db2->nf()) {
     $db->query("SELECT * FROM message_type " . "WHERE message_type_id < 8 " . "ORDER BY message_type_id");
 } else {
     $db->query("SELECT * FROM message_type " . "WHERE message_type_id != 5 " . "ORDER BY message_type_id");
 }
 while ($db->next_record()) {
     $message_type_id = $db->f("message_type_id");
     $message_type_name = $db->f("message_type_name");
     // do we have unread msges in that folder?
     $db2->query("SELECT * FROM message " . "WHERE account_id = " . SmrSession::$old_account_id . " AND " . "game_id = " . SmrSession::$game_id . " AND " . "message_type_id = {$message_type_id} AND " . "msg_read = 'FALSE'");
     $msg_read = $db2->nf();
     // get number of msges
     $db2->query("SELECT count(message_id) as message_count FROM message " . "WHERE account_id = " . SmrSession::$old_account_id . " AND " . "game_id = " . SmrSession::$game_id . " AND " . "message_type_id = {$message_type_id}");
     if ($db2->next_record()) {
         $message_count = $db2->f("message_count");
     }
     print "<tr>";
     print "<td";
     if ($msg_read) {
         print " style=\"font-weight:bold;\"";
     }
     print ">";
     $container = array();
     $container["url"] = "skeleton.php";
     $container["body"] = "message_view.php";
     $container["folder_id"] = $message_type_id;
     print_link($container, $message_type_name);
     print "</td>";
     print "<td align=\"center\" style=\"color:yellow;";
     if ($msg_read) {
Пример #10
0
<?php

require_once get_file_loc('smr_sector.inc');
$sector = new SMR_SECTOR($player->sector_id, SmrSession::$game_id, SmrSession::$old_account_id);
print_topic("READING THE WALL");
include get_file_loc('menue.inc');
print_bar_menue();
$db = new SmrMySqlDatabase();
$db->query("SELECT message_id FROM bar_wall WHERE sector_id = {$sector->sector_id} AND game_id = " . SmrSession::$game_id . " ORDER BY message_id DESC");
if ($db->next_record()) {
    $amount = $db->f("message_id") + 1;
} else {
    $amount = 1;
}
$time_now = time();
$db2 = new SmrMySqlDatabase();
$wall = $_REQUEST['wall'];
if (isset($wall)) {
    $db2->query("INSERT INTO bar_wall (sector_id, game_id, message_id, message, time) VALUES ({$sector->sector_id}, " . SmrSession::$game_id . ", {$amount},  " . format_string($wall, true) . " , {$time_now})");
}
$db->query("SELECT * FROM bar_wall WHERE game_id = {$player->game_id} AND sector_id = {$player->sector_id} ORDER BY time DESC");
if ($db->nf()) {
    print "<table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" class=\"standard\">";
    print "<tr>";
    print "<th align=\"center\">Time written</th>";
    print "<th align=\"center\">Message</th>";
    print "</tr>";
    while ($db->next_record()) {
        $time = $db->f("time");
        $message_on_wall = stripslashes($db->f("message"));
        print "<tr>";
Пример #11
0
function do_voodoo()
{
    ob_clean();
    global $lock, $var;
    foreach ($GLOBALS as $key => $value) {
        ${$key} =& $GLOBALS[$key];
    }
    // initialize objects we usually need, like player, ship
    if (SmrSession::$game_id > 0) {
        $db = new SmrMySqlDatabase();
        // We need to acquire locks BEFORE getting the player information
        // Otherwise we could be working on stale information
        $db->query('SELECT sector_id FROM player WHERE account_id=' . SmrSession::$old_account_id . ' AND game_id=' . SmrSession::$game_id . ' LIMIT 1');
        $db->next_record();
        $sector_id = $db->f('sector_id');
        if (!$lock && $var['body'] != 'error.php' && !isset($var['ForwardError'])) {
            if (!acquire_lock($sector_id)) {
                create_error("Failed to acquire sector lock");
            }
        }
        // Now that they've acquire a lock we can move on
        $player = new SMR_PLAYER(SmrSession::$old_account_id, SmrSession::$game_id);
        if ($player->dead == 'TRUE' && $var['body'] != 'death.php' && !isset($var['override_death'])) {
            $container = array();
            $container["url"] = "skeleton.php";
            $container["body"] = "death.php";
            forward($container);
        }
        $ship = new SMR_SHIP(SmrSession::$old_account_id, SmrSession::$game_id);
        // update turns on that player
        $player->update_turns($ship->speed);
        if ($player->newbie_turns <= 20 && $player->newbie_warning == "TRUE" && $var["body"] != "newbie_warning.php") {
            forward(create_container("skeleton.php", "newbie_warning.php"));
        }
    }
    require get_file_loc($var["url"]);
    SmrSession::update();
    if ($lock) {
        release_lock($lock);
    }
    exit;
}
Пример #12
0
    print "<a href=\"http://www.mpogd.com/gotm/vote.asp\" target=\"_game_site\"><img border=\"0\" src=\"images/game_sites/mpogd.png\" width=\"98\" height=\"41\"></a>&nbsp;&nbsp;";
}
$db->query("SELECT timeout FROM vote_links WHERE account_id=" . SmrSession::$old_account_id . " AND link_id=2 LIMIT 1");
if (isset(SmrSession::$game_id) && SmrSession::$game_id > 0 && (!$db->next_record() || $db->f("timeout") < time() - 86400) && rand(0, 100) < 80) {
    $container["link_id"] = 2;
    print "<a href='javascript:window.open(\"http://www.topwebgames.com/in.asp?id=136\");document.location=\"" . URL . "/loader2.php?sn=" . SmrSession::get_new_sn($container) . "\"'><img border=\"0\" src=\"images/game_sites/twg_vote.png\" width=\"98\" height=\"41\"></a>";
} else {
    $container["link_id"] = 0;
    print "<a href=\"http://www.topwebgames.com/in.asp?id=136\" target=\"_game_site\"><img border=\"0\" src=\"images/game_sites/twg.png\" width=\"98\" height=\"41\"></a>&nbsp;&nbsp;";
}
$db->query("SELECT timeout FROM vote_links WHERE account_id=" . SmrSession::$old_account_id . " AND link_id=3 LIMIT 1");
if (isset(SmrSession::$game_id) && SmrSession::$game_id > 0 && (!$db->next_record() || $db->f("timeout") < time() - 86400) && rand(0, 100) < 80) {
    $container["link_id"] = 3;
    print "<a href='javascript:window.open(\"http://www.omgn.com/topgames/vote.php?Game_ID=30\");document.location=\"" . URL . "/loader2.php?sn=" . SmrSession::get_new_sn($container) . "\"'><img border=\"0\" src=\"images/game_sites/omgn_vote.jpg\" width=\"98\" height=\"41\"></a>";
} else {
    $container["link_id"] = 0;
    print "<a href=\"http://www.omgn.com/topgames/vote.php?Game_ID=30\" target=\"_game_site\"><img border=\"0\" src=\"images/game_sites/omgn.jpg\" width=\"98\" height=\"41\"></a>&nbsp;&nbsp;";
}
print "</td>";
$db = new SmrMySqlDatabase();
$db->query("SELECT *\n\t\t\tFROM version\n\t\t\tORDER BY went_live DESC\n\t\t\tLIMIT 1\n\t\t   ");
if ($db->next_record()) {
    $version_id = $db->f("version_id");
    $container = array('url' => 'skeleton.php', 'body' => 'changelog_view.php', 'version_id' => $version_id);
    $version = create_link($container, 'v' . $db->f('major_version') . '.' . $db->f('minor_version') . '.' . $db->f('patch_level'));
}
$this_year = date("Y");
$time_elapsed = getmicrotime() - $time_start;
print "<td align=\"right\" width=\"100%\" style=\"vertical-align:bottom\"><span style=\"font-size:75%;\">Space Merchant Realms<br>{$version}&nbsp;&nbsp;&nbsp;&copy; 2001-{$this_year}<br>hosted by <a href=\"http://www.fem.tu-ilmenau.de/fem_neu/scripts/index.php?fuseaction=page.content&id=1&menue_name=englisch\" target=\"fem\">FeM</a><br />Script runtime: " . number_format($time_elapsed, 3) . " sec</span></td>";
print "</tr>";
print "</table>";
Пример #13
0
} elseif ($player->controlled != $player->sector_id) {
    $db->query("SELECT * FROM port_has_goods " . "WHERE game_id = {$player->game_id} AND " . "sector_id = {$player->sector_id} AND " . "(good_id = 5 OR good_id = 9 OR good_id = 12)");
    $base_chance = 15 - $db->nf() * 4;
    if ($ship->ship_type_id == 23 || $ship->ship_type_id == 24 || $ship->ship_type_id == 25) {
        $base_chance -= 4;
    }
    $rand = mt_rand(1, 100);
    if ($rand <= $base_chance) {
        if (!empty($ship->cargo[5]) || !empty($ship->cargo[9]) || !empty($ship->cargo[12])) {
            //find the fine
            //get base for ports that dont happen to trade that good
            $query = new SmrMySqlDatabase();
            $query->query("SELECT * FROM good WHERE good_id = 5 OR good_id = 9 OR good_id = 12");
            $base = array();
            while ($query->next_record()) {
                $base[$query->f("good_id")] = $query->f("base_price");
            }
            $fine = $port->level * ($ship->cargo[5] * $base[5] + $ship->cargo[9] * $base[9] + $ship->cargo[12] * $base[12]);
            $player->credits -= $fine;
            if ($player->credits < 0) {
                // because credits is 0 it will take money from bank
                $player->bank += $player->credits;
                // set credits to zero
                $player->credits = 0;
                // leave insurance
                if ($player->bank < 5000) {
                    $player->bank = 5000;
                }
            }
            print "<span style=\"color:red;\">The Federation searched your ship and illegal goods were found!</span><br>";
            print "<span style=\"color:red;\">All illegal goods have been removed from your ship and you have been fined " . number_format($fine) . " credits</span>";
Пример #14
0
     }
     if ($sender_id == -1) {
         $playerName = 'Bank Reporter';
     }
     if ($sender_id == -2) {
         $playerName = 'Forces Reporter';
     }
     if ($sender_id == -3) {
         $playerName = 'Game Admins';
     }
 }
 $threads[$i]['tail'] .= '</td><td class="shrink nowrap">';
 $threads[$i]['tail'] .= stripslashes($playerName);
 $db3->query("SELECT * FROM player_has_alliance_role WHERE account_id = {$player->account_id} AND game_id = {$player->game_id} AND alliance_id={$player->alliance_id}");
 if ($db3->next_record()) {
     $role_id = $db3->f("role_id");
 } else {
     $role_id = 0;
 }
 $db3->query("SELECT * FROM alliance_has_roles WHERE alliance_id = {$alliance_id} AND game_id = {$player->game_id} AND role_id = {$role_id}");
 $db3->next_record();
 if ($player->account_id == $sender_id || $db3->f("mb_messages")) {
     $container['thread_id'] = $db->f('thread');
     $threads[$i]['tail'] .= '<br><small>';
     $threads[$i]['tail'] .= create_link($container, 'Delete Thread!');
     $threads[$i]['tail'] .= '</small>';
 }
 $threads[$i]['tail'] .= '</td><td class="shrink center">';
 $threads[$i]['tail'] .= $db->f('num_replies');
 $thread_replies[$i] = $db->f('num_replies');
 $threads[$i]['tail'] .= '</td><td class="shrink nowrap">';
Пример #15
0
<?php

print_topic("Change Log");
$db2 = new SmrMySqlDatabase();
$db->query("SELECT *\n\t\t\tFROM version\n\t\t\tWHERE version_id <= " . $var['version_id'] . "\n\t\t\tORDER BY version_id DESC");
while ($db->next_record()) {
    $version_id = $db->f("version_id");
    $version = $db->f("major_version") . "." . $db->f("minor_version") . "." . $db->f("patch_level");
    $went_live = $db->f("went_live");
    // get human readable format for date
    if ($went_live > 0) {
        $went_live = date("m/d/Y - h:i A", $went_live);
    } else {
        $went_live = "never";
    }
    print "<b><small>{$version} ({$went_live}):</small></b>";
    print '<ul>';
    $db2->query("SELECT *\n\t\t\t\tFROM changelog\n\t\t\t\tWHERE version_id = {$version_id}\n\t\t\t\tORDER BY changelog_id");
    while ($db2->next_record()) {
        print '<li>' . stripslashes($db2->f('change_title')) . '<br /><small>' . stripslashes($db2->f('change_message')) . '</small></li>';
    }
    print '</ul>';
}
Пример #16
0
 print_link($container, "<span style=\"color:#80C870;\">Scout Drones</span>");
 print "</th>";
 $container["category"] = "mines";
 print "<th align=\"center\">";
 print_link($container, "<span style=\"color:#80C870;\">Mines</span>");
 print "</th>";
 $container["category"] = "expire_time";
 print "<th align=\"center\">";
 print_link($container, "<span style=\"color:#80C870;\">Expire time</span>");
 print "</th>";
 print "</tr>";
 while ($db->next_record()) {
     $force_sector = $db->f("sector_id");
     $db2->query("SELECT * FROM sector WHERE sector_id = {$force_sector} AND game_id = {$player->game_id}");
     $db2->next_record();
     $gal_id = $db2->f("galaxy_id");
     $db2->query("SELECT * FROM galaxy WHERE galaxy_id = {$gal_id}");
     $db2->next_record();
     $galaxy_name = $db2->f("galaxy_name");
     $force_sd = $db->f("scout_drones");
     $force_cd = $db->f("combat_drones");
     $force_mine = $db->f("mines");
     $force_time = $db->f("expire_time");
     print "<tr>";
     print "<td align=\"center\">{$force_sector} ({$galaxy_name})</td>";
     print "<td align=\"center\">{$force_cd}</td>";
     print "<td align=\"center\">{$force_sd}</td>";
     print "<td align=\"center\">{$force_mine}</td>";
     print "<td align=\"center\">" . date("n/j/Y g:i:s A", $force_time) . "</td>";
     print "</tr>";
 }
Пример #17
0
    $container["url"] = "skeleton.php";
    $container["body"] = "message_view.php";
    $container["folder_id"] = MSG_PLANET;
    forward($container);
}
$db2 = new SmrMySqlDatabase();
//check for planet messages
$db->query("SELECT * FROM alliance_thread_topic WHERE alliance_id = {$player->alliance_id} AND game_id = {$player->game_id} AND " . "topic LIKE 'Planet Attack Report Sector %'");
$container = array();
$msg = array();
while ($db->next_record()) {
    //get the newest post time and such
    $thread_id = $db->f("thread_id");
    $db2->query("SELECT * FROM alliance_thread WHERE thread_id = {$thread_id} AND alliance_id = {$player->alliance_id} AND game_id = {$player->game_id} ORDER BY reply_id DESC");
    $db2->next_record();
    $post_time = $db2->f("time");
    $db2->query("SELECT * FROM player_read_thread WHERE thread_id = {$thread_id} AND alliance_id = {$player->alliance_id} AND game_id = {$player->game_id} AND account_id = {$player->account_id}");
    if ($db2->next_record()) {
        $time_read = $db2->f("time");
    } else {
        $time_read = 0;
    }
    if ($time_read < $post_time) {
        $actual_id = $thread_id;
        $msg[] = $thread_id;
    }
}
if (!isset($actual_id)) {
    $player->remove_message("3");
    create_error("An error occured while processing your request.<br><small>This error most likely occured due to your leader deleting the message</small>");
}
Пример #18
0
    print_link($container, $player->get_colored_race($db->f("race_id")));
    // xp
    echo '</td><td class="shrink center">';
    echo $db->f('experience');
    echo '</td>';
    // Roles
    if ($var['action'] == 'Show Alliance Roles') {
        echo '<td class="shrink right">';
        $db2 = new SmrMySqlDatabase();
        $db2->query('SELECT role_id
					FROM player_has_alliance_role
					WHERE account_id=' . $db->f('account_id') . '
					AND game_id=' . SmrSession::$game_id . ' AND alliance_id=' . $db->f('alliance_id') . '
					LIMIT 1');
        if ($db2->next_record()) {
            $role_id = $db2->f('role_id');
        } else {
            $role_id = 0;
        }
        if ($allowed && $db->f("account_id") != $leader_id) {
            // ok do we display a select box or just a plain entry
            /*if (SmrSession::$old_account_id == $db->f('account_id') ||
            		SmrSession::$old_account_id == $leader_id) {*/
            echo '<select name="role[' . $db->f('account_id') . ']" id="InputFields">';
            foreach ($roles as $curr_role_id => $role) {
                echo '<option value="' . $curr_role_id . '"';
                if ($curr_role_id == $role_id) {
                    echo ' selected';
                }
                echo '>';
                echo stripslashes($role);
Пример #19
0
 if ($debug) {
     print "get rid of plotted course<br>";
 }
 // forget plotted course
 $db->query("DELETE FROM player_plotted_course WHERE account_id = {$killed_id} AND game_id = {$player->game_id}");
 if ($debug) {
     print "news entry<br>";
 }
 $killed->get_relations();
 // create news msg
 if ($killed->relations_global[$killer->race_id] <= -300 || $killer->relations_global[$killed->race_id] <= -300) {
     $news_message = "<span style=\"color:red;\">News from the War Front</span><br /> " . "{$killed_name} ({$killed->race_name})";
     $db2->query("SELECT * FROM ship_has_name WHERE game_id = {$player->game_id} AND " . "account_id = {$killed->account_id}");
     if ($db2->next_record()) {
         //they have a name so we print it
         $db->query("SELECT '" . htmlentities($db2->f("ship_name")) . "' LIKE '&lt;img%'");
         $named_ship = stripslashes($db2->f("ship_name"));
         $named_ship = strip_tags($db2->f("ship_name"), "<font><span>");
         if ($db->next_record() && $db->f(0) != 0) {
             //nothing
         } else {
             $news_message .= " flying <font color=\"yellow\">{$named_ship}</font>";
         }
     }
     $news_message .= " was killed by " . "{$killer_name} ({$killer->race_name})";
     $db2->query("SELECT * FROM ship_has_name WHERE game_id = {$player->game_id} AND " . "account_id = {$killer->account_id}");
     if ($db2->next_record()) {
         //they have a name so we print it
         $db->query("SELECT '" . htmlentities($db2->f("ship_name")) . "' LIKE '&lt;img%'");
         $named_ship = stripslashes($db2->f("ship_name"));
         $named_ship = strip_tags($db2->f("ship_name"), "<font><span>");
Пример #20
0
print_topic("Underground HQ");
include get_file_loc('menue.inc');
print_ug_menue();
$db2 = new SmrMySqlDatabase();
$db->query("SELECT * FROM bounty WHERE game_id = {$player->game_id} AND type = 'UG' AND claimer_id = 0 ORDER BY amount DESC");
if ($db->nf()) {
    print "Most Wanted by the Underground<br><br>";
    print_table();
    print "<tr>";
    print "<th>Player Name</th>";
    print "<th>Bounty Amount</th>";
    print "</tr>";
    while ($db->next_record()) {
        $id = $db->f("account_id");
        $db2->query("SELECT * FROM player WHERE game_id = {$player->game_id} AND account_id = {$id}");
        if ($db2->next_record()) {
            $name = stripslashes($db2->f("player_name"));
            $amount = $db->f("amount");
            print "<tr>";
            print "<td align=\"center\"><font color=yellow>{$name}</font></td>";
            print "<td align=\"center\"><font color=red> " . number_format($amount) . " </font></td>";
            print "</tr>";
        }
    }
    print "</table>";
}
if ($player->alignment <= 99 && $player->alignment >= -100) {
    print_form(create_container("government_processing.php", ""));
    print_submit("Become a gang member");
    print "</form>";
}
Пример #21
0
     if ($race == 1) {
         $race = 9;
     } else {
         $race -= 1;
     }
     //3 bytes total...
     $db2->query("SELECT * FROM good ORDER BY good_id");
     for ($i = 0; $i <= 2; $i++) {
         $CurrByte = 0;
         $CurrAdd = 128;
         for ($j = 0; $j <= 3; $j++) {
             $db2->next_record();
             $good_id = $db2->f("good_id");
             $db3->query("SELECT * FROM port_has_goods WHERE game_id = {$game_id} AND sector_id = {$sector_id} AND good_id = {$good_id}");
             if ($db3->next_record()) {
                 if ($db3->f("transaction") == "Sell") {
                     $CurrByte += $CurrAdd;
                 } else {
                     $CurrByte += $CurrAdd / 2;
                 }
             }
             $CurrAdd /= 4;
         }
         $file .= addbyte($CurrByte);
     }
 }
 //add port race byte...
 $race = $race * 16;
 $db2->query("SELECT * FROM planet WHERE game_id = {$game_id} AND sector_id = {$sector_id}");
 if ($db2->next_record()) {
     $db2->query("SELECT * FROM planet WHERE game_id = {$game_id} AND sector_id = {$sector_id} AND owner_id IN {$alliance}");
    $container["body"] = "galactic_post_view_article.php";
    transfer("id");
    print_form($container);
    print_submit("No");
    print "</form>";
} else {
    $db->query("SELECT * FROM galactic_post_paper WHERE game_id = {$player->game_id} AND paper_id = {$var['id']}");
    $db->next_record();
    $title = $db->f("title");
    print "Are you sure you want to delete the paper titled {$title} and the following articles with it<br><br>";
    $db2->query("SELECT * FROM galactic_post_paper_content WHERE game_id = {$player->game_id} AND paper_id = {$var['id']}");
    while ($db2->next_record()) {
        $article_id = $db2->f("article_id");
        $db3->query("SELECT * FROM galactic_post_article WHERE game_id = {$player->game_id} AND article_id = {$article_id}");
        $db3->next_record();
        $article_title = stripslashes($db3->f("title"));
        print "{$article_title}<br>";
    }
    print "<br>";
    $container = array();
    $container["url"] = "galactic_post_delete.php";
    transfer("paper");
    transfer("id");
    print_form($container);
    print_submit("Yes");
    print "</form>";
    $container = array();
    $container["url"] = "skeleton.php";
    $container["body"] = "galactic_post_view_article.php";
    transfer("id");
    print_form($container);
Пример #23
0
print "<th>Build</th>";
print "</tr>";
// get game speed
$db->query("SELECT * FROM game WHERE game_id = {$player->game_id}");
if ($db->next_record()) {
    $game_speed = $db->f("game_speed");
}
$db2 = new SmrMySqlDatabase();
$db->query("SELECT * FROM planet_construction ORDER BY construction_id");
while ($db->next_record()) {
    $construction_id = $db->f("construction_id");
    $construction_name = $db->f("construction_name");
    $construction_description = $db->f("construction_description");
    $db2->query("SELECT * FROM planet_cost_credits WHERE construction_id = {$construction_id}");
    if ($db2->next_record()) {
        $cost = $db2->f("amount");
    }
    /*$container = array();
    	$container["url"] = "planet_construction_processing.php";
    	$container["construction_id"] = $construction_id;
    	$container["cost"] = $cost;
    
    	print_form($container);*/
    print "<tr>";
    print "<td>{$construction_name}</td>";
    print "<td>{$construction_description}</td>";
    print "<td align=\"center\">";
    print $planet->construction[$construction_id];
    print "/";
    print $planet->max_construction[$construction_id];
    print "</td>";
Пример #24
0
 print "</tr>";
 while ($db->next_record()) {
     $curr_player = new SMR_PLAYER($db->f("account_id"), $player->game_id);
     $curr_player->get_display_xp_lvl();
     print "<tr>";
     $container = array();
     $container["url"] = "skeleton.php";
     $container["body"] = "trader_search_result.php";
     $container["player_id"] = $curr_player->player_id;
     print "<td>";
     print_link($container, $curr_player->get_colored_name());
     print "<br>";
     $db2->query("SELECT * FROM ship_has_name WHERE game_id = {$player->game_id} AND " . "account_id = {$curr_player->account_id}");
     if ($db2->next_record()) {
         //they have a name so we print it
         $named_ship = stripslashes($db2->f("ship_name"));
         print "{$named_ship}";
     }
     print "</td>";
     print "<td>";
     if ($curr_player->alliance_id > 0) {
         $container = array();
         $container["url"] = "skeleton.php";
         $container["body"] = "alliance_roster.php";
         $container["alliance_id"] = $curr_player->alliance_id;
         print_link($container, "{$curr_player->alliance_name}");
     } else {
         print "(none)";
     }
     print "</td>";
     $container = array();
Пример #25
0
$db->query("SELECT * FROM account_has_stats WHERE account_id = {$account->account_id}");
if ($db->next_record()) {
    print "<b>Extended Stats</b><br>";
    print "You have joined " . $db->f("games_joined") . " games.<br>";
    print "You have busted " . $db->f("planet_busts") . " planets.<br>";
    print "You have busted a total of " . $db->f("planet_bust_levels") . " combined levels on planets.<br>";
    print "You have raided " . $db->f("port_raids") . " ports.<br>";
    print "You have raided a total of " . $db->f("port_raid_levels") . " combined levels of ports.<br>";
    print "You have done " . $db->f("planet_damage") . " damage to planets.<br>";
    print "You have done " . $db->f("port_damage") . " damage to ports.<br>";
    print "You have explored " . $db->f("sectors_explored") . " sectors.<br>";
    print "You have died " . $db->f("deaths") . " times.<br>";
    print "You have traded " . $db->f("goods_traded") . " goods.<br>";
    $db2->query("SELECT sum(amount) as amount FROM account_donated WHERE account_id = {$account->account_id}");
    if ($db2->next_record()) {
        print "You have donated " . $db2->f("amount") . " dollars to SMR.<br>";
    }
    print "You have claimed " . $db->f("bounties_claimed") . " bounties.<br>";
    print "You have claimed " . $db->f("bounty_amount_claimed") . " credits from bounties.<br>";
    print "You have claimed " . $db->f("military_claimed") . " credits from military payment.<br>";
    print "You have had a total of " . $db->f("bounty_amount_on") . " credits bounty placed on you.<br>";
    print "You have done " . $db->f("player_damage") . " damage to other ships.<br>";
    print "The total experience of traders you have killed is " . $db->f("traders_killed_exp") . ".<br>";
    print "You have gained " . $db->f("kill_exp") . " experience from killing other traders.<br>";
    print "You have used " . $db->f("turns_used") . " turns since your last death.<br>";
    print "You have won " . $db->f("blackjack_win") . " credits from Blackjack.<br>";
    print "You have lost " . $db->f("blackjack_lose") . " credits from Blackjack.<br>";
    print "You have won " . $db->f("lotto") . " credits from the lotto.<br>";
    print "You have had " . $db->f("drinks") . " drinks at the bar.<br>";
    print "You have bought " . $db->f("mines") . " mines.<br>";
    print "You have bought " . $db->f("combat_drones") . " combat_drones.<br>";
Пример #26
0
<?php

$container = array();
$container['url'] = 'skeleton.php';
$container['body'] = 'message_blacklist.php';
if (!isset($_REQUEST['PlayerName'])) {
    $container['error'] = 1;
    forward($container);
    exit;
}
$player_name = mysql_real_escape_string($_REQUEST['PlayerName']);
$db = new SmrMySqlDatabase();
$db->query('SELECT account_id FROM player WHERE player_name=\'' . $player_name . '\' AND game_id=' . SmrSession::$game_id . ' LIMIT 1');
if (!$db->next_record()) {
    $container['error'] = 1;
    forward($container);
    exit;
}
$blacklisted_id = $db->f('account_id');
$db->query('SELECT account_id FROM message_blacklist WHERE account_id=' . SmrSession::$old_account_id . ' AND blacklisted_id=' . $blacklisted_id . ' AND game_id=' . SmrSession::$game_id . ' LIMIT 1');
if ($db->next_record()) {
    $container['error'] = 2;
    forward($container);
    exit;
}
$db->query('INSERT INTO message_blacklist (game_id,account_id,blacklisted_id) VALUES (' . SmrSession::$game_id . ',' . SmrSession::$old_account_id . ',' . $blacklisted_id . ')');
$container['error'] = 3;
forward($container);
Пример #27
0
if (isset($game_id)) {
    $container["game_id"] = $game_id;
}
print_link($container, "<b>&lt;&lt;Back</b>");
print "<br>";
print "Here are the ranks of players by {$cat} {$action}<br><br>";
print_table();
print "<tr><th align=center>Rank</th><th align=center>Player</th><th align=center>{$cat} {$action}</th></tr>";
if ($cat == "<b>Money Donated to SMR</b>") {
    $db->query("SELECT account_id, sum(amount) as amount FROM account_donated " . "GROUP BY account_id ORDER BY amount DESC LIMIT 25");
} else {
    $db->query("SELECT account_id, {$row} as amount FROM {$table} {$row} > 0 ORDER BY amount DESC LIMIT 25");
}
while ($db->next_record()) {
    $this_acc = new SMR_ACCOUNT();
    $this_acc->get_by_id($db->f("account_id"));
    if ($db->f("account_id") == ".SmrSession::{$old_account_id}.") {
        $bold = " style=\"font-weight:bold;\"";
    } else {
        $bold = "";
    }
    print "<tr>";
    print "<td align=center{$bold}>" . $rank++ . "</td>";
    //link to stat page
    $container = array();
    $container["url"] = "skeleton.php";
    $container["body"] = "hall_of_fame_player_detail.php";
    $container["acc_id"] = $db->f("account_id");
    if (isset($game_id)) {
        $container["game_id"] = $game_id;
        $container["sending_page"] = 'current_hof';
Пример #28
0
 print "</tr>";
 $db2 = new SmrMySqlDatabase();
 while ($db->next_record()) {
     $race_id_2 = $db->f("race_id_2");
     $type = $db->f("type");
     $end_time = $db->f("end_time");
     print "<tr>";
     print "<td align=\"center\">" . $player->get_colored_race($race_id_2) . "</td>";
     print "<td align=\"center\">{$type}</td>";
     $container = array();
     $container["url"] = "council_vote_processing.php";
     $container["race_id"] = $race_id_2;
     print_form($container);
     $db2->query("SELECT * FROM player_votes_pact " . "WHERE account_id = {$player->account_id} AND " . "game_id = {$player->game_id} AND " . "race_id_1 = {$player->race_id} AND " . "race_id_2 = {$race_id_2}");
     if ($db2->next_record()) {
         $voted_for = $db2->f("vote");
     } else {
         $voted_for = "";
     }
     print "<td nowrap=\"nowrap\" align=\"center\">";
     if ($voted_for == "YES") {
         print_submit_style("Yes", "background-color:green;");
     } else {
         print_submit("Yes");
     }
     print "&nbsp;";
     if ($voted_for == "NO") {
         print_submit_style("No", "background-color:green;");
     } else {
         print_submit("No");
     }
Пример #29
0
        $file .= addbyte($level);
    }
    $db3->query("SELECT * FROM warp WHERE game_id = {$game_id} AND (sector_id_1 = {$sector_id} OR sector_id_2 = {$sector_id}) LIMIT 1");
    if ($db3->next_record()) {
        $CurrByte = 128;
    } else {
        $CurrByte = 0;
    }
    // locations
    $db2->query("SELECT * FROM location NATURAL JOIN location_type WHERE game_id = {$game_id} AND sector_id = {$sector_id} LIMIT 1");
    $CurrByte += $db2->nf();
    $file .= addbyte($CurrByte);
    // warp
    $db3->query("SELECT * FROM warp WHERE game_id = {$game_id} AND (sector_id_1 = {$sector_id} OR sector_id_2 = {$sector_id}) LIMIT 1");
    if ($db3->next_record()) {
        $warp_id = $db3->f("sector_id_1") == $sector_id ? $db3->f("sector_id_2") : $db3->f("sector_id_1");
        $file .= add2bytes($warp_id);
    }
    while ($db2->next_record()) {
        $file .= add2bytes($db2->f("mgu_id"));
    }
}
$size = strlen($file);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"{$game_name}.cmf\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $size);
$attacker_msg = array();
if ($player->getAllianceID() != 0) {
    $db->query('SELECT * FROM player ' . 'WHERE game_id = ' . $player->getGameID() . ' AND ' . 'alliance_id = ' . $player->getAllianceID() . ' AND ' . 'sector_id = ' . $player->getSectorID() . ' AND ' . 'land_on_planet = \'FALSE\' AND ' . 'newbie_turns = 0 ' . 'ORDER BY rand() LIMIT 10');
} else {
    $db->query('SELECT * FROM player ' . 'WHERE game_id = ' . $player->getGameID() . ' AND ' . 'sector_id = ' . $player->getSectorID() . ' AND ' . 'account_id = ' . $player->getAccountID() . ' AND ' . 'land_on_planet = \'FALSE\' AND ' . 'newbie_turns = 0');
}
$db2 = new SmrMySqlDatabase();
while ($db->next_record() && ($forces->hasCDs() || $forces->hasSDs() || $forces->hasMines())) {
    $curr_attacker =& SmrPlayer::getPlayer($db->f('account_id'), SmrSession::$game_id);
    $curr_attacker_ship = new SMR_SHIP($db->f('account_id'), SmrSession::$game_id);
    // disable cloak
    $curr_attacker_ship->disable_cloak();
    $db2->query('SELECT * FROM ship_has_weapon, weapon_type ' . 'WHERE account_id = ' . $curr_attacker->getAccountID() . ' AND ' . 'game_id = ' . SmrSession::$game_id . ' AND ' . 'ship_has_weapon.weapon_type_id = weapon_type.weapon_type_id ' . 'ORDER BY order_id');
    // iterate over all existing weapons
    while ($db2->next_record() && ($forces->hasCDs() || $forces->hasSDs() || $forces->hasMines())) {
        $weapon_name = $db2->f('weapon_name');
        $shield_damage = $db2->f('shield_damage');
        $armour_damage = $db2->f('armour_damage');
        $accuracy = $db2->f('accuracy');
        if ($forces->hasMines()) {
            if ($armour_damage > 0) {
                // mines take 20 armour damage each
                $mines_dead = round($armour_damage / 20);
                // more damage than mines?
                if ($mines_dead > $forces->getMines()) {
                    $mines_dead = $forces->getMines();
                }
                // subtract mines that died
                $forces->takeMines($mines_dead);
                // add damage we did
                $attacker_damage += $mines_dead * 20;