Пример #1
0
 function run()
 {
     $CONF = Config::getAll(NULL, ROOT_UNI);
     if ($CONF['asteroid_event'] < TIMESTAMP) {
         $GLOBALS['DATABASE']->query("DELETE FROM " . PLANETS . " where `id_owner` = '" . Asteroid_Id . "' AND `id` != '706' ;");
         $galaxy = 1;
         $system = $this->randRange(1, 500, 50);
         foreach ($system as $System_Element) {
             $planets = rand(1, 10);
             $cautare = $GLOBALS['DATABASE']->query("SELECT *FROM " . PLANETS . " where `galaxy` = '" . $galaxy . "' and `system` = '" . $System_Element . "' and `planet` = '" . $planets . "' AND `universe` = '1';");
             if ($GLOBALS['DATABASE']->numRows($cautare) == 0) {
                 $metal_rand = rand(1, Config::get('asteroid_metal'));
                 $crystal_rand = rand(1, Config::get('asteroid_crystal'));
                 $deuterium_rand = rand(1, Config::get('asteroid_deuterium'));
                 $GLOBALS['DATABASE']->query("INSERT INTO " . PLANETS . "(`name`,`id_owner`,`universe`,`galaxy`,`system`,`planet`,`planet_type`,`image`,`diameter`,`der_metal`,`der_crystal`,`der_deuterium`,`last_update`) \n\t\tVALUES('Asteroid','" . Asteroid_Id . "','1','" . $galaxy . "','" . $System_Element . "','" . $planets . "','1','asteroid','9800','" . $metal_rand . "','" . $crystal_rand . "','" . $deuterium_rand . "','" . TIMESTAMP . "');");
             }
         }
         $totalPremiums = $GLOBALS['DATABASE']->query("SELECT `id`, `lang` FROM " . USERS . ";");
         $langObjects = array();
         while ($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)) {
             if (!isset($langObjects[$xy['lang']])) {
                 $langObjects[$xy['lang']] = new Language($xy['lang']);
                 $langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
             }
             $LNG = $langObjects[$xy['lang']];
             $message = '<div style="text-align:justify;">' . $LNG['sys_asteroid_3'] . '</div><div class="citation"><div class="guillemet ouvrir"></div><div class="guillemet fermer"></div><ul style="text-align : left;">' . $LNG['sys_asteroid_4'] . '</ul></div><div class="explication_utilisateur">' . $LNG['ls_fts_colo_9'] . '</div>';
             SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, $LNG['sys_asteroid_1'], $LNG['sys_asteroid_2'], $message);
         }
         $newevkaka = TIMESTAMP + 5 * 60;
         $GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET asteroid_event = '" . $newevkaka . "' where `uni` = '1';");
     }
 }
Пример #2
0
function ShowFleetsConfPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('fleetconf' => $CONF['fleetconf']);
        $fleetconf = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('fleetconf' => $fleetconf);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
        require_once 'includes/functions/BBCode.php';
        $Time = TIMESTAMP;
        $Message = '<span class="admin">All promotional fleets and defence have been unlocked until ' . date("d.m.Y - H:i:s", $CONF['fleetconf']) . '. - <a href="?page=shipyard&mode=fleet">Fleet</a> - <a href="?page=shipyard&mode=defence">Defence</a>';
        $From = '<span class="admin">"Antimatter"</span>';
        $pmSubject = '<span class="admin">"Purchase Bonus"</span>';
        $pmMessage = '<span class="admin">' . bbcode($Message) . '</span>';
        $USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1';");
        while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
            $sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
            SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
        }
    }
    $template = new template();
    $template->assign_vars(array('fleetconf' => $CONF['fleetconf'], 'bonus_next_active' => $CONF['fleetconf'] > TIMESTAMP ? $CONF['fleetconf'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['fleetconf'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['fleetconf']) : 0));
    $template->show('fleetconf.tpl');
}
Пример #3
0
function ShowSendMessagesPage()
{
    global $USER, $LNG, $db;
    if ($_GET['mode'] == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $color = 'yellow';
                break;
            case AUTH_OPS:
                $color = 'skyblue';
                break;
            case AUTH_ADM:
                $color = 'red';
                break;
        }
        $Subject = makebr(request_var('subject', '', true));
        $Message = makebr(request_var('text', '', true));
        if (!empty($Message) && !empty($Subject)) {
            require_once ROOT_PATH . 'includes/functions/BBCode.php';
            $Time = TIMESTAMP;
            $From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
            $Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>';
            $Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>';
            SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']);
            $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';");
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $template = new template();
    $template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit']));
    $template->show('adm/SendMessagesPage.tpl');
}
Пример #4
0
 function ReturnEvent()
 {
     $LNG = $this->GetUserLang($this->_fleet['fleet_owner']);
     $Message = sprintf($LNG['sys_tran_mess_back'], $StartName, GetStartAdressLink($this->_fleet, ''));
     SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
     $this->RestoreFleet();
 }
Пример #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 . '');
}
Пример #6
0
/**
 * MissionCaseStayAlly @todo description
 *
 * @global array $lang @see common.php
 * @param array $fleetRow @see common.php
 * @return bool true.
 */
