AsyncTask: Rewrite how thread-local storage works, now non-dependent on Server or ServerScheduler

this implementation was god-awful bad and it was entirely avoidable to make it this complicated.

This utilizes the fact that pthreads treats static properties as thread-local. AsyncTask local storage now utilizes a \SplObjectStorage stored in an AsyncTask private static field.
This commit is contained in:
Dylan K. Taylor
2018-05-29 19:41:00 +01:00
parent 299e4c8a85
commit 81957d133d
5 changed files with 52 additions and 112 deletions

View File

@ -144,7 +144,7 @@ class VerifyLoginTask extends AsyncTask{
public function onCompletion(Server $server){
/** @var Player $player */
$player = $this->fetchLocal($server);
$player = $this->fetchLocal();
if($player->isClosed()){
$server->getLogger()->error("Player " . $player->getName() . " was disconnected before their login could be verified");
}else{