Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
2
Cevap
345
Tıklama
0
Öne Çıkarma
Maden Toplama Modulunde Bug Sorunu
O
11 yıl
Onbaşı
Konu Sahibi

ASAGIDAKI KOD OGAME OYUNUN MADEN TOPLAMA MODULUNUN PHP DOSYASIDIR, FAKAT KOTU NIYETLI ARKADASLAR BUNUN BUGUNU BULMUSLAR YARDIMCI OLABILRSENIZ SEVINIRIM

<?php 

class ShowHarvestPage extends AbstractPage {

public static $requireModule = 0;

var $HarvestPrice = array(
1 => 2000,
5 => 8000,
10 => 15000,
20 => 25000,
);

function __construct() {
parent::__construct();
}

function show() {
global $CONF, $LNG, $PLANET, $USER, $resource, $UNI;

if($USER['harvest_delay'] < TIMESTAMP - 24*60*60){

// if($USER['harvest_time'] < 5){

// $time = TIMESTAMP;
// $GLOBALS['DATABASE']->query("UPDATE `uni1_users` SET `harvest_time` = 5, `harvest_delay` = ".$time." where `id` = ".$USER['id'].";");
// $this->printMessage("Whe are setting back your harvest counters to 5.", true, array('game.php?page=>harvest', 2));
// die();

// } else{

// $time = TIMESTAMP;
// $GLOBALS['DATABASE']->query("UPDATE `uni1_users` SET `harvest_delay` = ".$time." where `id` = ".$USER['id'].";");
// $this->printMessage("Loading your data.", true, array('game.php?page=>harvest', 2));
// die();

// }

}

if(!empty($USER['urlaubs_modus'])){
$this->printMessage("You can't access this page while you are in V mode!", true, array('game.php?page=>overview', 2));
die();
}

if($_POST)
{

$mode = HTTP::_GP('con', '');

switch($mode){
case 'extra':

$take = HTTP::_GP('buy',0);
$take = $GLOBALS['DATABASE']->escape($take);
if(!array_key_exists($take,$this->HarvestPrice)){
$this->printMessage("Invalid Option", true, array('?page=>Harvest', 3));
}else{
//option is ok . go forward
//enough dm ?
if($USER['darkmatter'] < $this->HarvestPrice[$take]){
$this->printMessage("Not enough DM", true, array('?page=>Harvest', 3));
die();
}
$USER['darkmatter'] -= $this->HarvestPrice[$take];
$GLOBALS['DATABASE']->query("Update ".USERS." SET `harvest_time` = `harvest_time` + ".($take)." WHERE `id` = ".$USER['id']." ; ");
$this->printMessage("You have bought ".$take." Harvest Points", true, array('?page=>Harvest', 3));
die();
}
break;
case 'gather':

if($USER['harvest_time'] == 0 ){
$this->printMessage("No Harvest Points Left!", true, array('game.php?page=>Harvest', 2));
die();
}

$check_planet = HTTP::_GP('check_planet', array());
$check_moons = HTTP::_GP('check_moons', array());

// echo "<pre>";
// var_dump($check_planet);
// die();

if (!isset($check_planet) && !isset($check_moons))
$this->redirectTo('game.php?page=harvest'); // If planets and moons array is set
if(!isset($check_planet))
$check_planet = array(); // If planets are empty

// sort($check_planet);
// $select_all_planets_query = "SELECT id, metal, crystal, deuterium FROM ".PLANETS." WHERE ";
// $selected_planet_count = 0;
foreach($check_planet as $ID => $Value) {
// $select_all_planets_query .= "`id` = '$Value' OR ";
// $selected_planet_count++;


$sur = $GLOBALS['DATABASE']->uniquequery("SELECT metal, crystal, deuterium FROM ".PLANETS." WHERE `id` = '".$Value."';");

$GLOBALS['DATABASE']->multi_query("LOCK TABLE ".PLANETS." WRITE; UPDATE ".PLANETS." SET `metal` = metal - ".$sur['metal'].", `crystal` = crystal - ".$sur['crystal'].", `deuterium` = deuterium - ".$sur['deuterium']." WHERE `id` = '".$Value."'; UNLOCK TABLES;");
$PLANET['metal'] += $sur['metal'];
$PLANET['crystal'] += $sur['crystal'];
$PLANET['deuterium'] += $sur['deuterium'];
}
// $select_all_planets_query .= ";";
// $select_all_planets_query = str_replace('OR ;', ';', $select_all_planets_query);

// echo $select_all_planets_query."<br>";
// echo $selected_planet_count."<br>";

// $select_all_planets_query_result = $GLOBALS['DATABASE']->query($select_all_planets_query);

// while ($row = $GLOBALS['DATABASE']->fetch_array($select_all_planets_query_result)) {
// var_dump($row);
// }
// echo "</pre>";
// die();

if(!isset($check_moons))
$check_moons = array(); // If moons are empty
foreach($check_moons as $ID => $Value) {
$surr = $GLOBALS['DATABASE']->uniquequery("SELECT metal, crystal, deuterium FROM ".PLANETS." where `id` = '".$Value."';");
$GLOBALS['DATABASE']->multi_query("LOCK TABLE ".PLANETS." WRITE; UPDATE ".PLANETS." SET `metal` = metal - ".$surr['metal'].", `crystal` = crystal - ".$surr['crystal'].", `deuterium` = deuterium - ".$surr['deuterium']." WHERE `id` = '".$Value."'; UNLOCK TABLES;");
$PLANET['metal'] += $surr['metal'];
$PLANET['crystal'] += $surr['crystal'];
$PLANET['deuterium'] += $surr['deuterium'];
}

$GLOBALS['DATABASE']->query("UPDATE ".USERS." SET `harvest_time` = `harvest_time` - 1 where `id` = '".$USER['id']."';");
$this->printMessage($LNG['h_ok'], true, array('game.php?page=>harvest', 4));

break;
}
}

$Planets = array();
$Moons = array();

// if (isset($USER['PLANETS'])) {
$planets_array_ozan = getPlanets($USER);
// }

ksort($planets_array_ozan);

// echo "<pre>";
// var_dump($planets_array_ozan);
// echo "</pre>";
// die();



foreach ($planets_array_ozan as $planet_id_ozan => $planet_data_array_ozan) {
if ($planet_data_array_ozan['planet_type'] == 1) {
if ($PLANET['id'] != $planet_data_array_ozan['id']) {
$Planets[$planet_id_ozan] = "[{$planet_data_array_ozan['galaxy']}:{$planet_data_array_ozan['system']}:{$planet_data_array_ozan['planet']}]";
}
}
elseif ($planet_data_array_ozan['planet_type'] == 3) {
$Moons[$planet_id_ozan] = "[{$planet_data_array_ozan['galaxy']}:{$planet_data_array_ozan['system']}:{$planet_data_array_ozan['planet']}]";
}
}
ksort($Planets);
ksort($Moons);

// foreach($USER['PLANETS'] as $ID => $PlanetQuery) {
// if ($ID == $PLANET['id']) continue;
// if ($PlanetQuery['planet_type'] == 3)
// {
// $Moons[$PlanetQuery['id']] = " [" . $PlanetQuery['galaxy'] . ":" . $PlanetQuery['system'] . ":" . $PlanetQuery['planet'] . "]";
// }
// elseif ($PlanetQuery['planet_type'] == 1)
// {
// $Planets[$PlanetQuery['id']] = " [".$PlanetQuery['galaxy'] . ":" . $PlanetQuery['system'] . ":" . $PlanetQuery['planet'] . "]";
// }
// }


$this->tplObj->loadscript("jquery.countdown.js");
$this->tplObj->assign_vars(array(
'prices' => $this->HarvestPrice,
'PlanetsList' => $Planets,
'MoonsList' => $Moons,
'harvest' => $USER['harvest_time'],
'p_state' => $USER['harvest_time'],
'p_delay' => ((($USER['harvest_delay']+24*60*60) < TIMESTAMP) ? true : (($USER['harvest_delay']+24*60*60) - TIMESTAMP)),
));
$this->display('page.harvest.default.tpl');
}
}

?>





< Bu mesaj bu kişi tarafından değiştirildi ogamecenter -- 24 Aralık 2014; 0:39:44 >

S
11 yıl
Çavuş

Insallah bulursun cozebilecek birini



< Bu ileti mobil sürüm kullanılarak atıldı >
Bu mesaja 1 cevap geldi.
K
11 yıl
Er

'p_delay'          => ((($USER['harvest_delay']+24*60*60) < time()) ? true : (($USER['harvest_delay']+24*60*60) - time())),


şeklinde değiştirebilirmisiniz. aşağıdaki şekilde olan satırı
 'p_delay'          => ((($USER['harvest_delay']+24*60*60) < TIMESTAMP ) ? true : (($USER['harvest_delay']+24*60*60) - TIMESTAMP)),





< Bu mesaj bu kişi tarafından değiştirildi KillHer -- 27 Aralık 2014; 23:27:38 >

DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.