function missionCaseStayAlly($fleetRow)
{
    global $lang;
    $readConnection = Nova::getSingleton('core/database_connection_pool')->getConnection('core_read');
    $startPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_start_galaxy'])->where('system =?', $fleetRow['fleet_start_system'])->where('planet =?', $fleetRow['fleet_start_planet'])->query()->fetch();
    $endPlanet = $readConnection->select(array('name', 'id_owner'))->from($readConnection->getDeprecatedTable('planets'))->where('galaxy =?', $fleetRow['fleet_end_galaxy'])->where('system =?', $fleetRow['fleet_end_system'])->where('planet =?', $fleetRow['fleet_end_planet'])->query()->fetch();
    $fleetStartLink = GetStartAdressLink($fleetRow, '');
    $fleetEndLink = GetTargetAdressLink($fleetRow, '');
    if ($fleetRow['fleet_mess'] == 0) {
        if ($fleetRow['fleet_end_stay'] <= time()) {
            $readConnection->update($readConnection->getDeprecatedTable('fleets'), array('fleet_mess' => 1), array('fleet_id =?' => $fleetRow['fleet_id']));
        } else {
            if ($fleetRow['fleet_start_time'] <= time()) {
                $message = sprintf($lang['sys_tran_mess_owner'], $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
                $message = sprintf($lang['sys_tran_mess_user'], $startPlanet['name'], $fleetStartLink, $endPlanet['name'], $fleetEndLink, $fleetRow['fleet_resource_metal'], $lang['Metal'], $fleetRow['fleet_resource_crystal'], $lang['Crystal'], $fleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($endPlanet['id_owner'], '', $fleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $message);
            }
        }
    } else {
        if ($fleetRow['fleet_end_time'] <= time()) {
            $message = sprintf($lang['sys_tran_mess_back'], $startPlanet['name'], $fleetStartLink);
            SendSimpleMessage($startPlanet['id_owner'], '', $fleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $message);
            RestoreFleetToPlanet($fleetRow, true);
            $readConnection->delete($readConnection->getDeprecatedTable('fleets'), array('fleet_id =?' => $fleetRow['fleet_id']));
        }
    }
    return true;
}
Пример #7
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();
 }
Пример #8
0
 function run()
 {
     $CONF = Config::getAll(NULL, ROOT_UNI);
     if ($CONF['birthday_event'] < TIMESTAMP) {
         $totalPremiums = $GLOBALS['DATABASE']->query("SELECT `id`, `lang` FROM " . USERS . " WHERE date_of_birth < " . TIMESTAMP . " AND date_of_birth != '0' AND year = '2015';");
         $langObjects = array();
         while ($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)) {
             if (!isset($langObjects[$xy['lang']])) {
                 $langObjects[$xy['lang']] = new Language($xy['lang']);
                 $langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
             }
             $LNG = $langObjects[$xy['lang']];
             $message = '<div class="citation">
     <div class="guillemet ouvrir">«</div>
     <div class="guillemet fermer">»</div>
     <ul style="text-align : left;">
     ' . $LNG['ls_eventcron_12'] . '
     </ul>
 </div>';
             SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, sprintf($LNG['ls_eventcron_10'], $this->getUsernames($xy['id'])), $LNG['ls_eventcron_11'], $message);
             $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET year = '2016' where `id` = '" . $xy['id'] . "';");
         }
         $newevkaka = TIMESTAMP + 5 * 60;
         $GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET birthday_event = '" . $newevkaka . "' where `uni` = '" . $UNI . "';");
     }
 }
Пример #9
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');
        }
    }
}
Пример #10
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);
    }
}
Пример #11
0
 function send()
 {
     global $USER, $UNI, $LNG;
     $ticketID = HTTP::_GP('id', 0);
     $category = HTTP::_GP('category', 0);
     $message = HTTP::_GP('message', '', true);
     $change = HTTP::_GP('change_status', 0);
     $ticketDetail = $GLOBALS['DATABASE']->getFirstRow("SELECT ownerID, subject, status FROM " . TICKETS . " WHERE ticketID = " . $ticketID . ";");
     $status = $change ? $ticketDetail['status'] <= 1 ? 2 : 1 : 1;
     if (!$change && empty($message)) {
         HTTP::redirectTo('admin.php?page=support&mode=view&id=' . $ticketID);
     }
     if ($change && $status == 1) {
         $this->ticketObj->createAnswer($ticketID, $USER['id'], $USER['username'], $subject, $LNG['ti_admin_open'], $status);
     }
     if (!empty($message)) {
         $subject = "RE: " . $ticketDetail['subject'];
         $this->ticketObj->createAnswer($ticketID, $USER['id'], $USER['username'], $subject, $message, $status);
     }
     if ($change && $status == 2) {
         $this->ticketObj->createAnswer($ticketID, $USER['id'], $USER['username'], $subject, $LNG['ti_admin_close'], $status);
     }
     SendSimpleMessage($ticketDetail['ownerID'], $USER['id'], TIMESTAMP, 4, $USER['username'], sprintf($LNG['sp_answer_message_title'], $ticketID), sprintf($LNG['sp_answer_message'], $ticketID));
     HTTP::redirectTo('admin.php?page=support');
 }
