mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Did some improvements
This commit is contained in:
parent
4ddb8a298b
commit
fe7595e313
7 changed files with 25 additions and 12 deletions
|
|
@ -165,7 +165,7 @@ class PocketMinecraftServer{
|
|||
$reason = "signal stop";
|
||||
}
|
||||
$this->api->chat->send(false, "Stopping server...");
|
||||
$this->ticker->stop = true;
|
||||
//$this->ticker->stop = true;
|
||||
$this->save(true);
|
||||
$this->stop = true;
|
||||
$this->trigger("server.close", $reason);
|
||||
|
|
@ -328,8 +328,8 @@ class PocketMinecraftServer{
|
|||
}
|
||||
console("[INFO] Loading events...");
|
||||
$this->loadEvents();
|
||||
$this->ticker = new TickLoop($this);
|
||||
$this->ticker->start();
|
||||
//$this->ticker = new TickLoop($this);
|
||||
//$this->ticker->start();
|
||||
declare(ticks=15);
|
||||
register_tick_function(array($this, "tick"));
|
||||
register_shutdown_function(array($this, "dumpError"));
|
||||
|
|
@ -358,6 +358,8 @@ class PocketMinecraftServer{
|
|||
global $arguments;
|
||||
$dump .= "Parameters: ".var_export($arguments, true)."\r\n\r\n\r\n";
|
||||
$dump .= "server.properties: ".var_export($this->api->getProperties(), true)."\r\n\r\n\r\n";
|
||||
global $lasttrace;
|
||||
$dump .= "Last Backtrace: ".$lasttrace."\r\n\r\n\r\n";
|
||||
$dump .= "Loaded Modules: ".var_export(get_loaded_extensions(), true)."\r\n\r\n";
|
||||
$name = "error_dump_".time();
|
||||
logg($dump, $name, true, 0, true);
|
||||
|
|
@ -504,7 +506,7 @@ class PocketMinecraftServer{
|
|||
|
||||
public function process(){
|
||||
while($this->stop === false){
|
||||
$packet = @$this->interface->readPacket();
|
||||
$packet = $this->interface->readPacket();
|
||||
if($packet !== false){
|
||||
$this->packetHandler($packet);
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class MinecraftInterface{
|
|||
}
|
||||
|
||||
$packet = new Packet($pid, $struct, $data[0]);
|
||||
$packet->parse();
|
||||
@$packet->parse();
|
||||
$this->data[] = array($pid, $packet->data, $data[0], $data[1], $data[2]);
|
||||
return $this->popPacket();
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ class MinecraftInterface{
|
|||
if($raw === false){
|
||||
$packet = new Packet($pid, $struct);
|
||||
$packet->data = $data;
|
||||
$packet->create();
|
||||
@$packet->create();
|
||||
$write = $this->socket->write($packet->raw, $dest, $port);
|
||||
$this->writeDump($pid, $packet->raw, $data, "client", $dest, $port);
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -247,7 +247,6 @@ class Utils extends Thread{
|
|||
(string) mt_rand(),
|
||||
(string) rand(),
|
||||
function_exists("zend_thread_id") ? ((string) zend_thread_id()):microtime(),
|
||||
var_export(@get_browser(), true),
|
||||
function_exists("sys_getloadavg") ? implode(";", sys_getloadavg()):microtime(),
|
||||
serialize(get_loaded_extensions()),
|
||||
sys_get_temp_dir(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue