Hello,
After month of playing 2moons i am getting error while sending colonisation.
Requirements for colonisation are ok. I have enough slots for new planet.
When fleets arrive i get error in log and fleet is bloked.
Error:
Display All
CreateOnePlanetRecord.php code:
Display All
PlanetDataBis file:
Display All
What is strage is that when i unblock fleet sometimes colonisation is successful and sometimes not.
I am using webhosting for game not VPS.
Hosting pamameters:
Apache 2.2 based on linux
php memory limit: 128 Mb
post max size: 32 Mb
I think that i dont have enoung computing power to create a new record to db where are lots of records
Can somebody help please?
After month of playing 2moons i am getting error while sending colonisation.
Requirements for colonisation are ok. I have enough slots for new planet.
When fleets arrive i get error in log and fleet is bloked.
Error:
Source Code
- [17-Dec-2016 21:59:23] NOTICE: "Undefined variable: PlanetData"
- File: /data/web/virtuals/145387/virtual/www/includes/functions/CreateOnePlanetRecord.php | Line: 48
- URL: http://solaris-online.cz/game.php | Version: V 1.0
- Stack trace:
- #0 /includes/functions/CreateOnePlanetRecord.php(48): errorHandler(8, 'Undefined varia...', '/data/web/virtu...', 48, Array)
- #1 /includes/classes/missions/MissionCaseColonisation.php(66): CreateOnePlanetRecord('7', '7', '6', '1', '9', 'Colony', false, '0')
- #2 /includes/classes/class.FlyingFleetHandler.php(82): MissionCaseColonisation->TargetEvent()
- #3 /includes/FleetHandler.php(16): FlyingFleetHandler->run()
- #4 /includes/common.php(126): require('/data/web/virtu...')
- #5 /game.php(10): require('/data/web/virtu...')
- #6 {main}
CreateOnePlanetRecord.php code:
PHP Source Code
- <?php
- /**
- * 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 <info@2moons.cc>
- * @copyright 2012 Jan Kröpke <info@2moons.cc>
- * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
- * @version 1.7.3 (2013-05-19)
- * @info $Id: CreateOnePlanetRecord.php 2640 2013-03-23 19:23:26Z slaver7 $
- * @link http://2moons.cc/
- */
- function CreateOnePlanetRecord($Galaxy, $System, $Position, $Universe, $PlanetOwnerID, $PlanetName = '', $HomeWorld = false, $AuthLevel = 0)
- {
- global $LNG;
- $CONF = Config::getAll(NULL, $Universe);
- if (Config::get('max_galaxy') < $Galaxy || 1 > $Galaxy) {
- throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:".$Galaxy.":".$System.":".$Position);
- }
- if (Config::get('max_system') < $System || 1 > $System) {
- throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:".$Galaxy.":".$System.":".$Position);
- }
- if (Config::get('max_planets') < $Position || 1 > $Position) {
- throw new Exception("Access denied for CreateOnePlanetRecord.php.<br>Try to create a planet at position:".$Galaxy.":".$System.":".$Position);
- }
- if (CheckPlanetIfExist($Galaxy, $System, $Position, $Universe)) {
- return false;
- }
- $FieldFactor = Config::get('planet_factor');
- require_once 'includes/PlanetDataBis.php' ;
- $Pos = ceil($Position / (Config::get('max_planets') / count($PlanetData)));
- $TMax = $PlanetData[$Pos]['temp'];
- $TMin = $TMax - 40;
- $Fields = $PlanetData[$Pos]['fields'] * Config::get('planet_factor');
- $Types = array_keys($PlanetData[$Pos]['image']);
- $Type = $Types[array_rand($Types)];
- $Class = $Type.'planet'.($PlanetData[$Pos]['image'][$Type] < 10 ? '0' : '').$PlanetData[$Pos]['image'][$Type];
- $Name = !empty($PlanetName) ? $GLOBALS['DATABASE']->sql_escape($PlanetName) : $LNG['type_planet'][1];
- $GLOBALS['DATABASE']->query("INSERT INTO ".PLANETS." SET
- name = '".$Name."',
- universe = ".$Universe.",
- id_owner = ".$PlanetOwnerID.",
- galaxy = ".$Galaxy.",
- system = ".$System.",
- planet = ".$Position.",
- last_update = ".TIMESTAMP.",
- planet_type = '1',
- image = '".$Class."',
- diameter = ".floor(1000 * sqrt($Fields)).",
- field_max = ".(($HomeWorld) ? Config::get('initial_fields') : floor($Fields)).",
- temp_min = ".$TMin.",
- temp_max = ".$TMax.",
- planet_protection = '0',
- metal = ".Config::get('metal_start').",
- metal_perhour = ".Config::get('metal_basic_income').",
- crystal = ".Config::get('crystal_start').",
- crystal_perhour = ".Config::get('crystal_basic_income').",
- deuterium = ".Config::get('deuterium_start').",
- deuterium_perhour = ".Config::get('deuterium_basic_income').";");
- return $GLOBALS['DATABASE']->GetInsertID();
- }
PHP Source Code
- <?php
- $PlanetData = array(
- 1 => array('temp' => mt_rand(220, 260), 'fields' => mt_rand(385, 498), 'image' => array('trocken' => mt_rand(1, 10), 'wuesten' => mt_rand(1, 4))),
- 2 => array('temp' => mt_rand(170, 210), 'fields' => mt_rand(387, 500), 'image' => array('trocken' => mt_rand(1, 10), 'wuesten' => mt_rand(1, 4))),
- 3 => array('temp' => mt_rand(120, 160), 'fields' => mt_rand(488, 527), 'image' => array('trocken' => mt_rand(1, 10), 'wuesten' => mt_rand(1, 4))),
- 4 => array('temp' => mt_rand(70, 110), 'fields' => mt_rand(513, 593), 'image' => array('dschjungel' => mt_rand(1, 10))),
- 5 => array('temp' => mt_rand(60, 100), 'fields' => mt_rand(538, 600), 'image' => array('dschjungel' => mt_rand(1, 10))),
- 6 => array('temp' => mt_rand(50, 90), 'fields' => mt_rand(538, 616), 'image' => array('dschjungel' => mt_rand(1, 10))),
- 7 => array('temp' => mt_rand(40, 80), 'fields' => mt_rand(531, 663), 'image' => array('normaltemp' => mt_rand(1, 7))),
- 8 => array('temp' => mt_rand(30, 70), 'fields' => mt_rand(559, 636), 'image' => array('normaltemp' => mt_rand(1, 7))),
- 9 => array('temp' => mt_rand(20, 60), 'fields' => mt_rand(551, 628), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))),
- 10 => array('temp' => mt_rand(10, 50), 'fields' => mt_rand(544, 614), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))),
- 11 => array('temp' => mt_rand(0, 40), 'fields' => mt_rand(538, 594), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))),
- 12 => array('temp' => mt_rand(-10, 30), 'fields' => mt_rand(526, 561), 'image' => array('normaltemp' => mt_rand(1, 7), 'wasser' => mt_rand(1, 9))),
- 13 => array('temp' => mt_rand(-50, -10), 'fields' => mt_rand(499, 511), 'image' => array('eis' => mt_rand(1, 10))),
- 14 => array('temp' => mt_rand(-90, -50), 'fields' => mt_rand(471, 483), 'image' => array('eis' => mt_rand(1, 10))),
- 15 => array('temp' => mt_rand(-130, -90), 'fields' => mt_rand(445, 464), 'image' => array('eis' => mt_rand(1, 10)))
- );
- ?>
What is strage is that when i unblock fleet sometimes colonisation is successful and sometimes not.
I am using webhosting for game not VPS.
Hosting pamameters:
Apache 2.2 based on linux
php memory limit: 128 Mb
post max size: 32 Mb
I think that i dont have enoung computing power to create a new record to db where are lots of records
Can somebody help please?