Example #1
0
function tpl_parse_fleet_db($fleet, $index, $user_data = false)
{
    global $lang, $time_now, $user, $sn_data;
    if (!$user_data) {
        $user_data = $user;
    }
    if ($fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] == 2) {
        $aks = doquery("SELECT * FROM {{aks}} WHERE id={$fleet['fleet_group']} LIMIT 1;", '', true);
    }
    $spy_level = $user['id'] == $fleet['fleet_owner'] ? 100 : $user[$sn_data[TECH_SPY]['name']] + $user[$sn_data[MRC_SPY]['name']];
    $return['fleet'] = array('NUMBER' => $index, 'ID' => $fleet['fleet_id'], 'OWNER' => $fleet['fleet_owner'], 'TARGET_OWNER' => $fleet['fleet_target_owner'], 'MESSAGE' => $fleet['fleet_mess'], 'MISSION' => $fleet['fleet_mission'], 'MISSION_NAME' => $lang['type_mission'][$fleet['fleet_mission']], 'ACS' => $aks['name'], 'AMOUNT' => $spy_level >= 4 ? pretty_number($fleet['fleet_amount']) . ($fleet['fleet_resource_metal'] + $fleet['fleet_resource_crystal'] + $fleet['fleet_resource_deuterium'] ? '+' : '') : '?', 'METAL' => $spy_level >= 8 ? $fleet['fleet_resource_metal'] : 0, 'CRYSTAL' => $spy_level >= 8 ? $fleet['fleet_resource_crystal'] : 0, 'DEUTERIUM' => $spy_level >= 8 ? $fleet['fleet_resource_deuterium'] : 0, 'START_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$fleet['fleet_start_type']], 'START_COORDS' => "[{$fleet['fleet_start_galaxy']}:{$fleet['fleet_start_system']}:{$fleet['fleet_start_planet']}]", 'START_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['fleet_end_time']), 'START_LEFT' => floor($fleet['fleet_end_time'] + 1 - $time_now), 'START_URL' => uni_render_coordinates_href($fleet, 'fleet_start_', 3), 'START_NAME' => $fleet['fleet_start_name'], 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$fleet['fleet_end_type']], 'END_COORDS' => "[{$fleet['fleet_end_galaxy']}:{$fleet['fleet_end_system']}:{$fleet['fleet_end_planet']}]", 'END_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['fleet_start_time']), 'END_LEFT' => floor($fleet['fleet_start_time'] + 1 - $time_now), 'END_URL' => uni_render_coordinates_href($fleet, 'fleet_end_', 3), 'END_NAME' => $fleet['fleet_end_name'], 'STAY_TIME' => date(FMT_DATE_TIME, $fleet['fleet_end_stay']), 'STAY_LEFT' => floor($fleet['fleet_end_stay'] + 1 - $time_now), 'OV_LABEL' => $fleet['ov_label'], 'OV_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['ov_time']), 'OV_LEFT' => floor($fleet['ov_time'] + 1 - $time_now), 'OV_THIS_PLANET' => $fleet['ov_this_planet']);
    $ship_list = explode(';', $fleet['fleet_array']);
    if ($spy_level >= 6) {
        foreach ($ship_list as $ship_record) {
            if ($ship_record) {
                $ship_data = explode(',', $ship_record);
                if ($spy_level >= 10) {
                    $return['ships'][$ship_data[0]] = array('ID' => $ship_data[0], 'NAME' => $lang['tech'][$ship_data[0]], 'AMOUNT' => $ship_data[1], 'CONSUMPTION' => GetShipConsumption($ship_data[0], $user_data), 'SPEED' => get_ship_speed($ship_data[0], $user_data), 'CAPACITY' => $sn_data[$ship_data[0]]['capacity']);
                } else {
                    $return['ships'][$ship_data[0]] = array('ID' => $ship_id++, 'NAME' => $lang['tech'][SHIP_FLEET], 'AMOUNT' => $ship_data[1], 'CONSUMPTION' => 0, 'SPEED' => 0, 'CAPACITY' => 0);
                }
            }
        }
    }
    return $return;
}
Example #2
0
function _rewardPurchase($userId, $currency, $mc_gross)
{
    // Make userid safe to use in query
    $userId = mysql_real_escape_string($userId);
    $timer = time();
    $INFO1 = mysql_query("SELECT * FROM `uni1_users` WHERE `id` = " . $userId . ";");
    if ($INFO1['lp_points'] >= 0) {
        $tex = 1;
    } elseif ($INFO1['lp_points'] >= 125) {
        $tex = 2;
    } elseif ($INFO1['lp_points'] >= 625) {
        $tex = 4;
    } elseif ($INFO1['lp_points'] >= 2500) {
        $tex = 6;
    } elseif ($INFO1['lp_points'] >= 7000) {
        $tex = 8;
    }
    mysql_query("UPDATE `uni1_users` SET `lp_points` = `lp_points` + " . $mc_gross * $tex . ", `antimatter` = `antimatter` + " . $currency . " WHERE `id` = '" . $userId . "';");
    if ($INFO1['ref_id'] != 0) {
        mysql_query("UPDATE `uni1_users` SET `antimatter` = `antimatter` + " . $currency / 100 * 5 . " WHERE `id` = '" . $INFO1['ref_id'] . "';");
        SendSimpleMessage($INFO1['ref_id'], '', $timer, 4, 'System', 'Anti Matter Order', 'Referal PayPal payment was successful. <br>' . pretty_number($currency / 100 * 5) . ' anti matter have been credited to your account.');
    }
    SendSimpleMessage($userId, '', $timer, 4, 'System', 'Anti Matter Order', 'PayPal payment was successful. <br>' . pretty_number($currency) . ' anti matter have been credited to your account.');
    SendSimpleMessage(1, '', $timer, 4, 'System', 'Anti Matter Order', 'PayPal payment was successful. <br>' . pretty_number($currency) . ' Anti Matter Units have been credited to ' . $userId . ' account.');
    if (DEBUG == true) {
        error_log(date('[Y-m-d H:i e] ') . "Verified IPN: {$req} " . PHP_EOL, 3, LOG_FILE);
    }
}
Example #3
0
function int_calc_storage_bar($resource_id)
{
    global $lang, $template, $caps_real, $planetrow, $user;
    $totalProduction = $caps_real['total'][$resource_id];
    $storage_fill = $caps_real['total_storage'][$resource_id] ? floor(mrc_get_level($user, $planetrow, $resource_id) / $caps_real['total_storage'][$resource_id] * 100) : 0;
    $template->assign_block_vars('resources', array('NAME' => $lang["sys_" . pname_resource_name($resource_id)], 'HOURLY' => pretty_number($totalProduction, true, true), 'WEEKLY' => pretty_number($totalProduction * 24 * 7, true, true), 'DAILY' => pretty_number($totalProduction * 24, true, true), 'MONTHLY' => pretty_number($totalProduction * 24 * 30, true, true), 'STORAGE' => intval($storage_fill), 'BAR' => min($storage_fill, 100)));
}
    function run()
    {
        if (Config::get(ROOT_UNI)->ref_active != 1) {
            return null;
        }
        /** @var $langObjects Language[] */
        $langObjects = array();
        $db = Database::get();
        $sql = 'SELECT `username`, `ref_id`, `id`, `lang`, user.`universe`
		FROM %%USERS%% user
		INNER JOIN %%STATPOINTS%% as stats
		ON stats.`id_owner` = user.`id` AND stats.`stat_type` = :type AND stats.`total_points` >= :points
		WHERE user.`ref_bonus` = 1;';
        $userArray = $db->select($sql, array(':type' => 1, ':points' => Config::get(ROOT_UNI)->ref_minpoints));
        foreach ($userArray as $user) {
            if (!isset($langObjects[$user['lang']])) {
                $langObjects[$user['lang']] = new Language($user['lang']);
                $langObjects[$user['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
            }
            $userConfig = Config::get($user['universe']);
            $LNG = $langObjects[$user['lang']];
            $sql = 'UPDATE %%USERS%% SET `darkmatter` = `darkmatter` + :bonus WHERE `id` = :userId;';
            $db->update($sql, array(':bonus' => $userConfig->ref_bonus, ':userId' => $user['ref_id']));
            $sql = 'UPDATE %%USERS%% SET `ref_bonus` = 0 WHERE `id` = :userId;';
            $db->update($sql, array(':userId' => $user['id']));
            $Message = sprintf($LNG['sys_refferal_text'], $user['username'], pretty_number($userConfig->ref_minpoints), pretty_number($userConfig->ref_bonus), $LNG['tech'][921]);
            PlayerUtil::sendMessage($user['ref_id'], '', $LNG['sys_refferal_from'], 4, sprintf($LNG['sys_refferal_title'], $user['username']), $Message, TIMESTAMP);
        }
        return true;
    }
Example #5
0
function _rewardPurchase($userId, $pay, $realpay, $received, $credits, $type, $transac, $code, $timer)
{
    // Make userid safe to use in query
    $userId = mysql_real_escape_string($userId);
    $timer = time();
    $INFO1 = mysql_query("SELECT * FROM `uni1_users` WHERE `id` = " . mysql_escape_string($userId) . ";");
    if ($INFO1['lp_points'] >= 0) {
        $tex = 1;
    } elseif ($INFO1['lp_points'] >= 125) {
        $tex = 2;
    } elseif ($INFO1['lp_points'] >= 625) {
        $tex = 4;
    } elseif ($INFO1['lp_points'] >= 2500) {
        $tex = 6;
    } elseif ($INFO1['lp_points'] >= 7000) {
        $tex = 8;
    }
    mysql_query("UPDATE `uni1_users` SET `lp_points` = `lp_points` + " . $mc_gross * $tex . ", `antimatter` = `antimatter` + '" . $credits . "' WHERE `id` = '" . mysql_escape_string($userId) . "';");
    mysql_query("INSERT INTO `uni1_allopass_log` VALUES ('', '" . mysql_escape_string($userId) . "', '" . mysql_escape_string($code) . "', '" . mysql_escape_string($credits) . "','" . mysql_escape_string($type) . "', '" . mysql_escape_string($transac) . "', '" . mysql_escape_string($pay) . "', '" . mysql_escape_string($realpay) . "', '" . mysql_escape_string($received) . "',  '" . $timer . "', '1');");
    if ($INFO1['ref_id'] != 0) {
        mysql_query("UPDATE `uni1_users` SET `antimatter` = `antimatter` + " . $INFO['amount'] / 100 * 5 . " WHERE `id` = '" . $INFO1['ref_id'] . "';");
        SendSimpleMessage($INFO1['ref_id'], '', TIMESTAMP, 4, 'System', 'Anti Matter Order', 'Referal PayPal payment was successful. <br>' . pretty_number($INFO['amount'] / 100 * 5) . ' anti matter have been credited to your account.');
    }
    SendSimpleMessage(mysql_escape_string($userId), '', $timer, 4, 'System', 'Anti Matter Order', 'Allopass payment was successful. <br>' . pretty_number($credits + $credits / 100 * $text) . ' Anti Matter Units have been credited to your account');
    //Admin Message
    SendSimpleMessage(1, '', $timer, 4, 'System', 'Anti Matter Order', 'Allopass payment was successful. <br>' . pretty_number($credits + $credits / 100 * $text) . ' Anti Matter Units have been credited to ' . $userId . '');
}
Example #6
0
 function ReturnEvent()
 {
     $LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
     $Message = sprintf($LNG['sys_fleet_won'], $TargetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['Metal'], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['Crystal'], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['Deuterium']);
     SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
     $this->RestoreFleet();
 }
 function ReturnEvent()
 {
     $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
     $Message = sprintf($LNG['sys_stat_mess'], GetStartAddressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
     PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_tower'], 4, $LNG['sys_mess_fleetback'], $Message, $this->_fleet['fleet_end_time'], NULL, 1, $this->_fleet['fleet_universe']);
     $this->RestoreFleet();
 }
Example #8
0
function GetElementPrice($USER, $PLANET, $Element, $USERfactor = true)
{
    global $pricelist, $resource, $LNG;
    if ($USERfactor) {
        $level = isset($PLANET[$resource[$Element]]) ? $PLANET[$resource[$Element]] : $USER[$resource[$Element]];
    }
    $array = array('metal' => $LNG['Metal'], 'crystal' => $LNG['Crystal'], 'deuterium' => $LNG['Deuterium'], 'energy_max' => $LNG['Energy'], 'darkmatter' => $LNG['Darkmatter']);
    $text = "";
    foreach ($array as $ResType => $ResTitle) {
        if ($pricelist[$Element][$ResType] != 0) {
            $text .= $ResTitle . ": ";
            if ($USERfactor) {
                $cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
            } else {
                $cost = floor($pricelist[$Element][$ResType]);
            }
            if (isset($PLANET[$ResType]) && $cost > $PLANET[$ResType] || isset($USER[$ResType]) && $cost > $USER[$ResType]) {
                $text .= "<b style=\"color:red;\" id=\"" . $ResType . "_" . $Element . "\">" . pretty_number($cost) . "</b> ";
            } else {
                $text .= "<b style=\"color:lime;\" id=\"" . $ResType . "_" . $Element . "\">" . pretty_number($cost) . "</b> ";
            }
        }
    }
    return $text;
}
 function show()
 {
     global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
     $code = isset($_GET['code']) ? $_GET['code'] : null;
     $quer = $GLOBALS['DATABASE']->query("SELECT *FROM `uni1_allopass_log` where `code` = '" . $code . "' ;");
     if ($GLOBALS['DATABASE']->numRows($quer) < 1) {
         $this->printMessage("We are proceeding the payment, do not quit this page. <br> you wil be redirected in 5 seconds", true, array('game.php?page=allo&code=' . $code . '', 5));
         die;
     }
     $query = $GLOBALS['DATABASE']->query("SELECT transac, date, orderid, reference_paid, credits FROM `uni1_allopass_log` where `code` = '" . $code . "' ;");
     $query = $GLOBALS['DATABASE']->fetch_array($query);
     $INFO1 = $GLOBALS['DATABASE']->uniquequery("SELECT * FROM `uni1_users` WHERE `id` = " . $USER['id'] . ";");
     if ($INFO1['lp_points'] == 0) {
         $text = 0;
     }
     if ($INFO1['lp_points'] > 0) {
         $text = 0;
     }
     if ($INFO1['lp_points'] >= 125) {
         $text = 5;
     }
     if ($INFO1['lp_points'] >= 625) {
         $text = 10;
     }
     if ($INFO1['lp_points'] >= 2500) {
         $text = 15;
     }
     if ($INFO1['lp_points'] >= 7000) {
         $text = 20;
     }
     $this->tplObj->assign_vars(array('transac' => $query['transac'], 'code' => $code, 'date' => str_replace(' ', '&nbsp;', _date($LNG['php_tdformat'], $query['date']), $USER['timezone']), 'orderid' => $query['orderid'], 'total' => $query['reference_paid'], 'credits' => pretty_number($query['credits'] + $query['credits'] / 100 * $text)));
     $this->display('page.allo.order.tpl');
 }
Example #10
0
function ShowGalaxyFooterlist($Galaxy, $System, $CurrentMIP, $CurrentRC, $CurrentSP)
{
    global $lang, $maxfleet_count, $fleetmax, $planetcount;
    $Result = "";
    if ($planetcount == 1) {
        $PlanetCountMessage = $planetcount . " " . $lang['gf_cntmone'];
    } elseif ($planetcount == 0) {
        $PlanetCountMessage = $lang['gf_cntmnone'];
    } else {
        $PlanetCountMessage = $planetcount . " " . $lang['gf_cntmsome'];
    }
    $Recyclers = pretty_number($CurrentRC);
    $SpyProbes = pretty_number($CurrentSP);
    $Result .= "<table ><tbody>";
    $Result .= "<td class=l style=\"font-weight: bold\" height=\"15\" width=\"180\" colspan=3><span id=\"slots\">" . $maxfleet_count . "</span>/" . $fleetmax . " " . $lang['gf_fleetslt'] . "&nbsp;</td>";
    $Result .= "<td class=l style=\"font-weight: bold\" height=\"15\" width=\"180\" colspan=2><span id=\"recyclers\">" . $Recyclers . "</span> " . $lang['gf_rc_title'] . "&nbsp;</td>";
    $Result .= "<td class=l style=\"font-weight: bold\" height=\"15\" width=\"170\" colspan=2><span id=\"probes\">" . $SpyProbes . "</span> " . $lang['gf_sp_title'] . "&nbsp;</td>";
    $Result .= "</tr>";
    $Result .= "<tr style=\"display: none;\" id=\"fleetstatusrow\">";
    $Result .= "<th class=c colspan=8><!--<div id=\"fleetstatus\"></div>-->";
    $Result .= "<table style=\"font-weight: bold\" width=\"90%\" id=\"fleetstatustable\">";
    $Result .= "<!-- will be filled with content later on while processing ajax replys -->";
    $Result .= "</tr></tbody></table>";
    $Result .= "</tr>";
    /*
    <tr style=\"display: none;\" id=\"fleetstatusrow\"><th colspan="8"><!--<div id="fleetstatus"></div>-->
    <table style="font-weight: bold;" width=100% id="fleetstatustable">
    <!-- will be filled with content later on while processing ajax replys -->
    </table>
    </th>
    </tr>
    */
    return $Result;
}
Example #11
0
 function IPN()
 {
     global $USER;
     /* if (!$this_p->validate_ipn())
                          {
     					message('There was an error');
     				  }
     			*/
     $ID = HTTP::_GP('custom', '');
     $txn_id = $_GET['txn_id'];
     $mc_gross = $_GET['mc_gross'];
     //print_r($ID);
     //  $ID        = HTTP::_GP('amount','');
     $explode = explode(',', $ID);
     $user_id = $explode[0];
     $the_id = $explode[1];
     if (empty($ID)) {
         message("Error occured");
     }
     $INFO = $GLOBALS['DATABASE']->uniquequery("SELECT * FROM `uni1_paypal` WHERE `id` = " . $GLOBALS['DATABASE']->sql_escape($the_id) . " and `player` = " . $GLOBALS['DATABASE']->sql_escape($user_id) . ";");
     //print_r($INFO);
     if (!empty($INFO)) {
         $GLOBALS['DATABASE']->query("UPDATE `uni1_users` SET `darkmatter` = `darkmatter` + " . $INFO['amount'] . " WHERE `id` = '" . $INFO['player'] . "';");
         $GLOBALS['DATABASE']->query("DELETE FROM `uni1_paypal` WHERE `id` = '" . $the_id . "';");
         //$GLOBALS['DATABASE']->query("INSERT INTO `uni1_paypal_log` VALUES (null,".$INFO['player'].",".$INFO['amount'].",".TIMESTAMP.") ;");
         $GLOBALS['DATABASE']->query("INSERT INTO `uni1_paysafecard_log` VALUES ('', '" . mysql_escape_string($user_id) . "',  '" . TIMESTAMP . "', '" . $txn_id . "', '" . $mc_gross . "','1', 'Paypal', '1');");
         message(pretty_number($INFO['amount']) . ' Credit have been added to your account. <br><br><a href="?page=overview">Continue</a>');
     } else {
         message('Error please contact the administrator <br><br><a href="?page=overview">Continue</a>');
     }
 }
 function show()
 {
     global $USER, $PLANET, $LNG, $UNI, $CONF, $resource, $pricelist;
     $mode = HTTP::_GP('y', '');
     $table = "";
     $range = $PLANET['hangar'] * 3 - 2;
     if ($range < 0) {
         $range = 0;
     }
     if ($mode == '1') {
         $cautare = $GLOBALS['DATABASE']->query("SELECT *from " . PLANETS . " where (`der_metal` >0 OR `der_crystal` >0) AND (`system` > '" . ($PLANET['system'] - $range) . "' AND `system` < '" . ($PLANET['system'] + $range) . "') AND `galaxy` = '" . $PLANET['galaxy'] . "' and `planet_type` = '1' AND universe = " . $UNI . " ;");
         $table = "<tr><th>" . $LNG['debris_action_1'] . "</th><th>" . $LNG['debris_action_2'] . "</th><th>" . $LNG['debris_action_3'] . "</th><th>" . $LNG['debris_action_4'] . "</th><th>" . $LNG['debris_action_5'] . "</th><th>" . $LNG['debris_action_6'] . "\n\t\t\t</th></tr>";
         //print_r($cautare);
         if ($GLOBALS['DATABASE']->numRows($cautare) > 0) {
             while ($GalaxyRowPlanet = $GLOBALS['DATABASE']->fetch_array($cautare)) {
                 $GRecNeeded = min(ceil(($GalaxyRowPlanet['der_metal'] + $GalaxyRowPlanet['der_crystal']) / $pricelist[219]['capacity']), $PLANET[$resource[219]]);
                 $table .= "<tr><td>" . $GalaxyRowPlanet['galaxy'] . "</td><td>" . $GalaxyRowPlanet['system'] . "</td><td>" . $GalaxyRowPlanet['planet'] . "</td><td>" . pretty_number($GalaxyRowPlanet['der_metal']) . "</td><td>" . pretty_number($GalaxyRowPlanet['der_crystal']) . "</td><td><a href='javascript:doit(8," . $GalaxyRowPlanet['id'] . ");'>" . $LNG['debris_action_6'] . "</a></td></tr>";
             }
         } else {
             $table .= "<tr><td colspan='6'>" . $LNG['debris_action_7'] . "</td></tr>";
         }
     }
     $this->tplObj->assign_vars(array('range' => $range, 'debris' => $table, 'user_maxfleetsettings' => $USER['settings_fleetactions']));
     $this->display("page.finddebris.default.tpl");
 }
Example #13
0
function flt_mission_relocate($mission_data)
{
    $fleet_row = $mission_data['fleet'];
    $destination_planet = $mission_data['dst_planet'];
    if (!$destination_planet || !is_array($destination_planet)) {
        doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
        return CACHE_FLEET;
    }
    /*
        // flt_mission_relocate
        $TargetAdress         = sprintf ($lang['sys_adress_planet'], $fleet_row['fleet_start_galaxy'], $fleet_row['fleet_start_system'], $fleet_row['fleet_start_planet']);
        $TargetAddedGoods     = sprintf ($lang['sys_stay_mess_goods'],
                          $lang['Metal'], pretty_number($fleet_row['fleet_resource_metal']),
                          $lang['Crystal'], pretty_number($fleet_row['fleet_resource_crystal']),
                          $lang['Deuterium'], pretty_number($fleet_row['fleet_resource_deuterium']));
    
        $TargetMessage        = $lang['sys_stay_mess_back'] ."<a href=\"galaxy.php?mode=3&galaxy=". $fleet_row['fleet_start_galaxy'] ."&system=". $fleet_row['fleet_start_system'] ."\">";
        $TargetMessage       .= $TargetAdress. "</a>". $lang['sys_stay_mess_bend'] ."<br />". $TargetAddedGoods;
    
        SendSimpleMessage ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
    */
    global $lang;
    $TargetUserID = $destination_planet['id_owner'];
    $TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']);
    $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($fleet_row['fleet_resource_metal']), $lang['Crystal'], pretty_number($fleet_row['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($fleet_row['fleet_resource_deuterium']));
    $TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $fleet_row['fleet_end_galaxy'] . "&system=" . $fleet_row['fleet_end_system'] . "\">";
    $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
    msg_send_simple_message($TargetUserID, '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
    return RestoreFleetToPlanet($fleet_row, false);
}
Example #14
0
 public function show()
 {
     global $LNG, $USER, $resource;
     $darkmatter_cost_trader = Config::get()->darkmatter_cost_trader;
     $this->assign(array('tr_cost_dm_trader' => sprintf($LNG['tr_cost_dm_trader'], pretty_number($darkmatter_cost_trader), $LNG['tech'][921]), 'charge' => self::$Charge, 'resource' => $resource, 'requiredDarkMatter' => $USER['darkmatter'] < $darkmatter_cost_trader ? sprintf($LNG['tr_not_enought'], $LNG['tech'][921]) : false));
     $this->display("page.trader.default.tpl");
 }
 function show()
 {
     global $LNG, $USER, $PLANET, $resource, $reslist;
     if ($USER['planet_sort'] == 0) {
         $Order = "id ";
     } elseif ($USER['planet_sort'] == 1) {
         $Order = "galaxy, system, planet, planet_type ";
     } elseif ($USER['planet_sort'] == 2) {
         $Order = "name ";
     }
     $Order .= $USER['planet_sort_order'] == 1 ? "DESC" : "ASC";
     $PlanetsRAW = $GLOBALS['DATABASE']->query("SELECT * FROM " . PLANETS . " WHERE id_owner = '" . $USER['id'] . "' AND destruyed = '0' AND planet_type != '4' ORDER BY " . $Order . ";");
     $elementALL = array(212, 202, 203, 204, 205, 229, 209, 206, 207, 217, 215, 213, 211, 219, 225, 226, 214, 216, 230, 227, 228, 222, 218, 221, 208, 210, 220, 223);
     $elementALLBis = array(401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 416, 417, 418, 419, 420, 421, 422, 502, 503);
     $elementAllTris = array(1, 2, 3, 4, 5, 6, 12, 14, 15, 21, 22, 23, 24, 31, 33, 34, 41, 42, 43, 44, 48);
     foreach ($elementAllTris as $Element) {
         $elementListallTris[$Element] = array('id' => $Element);
     }
     foreach ($elementALL as $Element) {
         $elementListall[$Element] = array('id' => $Element);
     }
     foreach ($elementALLBis as $Element) {
         $elementListallBis[$Element] = array('id' => $Element);
     }
     $planetList = array();
     $PlanetRess = new ResourceUpdate();
     while ($PLANETA = $GLOBALS['DATABASE']->fetch_array($PlanetsRAW)) {
         list($USER, $PLANETA) = $PlanetRess->CalcResource($USER, $PLANETA, true);
         $planetList[] = array('id' => $PLANETA['id'], 'name' => $PLANETA['name'], 'image' => $PLANETA['image'], 'galaxy' => $PLANETA['galaxy'], 'system' => $PLANETA['system'], 'planet' => $PLANETA['planet'], 'type' => $PLANETA['planet_type'], 'metal_percent' => round($PLANETA['metal'] * 100 / $PLANETA['metal_max']), 'cystal_percent' => round($PLANETA['crystal'] * 100 / $PLANETA['crystal_max']), 'deut_percent' => round($PLANETA['deuterium'] * 100 / $PLANETA['deuterium_max']), 'metal_mine' => $PLANETA['metal_mine'], 'crystal_mine' => $PLANETA['crystal_mine'], 'deuterium_sintetizer' => $PLANETA['deuterium_sintetizer'], 'solar_plant' => $PLANETA['solar_plant'], 'searcher' => $PLANETA['searcher'], 'fusion_plant' => $PLANETA['fusion_plant'], 'robot_factory' => $PLANETA['robot_factory'], 'nano_factory' => $PLANETA['nano_factory'], 'hangar' => $PLANETA['hangar'], 'metal_store' => $PLANETA['metal_store'], 'crystal_store' => $PLANETA['crystal_store'], 'deuterium_store' => $PLANETA['deuterium_store'], 'laboratory' => $PLANETA['laboratory'], 'terraformer' => $PLANETA['terraformer'], 'university' => $PLANETA['university'], 'ally_deposit' => $PLANETA['ally_deposit'], 'silo' => $PLANETA['silo'], 'mondbasis' => $PLANETA['mondbasis'], 'phalanx' => $PLANETA['phalanx'], 'sprungtor' => $PLANETA['sprungtor'], 'collider' => $PLANETA['collider'], 'solar_satelit' => pretty_number($PLANETA['solar_satelit']), 'small_ship_cargo' => pretty_number($PLANETA['small_ship_cargo']), 'big_ship_cargo' => pretty_number($PLANETA['big_ship_cargo']), 'light_hunter' => pretty_number($PLANETA['light_hunter']), 'heavy_hunter' => pretty_number($PLANETA['heavy_hunter']), 'M7' => pretty_number($PLANETA['M7']), 'recycler' => pretty_number($PLANETA['recycler']), 'crusher' => pretty_number($PLANETA['crusher']), 'battle_ship' => pretty_number($PLANETA['battle_ship']), 'ev_transporter' => pretty_number($PLANETA['ev_transporter']), 'battleship' => pretty_number($PLANETA['battleship']), 'destructor' => pretty_number($PLANETA['destructor']), 'bomber_ship' => pretty_number($PLANETA['bomber_ship']), 'М19' => pretty_number($PLANETA['М19']), 'giga_recykler' => pretty_number($PLANETA['giga_recykler']), 'galleon' => pretty_number($PLANETA['galleon']), 'destroyer' => pretty_number($PLANETA['destroyer']), 'dearth_star' => pretty_number($PLANETA['dearth_star']), 'lune_noir' => pretty_number($PLANETA['lune_noir']), 'M32' => pretty_number($PLANETA['M32']), 'frigate' => pretty_number($PLANETA['frigate']), 'black_wanderer' => pretty_number($PLANETA['black_wanderer']), 'flying_death' => pretty_number($PLANETA['flying_death']), 'star_crasher' => pretty_number($PLANETA['star_crasher']), 'bs_class_oneil' => pretty_number($PLANETA['bs_class_oneil']), 'colonizer' => pretty_number($PLANETA['colonizer']), 'spy_sonde' => pretty_number($PLANETA['spy_sonde']), 'dm_ship' => pretty_number($PLANETA['dm_ship']), 'Scrappy' => pretty_number($PLANETA['Scrappy']), 'misil_launcher' => pretty_number($PLANETA['misil_launcher']), 'small_laser' => pretty_number($PLANETA['small_laser']), 'big_laser' => pretty_number($PLANETA['big_laser']), 'gauss_canyon' => pretty_number($PLANETA['gauss_canyon']), 'ionic_canyon' => pretty_number($PLANETA['ionic_canyon']), 'buster_canyon' => pretty_number($PLANETA['buster_canyon']), 'small_protection_shield' => pretty_number($PLANETA['small_protection_shield']), 'big_protection_shield' => pretty_number($PLANETA['big_protection_shield']), 'planet_protector' => pretty_number($PLANETA['planet_protector']), 'graviton_canyon' => pretty_number($PLANETA['graviton_canyon']), 'orbital_station' => pretty_number($PLANETA['orbital_station']), 'lepton_gun' => pretty_number($PLANETA['lepton_gun']), 'proton_gun' => pretty_number($PLANETA['proton_gun']), 'canyon' => pretty_number($PLANETA['canyon']), 'hydrogen_gun' => pretty_number($PLANETA['hydrogen_gun']), 'dora_gun' => pretty_number($PLANETA['dora_gun']), 'photon_cannon' => pretty_number($PLANETA['photon_cannon']), 'particle_emitter' => pretty_number($PLANETA['particle_emitter']), 'slim_mehador' => pretty_number($PLANETA['slim_mehador']), 'iron_mehador' => pretty_number($PLANETA['iron_mehador']), 'grand_mehador' => pretty_number($PLANETA['grand_mehador']), 'interceptor_misil' => pretty_number($PLANETA['interceptor_misil']), 'interplanetary_misil' => pretty_number($PLANETA['interplanetary_misil']), 'current' => $PLANETA['field_current'], 'max' => CalculateMaxPlanetFields($PLANETA), 'energy_used' => $PLANETA['energy'] + $PLANETA['energy_used'], 'resource901' => pretty_number($PLANETA['metal']), 'resource902' => pretty_number($PLANETA['crystal']), 'resource903' => pretty_number($PLANETA['deuterium']), 'resource911' => pretty_number($PLANETA['energy']));
     }
     $this->tplObj->loadscript("empire.js");
     $this->tplObj->assign_vars(array('planetList' => $planetList, 'elementListall' => $elementListall, 'elementListallBis' => $elementListallBis, 'elementListallTris' => $elementListallTris));
     $this->display('page.empire.default.tpl');
 }
Example #16
0
function ShowTopKB()
{
    global $lang;
    //anzeige der Top 100 Liste
    includeLang('INGAME');
    $parse = $lang;
    $RowsTPL = gettemplate('topkb/topkb_rows');
    $top = doquery("SELECT * FROM {{table}} ORDER BY gesamtunits DESC LIMIT 100;", 'topkb');
    $a = 0;
    while ($data = mysql_fetch_array($top)) {
        $a++;
        $timedeut = date("D d M H:i:s", $data['time']);
        $user1 = doquery("SELECT * FROM {{table}} WHERE username='******';", 'users', true);
        if ($data['fleetresult'] == "a" and $user1['hof'] == 1) {
            $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\"><font color=\"green\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"red\">" . $data['defender'] . "</font></a>";
        } else {
            if ($data['fleetresult'] == "r" and $user1['hof'] == 1) {
                $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?page=showtopkb&mode=" . $data['rid'] . "', '');\"><font color=\"red\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"green\">" . $data['defender'] . "</font></a>";
            } else {
                if ($data['fleetresult'] == "w" and $user1['hof'] == 1) {
                    $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\">" . $data['angreifer'] . "<b> VS </b>" . $data['defender'] . "</a>";
                }
            }
        }
        $bloc['top_rank'] = $a;
        $bloc['top_time'] = $timedeut;
        $bloc['top_units'] = pretty_number($data['gesamtunits']);
        $bloc['underrow'] = $lang['grata'] . "test";
        //  date("r", $data['time']);
        $parse['top_list'] .= parsetemplate($RowsTPL, $bloc);
    }
    display(parsetemplate(gettemplate('topkb/topkb'), $parse), false);
}
Example #17
0
function ShowRecordsPage()
{
    global $USER, $PLANET, $LNG, $resource, $db, $CONF, $UNI;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $Records = new records();
    $RecordsArray = $Records->GetRecords($UNI);
    foreach ($RecordsArray as $ElementID => $ElementIDArray) {
        if ($ElementID >= 1 && $ElementID <= 39 || $ElementID == 44) {
            $Builds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 41 && $ElementID <= 99 && $ElementID != 44) {
            $MoonsBuilds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 101 && $ElementID <= 199) {
            $Techno[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 201 && $ElementID <= 399) {
            $Fleet[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 401 && $ElementID <= 599) {
            $Defense[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        }
    }
    $Records = array($LNG['rec_build'] => $Builds, $LNG['rec_specb'] => $MoonsBuilds, $LNG['rec_techn'] => $Techno, $LNG['rec_fleet'] => $Fleet, $LNG['rec_defes'] => $Defense);
    $template->assign_vars(array('Records' => $Records, 'update' => sprintf($LNG['rec_last_update_on'], date(TDFORMAT, $CONF['stat_last_update'])), 'level' => $LNG['rec_level'], 'player' => $LNG['rec_playe']));
    $template->show("records_overview.tpl");
}
Example #18
0
function GetElementPrice($user, $planet, $Element, $userfactor = true)
{
    global $pricelist, $resource, $lang;
    if ($userfactor) {
        $level = $planet[$resource[$Element]] ? $planet[$resource[$Element]] : $user[$resource[$Element]];
    }
    $is_buyeable = true;
    $array = array('metal' => $lang["Metal"], 'crystal' => $lang["Crystal"], 'deuterium' => $lang["Deuterium"], 'appolonium' => $lang["Appolonium"], 'energy_max' => $lang["Energy"]);
    $text = $lang['Requires'] . ": ";
    foreach ($array as $ResType => $ResTitle) {
        if ($pricelist[$Element][$ResType] != 0) {
            $text .= $ResTitle . ": ";
            if ($userfactor) {
                $cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
            } else {
                $cost = floor($pricelist[$Element][$ResType]);
            }
            if ($cost > $planet[$ResType]) {
                $text .= "<b style=\"color:red;\"> <t title=\"-" . pretty_number($cost - $planet[$ResType]) . "\">";
                $text .= "<span class=\"noresources\">" . pretty_number($cost) . "</span></t></b> ";
                $is_buyeable = false;
                //style="cursor: pointer;"
            } else {
                $text .= "<b style=\"color:lime;\"> <span class=\"noresources\">" . pretty_number($cost) . "</span></b> ";
            }
        }
    }
    return $text;
}
Example #19
0
/**
 * This file is part of XNova:Legacies
 *
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @see http://www.xnova-ng.org/
 *
 * Copyright (c) 2009-2010, XNova Support Team <http://www.xnova-ng.org>
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *                                --> NOTICE <--
 *  This file is part of the core development branch, changing its contents will
 * make you unable to use the automatic updates manager. Please refer to the
 * documentation for further information about customizing XNova.
 *
 */
function MissionCaseStay($FleetRow)
{
    global $lang, $resource;
    if ($FleetRow['fleet_mess'] == 0) {
        if ($FleetRow['fleet_start_time'] <= time()) {
            $QryGetTargetPlanet = "SELECT * FROM {{table}} ";
            $QryGetTargetPlanet .= "WHERE ";
            $QryGetTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryGetTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryGetTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
            $QryGetTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
            $TargetPlanet = doquery($QryGetTargetPlanet, 'planets', true);
            $TargetUserID = $TargetPlanet['id_owner'];
            $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
            $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
            $TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_end_galaxy'] . "&system=" . $FleetRow['fleet_end_system'] . "\">";
            $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
            SendSimpleMessage($TargetUserID, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
            RestoreFleetToPlanet($FleetRow, false);
            doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
        }
    } else {
        if ($FleetRow['fleet_end_time'] <= time()) {
            $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet']);
            $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
            $TargetMessage = $lang['sys_stay_mess_back'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_start_galaxy'] . "&system=" . $FleetRow['fleet_start_system'] . "\">";
            $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_bend'] . "<br />" . $TargetAddedGoods;
            SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
            RestoreFleetToPlanet($FleetRow, true);
            doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
        }
    }
}
Example #20
0
function ShowImperiumPage($CurrentUser)
{
    global $lang, $resource, $reslist, $dpath;
    $planetsrow = doquery("\r\n\tSELECT `id`,`name`,`galaxy`,`system`,`planet`,`planet_type`,\r\n\t`image`,`field_current`,`field_max`,`metal`,`metal_perhour`,\r\n\t`crystal`,`crystal_perhour`,`deuterium`,`deuterium_perhour`,\r\n\t`energy_used`,`energy_max`,`metal_mine`,`crystal_mine`,`deuterium_sintetizer`,\r\n\t`solar_plant`,`fusion_plant`,`robot_factory`,`nano_factory`,`hangar`,`metal_store`,\r\n\t`crystal_store`,`deuterium_store`,`laboratory`,`terraformer`,`ally_deposit`,`silo`,\r\n\t`small_ship_cargo`,`big_ship_cargo`,`light_hunter`,`heavy_hunter`,`crusher`,`battle_ship`,\r\n\t`colonizer`,`recycler`,`spy_sonde`,`bomber_ship`,`solar_satelit`,`destructor`,`dearth_star`,\r\n\t`battleship`,`supernova`,`misil_launcher`,`small_laser`,`big_laser`,`gauss_canyon`,`ionic_canyon`,\r\n\t`buster_canyon`,`small_protection_shield`,`planet_protector`,`big_protection_shield`,`interceptor_misil`,\r\n\t`interplanetary_misil`, `mondbasis`, `phalanx`, `sprungtor` FROM {{table}} WHERE `id_owner` = '" . $CurrentUser['id'] . "' AND `destruyed` = 0;", 'planets');
    $parse = $lang;
    $planet = array();
    while ($p = mysql_fetch_array($planetsrow)) {
        $planet[] = $p;
    }
    $parse['mount'] = count($planet) + 1;
    foreach ($planet as $p) {
        $datat = array('<a href="game.php?page=overview&cp=' . $p['id'] . '&amp;re=0"><img src="' . $dpath . 'planeten/small/s_' . $p['image'] . '.jpg" border="0" height="80" width="80"></a>', $p['name'], "[<a href=\"game.php?page=galaxy&mode=3&galaxy={$p['galaxy']}&system={$p['system']}\">{$p['galaxy']}:{$p['system']}:{$p['planet']}</a>]", $p['field_current'] . '/' . $p['field_max'], '<a href="game.php?page=resources&cp=' . $p['id'] . '&amp;re=0&amp;planettype=' . $p['planet_type'] . '">' . pretty_number($p['metal']) . '</a> / ' . pretty_number($p['metal_perhour']), '<a href="game.php?page=resources&cp=' . $p['id'] . '&amp;re=0&amp;planettype=' . $p['planet_type'] . '">' . pretty_number($p['crystal']) . '</a> / ' . pretty_number($p['crystal_perhour']), '<a href="game.php?page=resources&cp=' . $p['id'] . '&amp;re=0&amp;planettype=' . $p['planet_type'] . '">' . pretty_number($p['deuterium']) . '</a> / ' . pretty_number($p['deuterium_perhour']), pretty_number($p['energy_max'] - $p['energy_used']) . ' / ' . pretty_number($p['energy_max']));
        $f = array('file_images', 'file_names', 'file_coordinates', 'file_fields', 'file_metal', 'file_crystal', 'file_deuterium', 'file_energy');
        for ($k = 0; $k < 8; $k++) {
            $data['text'] = $datat[$k];
            $parse[$f[$k]] .= parsetemplate(gettemplate('empire/empire_row'), $data);
        }
        foreach ($resource as $i => $res) {
            $data['text'] = $p[$resource[$i]] == 0 && $CurrentUser[$resource[$i]] == 0 ? '-' : (in_array($i, $reslist['build']) ? "<a href=\"game.php?page=buildings&cp={$p['id']}&amp;re=0&amp;planettype={$p['planet_type']}\">{$p[$resource[$i]]}</a>" : (in_array($i, $reslist['tech']) ? "<a href=\"game.php?page=buildings&mode=research&cp={$p['id']}&amp;re=0&amp;planettype={$p['planet_type']}\">{$CurrentUser[$resource[$i]]}</a>" : (in_array($i, $reslist['fleet']) ? "<a href=\"game.php?page=buildings&mode=fleet&cp={$p['id']}&amp;re=0&amp;planettype={$p['planet_type']}\">{$p[$resource[$i]]}</a>" : (in_array($i, $reslist['defense']) ? "<a href=\"game.php?page=buildings&mode=defense&cp={$p['id']}&amp;re=0&amp;planettype={$p['planet_type']}\">{$p[$resource[$i]]}</a>" : '-'))));
            $r[$i] .= parsetemplate(gettemplate('empire/empire_row'), $data);
        }
    }
    $m = array('build', 'tech', 'fleet', 'defense');
    $n = array('building_row', 'technology_row', 'fleet_row', 'defense_row');
    for ($j = 0; $j < 4; $j++) {
        foreach ($reslist[$m[$j]] as $a => $i) {
            $data['text'] = $lang['tech'][$i];
            $parse[$n[$j]] .= "<tr>" . parsetemplate(gettemplate('empire/empire_row'), $data) . $r[$i] . "</tr>";
        }
    }
    return display(parsetemplate(gettemplate('empire/empire_table'), $parse), false);
}
Example #21
0
function GetElementPrice($user, $planet, $Element, $userfactor = true, $level = false)
{
    global $pricelist, $resource, $lang;
    //if ($userfactor) // OLD CODE
    if ($userfactor && $level === false) {
        // FIX BY JSTAR
        $level = $planet[$resource[$Element]] ? $planet[$resource[$Element]] : $user[$resource[$Element]];
    }
    $is_buyeable = true;
    $array = array('metal' => $lang['Metal'], 'crystal' => $lang['Crystal'], 'deuterium' => $lang['Deuterium'], 'energy_max' => $lang['Energy']);
    $text = $lang['fgp_require'];
    foreach ($array as $ResType => $ResTitle) {
        if ($pricelist[$Element][$ResType] != 0) {
            $text .= $ResTitle . ": ";
            if ($userfactor) {
                $cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
            } else {
                $cost = floor($pricelist[$Element][$ResType]);
            }
            if ($cost > $planet[$ResType]) {
                $text .= "<b style=\"color:red;\"> <t title=\"-" . pretty_number($cost - $planet[$ResType]) . "\">";
                $text .= "<span class=\"noresources\">" . pretty_number($cost) . "</span></t></b> ";
                $is_buyeable = false;
            } else {
                $text .= "<b style=\"color:lime;\">" . pretty_number($cost) . "</b> ";
            }
        }
    }
    return $text;
}
 private function GetRestPrice($user, $planet, $Element, $userfactor = true)
 {
     global $pricelist, $resource, $lang;
     if ($userfactor) {
         $level = $planet[$resource[$Element]] ? $planet[$resource[$Element]] : $user[$resource[$Element]];
     }
     $array = array('metal' => $lang['Metal'], 'crystal' => $lang['Crystal'], 'deuterium' => $lang['Deuterium'], 'energy_max' => $lang['Energy']);
     $text = "<br><font color=\"#7f7f7f\">" . $lang['bd_remaining'] . ": ";
     foreach ($array as $ResType => $ResTitle) {
         if ($pricelist[$Element][$ResType] != 0) {
             $text .= $ResTitle . ": ";
             if ($userfactor) {
                 $cost = floor($pricelist[$Element][$ResType] * pow($pricelist[$Element]['factor'], $level));
             } else {
                 $cost = floor($pricelist[$Element][$ResType]);
             }
             if ($cost > $planet[$ResType]) {
                 $text .= "<b style=\"color: rgb(127, 95, 96);\">" . pretty_number($planet[$ResType] - $cost) . "</b> ";
             } else {
                 $text .= "<b style=\"color: rgb(95, 127, 108);\">" . pretty_number($planet[$ResType] - $cost) . "</b> ";
             }
         }
     }
     $text .= "</font>";
     return $text;
 }
Example #23
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowTopKB()
{
    global $USER, $PLANET, $LNG, $UNI, $db, $LANG;
    $mode = request_var('mode', '');
    $template = new template();
    switch ($mode) {
        case "showkb":
            $template->isPopup(true);
            $LANG->includeLang(array('FLEET'));
            $ReportID = request_var('rid', '');
            if (file_exists(ROOT_PATH . 'raports/topkb_' . $ReportID . '.php')) {
                require_once ROOT_PATH . 'raports/topkb_' . $ReportID . '.php';
                $RaportRAW = $db->uniquequery("SELECT `angreifer`, `defender` FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';");
            }
            foreach ($LNG['tech_rc'] as $id => $s_name) {
                $ship[] = "[ship[" . $id . "]]";
                $shipname[] = $s_name;
            }
            $template->assign_vars(array('attacker' => $RaportRAW['angreifer'], 'defender' => $RaportRAW['defender'], 'report' => $raport));
            $template->show("topkb_report.tpl");
            break;
        default:
            $PlanetRess = new ResourceUpdate();
            $PlanetRess->CalcResource();
            $PlanetRess->SavePlanetToDB();
            $top = $db->query("SELECT * FROM " . TOPKB . " WHERE `universe` = '" . $UNI . "' ORDER BY gesamtunits DESC LIMIT 100;");
            while ($data = $db->fetch_array($top)) {
                $TopKBList[] = array('result' => $data['fleetresult'], 'time' => date(TDFORMAT, $data['time']), 'units' => pretty_number($data['gesamtunits']), 'rid' => $data['rid'], 'attacker' => $data['angreifer'], 'defender' => $data['defender'], 'result' => $data['fleetresult']);
            }
            $db->free_result($top);
            $template->assign_vars(array('tkb_units' => $LNG['tkb_units'], 'tkb_datum' => $LNG['tkb_datum'], 'tkb_owners' => $LNG['tkb_owners'], 'tkb_platz' => $LNG['tkb_platz'], 'tkb_top' => $LNG['tkb_top'], 'tkb_gratz' => $LNG['tkb_gratz'], 'tkb_legende' => $LNG['tkb_legende'], 'tkb_gewinner' => $LNG['tkb_gewinner'], 'tkb_verlierer' => $LNG['tkb_verlierer'], 'TopKBList' => $TopKBList));
            $template->show("topkb_overview.tpl");
            break;
    }
}
Example #24
0
/**
 * MissionCaseRecycling.php
 *
 * @version 2.0
 * @copyright 2009 by MadnessRed for XNova
 */
function MissionCaseRecycling($FleetRow)
{
    global $pricelist, $lang;
    //Firstly we need to planet info.
    $CurrentPlanet = doquery("SELECT `debris_m`,`debris_c` FROM {{table}} WHERE `id` = '" . $FleetRow['target_id'] . "' LIMIT 1 ;", 'planets', true);
    //If there actually is a debris field here.
    if ($CurrentPlanet['debris_m'] + $CurrentPlanet['debris_c'] > 0) {
        //How much res is currently with the fleet
        $onboard = $FleetRow["metal"] + $FleetRow["crystal"] + $FleetRow["deuterium"];
        //What is the cargo capacity of the fleet?
        //XNova code will work fine with a small tweak
        $FleetRecord = explode(";", $FleetRow['array']);
        $RecyclerCapacity = 0;
        $OtherFleetCapacity = 0;
        foreach ($FleetRecord as $Item => $Group) {
            if ($Group != '') {
                $Class = explode(",", $Group);
                if ($Class[0] == 209) {
                    $RecyclerCapacity += $pricelist[$Class[0]]["capacity"] * $Class[1];
                } else {
                    $OtherFleetCapacity += $pricelist[$Class[0]]["capacity"] * $Class[1];
                }
            }
        }
        //</XNova Code>
        //How how much space is avaialble for debris?
        $onboard -= $OtherFleetCapacity;
        if ($onboard > 0) {
            $RecyclerCapacity -= $onboard;
        }
        if ($RecyclerCapacity < 0) {
            $RecyclerCapacity = 0;
        }
        //So do we have enough space for it all?
        $added = array(0, 0);
        if ($RecyclerCapacity >= $CurrentPlanet['debris_m'] + $CurrentPlanet['debris_c']) {
            //Add the resources to the fleetrow
            $FleetRow["metal"] += $CurrentPlanet['debris_m'];
            $added[0] = $CurrentPlanet['debris_m'];
            $FleetRow["crystal"] += $CurrentPlanet['debris_c'];
            $added[1] = $CurrentPlanet['debris_c'];
        } else {
            //How much can we take as a percent?
            $pc = $RecyclerCapacity / ($CurrentPlanet['debris_m'] + $CurrentPlanet['debris_c']);
            //Add the resources to the fleetrow
            $FleetRow["metal"] += $CurrentPlanet['debris_m'] * $pc;
            $added[0] = $CurrentPlanet['debris_m'] * $pc;
            $FleetRow["crystal"] += $CurrentPlanet['debris_c'] * $pc;
            $added[1] = $CurrentPlanet['debris_c'] * $pc;
        }
        //Now add those resources to the return fleet.
        doquery("UPDATE {{table}} SET `metal` = '" . $FleetRow["metal"] . "', `crystal` = '" . $FleetRow["crystal"] . "' WHERE `partner_fleet` = '" . $FleetRow["fleet_id"] . "' LIMIT 1 ;", 'fleets');
        //Now change the amount of debris:
        doquery("UPDATE {{table}} SET `debris_m` = `debris_m` - '" . $added[0] . "',`debris_c` = `debris_c` - '" . $added[1] . "' WHERE `id` = '" . $FleetRow['target_id'] . "' LIMIT 1 ;", 'planets');
        //And message the yser
        $Message = sprintf($lang['fleet_8_mess'], pretty_number($added[0]), $lang['Metal'], pretty_number($added[1]), $lang['Crystal']);
        PM($FleetRow['owner_userid'], 0, $Message, $lang['fleet_8_tit'], $lang['fleet_control'], 2);
    }
}
Example #25
0
 function ReturnEvent()
 {
     $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
     $TargetUserID = $this->_fleet['fleet_target_owner'];
     $TargetMessage = sprintf($LNG['sys_stat_mess'], GetStartAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
     SendSimpleMessage($TargetUserID, 0, $this->_fleet['fleet_end_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_stat_mess_stay'], $TargetMessage);
     $this->RestoreFleet();
 }
Example #26
0
 function ReturnEvent()
 {
     $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
     $TargetName = $GLOBALS['DATABASE']->getFirstCell("SELECT name FROM " . PLANETS . " WHERE id = " . $this->_fleet['fleet_start_id'] . ";");
     $Message = sprintf($LNG['sys_fleet_won'], $TargetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903], pretty_number($this->_fleet['fleet_resource_elyrium']), $LNG['tech'][904]);
     SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_end_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
     $this->RestoreFleet();
 }
Example #27
0
/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package 2Moons
 * @author Jan Kröpke <*****@*****.**>
 * @copyright 2012 Jan Kröpke <*****@*****.**>
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.7.3 (2013-05-19)
 * @info $Id: ShowOverviewPage.php 2640 2013-03-23 19:23:26Z slaver7 $
 * @link http://2moons.cc/
 */
function ShowOverviewPage()
{
    global $LNG, $USER, $UNI, $CONF;
    $Message = array();
    if ($USER['authlevel'] >= AUTH_ADM) {
        if (file_exists(ROOT_PATH . 'update.php')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'update.php');
        }
        if (file_exists(ROOT_PATH . 'webinstall.php')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'webinstall.php');
        }
        if (file_exists('includes/ENABLE_INSTALL_TOOL')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'includes/ENABLE_INSTALL_TOOL');
        }
        if (!is_writable(ROOT_PATH . 'cache')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'cache');
        }
        if (!is_writable('includes')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'includes');
        }
    }
    $getch = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_ticket`");
    $total_ticket = $GLOBALS['DATABASE']->numRows($getch);
    $open_tickets = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_ticket` WHERE status = '0'");
    $open_tickets = $GLOBALS['DATABASE']->numRows($open_tickets);
    $open_ratio = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_inquery_feedback` WHERE finished = '1'");
    $open_ratio = $GLOBALS['DATABASE']->numRows($open_ratio);
    $online_users = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_users` WHERE onlinetime > '" . (TIMESTAMP - 15 * 60) . "'");
    $online_users = $GLOBALS['DATABASE']->numRows($online_users);
    $prem_users = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_users` WHERE premium_reward_days > '" . TIMESTAMP . "'");
    $prem_users = $GLOBALS['DATABASE']->numRows($prem_users);
    $locked_cron = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_cronjobs` WHERE `lock` IS NOT NULL;");
    $locked_cron = $GLOBALS['DATABASE']->numRows($locked_cron);
    $multi_declare = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_multi_declaration` WHERE `finished` = '1';");
    $multi_declare = $GLOBALS['DATABASE']->numRows($multi_declare);
    $total_declare = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_multi_declaration`;");
    $total_declare = $GLOBALS['DATABASE']->numRows($total_declare);
    $complaints = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_complaints`");
    $complaints = $GLOBALS['DATABASE']->numRows($complaints);
    $complaintsb = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_complaints` WHERE finished = '1'");
    $complaintsb = $GLOBALS['DATABASE']->numRows($complaintsb);
    $goog = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_inquery_feedback`");
    $total_r = $GLOBALS['DATABASE']->numRows($goog);
    if ($total_r == 0) {
        $total_r = 1;
    }
    $total_ratio = 0;
    $total_ratio = 0;
    $template = new template();
    $AvailableUnis[Config::get('uni')] = $CONF['uni_name'] . ' (ID: ' . $CONF['uni'] . ')';
    $Query = $GLOBALS['DATABASE']->query("SELECT `uni`, `uni_name` FROM " . CONFIG . " WHERE `uni` != '" . $UNI . "' ORDER BY `uni` DESC;");
    while ($Unis = $GLOBALS['DATABASE']->fetch_array($Query)) {
        $AvailableUnis[$Unis['uni']] = $Unis['uni_name'] . ' (ID: ' . $Unis['uni'] . ')';
    }
    ksort($AvailableUnis);
    $template->assign_vars(array('complaintsb' => pretty_number($complaintsb), 'multi_declare' => pretty_number($multi_declare), 'total_declare' => pretty_number($total_declare), 'total_users' => pretty_number($CONF['users_amount']), 'total_ticket' => pretty_number($total_ticket), 'total_ratio' => pretty_number($total_ratio), 'open_tickets' => pretty_number($open_tickets), 'prem_users' => pretty_number($prem_users), 'online_users' => pretty_number($online_users), 'open_ratio' => pretty_number($open_ratio), 'locked_cron' => pretty_number($locked_cron), 'complaints' => pretty_number($complaints), 'ow_none' => $LNG['ow_none'], 'ow_overview' => $LNG['ow_overview'], 'ow_welcome_text' => $LNG['ow_welcome_text'], 'ow_credits' => $LNG['ow_credits'], 'ow_special_thanks' => $LNG['ow_special_thanks'], 'ow_translator' => $LNG['ow_translator'], 'ow_proyect_leader' => $LNG['ow_proyect_leader'], 'ow_support' => $LNG['ow_support'], 'ow_title' => $LNG['ow_title'], 'ow_forum' => $LNG['ow_forum'], 'ow_donate' => $LNG['ow_donate'], 'Messages' => $Message, 'date' => date('m\\_Y', TIMESTAMP), 'sid' => session_id(), 'AvailableUnis' => $AvailableUnis));
    $template->show('OverviewBody.tpl');
}
 function show()
 {
     global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
     //$PlanetRess = new ResourceUpdate();
     //$PlanetRess->CalcResource();
     //$PlanetRess->SavePlanetToDB();
     $this->tplObj->loadscript('p_trader.js');
     if ($_POST) {
         //if($_SESSION['last']['user_side'] != 'game.php?page=p_trade'){
         //	$this->printMessage("Page error, err nr 5.", true, array('game.php?page=ptrade', 2));
         //	die();
         //}
         //$PlanetRess = new ResourceUpdate();
         //$PlanetRess->CalcResource();
         //$PlanetRess->SavePlanetToDb();
         /*totalPoints
         		oldMetal
         		oldCrystal
         		oldDeuterium
         		newMetal
         		newCrystal
         		newDeuterium
         		*/
         $total_points = isset($_POST['totalPoints']) ? $_POST['totalPoints'] : 0;
         $new_metal = isset($_POST['newMetal']) ? $_POST['newMetal'] : 0;
         $new_crystal = isset($_POST['newCrystal']) ? $_POST['newCrystal'] : 0;
         $new_deuterium = isset($_POST['newDeuterium']) ? $_POST['newDeuterium'] : 0;
         $userId = isset($_POST['userid']) ? $_POST['userid'] : null;
         $recalculate = $new_metal + 2 * $new_crystal + 4 * $new_deuterium;
         if ($recalculate != $total_points && $recalculate - $total_points > 2000) {
             $this->printMessage("Error with inputs.", true, array('game.php?page=PTrader', 2));
             die;
         }
         if ($new_metal < 0 || $new_crystal < 0 || $new_deuterium < 0) {
             $this->printMessage("ERROR with negative numbers.", true, array('game.php?page=PTrader', 2));
             die;
         }
         //	if($USER['antimatter'] < 250 && $USER['premium_reward_days'] < TIMESTAMP){
         //	$this->printMessage("Not enough antimatter.", true, array('game.php?page=PTrader', 2));
         //		die();
         //	}
         $PLANET['metal'] = $GLOBALS['DATABASE']->sql_escape($new_metal);
         $PLANET['crystal'] = $GLOBALS['DATABASE']->sql_escape($new_crystal);
         $PLANET['deuterium'] = $GLOBALS['DATABASE']->sql_escape($new_deuterium);
         $GLOBALS['DATABASE']->query("UPDATE " . PLANETS . " set `metal` = '" . $GLOBALS['DATABASE']->sql_escape($new_metal) . "', `crystal` = '" . $GLOBALS['DATABASE']->sql_escape($new_crystal) . "', `deuterium` = '" . $GLOBALS['DATABASE']->sql_escape($new_deuterium) . "' where `id` = '" . $PLANET['id'] . "' ;");
         if ($USER['premium_reward_days'] < TIMESTAMP) {
             //$GLOBALS['DATABASE']->query("UPDATE ".USERS." set `antimatter` = antimatter - '250' WHERE `id` = '".$USER['id']."' ;");
         }
         $this->printMessage("Exchange has been successfully made.", true, array('game.php?page=PTrader', 2));
         die;
     }
     $recalculate = $PLANET['metal'] + $PLANET['crystal'] * 2 + $PLANET['deuterium'] * 4;
     //$GLOBALS['DATABASE']->query("UPDATE ".USERS." set `ptrader_total` = '".$recalculate."' where `id` = '".$USER['id']."' ;");
     $_SESSION['total_p'] = $recalculate;
     $this->tplObj->assign_vars(array('total_points' => pretty_number(floattostring($recalculate)), 'total_points11' => floattostring($recalculate), 'planet_metal' => pretty_number($PLANET['metal']), 'planet_crystal' => pretty_number($PLANET['crystal']), 'planet_deuterium' => pretty_number($PLANET['deuterium']), 'planet_metal11' => $PLANET['metal'], 'planet_crystal11' => $PLANET['crystal'], 'planet_deuterium11' => $PLANET['deuterium'], 'planet_metal_t' => pretty_number($PLANET['metal']), 'planet_crystal_t' => pretty_number(floattostring($PLANET['crystal'] * 2)), 'planet_deuterium_t' => pretty_number(floattostring($PLANET['deuterium'] * 4))));
     $this->display('page.ptrader.default.tpl');
 }
 function ReturnEvent()
 {
     $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
     $sql = 'SELECT name FROM %%PLANETS%% WHERE id = :planetId;';
     $planetName = Database::get()->selectSingle($sql, array(':planetId' => $this->_fleet['fleet_start_id']), 'name');
     $Message = sprintf($LNG['sys_fleet_won'], $planetName, GetTargetAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['tech'][901], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['tech'][902], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['tech'][903]);
     PlayerUtil::sendMessage($this->_fleet['fleet_owner'], 0, $LNG['sys_mess_tower'], 4, $LNG['sys_mess_fleetback'], $Message, $this->_fleet['fleet_end_time'], NULL, 1, $this->_fleet['fleet_universe']);
     $this->RestoreFleet();
 }
Example #30
0
 function ReturnEvent()
 {
     global $LANG;
     $LNG = $LANG->GetUserLang($this->_fleet['fleet_owner']);
     $TargetUserID = $this->_fleet['fleet_target_owner'];
     $TargetMessage = sprintf($LNG['sys_stat_mess'], GetStartAdressLink($this->_fleet, ''), pretty_number($this->_fleet['fleet_resource_metal']), $LNG['Metal'], pretty_number($this->_fleet['fleet_resource_crystal']), $LNG['Crystal'], pretty_number($this->_fleet['fleet_resource_deuterium']), $LNG['Deuterium']);
     SendSimpleMessage($TargetUserID, '', $this->_fleet['fleet_end_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_stat_mess_stay'], $TargetMessage);
     $this->RestoreFleet();
 }