Added memory-limit option

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-19 13:46:52 +01:00
parent 4a46fde483
commit 11f4096403
4 changed files with 83 additions and 1 deletions

View File

@ -212,6 +212,11 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
} }
private function loadProperties(){ private function loadProperties(){
if(isset($this->config["memory-limit"])){
@ini_set("memory_limit", $this->config["memory-limit"]);
}else{
$this->config["memory-limit"] = "256M";
}
if(is_object($this->server)){ if(is_object($this->server)){
$this->server->setType($this->config["server-type"]); $this->server->setType($this->config["server-type"]);
$this->server->timePerSecond = $this->config["time-per-second"]; $this->server->timePerSecond = $this->config["time-per-second"];

View File

@ -29,11 +29,12 @@ set_time_limit(0);
date_default_timezone_set(@date_default_timezone_get()); date_default_timezone_set(@date_default_timezone_get());
gc_enable(); gc_enable();
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
ini_set("allow_url_fopen", 1);
ini_set("display_errors", 1); ini_set("display_errors", 1);
ini_set('default_charset', 'utf-8'); ini_set('default_charset', 'utf-8');
define("FILE_PATH", dirname(__FILE__)."/../"); define("FILE_PATH", dirname(__FILE__)."/../");
set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH . PATH_SEPARATOR . FILE_PATH . "/classes/"); set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH . PATH_SEPARATOR . FILE_PATH . "/classes/");
ini_set("memory_limit", "1024M"); ini_set("memory_limit", "256M");
define("CURRENT_PROTOCOL", 5); define("CURRENT_PROTOCOL", 5);
define("CURRENT_VERSION", 1); define("CURRENT_VERSION", 1);
define("LOG", true); define("LOG", true);

View File

@ -4,6 +4,7 @@ description= This is a Work in Progress custom server.
motd=Welcome to PHP Server motd=Welcome to PHP Server
port=19132 port=19132
protocol=CURRENT protocol=CURRENT
memory-limit=256M
last-update=false last-update=false
white-list=false white-list=false
debug=2 debug=2

View File

@ -86,24 +86,99 @@ $pstruct = array(
"customData", "customData",
), ),
0x81 => array(
"itriad",
"ubyte",
"customData",
),
0x82 => array(
"itriad",
"ubyte",
"customData",
),
0x83 => array(
"itriad",
"ubyte",
"customData",
),
0x84 => array( 0x84 => array(
"itriad", "itriad",
"ubyte", "ubyte",
"customData", "customData",
), ),
0x85 => array(
"itriad",
"ubyte",
"customData",
),
0x86 => array(
"itriad",
"ubyte",
"customData",
),
0x87 => array(
"itriad",
"ubyte",
"customData",
),
0x88 => array( 0x88 => array(
"itriad", "itriad",
"ubyte", "ubyte",
"customData", "customData",
), ),
0x89 => array(
"itriad",
"ubyte",
"customData",
),
0x8a => array(
"itriad",
"ubyte",
"customData",
),
0x8b => array(
"itriad",
"ubyte",
"customData",
),
0x8c => array( 0x8c => array(
"itriad", "itriad",
"ubyte", "ubyte",
"customData", "customData",
), ),
0x8d => array(
"itriad",
"ubyte",
"customData",
),
0x8e => array(
"itriad",
"ubyte",
"customData",
),
0x8f => array(
"itriad",
"ubyte",
"customData",
),
0xa0 => array( 0xa0 => array(
"short", "short",
"bool", "bool",