mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 16:45:13 +00:00
RCON: properly handle potential errors during socket setup
This commit is contained in:
@ -25,6 +25,7 @@ namespace pocketmine\level\format\io\region;
|
||||
|
||||
use pocketmine\level\format\ChunkException;
|
||||
use pocketmine\level\format\io\exception\CorruptedChunkException;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\utils\Binary;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use function ceil;
|
||||
@ -98,7 +99,9 @@ class RegionLoader{
|
||||
throw new CorruptedRegionException("Region file should be padded to a multiple of 4KiB");
|
||||
}
|
||||
|
||||
$this->filePointer = fopen($this->filePath, "r+b");
|
||||
$filePointer = fopen($this->filePath, "r+b");
|
||||
if($filePointer === false) throw new AssumptionFailedError("fopen() should not fail here");
|
||||
$this->filePointer = $filePointer;
|
||||
stream_set_read_buffer($this->filePointer, 1024 * 16); //16KB
|
||||
stream_set_write_buffer($this->filePointer, 1024 * 16); //16KB
|
||||
if(!$exists){
|
||||
|
Reference in New Issue
Block a user