Crash main server thread when RakLib dies

this way we get crashdumps and find out what's actually wrong with RakLib in the wild.
This commit is contained in:
Dylan K. Taylor
2019-01-09 19:04:12 +00:00
parent cc230034f9
commit 5d8fa2e126
2 changed files with 9 additions and 5 deletions

View File

@ -103,7 +103,11 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
public function tick() : void{
if(!$this->rakLib->isRunning() and !$this->rakLib->isShutdown()){
throw new \Exception("RakLib Thread crashed");
$e = $this->rakLib->getCrashInfo();
if($e !== null){
throw $e;
}
throw new \Exception("RakLib Thread crashed without crash information");
}
}