$ACTUAL_TICK = $game->config['tick_id'];
$NEXT_TICK = $game->config['tick_time'] - $game->TIME;
$LAST_TICK_TIME = $game->config['tick_time'] - 5 * 60;
// #############################################################################
// Session-System
include 'include/session.php';
$game->init_player();
$main_html = '';
if (!empty($_POST['change_skin']) || !empty($_GET['change_skin'])) {
    $skin_id = intval(!empty($_POST['change_skin']) ? $_POST['new_skin'] : $_GET['change_skin']);
    $sql = 'SELECT skin_id, skin_name, gfxpack_link, skin_html

            FROM skins

            WHERE skin_id = ' . $skin_id;
    if (($skin_data = $db->queryrow($sql)) === false) {
        message(DATABASE_ERROR, 'Could not query skin data');
    }
    if (empty($skin_data['skin_id'])) {
        message(GENERAL, constant($game->sprache("TEXT0")));
    }
    $sql = 'UPDATE user_templates

            SET user_template = "' . addslashes($skin_data['skin_html']) . '"

            WHERE user_id = ' . $game->player['user_id'];
    if (!$db->query($sql)) {
        message(DATABASE_ERROR, 'Could not update user template data');
    }
    $sql = 'UPDATE user
Beispiel #2
0
// create sql-object for db-connection
if (isset($_GET['sql_debug'])) {
    $db->debug = true;
}
// #############################################################################
// Session-System
include 'session.php';
// #############################################################################
//Generation
define('FPDF_FONTPATH', 'fpdf17/font/');
require 'fpdf17/fpdf.php';
require 'myPDF.php';
$user = $game->player['user_id'];
$id = $_GET['id'];
$sql = 'SELECT id, sender, receiver, subject, text, time FROM message WHERE id = ' . $id;
if (($messagedata = $db->queryrow($sql)) == false) {
    /* 12/06/08 - AC: Look also into archived message */
    $sql = 'SELECT id, sender, receiver, subject, text, time FROM message_archiv WHERE id = ' . $id;
    if (($messagedata = $db->queryrow($sql)) == false) {
        message(DATABASE_ERROR, 'Could not query message data');
    }
}
$sender = $messagedata['sender'];
$receiver = $messagedata['receiver'];
$subject = $messagedata['subject'];
$text = html_entity_decode($messagedata['text']);
$time = date('d.m.y H:i', $messagedata['time']);
if ($user != $receiver) {
    redirect('../index.php?a=messages');
}
//Sender data

-->

</style>

<body bgcolor="#000000" text="#DDDDDD"  background="/gfx/bg_stars1.gif">

  <table class="style_outer" width="550" align="center" border="0" cellpadding="2" cellspacing="2">
    <tr>
      <td>
        <table class="style_inner" width="550" align="center" border="0" cellpadding="2" cellspacing="2">
    
';
if (isset($_GET['user'])) {
    $user_id = (int) $_GET['user'];
    echo '<td>&nbsp;</td><td><font size="3"><b>' . constant($game->sprache("TEXT1")) . '</b></font></td><td><font size="3"><b>' . get_username_by_id($user_id) . '</b></font></td></tr><tr><td>&nbsp;</td></tr><tr><td></td><td width="235"><b>' . constant($game->sprache("TEXT2")) . '</b></td><td width="200"><b>' . constant($game->sprache("TEXT3")) . '</b></td><td width="70"><b>' . constant($game->sprache("TEXT4")) . '</b></td></tr>';
    $config = $db->queryrow('SELECT * FROM config');
    $sql = 'SELECT * FROM ship_trade WHERE user = '******' AND end_time > ' . $config['tick_id'] . '';
    if (!($q_tradedata = $db->query($sql))) {
        message(DATABASE_ERROR, 'Could not query tradedata');
    }
    while ($tradedata = $db->fetchrow($q_tradedata)) {
        echo '<tr><td width="55" align="center">[<a onclick="opener.window.location=this.href;self.close();return false" href="/game/index.php?a=trade&view=view_bidding_detail&id=' . $tradedata['id'] . '">' . constant($game->sprache("TEXT5")) . '</a>]</td><td>' . $tradedata['header'] . '</td><td><img src="' . PROXY_GFX_PATH . '/skin1/menu_metal_small.gif">&nbsp;' . $tradedata['resource_1'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_mineral_small.gif">&nbsp;' . $tradedata['resource_2'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_latinum_small.gif">&nbsp;' . $tradedata['resource_3'] . '&nbsp;<br><img src="' . PROXY_GFX_PATH . '/skin1/menu_unit1_small.gif">&nbsp;' . $tradedata['unit_1'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_unit2_small.gif">&nbsp;' . $tradedata['unit_2'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_unit3_small.gif">&nbsp;' . $tradedata['unit_3'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_unit4_small.gif">&nbsp;' . $tradedata['unit_4'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_unit5_small.gif">&nbsp;' . $tradedata['unit_5'] . '&nbsp;<img src="' . PROXY_GFX_PATH . '/skin1/menu_unit6_small.gif">&nbsp;' . $tradedata['unit_6'] . '</td><td>' . Zeit(TICK_DURATION * ($tradedata['end_time'] - $config['tick_id'])) . '</td></tr>';
    }
} else {
    echo constant($game->sprache("TEXT6"));
}
echo '</table></td></tr></table></body>
</html>';
$db->close();
Beispiel #4
0
    } else {
        if (!ImageCopyResampled($destimg, $srcimg, 0, 0, 0, 0, 150, 159, ImageSX($srcimg), ImageSY($srcimg))) {
            $sdl->log('<b>Error:</b> problem resizing image');
        } else {
            imagepng($destimg, $game_path . 'maps/images/galaxy_detail_small.png');
        }
        imagedestroy($srcimg);
    }
    imagedestroy($destimg);
}
$sdl->finish_job('Create galaxy map');
// #######################################################################################
// #######################################################################################
// Keep light the DB: delete old fleets movements!
$sdl->start_job('Slimming ship movements');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('<b>Error:</b> cannot query tick data!');
} else {
    $ACTUAL_TICK = $cfg_data['tick_id'];
    if (!$cfg_data['tick_stopped']) {
        $oneWeek = 7 * 24 * 60 * 60;
        $time = $ACTUAL_TICK - $oneWeek / (TICK_DURATION * 60);
        // Delete one week old deactivated moves
        $sql = 'DELETE FROM scheduler_shipmovement
                WHERE move_finish <= ' . $time . ' AND
                      move_status <> 0 AND
                      move_exec_started <> 0';
        if (!$db->query($sql)) {
            $sdl->log('<b>Error:</b> cannot delete scheduler_shipmovement data!');
        }
    } else {
Beispiel #5
0
// Init
$starttime = microtime() + time();
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
include $game_path . 'include/libs/world.php';
// Needed by NPC BOT
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$game = new game();
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting Scheduler at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - TICK_DURATION * 60;
$STARDATE = $cfg_data['stardate'];
$FUTURE_SHIP = $cfg_data['future_ship'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished Scheduler in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished Scheduler in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
    exit;
    case 'ITA':
        $not_member = 'Non sei un membro di quest&#146;alleanza!';
        $not_allowed = 'Non hai i permessi per utilizzare questa funzione!';
        $not_allowed = 'Immagine perduta!';
        $fleets_position = 'Posizione flotte:';
        break;
    default:
        $not_member = 'You aren&#146;t a member of this alliance!';
        $not_allowed = 'You aren&#146;t allowed to use this function!';
        $not_allowed = 'Lost image!';
        $fleets_position = 'Fleets positions:';
        break;
}
// Read alliance ID from DB
$sql = 'SELECT alliance_id FROM alliance WHERE alliance_tag LIKE "' . addslashes($_GET['alliance']) . '"';
$alliance = $db->queryrow($sql);
if (!isset($alliance['alliance_id'])) {
    exit;
}
// Name of the generated files:
$image_url = 'maps/tmp/alliance_' . $alliance['alliance_id'] . '_fleets_' . $size . '.png';
$map_url = 'maps/tmp/alliance_' . $alliance['alliance_id'] . '_fleets_' . $size . '.html';
// Check if player is currently member of this ally
if ($game->player['user_alliance'] != $alliance['alliance_id']) {
    echo '<html><body bgcolor="#000000" text="#DDDDDD"  background="/gfx/bg_stars1.gif"><center>
        <span style="font-family: Verdana; font-size: 32px;"><b>' . $not_member . '</b></span><br>
        </body></html>';
    exit;
}
// Check if player has permissions to see this
if ($game->player['user_alliance_rights3'] != 1) {
include 'commons.php';
// ########################################################################################
// ########################################################################################
// Init
$starttime = microtime() + time();
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting FixAll-Script at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - 5 * 60;
$STARDATE = $cfg_data['stardate'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished FixAll-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished FixAll-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
    exit;
}
Beispiel #8
0
    die;
}
$db = new sql($config['server'] . ":" . $config['port'], $config['geodb_database'], $config['user'], $config['password']);
// create sql-object for db-connection
//Range-Bereich
$range_min['x'] = 5.8;
$range_max['x'] = 17.2;
$range_min['y'] = 45.8;
$range_max['y'] = 55.1;
// Größe der Karte in Pixel
$karte_groesse_x = 650;
$karte_groesse_y = 836;
$num = 0;
foreach ($userlist as $user) {
    $sql = "SELECT * FROM geodb_locations WHERE plz like '%" . $user['plz'] . "%' AND adm0='" . $user['country'] . "'  ORDER BY LENGTH(plz)";
    $r = $db->queryrow($sql);
    if ($r['laenge'] > 0) {
        // Dann Geokoordinaten auf Bildgröße skalieren und absolute X,Y-Koordinaten speichern
        $xpos = floor(($r['laenge'] - $range_min['x']) * ($karte_groesse_x / ($range_max['x'] - $range_min['x'])) / 5);
        $ypos = floor(($r['breite'] - $range_max['y']) * ($karte_groesse_y / ($range_min['y'] - $range_max['y'])) / 5);
        $daten[$xpos][$ypos][] = $user['user_name'] . ' ' . $user['country'] . ' - ' . $r['name'] . ' (' . $user['plz'] . ')';
        $num++;
    }
}
$image = ImageCreateFromPNG($game_path . "karte.png");
imageAlphaBlending($image, true);
imageSaveAlpha($image, true);
$color_1 = imagecolorallocate($image, 255, 255, 255);
imagestring($image, 2, 0, 0, 'www.stgc.de - ' . gmdate('d.m.y H:i', time() + TIME_OFFSET) . ' - Brown Bobby - ' . $num . ' Spieler', $color_1);
$map_data .= '<map name="bbmap"> ';
foreach ($daten as $xpos => $datensatz) {
Beispiel #9
0
// #######################################################################################
// #######################################################################################
// Init
$starttime = microtime() + time();
include $game_path . 'include/global.php';
include $game_path . 'include/functions.php';
include $game_path . 'include/text_races.php';
include $game_path . 'include/race_data.php';
include $game_path . 'include/ship_data.php';
include $game_path . 'include/libs/moves.php';
$sdl = new scheduler();
$db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']);
// create sql-object for db-connection
$game = new game();
$sdl->log('<br><br><br><b>-------------------------------------------------------------</b><br>' . '<b>Starting SixHours-Script at ' . date('d.m.y H:i:s', time()) . '</b>');
if (($cfg_data = $db->queryrow('SELECT * FROM config')) === false) {
    $sdl->log('- Fatal: Could not query tick data! ABORTED');
    exit;
}
$ACTUAL_TICK = $cfg_data['tick_id'];
$NEXT_TICK = $cfg_data['tick_time'] - time();
$LAST_TICK_TIME = $cfg_data['tick_time'] - 5 * 60;
$STARDATE = $cfg_data['stardate'];
if ($cfg_data['tick_stopped']) {
    $sdl->log('Finished SixHours-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>Tick has been stopped (Unlock in table "config")');
    exit;
}
if (empty($ACTUAL_TICK)) {
    $sdl->log('Finished SixHours-Script in ' . round(microtime() + time() - $starttime, 4) . ' secs<br>- Fatal: empty($ACTUAL_TICK) == true');
    exit;
}