Пример #12
0
 private function _activeUser()
 {
     $validationID = HTTP::_GP('i', 0);
     $validationKey = HTTP::_GP('k', '');
     $userData = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . USERS_VALID . " WHERE validationID = " . $validationID . " AND validationKey = '" . $GLOBALS['DATABASE']->escape($validationKey) . "';");
     if (!isset($userData)) {
         $this->printMessage(t('vertifyNoUserFound'));
     }
     $GLOBALS['DATABASE']->query("DELETE FROM " . USERS_VALID . " WHERE validationID = " . $validationID . ";");
     list($userID, $planetID) = PlayerUtil::createPlayer($userData['universe'], $userData['userName'], $userData['password'], $userData['email'], $userData['race'], $userData['language']);
     if (Config::get('mail_active', $userData['universe']) == 1) {
         require 'includes/classes/Mail.class.php';
         $MailSubject = t('registerMailCompleteTitle', Config::get('game_name', $userData['universe']));
         $MailRAW = $GLOBALS['LNG']->getTemplate('email_reg_done');
         $MailContent = str_replace(array('{USERNAME}', '{GAMENAME}', '{GAMEMAIL}'), array($userData['email'], Config::get('game_name') . ' - ' . Config::get('uni_name'), Config::get('smtp_sendmail')), $MailRAW);
         try {
             Mail::send($userData['email'], $userData['userName'], $MailSubject, $MailContent);
         } catch (Exception $e) {
             // This mail is wayne.
         }
     }
     if (!empty($userData['referralID'])) {
         $GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET\n\t\t\t`ref_id`\t= " . $userData['referralID'] . ",\n\t\t\t`ref_bonus`\t= 1\n\t\t\tWHERE\n\t\t\t`id`\t\t= " . $userID . ";");
     }
     if (!empty($userData['externalAuthUID'])) {
         $GLOBALS['DATABASE']->query("INSERT INTO " . USERS_AUTH . " SET\n\t\t\t`id`\t\t= " . $userID . ",\n\t\t\t`account`\t= '" . $GLOBALS['DATABASE']->escape($userData['externalAuthUID']) . "',\n\t\t\t`mode`\t\t= '" . $GLOBALS['DATABASE']->escape($userData['externalAuthMethod']) . "';");
     }
     $nameSender = t('registerWelcomePMSenderName');
     $subject = t('registerWelcomePMSubject');
     $message = t('registerWelcomePMText', Config::get('game_name', $userData['universe']));
     SendSimpleMessage($userID, 1, TIMESTAMP, 1, $nameSender, $subject, $message);
     return array('userID' => $userID, 'userName' => $userData['userName'], 'planetID' => $planetID);
 }
Пример #13
0
function MissionCaseColonisation($FleetRow)
{
    global $lang, $resource;
    $iPlanetCount = mysql_result(doquery("SELECT count(*) FROM {{table}} WHERE `id_owner` = '" . $FleetRow['fleet_owner'] . "' AND `planet_type` = '1'", 'planets'), 0);
    if ($FleetRow['fleet_mess'] == 0) {
        $iGalaxyPlace = mysql_result(doquery("SELECT count(*) FROM {{table}} WHERE `galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND `system` = '" . $FleetRow['fleet_end_system'] . "' AND `planet` = '" . $FleetRow['fleet_end_planet'] . "';", 'galaxy'), 0);
        $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
        if ($iGalaxyPlace == 0) {
            if ($iPlanetCount >= MAX_PLAYER_PLANETS) {
                $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_maxcolo'] . MAX_PLAYER_PLANETS . $lang['sys_colo_planet'];
                SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
            } else {
                $NewOwnerPlanet = CreateOnePlanetRecord($FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $FleetRow['fleet_owner'], $lang['sys_colo_defaultname'], false);
                if ($NewOwnerPlanet == true) {
                    $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok'];
                    SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                    if ($FleetRow['fleet_amount'] == 1) {
                        doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
                    } else {
                        $CurrentFleet = explode(";", $FleetRow['fleet_array']);
                        $NewFleet = "";
                        foreach ($CurrentFleet as $Item => $Group) {
                            if ($Group != '') {
                                $Class = explode(",", $Group);
                                if ($Class[0] == 208) {
                                    if ($Class[1] > 1) {
                                        $NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
                                    }
                                } else {
                                    if ($Class[1] != 0) {
                                        $NewFleet .= $Class[0] . "," . $Class[1] . ";";
                                    }
                                }
                            }
                        }
                        $QryUpdateFleet = "UPDATE {{table}} SET ";
                        $QryUpdateFleet .= "`fleet_array` = '" . $NewFleet . "', ";
                        $QryUpdateFleet .= "`fleet_amount` = `fleet_amount` - 1, ";
                        $QryUpdateFleet .= "`fleet_mess` = '1' ";
                        $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';";
                        doquery($QryUpdateFleet, 'fleets');
                    }
                } else {
                    $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_badpos'];
                    SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
                    doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
                }
            }
        } else {
            $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_notfree'];
            SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 0, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage);
            doquery("UPDATE {{table}} SET `fleet_mess` = '1' WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
        }
    } else {
        RestoreFleetToPlanet($FleetRow, true);
        doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
    }
}
Пример #14
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();
 }
Пример #15
0
 function run()
 {
     $query = $GLOBALS['DATABASE']->query("SELECT DISTINCT id FROM uni1_users;");
     while ($x = $GLOBALS['DATABASE']->fetch_array($query)) {
         $msg = '<span class="admin">If you have questions about the game: <a href="?page=ticket">Write them here</a></span>';
         SendSimpleMessage($x['id'], '', TIMESTAMP, 50, 'System', 'Questions', $msg);
     }
 }
Пример #16
0
 function ReturnEvent()
 {
     $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
     $StartName = $GLOBALS['DATABASE']->getFirstCell("SELECT name FROM " . PLANETS . " WHERE id = " . $this->_fleet['fleet_start_id'] . ";");
     $Message = sprintf($LNG['sys_tran_mess_back'], $StartName, GetStartAdressLink($this->_fleet, ''));
     SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_end_time'], 5, $LNG['sys_mess_tower'], $LNG['sys_mess_fleetback'], $Message);
     $this->RestoreFleet();
 }
Пример #17
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();
 }
