diff --git a/README.md b/README.md index e46bbee05..2e015d789 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,6 @@ How to contact me Third-party Tools: ------------------ * [How to connect to internet servers](http://www.minecraftforum.net/topic/1256915-legit-minecraftpe-online-multiplayer/) -* OBSOLETE [Video-Tutorial made by ChrisMCMine](http://www.youtube.com/watch?v=GC9MBVaHge0) +* [Video-Tutorial made by ChrisMCMine](http://www.youtube.com/watch?v=GC9MBVaHge0) * [User-made program to merge server I/O done in C++](https://github.com/filfat/MCPES_CPP_INPUT/) * [Proxy to allow devices in your local network join online servers using node.js](https://github.com/brandon15811/Minecraft-PE-Proxy) \ No newline at end of file diff --git a/TODO b/TODO index dcdb8658a..4a9207c22 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ - Fix spawn position resetting - Mob spawning, item pick up -- Fix incorrect timeout - Inventory loading and saving - Entity saving \ No newline at end of file diff --git a/classes/PocketMinecraftServer.class.php b/classes/PocketMinecraftServer.class.php index 85d635f64..3c5c969c4 100644 --- a/classes/PocketMinecraftServer.class.php +++ b/classes/PocketMinecraftServer.class.php @@ -298,7 +298,6 @@ class PocketMinecraftServer extends stdClass{ $this->loadEvents(); declare(ticks=15); register_tick_function(array($this, "tick")); - $this->event("onTick", "tickerFunction", true); register_shutdown_function(array($this, "close")); console("[INFO] Server started!"); $this->process(); @@ -309,6 +308,7 @@ class PocketMinecraftServer extends stdClass{ if($this->lastTick <= ($time - 0.05)){ $this->tickMeasure[] = $this->lastTick = $time; array_shift($this->tickMeasure); + $this->tickerFunction($time); $this->trigger("onTick", $time); } } diff --git a/classes/Session.class.php b/classes/Session.class.php index eaf45274c..21e8f52a5 100644 --- a/classes/Session.class.php +++ b/classes/Session.class.php @@ -52,7 +52,10 @@ class Session{ $this->counter = array(0, 0); } - public function onTick($time){ + public function onTick($time, $event){ + if($event !== "onTick"){ + return; + } if($time > $this->timeout){ $this->close("timeout"); }else{ @@ -169,7 +172,7 @@ class Session{ } } - public function handle($pid, &$data){ + public function handle($pid, $data){ if($this->connected === true){ $this->timeout = microtime(true) + 25; switch($pid){ @@ -397,7 +400,7 @@ class Session{ $this->buffer[$count] = array($id, $data); } $data["id"] = $id; - $this->send(0x84, array( + $this->send(0x80, array( $count, 0x00, $data, diff --git a/common/default.properties b/common/default.properties index 762d1cbb2..e5b22bc9d 100644 --- a/common/default.properties +++ b/common/default.properties @@ -12,7 +12,7 @@ debug=2 max-players=20 server-type=normal time-per-second=20 -gamemode=0 +gamemode=1 difficulty=1 seed=false level-name=false