Implemented network encryption (#2343)

For those who fuss about performance, you can disable the `network.enable-encryption` option to use sessions without encryption.
This commit is contained in:
Dylan K. Taylor
2018-07-31 15:54:18 +01:00
committed by GitHub
parent 62cb7963dc
commit 2bf6764112
13 changed files with 556 additions and 176 deletions

View File

@@ -71,6 +71,7 @@ use pocketmine\nbt\tag\ShortTag;
use pocketmine\nbt\tag\StringTag;
use pocketmine\network\AdvancedNetworkInterface;
use pocketmine\network\mcpe\CompressBatchedTask;
use pocketmine\network\mcpe\NetworkCipher;
use pocketmine\network\mcpe\NetworkCompression;
use pocketmine\network\mcpe\NetworkSession;
use pocketmine\network\mcpe\PacketStream;
@@ -1544,6 +1545,8 @@ class Server{
}
$this->networkCompressionAsync = (bool) $this->getProperty("network.async-compression", true);
NetworkCipher::$ENABLED = (bool) $this->getProperty("network.enable-encryption", true);
$this->autoTickRate = (bool) $this->getProperty("level-settings.auto-tick-rate", true);
$this->autoTickRateLimit = (int) $this->getProperty("level-settings.auto-tick-rate-limit", 20);
$this->alwaysTickPlayers = (bool) $this->getProperty("level-settings.always-tick-players", false);