Пример #18
0
 function TargetEvent()
 {
     global $db, $resource, $reslist;
     $SQL = "";
     foreach ($reslist['defense'] as $Element) {
         $SQL .= PLANETS . "." . $resource[$Element] . ", ";
     }
     $QryTarget = "SELECT " . USERS . ".defence_tech, " . PLANETS . ".id, " . PLANETS . ".id_owner, " . substr($SQL, 0, -2) . "\r\n\t\t\t\t\t\t\t   FROM " . PLANETS . ", " . USERS . "\r\n\t\t\t\t\t\t\t   WHERE " . PLANETS . ".`galaxy` = '" . $this->_fleet['fleet_end_galaxy'] . "' AND \r\n\t\t\t\t\t\t\t   " . PLANETS . ".`system` = '" . $this->_fleet['fleet_end_system'] . "' AND \r\n\t\t\t\t\t\t\t   " . PLANETS . ".`planet` = '" . $this->_fleet['fleet_end_planet'] . "' AND \r\n\t\t\t\t\t\t\t   " . PLANETS . ".`planet_type` = '1' AND \r\n\t\t\t\t\t\t\t   " . PLANETS . ".id_owner = " . USERS . ".id;";
     $TargetInfo = $db->uniquequery($QryTarget);
     $OwnerInfo = $db->uniquequery("SELECT `military_tech` FROM " . USERS . " WHERE `id` = '" . $this->_fleet['fleet_owner'] . "';");
     $Target = !in_array($this->_fleet['fleet_target_obj'], $reslist['defense']) || $this->_fleet['fleet_target_obj'] == 502 || $this->_fleet['fleet_target_obj'] == 0 ? 401 : $this->_fleet['fleet_target_obj'];
     foreach ($reslist['defense'] as $Element) {
         $TargetDefensive[$Element] = $TargetInfo[$resource[$Element]];
     }
     $message = "";
     $SQL = "";
     $LNG = $this->GetUserLang(0);
     $LNG += $this->GetUserLang(0, 'TECH');
     require_once 'calculateMIPAttack.' . PHP_EXT;
     if ($TargetInfo[$resource[502]] >= $this->_fleet['fleet_amount']) {
         $message = $LNG['sys_irak_no_att'];
         $x = $resource[502];
         $SQL .= "UPDATE " . PLANETS . " SET " . $x . " = " . $x . "-" . $this->_fleet['fleet_amount'] . " WHERE id = " . $TargetInfo['id'] . ";";
     } else {
         if ($TargetInfo[$resource[502]] > 0) {
             $db->query("UPDATE " . PLANETS . " SET " . $resource[502] . " = '0'  WHERE id = " . $TargetInfo['id'] . ";");
             $message .= sprintf($LNG['sys_irak_def'], $TargetInfo[$resource[502]]);
         }
         $irak = calculateMIPAttack($TargetInfo["defence_tech"], $OwnerInfo["military_tech"], $this->_fleet['fleet_amount'], $TargetDefensive, $Target, $TargetInfo[$resource[502]]);
         ksort($irak, SORT_NUMERIC);
         $Count = 0;
         foreach ($irak as $Element => $destroy) {
             if (empty($Element)) {
                 continue;
             }
             if ($id != 502) {
                 $message .= $LNG['tech'][$Element] . " (- " . $destroy . ")<br>";
             }
             if ($destroy == 0) {
                 continue;
             }
             if (in_array($Element, $reslist['one'])) {
                 $SQL .= "UPDATE " . PLANETS . " SET `" . $resource[$Element] . "` = '0' WHERE id = " . $TargetInfo['id'] . ";";
             } else {
                 $SQL .= "UPDATE " . PLANETS . " SET `" . $resource[$Element] . "` = `" . $resource[$Element] . "` - '" . $destroy . "' WHERE id = " . $TargetInfo['id'] . ";";
             }
         }
     }
     $UserPlanet = $db->fetch_array($db->query("SELECT name FROM " . PLANETS . " WHERE id = '" . $this->_fleet['fleet_owner'] . "';"));
     $OwnerLink = $UserPlanet['name'] . "[" . $this->_fleet['fleet_start_galaxy'] . ":" . $this->_fleet['fleet_start_system'] . ":" . $this->_fleet['fleet_start_planet'] . "]";
     $TargetLink = $TargetInfo['name'] . "[" . $this->_fleet['fleet_end_galaxy'] . ":" . $this->_fleet['fleet_end_system'] . ":" . $this->_fleet['fleet_end_planet'] . "]";
     $Message = sprintf($LNG['sys_irak_mess'], $this->_fleet['fleet_amount'], $OwnerLink, $TargetLink) . (empty($message) ? $LNG['sys_irak_no_def'] : $message);
     SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_start_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_irak_subject'], $Message);
     SendSimpleMessage($TargetInfo['id_owner'], '', $this->_fleet['fleet_start_time'], 3, $LNG['sys_mess_tower'], $LNG['sys_irak_subject'], $Message);
     $SQL .= "DELETE FROM " . FLEETS . " WHERE fleet_id = '" . $this->_fleet['fleet_id'] . "';";
     $db->multi_query($SQL);
 }
