hack attempt

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • hack attempt

    hi, hoping to get some help please, on the xterium version, when your in premium shop and you want to buy stardust, you get the message "hack attempt" when you click on buy.....any idea how to fix this?
  • I certainly understand everything, but psychics on vacation and do not know when they will return. Need code! Code of the function of buying stellar ore, without it there can only be assumptions
    Кто к нам с чем зачем, тот от того и того! :D
  • is this what your asking for?
    <div id="box_stardust" class="content_box" style="display: block;">
    <img class="pren_img" alt="" title="" src="/styles/images/premium/stardust.jpg">
    <form action="game.php?page=premium" method="post">
    <input type="hidden" name="price" id="cost_stardust_price" value="">
    <input type="hidden" name="mode" value="buystardust">
    <div class="content_form">
    +<input style="width:50px;" type="number" min="0" value="0" id="stardust" name="stardust" onkeyup="Totalstardust();" onchange="Totalstardust();">
    <span style="float:right;">cost is <span style="color:#090;" id="cost_stardust">0</span> Antimatter</span>
    </div>
    <input class="pren_btn_buy" type="submit" value="Buy">
    </form>
    </div>
    or the php file
  • <?php
    class ShowPremiumPage extends AbstractPage
    {
    function __construct()
    {
    parent::__construct();
    }

    function KeyUpBuy($name,$count,$days)
    {
    $PremiumCalc = $GLOBALS['DATABASE']->query("SELECT cost, factor, factorone, rangevalue FROM `uni1_premium_calc` WHERE name = '".$name."';");
    $PremiumCalc = $GLOBALS['DATABASE']->fetch_array($PremiumCalc);

    $Cost= $PremiumCalc['cost'];
    $Factor= $PremiumCalc['factor'];
    $FactorOne= $PremiumCalc['factorone'];
    $RangeValue = $PremiumCalc['rangevalue'];
    $CostPerDay = round($Cost * pow($Factor, (floor($count/$FactorOne))-$RangeValue) * $count);
    $Discount = 1 - min(0.50, ($days * 0.5 / 100)) ;
    $FullCost = round($days * $CostPerDay * $Discount);
    return $FullCost;
    }

    function KeyUpBuyBis($days)
    {
    $prem_days = $days;
    $CostPerDay = 175 * $prem_days ;
    $Discount = 1 - min(0.50, ($prem_days * 0.5 / 100)) ;
    $FullCost = $prem_days * $CostPerDay * $Discount;
    return $FullCost;
    }

    function buystardust(){
    global $USER, $PLANET, $LNG, $UNI, $CONF,$resource,$pricelist;
    $stardust = HTTP::_GP('stardust', 0);
    $price = (100000 - (100000/100*$CONF['stardust_bonus'])) * $stardust;
    if ($price < 0) {
    $this->printMessage("Hack attempt.", true, array('game.php?page=premium', 2));
    }
    if($USER['antimatter'] < $price){
    $this->printMessage("You do not have enough antimatter", true, array('game.php?page=premium', 2));
    die();
    }elseif($stardust < 0){
    $this->printMessage("Hack attempt.", true, array('game.php?page=premium', 2));
    die();
    }else{
    $USER['antimatter'] -= $price;
    $GLOBALS['DATABASE']->query("UPDATE ".USERS." SET `stardust` = `stardust` + '".$stardust."', `antimatter` = `antimatter` - '".$price."' WHERE `id` = ".$USER['id'].";");
    }
    $this->printMessage('Stardust has succesfully be bought', true, array('game.php?page=premium', 2));
    die();
    }
    function show(){
    global $USER, $PLANET, $LNG, $UNI, $CONF,$resource,$pricelist;

    if($_POST){
    $mode = HTTP::_GP('item', '');
    $count = HTTP::_GP('count', 0);
    $days = HTTP::_GP('days', 0);

    $premiun_extra = 0;
    if($CONF['premium'] != 0 && $CONF['purchase_bonus_timer'] > TIMESTAMP){
    $premiun_extra = $CONF['premium'];
    }

    if($mode != 'prem_advanced_battlesim'){
    $price = $this->KeyUpBuy($mode,$count,$days);
    }else{
    $price = $this->KeyUpBuyBis($days);
    }

    $Premium_Time = (TIMESTAMP + $days * 86400) + (($days * 86400) / 100 * $premiun_extra);


    if ($days < 1) {
    $this->printMessage("You have to select a minimum of 1 day period for this bonus.", true, array('game.php?page=premium', 2));
    }elseif ($count < 1 && $mode != "prem_advanced_battlesim") {
    $this->printMessage("You have to select a minimum of 1 for this bonus.", true, array('game.php?page=premium', 2));
    }elseif ($price < 0) {
    $this->printMessage("Hack attempt.", true, array('game.php?page=premium', 2));
    }
    switch($mode){
    case 'prem_res':
    if($USER['antimatter'] < $price){
    $this->printMessage("You do not have enough antimatter", true, array('game.php?page=premium', 2));
    die();
    }elseif($USER['premium_reward_extraction_days'] > TIMESTAMP){
    $this->printMessage("You already have that bonus active", true, array('game.php?page=premium', 2));
    die();
    }else{
    $USER['antimatter'] -= $price;
    $GLOBALS['DATABASE']->query("Update ".USERS." SET `antimatter` = `antimatter` - ".$price.", `premium_reward_extraction` = ".$count.", `premium_reward_extraction_days` = ".$Premium_Time." WHERE `id` = ".$USER['id'].";");
    $this->printMessage("Premium reward extraction (".$count."%) is succesfully activated for ".$days." days", true, array('game.php?page=premium', 2));
    die();
    }
    break;
    case 'prem_storage':
    if($USER['antimatter'] < $price){
    $this->printMessage("You do not have enough antimatter", true, array('game.php?page=premium', 2));
    die();
    }elseif($USER['premium_reward_storing_days'] > TIMESTAMP){
    $this->printMessage("You already have that bonus active", true, array('game.php?page=premium', 2));
    die();
    }else{
    $USER['antimatter'] -= $price;
    $GLOBALS['DATABASE']->query("Update ".USERS." SET `antimatter` = `antimatter` - ".$price.", `premium_reward_storing` = ".$count.", `premium_reward_storing_days` = ".$Premium_Time." WHERE `id` = ".$USER['id'].";");
    $this->printMessage("Premium reward storing (".$count."%) is succesfully activated for ".$days." days", true, array('game.php?page=premium', 2));
    die();
    }
    break;
    case 'prem_s_build':
    if($USER['antimatter'] < $price){
    $this->printMessage("You do not have enough antimatter", true, array('game.php?page=premium', 2));
    die();
    }elseif($USER['premium_reward_speed_days'] > TIMESTAMP){
    $this->printMessage("You already have that bonus active", true, array('game.php?page=premium', 2));
    die();
    }else{
    $USER['antimatter'] -= $price;
    $GLOBALS['DATABASE']->query("Update ".USERS." SET `antimatter` = `antimatter` - ".$price.", `premium_reward_speed` = ".$count.", `premium_reward_speed_days` = ".$Premium_Time." WHERE `id` = ".$USER['id'].";");
    $this->printMessage("Premium speed of construction and research (".$count."%) is succesfully activated for ".$days." days", true, array('game.php?page=premium', 2));
    die();
  • PHP Source Code

    1. function buystardust(){
    2. global $USER, $PLANET, $LNG, $UNI, $CONF,$resource,$pricelist;
    3. $stardust = max(0, HTTP::_GP('stardust', 1));
    4. //$price = (100000 - (100000/100*$CONF['stardust_bonus'])) * $stardust; WTF???
    5. $price = 100000 * $stardust;
    6. if ($USER['antimatter'] < $price || $stardust < 1)
    7. $this->printMessage("You do not have enough antimatter", true, array('game.php?page=premium', 2));
    8. $USER['antimatter'] -= $price;
    9. $GLOBALS['DATABASE']->query("UPDATE ".USERS." SET `stardust` = `stardust` + '".$stardust."', `antimatter` = `antimatter` - '".$price."' WHERE `id` = ".$USER['id'].";");
    10. $this->printMessage('Stardust has succesfully be bought', true, array('game.php?page=premium', 2));
    11. }
    Display All
    Comment on the amount of code you provided did not want to be honest
    Кто к нам с чем зачем, тот от того и того! :D
  • thanks it works ..but it wont give me an amount when im buying and it wont update the system when i buy it......i.e if i buy 2 it will take the antimatter for it but it wont show how much i have..and if i try to upgarde something that needs stardust it wont do it because it thinks i have none
  • This does not work the script most likely, you need to watch it already, if you want I can look through the FTP, my Skype is in the information
    Кто к нам с чем зачем, тот от того и того! :D