From f936e29d342e2943553893f8b3168f2c6340f282 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Wed, 20 Mar 2013 16:42:20 +0100 Subject: [PATCH] TPS check --- src/PocketMinecraftServer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index eb8b75785..ef01769c2 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -110,6 +110,7 @@ class PocketMinecraftServer{ } $this->action(500000, '$this->time += (int) ($this->timePerSecond / 2);$this->api->dhandle("server.time", $this->time);'); $this->action(5000000, 'if($this->difficulty < 2){$this->api->dhandle("server.regeneration", 1);}'); + $this->action(1000000 * 15, 'if($this->getTPS() < 15){console("[WARNING] Can\'t keep up! Is the server overloaded?");}'); $this->action(1000000 * 60 * 10, '$this->custom = array();'); if($this->api instanceof ServerAPI){ $this->action(1000000 * 80, '$cnt = count($this->clients); if($cnt > 1){$this->api->chat->broadcast("Online (".$cnt."): ".implode(", ",$this->api->player->online()));}');