Пример #19
0
/**
 * MissionCaseTransport.php
 *
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function MissionCaseTransport($FleetRow)
{
    global $lang;
    $QryStartPlanet = "SELECT * FROM {{table}} ";
    $QryStartPlanet .= "WHERE ";
    $QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
    $QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
    $QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "' AND ";
    $QryStartPlanet .= "`planet_type` = '" . $FleetRow['fleet_start_type'] . "';";
    $StartPlanet = doquery($QryStartPlanet, 'planets', true);
    $StartName = $StartPlanet['name'];
    $StartOwner = $StartPlanet['id_owner'];
    $QryTargetPlanet = "SELECT * FROM {{table}} ";
    $QryTargetPlanet .= "WHERE ";
    $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
    $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
    $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
    $QryTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
    $TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
    $TargetName = $TargetPlanet['name'];
    $TargetOwner = $TargetPlanet['id_owner'];
    if ($FleetRow['fleet_mess'] == 0) {
        if ($FleetRow['fleet_start_time'] < time()) {
            StoreGoodsToPlanet($FleetRow, false);
            $Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium'], $FleetRow['fleet_resource_appolonium'], $lang['Appolonium']);
            SendSimpleMessage($StartOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
            if ($TargetOwner != $StartOwner) {
                $Message = sprintf($lang['sys_tran_mess_user'], $StartName, GetStartAdressLink($FleetRow, ''), $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium'], $FleetRow['fleet_resource_appolonium'], $lang['Appolonium']);
                SendSimpleMessage($TargetOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
            }
            $QryUpdateFleet = "UPDATE {{table}} SET ";
            $QryUpdateFleet .= "`fleet_resource_metal` = '0' , ";
            $QryUpdateFleet .= "`fleet_resource_crystal` = '0' , ";
            $QryUpdateFleet .= "`fleet_resource_deuterium` = '0' , ";
            $QryUpdateFleet .= "`fleet_resource_appolonium` = '0' , ";
            $QryUpdateFleet .= "`fleet_mess` = '1' ";
            $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
            $QryUpdateFleet .= "LIMIT 1 ;";
            doquery($QryUpdateFleet, 'fleets');
        }
    } else {
        if ($FleetRow['fleet_end_time'] < time()) {
            $Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
            SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
            RestoreFleetToPlanet($FleetRow, true);
            //Piratenangriff nach Zufallsprinzip
            $zufall = 0;
            $zufall = rand(1, 10);
            if ($zufall == 7) {
                Piratenangriff($FleetRow);
                $zufall = 0;
            }
            // Ende Piratenangriff
            doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
        }
    }
}
Пример #20
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();
 }
Пример #21
0
function ShowSendMessagesPage()
{
    global $USER, $LNG, $CONF;
    $ACTION = HTTP::_GP('action', '');
    if ($ACTION == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $class = 'mod';
                break;
            case AUTH_OPS:
                $class = 'ops';
                break;
            case AUTH_ADM:
                $class = 'admin';
                break;
        }
        $Subject = HTTP::_GP('subject', '', true);
        $Message = HTTP::_GP('text', '', true);
        $Mode = HTTP::_GP('mode', 0);
        $Lang = HTTP::_GP('lang', '');
        if (!empty($Message) && !empty($Subject)) {
            require_once 'includes/functions/BBCode.php';
            if ($Mode == 0 || $Mode == 2) {
                $Time = TIMESTAMP;
                $From = '<span class="' . $class . '">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
                $pmSubject = '<span class="' . $class . '">' . $Subject . '</span>';
                $pmMessage = '<span class="' . $class . '">' . bbcode($Message) . '</span>';
                $USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1'" . (!empty($Lang) ? " AND `lang` = '" . $GLOBALS['DATABASE']->sql_escape($Lang) . "'" : "") . ";");
                while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
                    $sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
                    SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
                }
            }
            if ($Mode == 1 || $Mode == 2) {
                require 'includes/classes/Mail.class.php';
                $userList = array();
                $USERS = $GLOBALS['DATABASE']->query("SELECT `email`, `username` FROM " . USERS . " WHERE `universe` = '1'" . (!empty($Lang) ? " AND `lang` = '" . $GLOBALS['DATABASE']->sql_escape($Lang) . "'" : "") . ";");
                while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
                    $userList[$UserData['email']] = array('username' => $UserData['username'], 'body' => bbcode(str_replace('{USERNAME}', $UserData['username'], $Message)));
                }
                Mail::multiSend($userList, strip_tags($Subject));
            }
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $sendModes = $LNG['ma_modes'];
    if (Config::get('mail_active') == 0) {
        unset($sendModes[1]);
        unset($sendModes[2]);
    }
    $template = new template();
    $template->assign_vars(array('langSelector' => array_merge(array('' => $LNG['ma_all']), $LNG->getAllowedLangs(false)), 'modes' => $sendModes));
    $template->show('SendMessagesPage.tpl');
}
Пример #22
0
 function ReturnEvent()
 {
     $LNG = $this->getLanguage(NULL, $this->_fleet['fleet_owner']);
     if ($this->_fleet['fleet_resource_darkmatter'] > 0) {
         SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_end_time'], 15, $LNG['sys_mess_tower'], $LNG['sys_expe_report'], sprintf($LNG['sys_expe_back_home_with_dm'], $LNG['tech'][921], pretty_number($this->_fleet['fleet_resource_darkmatter']), $LNG['tech'][921]));
         $this->UpdateFleet('fleet_array', '220,0;');
     } else {
         SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_end_time'], 15, $LNG['sys_mess_tower'], $LNG['sys_expe_report'], $LNG['sys_expe_back_home_without_dm']);
     }
     $this->RestoreFleet();
 }
Пример #23
0
 function hlnSend()
 {
     global $LNG, $ProdGrid, $resource, $reslist, $CONF, $pricelist, $USER, $PLANET;
     $feed = HTTP::_GP('message', '', UTF8_SUPPORT);
     if ($USER['hln_post'] < TIMESTAMP) {
         $GLOBALS['DATABASE']->query("INSERT INTO `uni1_newsfeed` VALUES ('" . $GLOBALS['DATABASE']->GetInsertID() . "', '" . $USER['id'] . "', '" . TIMESTAMP . "', '" . $feed . "', '0', '0') ;");
         $GLOBALS['DATABASE']->query("UPDATE uni1_users SET hln_post = " . (TIMESTAMP + 36 * 3600) . " WHERE id = " . $USER['id'] . ";");
         SendSimpleMessage(1, 1, TIMESTAMP, 1, "Live Feed System", "New feed", 'There is a new feed waiting on aprouval');
         $this->printMessage("<span class='vert'>Feed has been posted and is waiting on aprouval!</span>", true, array('game.php?page=overview', 2));
     }
 }
 function show()
 {
     global $USER, $PLANET, $LNG, $UNI, $CONF, $resource, $pricelist;
     $this->tplObj->loadscript("donationbis.js");
     $bonus = 0;
     if ($USER['lp_points'] >= 125) {
         $bonus = 5;
     }
     if ($USER['lp_points'] >= 625) {
         $bonus = 10;
     }
     if ($USER['lp_points'] >= 2500) {
         $bonus = 15;
     }
     if ($USER['lp_points'] >= 7000) {
         $bonus = 20;
     }
     if ($_POST) {
         $code0 = HTTP::_GP('c1', '');
         $code1 = HTTP::_GP('c2', '');
         $code2 = HTTP::_GP('c3', '');
         $code3 = HTTP::_GP('c4', '');
         $eur = $_POST['eur'];
         $omg = $_POST['lpss'];
         $f**k = $_POST['bonus'];
         $finalCode = "" . $code0 . "-" . $code1 . "-" . $code2 . "-" . $code3 . "";
         if (strlen($code0) + strlen($code1) + strlen($code2) + strlen($code3) < 16) {
             $this->printMessage('<span class="rouge">You need to enter a valid pin code</span>', true, array('game.php?page=Donatebis', 2));
         } else {
             SendSimpleMessage(1, 1, TIMESTAMP, 1, 'Paysafe Code', 'Paysafe Code', 'The player ' . $USER['id'] . ' have send you a new paysafe pin code to approve. The code is ' . $finalCode . ' for a total value of ' . $eur . ' and is waiting on your aproval. the players has a total of ' . $omg . ' Loyality Points and should receive ' . $f**k . '% antimatter bonus');
             // To send HTML mail, the Content-type header must be set
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $to = '*****@*****.**';
             // Additional headers
             $headers .= 'To: Jeremy <*****@*****.**>' . "\r\n";
             $headers .= 'From: Astro-Mania <*****@*****.**>' . "\r\n";
             $headers .= 'Reply-To: Astro-Mania <*****@*****.**>' . "\r\n";
             // Mail it
             mail($to, 'Paysafe Pin Code', 'The player ' . $USER['username'] . ' have send you a new paysafe pin code to approve. The code is ' . $finalCode . ' for a total value of ' . $eur . ' and is waiting on your aproval. the players has a total of ' . $omg . ' Loyality Points and should receive ' . $f**k . '% antimatter bonus', $headers);
             $this->printMessage("Pin code send, do not use it for something else or you wont receive the requested DM", true, array('game.php?page=overview', 5));
             die;
         }
     }
     $pointes = 0;
     if ($CONF['purchase_bonus'] != 0 && $CONF['purchase_bonus_timer'] > TIMESTAMP) {
         $pointes = $CONF['purchase_bonus'];
     }
     $stringforsign = "email=user@mail.comout=0project=13241theme=102userip=" . $USER['user_lastip'] . "v1=" . $USER['id'] . "doORw8XBZCe75jEi";
     $sign = md5($stringforsign);
     $this->tplObj->assign_vars(array('bonus' => $bonus, 'pointes' => $pointes, 'user_lastip' => $USER['user_lastip'], 'user_id' => $USER['id'], 'user_amount' => $CONF['users_amount'], 'sign' => $sign));
     $this->display("page.donate.bis.tpl");
 }
Пример #25
0
 public function newInvoice($invoiceID, $userID, $sum)
 {
     try {
         //insert new invoice into db
         $GLOBALS['DATABASE']->query("INSERT INTO vc_payments(payment_invoice, user_id, payment_date, payment_total) VALUES (" . $invoiceID . ", '" . $userID . "', " . TIMESTAMP . ", " . $sum . ")");
         $GLOBALS['DATABASE']->query("UPDATE uni1_users SET antimatter = antimatter + " . $sum . " WHERE id = " . $userID . "");
         SendSimpleMessage($userID, '', TIMESTAMP, 4, 'System', 'Anti Matter Order', 'Xsolla payment was successful. <br>' . pretty_number($sum) . ' anti matter have been credited to your account.');
         SendSimpleMessage(1, '', TIMESTAMP, 4, 'System', 'Anti Matter Order', 'Xsolla payment was successful. <br>' . pretty_number($sum) . ' Anti Matter Units have been credited to ' . $userID . ' account.');
     } catch (PDOException $e) {
         throw new Exception('error creating payment.');
     }
 }
Пример #26
0
 function ReturnEvent()
 {
     global $LANG;
     $LNG = $LANG->GetUserLang($this->_fleet['fleet_owner']);
     if ($this->_fleet['fleet_resource_darkmatter'] > 0) {
         SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 15, $LNG['sys_mess_tower'], $LNG['sys_expe_report'], sprintf($LNG['sys_expe_back_home_with_dm'], $LNG['Darkmatter'], pretty_number($this->_fleet['fleet_resource_darkmatter']), $LNG['Darkmatter']));
         $this->UpdateFleet('fleet_array', '220,0;');
     } else {
         SendSimpleMessage($this->_fleet['fleet_owner'], '', $this->_fleet['fleet_end_time'], 15, $LNG['sys_mess_tower'], $LNG['sys_expe_report'], $LNG['sys_expe_back_home_without_dm']);
     }
     $this->RestoreFleet();
 }
Пример #27
0
 function TargetEvent()
 {
     global $db, $resource, $LANG;
     $iPlanetCount = $db->countquery("SELECT count(*) FROM " . PLANETS . " WHERE `id_owner` = '" . $this->_fleet['fleet_owner'] . "' AND `planet_type` = '1' AND `destruyed` = '0';");
     $iGalaxyPlace = $db->countquery("SELECT count(*) AS plani FROM " . PLANETS . " WHERE `id` = '" . $this->_fleet['fleet_end_id'] . "';");
     $Player = $db->uniquequery("SELECT `lang`, `authlevel`, `" . $resource[124] . "` FROM " . USERS . " WHERE `id` = '" . $this->_fleet['fleet_owner'] . "';");
     $LNG = $LANG->GetUserLang($Player['lang']);
     $MaxPlanets = MaxPlanets($Player[$resource[124]]);
     if ($iGalaxyPlace != 0) {
         $TheMessage = sprintf($LNG['sys_colo_notfree'], GetTargetAdressLink($this->_fleet, ''));
         $this->UpdateFleet('fleet_mess', 1);
     } elseif ($iPlanetCount >= $MaxPlanets) {
         $TheMessage = sprintf($LNG['sys_colo_maxcolo'], GetTargetAdressLink($this->_fleet, ''), $MaxPlanets);
         $this->UpdateFleet('fleet_mess', 1);
     } else {
         require_once ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.php';
         $NewOwnerPlanet = CreateOnePlanetRecord($this->_fleet['fleet_end_galaxy'], $this->_fleet['fleet_end_system'], $this->_fleet['fleet_end_planet'], $this->_fleet['fleet_universe'], $this->_fleet['fleet_owner'], $LNG['fcp_colony'], false, $Player['authlevel']);
         if ($NewOwnerPlanet === false) {
             $TheMessage = sprintf($LNG['sys_colo_badpos'], GetTargetAdressLink($this->_fleet, ''));
             $this->UpdateFleet('fleet_mess', 1);
         } else {
             $this->_fleet['fleet_end_id'] = $NewOwnerPlanet;
             $TheMessage = sprintf($LNG['sys_colo_allisok'], GetTargetAdressLink($this->_fleet, ''));
             $this->StoreGoodsToPlanet();
             if ($this->_fleet['fleet_amount'] == 1) {
                 $this->KillFleet();
             } else {
                 $CurrentFleet = explode(";", $this->_fleet['fleet_array']);
                 $NewFleet = '';
                 foreach ($CurrentFleet as $Item => $Group) {
                     if (empty($Group)) {
                         continue;
                     }
                     $Class = explode(",", $Group);
                     if ($Class[0] == 208 && $Class[1] > 1) {
                         $NewFleet .= $Class[0] . "," . ($Class[1] - 1) . ";";
                     } elseif ($Class[0] != 208 && $Class[1] > 0) {
                         $NewFleet .= $Class[0] . "," . $Class[1] . ";";
                     }
                 }
                 $this->UpdateFleet('fleet_array', $NewFleet);
                 $this->UpdateFleet('fleet_amount', $this->_fleet['fleet_amount'] - 1);
                 $this->UpdateFleet('fleet_resource_metal', 0);
                 $this->UpdateFleet('fleet_resource_crystal', 0);
                 $this->UpdateFleet('fleet_resource_deuterium', 0);
                 $this->UpdateFleet('fleet_resource_norio', 0);
                 $this->UpdateFleet('fleet_mess', 1);
             }
         }
     }
     SendSimpleMessage($this->_fleet['fleet_owner'], 0, $this->_fleet['fleet_start_time'], 4, $LNG['sys_colo_mess_from'], $LNG['sys_colo_mess_report'], $TheMessage);
     $this->SaveFleet();
 }
Пример #28
0
function MissionCaseStayAlly($FleetRow)
{
    global $lang;
    $QryStartPlanet = "SELECT name, id_owner FROM {{table}} ";
    $QryStartPlanet .= "WHERE ";
    $QryStartPlanet .= "`galaxy` = '" . $FleetRow['fleet_start_galaxy'] . "' AND ";
    $QryStartPlanet .= "`system` = '" . $FleetRow['fleet_start_system'] . "' AND ";
    $QryStartPlanet .= "`planet` = '" . $FleetRow['fleet_start_planet'] . "';";
    $StartPlanet = doquery($QryStartPlanet, 'planets', true);
    $StartName = $StartPlanet['name'];
    $StartOwner = $StartPlanet['id_owner'];
    $QryTargetPlanet = "SELECT name, id_owner FROM {{table}} ";
    $QryTargetPlanet .= "WHERE ";
    $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
    $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
    $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "';";
    $TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
    $TargetName = $TargetPlanet['name'];
    $TargetOwner = $TargetPlanet['id_owner'];
    switch ($FleetRow['fleet_mess']) {
        case '0':
            if ($FleetRow['fleet_start_time'] <= time()) {
                $Message = sprintf($lang['sys_tran_mess_owner'], $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($StartOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
                $Message = sprintf($lang['sys_tran_mess_user'], $StartName, GetStartAdressLink($FleetRow, ''), $TargetName, GetTargetAdressLink($FleetRow, ''), $FleetRow['fleet_resource_metal'], $lang['Metal'], $FleetRow['fleet_resource_crystal'], $lang['Crystal'], $FleetRow['fleet_resource_deuterium'], $lang['Deuterium']);
                SendSimpleMessage($TargetOwner, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
                $QryUpdateFleet = "UPDATE {{table}} SET ";
                $QryUpdateFleet .= "`fleet_mess` = 1 ";
                $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
                $QryUpdateFleet .= "LIMIT 1 ;";
                doquery($QryUpdateFleet, 'fleets');
            }
            break;
        case '1':
            if ($FleetRow['fleet_end_stay'] <= time()) {
                $QryUpdateFleet = "UPDATE {{table}} SET ";
                $QryUpdateFleet .= "`fleet_mess` = 2 ";
                $QryUpdateFleet .= "WHERE `fleet_id` = '" . $FleetRow['fleet_id'] . "' ";
                $QryUpdateFleet .= "LIMIT 1 ;";
                doquery($QryUpdateFleet, 'fleets');
            }
            break;
        default:
            if ($FleetRow['fleet_end_time'] < time()) {
                $Message = sprintf($lang['sys_tran_mess_back'], $StartName, GetStartAdressLink($FleetRow, ''));
                SendSimpleMessage($StartOwner, '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_tower'], $lang['sys_mess_fleetback'], $Message);
                RestoreFleetToPlanet($FleetRow, true);
                doquery("DELETE FROM {{table}} WHERE fleet_id=" . $FleetRow["fleet_id"], 'fleets');
            }
            break;
    }
}
Пример #29
0
    function run()
    {
        $CONF = Config::getAll(NULL, ROOT_UNI);
        if ($CONF['globaleventsocial'] < TIMESTAMP) {
            $getEvent = rand(1, 2);
            $langObjects = array();
            switch ($getEvent) {
                case '1':
                    $query = $GLOBALS['DATABASE']->query("SELECT id, lang FROM uni1_users;");
                    while ($x = $GLOBALS['DATABASE']->fetch_array($query)) {
                        if (!isset($langObjects[$x['lang']])) {
                            $langObjects[$x['lang']] = new Language($x['lang']);
                            $langObjects[$x['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
                        }
                        $LNG = $langObjects[$x['lang']];
                        $message = '<div class="citation">
        <div class="guillemet ouvrir">«</div>
        <div class="guillemet fermer">»</div>
        <ul style="text-align : left;">
        ' . $LNG['ls_eventcron_1'] . '
        </ul>
    </div>';
                        SendSimpleMessage($x['id'], 0, TIMESTAMP, 7, $LNG['ls_eventcron_2'], $LNG['sys_asteroid_2'], $message);
                    }
                    break;
                case '2':
                    $query = $GLOBALS['DATABASE']->query("SELECT id, lang FROM uni1_users;");
                    while ($x = $GLOBALS['DATABASE']->fetch_array($query)) {
                        if (!isset($langObjects[$x['lang']])) {
                            $langObjects[$x['lang']] = new Language($x['lang']);
                            $langObjects[$x['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
                        }
                        $LNG = $langObjects[$x['lang']];
                        $message = '<div class="citation">
        <div class="guillemet ouvrir">«</div>
        <div class="guillemet fermer">»</div>
        <ul style="text-align : left;">
        ' . $LNG['ls_eventcron_7'] . '
        </ul>
    </div>
	<div class="explication_utilisateur">
        ' . $LNG['ls_eventcron_8'] . '
            </div>
	';
                        SendSimpleMessage($x['id'], 0, TIMESTAMP, 7, $LNG['ls_eventcron_9'], $LNG['sys_asteroid_2'], $message);
                    }
                    break;
            }
            $newevkaka = TIMESTAMP + 5 * 60;
            $GLOBALS['DATABASE']->query("UPDATE " . CONFIG . " SET globaleventsocial = '" . $newevkaka . "' where `uni` = '1';");
        }
    }
Пример #30
0
/**
 * MissionCaseTransport.php
 *
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function MissionCaseTransport($FleetRow)
{
    global $lang;
    $from = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $FleetRow['owner_userid'] . "' LIMIT 1 ;", 'planets', true);
    $to = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $FleetRow['target_userid'] . "' LIMIT 1 ;", 'planets', true);
    RestoreRes($FleetRow, false);
    $Message = sprintf($lang['sys_tran_mess_owner'], $TargetPlanet['name'], "[" . $TargetPlanet['galaxy'] . ":" . $TargetPlanet['system'] . ":" . $TargetPlanet['planet'] . "]", $FleetRow['metal'], $lang['Metal'], $FleetRow['crystal'], $lang['Crystal'], $FleetRow['deuterium'], $lang['Deuterium']);
    SendSimpleMessage($StartPlanet['id_owner'], '', $FleetRow['arrival'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    if ($TargetPlanet['id_owner'] != $StartPlanet['id_owner']) {
        $Message = sprintf($lang['sys_tran_mess_user'], $StartPlanet['name'], "[" . $StartPlanet['galaxy'] . ":" . $StartPlanet['system'] . ":" . $StartPlanet['planet'] . "]", $TargetPlanet['name'], "[" . $TargetPlanet['galaxy'] . ":" . $TargetPlanet['system'] . ":" . $TargetPlanet['planet'] . "]", $FleetRow['metal'], $lang['Metal'], $FleetRow['crystal'], $lang['Crystal'], $FleetRow['deuterium'], $lang['Deuterium']);
        SendSimpleMessage($TargetPlanet['id_owner'], '', $FleetRow['arrival'], 5, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
    }
}