for ($i = 0; $i < $to_add_counter; $i++) { $sql = 'INSERT INTO ships (fleet_id, user_id, template_id, experience, hitpoints, construction_time, torp, rof, rof2, last_refit_time) VALUES (' . $borg_fleet['fleet_id'] . ', ' . BORG_USERID . ', ' . $borg_tp['sphere'] . ', ' . $borg_std_tp['value_9'] . ', ' . $borg_std_tp['value_5'] . ', ' . time() . ', ' . $borg_std_tp['max_torp'] . ', ' . $borg_std_tp['rof'] . ', ' . $borg_std_tp['rof2'] . ', ' . time() . ')'; if (!$db->query($sql)) { $sdl->log('<b>Error:</b>: could not insert new sphere in ships! CONTINUE'); } } } $sdl->finish_job('Unimatrix Zero Maintenance'); $sdl->start_job('borg_npc_target Maintenance'); $db->query('UPDATE borg_npc_target SET timeout = ' . $ACTUAL_TICK . ' + 1440, delay = 1 WHERE tries > 4 AND delay = 0'); $db->query('UPDATE borg_npc_target SET timeout = 0, tries = 0, delay = 0, priority = priority + 1 WHERE delay = 1 AND timeout < ' . $ACTUAL_TICK); $sdl->finish_job('borg_npc_target Maintenance'); $sdl->start_job('User SlowStats Update'); $sql = 'SELECT user_id FROM user WHERE user_active = 1 AND user_auth_level = 1'; $user_set = $db->queryrowset($sql); foreach ($user_set as $s_user) { $charted = $db->queryrow('SELECT COUNT(*) AS num FROM starsystems_details sd INNER JOIN starsystems ss USING (system_id) WHERE ss.system_closed = 0 AND sd.user_id = ' . $s_user['user_id']); $first_contact = $db->queryrow('SELECT COUNT(*) AS num FROM settlers_relations WHERE user_id = ' . $s_user['user_id'] . ' AND log_code = 1'); $settler_made = $db->queryrow('SELECT COUNT(*) AS num FROM settlers_relations WHERE user_id = ' . $s_user['user_id'] . ' AND log_code = 30'); $settler_best = $db->queryrow('SELECT COUNT(*) AS num FROM planets WHERE planet_owner = ' . INDEPENDENT_USERID . ' AND best_mood_user = '******'user_id']); $sql = 'UPDATE user SET user_charted = ' . $charted['num'] . ', user_first_contact = ' . $first_contact['num'] . ', user_settler_made = ' . $settler_made['num'] . ', user_settler_best = ' . $settler_best['num'] . ' WHERE user_id = ' . $s_user['user_id']; if (!$db->query($sql)) { $sdl->log('<b>Error:</b>: could not update user #' . $s_user['user_id'] . ' slow stats data! CONTINUE.'); } } $sdl->finish_job('User SlowStats Update'); $sdl->start_job('Buildings / Research level fix'); if (isset($MAX_BUILDING_LVL)) { $count = 0; $qry = $db->query('SELECT p.*,u.user_capital,u.pending_capital_choice FROM (planets p) LEFT JOIN (user u) ON u.user_id=p.planet_owner WHERE p.planet_owner<>0 ORDER BY planet_id ASC');
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ // include game definitions, path url and so on include 'config.script.php'; error_reporting(E_ERROR); ini_set('memory_limit', '200M'); include $game_path . 'include/sql.php'; include $game_path . 'include/global.php'; include $game_path . 'include/functions.php'; // create sql-object for db-connection $db = new sql($config['server'] . ":" . $config['port'], $config['game_database'], $config['user'], $config['password']); // create sql-object for db-connection $game = new game(); if (($userlist = $db->queryrowset('SELECT user_name, plz, country FROM user WHERE user_active=1 AND plz>0')) === false) { 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)";