diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index bc0951216..e694ee2f4 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -71,7 +71,7 @@ namespace pocketmine { use pocketmine\wizard\Installer; const VERSION = "Alpha_1.4dev"; - const API_VERSION = "1.9.0"; + const API_VERSION = "1.10.0"; const CODENAME = "絶好(Zekkou)ケーキ(Cake)"; const MINECRAFT_VERSION = "v0.10.4 alpha"; diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 2c94c22ba..5501449df 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -622,6 +622,16 @@ class Server{ $this->mainInterface->putRaw($address, $port, $payload); } + /** + * Blocks an IP address from the main interface. Setting timeout to -1 will block it forever + * + * @param string $address + * @param int $timeout + */ + public function blockAddress($address, $timeout = 300){ + $this->mainInterface->blockAddress($address, $timeout); + } + /** * @param string $address * @param int $port @@ -639,7 +649,7 @@ class Server{ } } - $this->mainInterface->blockAddress($address, 600); + $this->blockAddress($address, 600); } //TODO: add raw packet events } @@ -1834,6 +1844,9 @@ class Server{ $this->reloadWhitelist(); $this->operators->reload(); + foreach($this->getIPBans()->getEntries() as $entry){ + $this->blockAddress($entry->getName(), -1); + } $this->pluginManager->registerInterface(PharPluginLoader::class); $this->pluginManager->loadPlugins($this->pluginPath); @@ -1911,6 +1924,9 @@ class Server{ } + foreach($this->getIPBans()->getEntries() as $entry){ + $this->blockAddress($entry->getName(), -1); + } if($this->getProperty("settings.send-usage", true) !== false){ $this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask([$this, "sendUsage"]), 6000, 6000); diff --git a/src/pocketmine/command/defaults/BanIpCommand.php b/src/pocketmine/command/defaults/BanIpCommand.php index 85876bd1f..7b02c0624 100644 --- a/src/pocketmine/command/defaults/BanIpCommand.php +++ b/src/pocketmine/command/defaults/BanIpCommand.php @@ -75,6 +75,8 @@ class BanIpCommand extends VanillaCommand{ } } + $sender->getServer()->blockAddress($ip, -1); + Command::broadcastCommandMessage($sender, "Banned IP Address " . $ip); } } \ No newline at end of file diff --git a/src/raklib b/src/raklib index 9a1c1868b..658529ec4 160000 --- a/src/raklib +++ b/src/raklib @@ -1 +1 @@ -Subproject commit 9a1c1868b34c2db546cad5895e5974e74ab24763 +Subproject commit 658529ec44f30ce210f5cf42d2280e51332fe3d0