drastic speedup through multicalls

This commit is contained in:
kremsy
2017-05-14 09:25:52 +02:00
parent 5d6f8d047c
commit e5c7fdbf6b
7 changed files with 33 additions and 31 deletions

View File

@ -533,14 +533,14 @@ class ModeScriptEventManager implements UsageInformationAble {
* @param string $data
*/
public function triggerModeScriptEvent($eventName, $data = '') {
try {
$this->maniaControl->getClient()->triggerModeScriptEvent($eventName, $data);
} catch (GameModeException $e) {
if ($e->getMessage() != 'Not in script mode.') {
throw $e;
$this->maniaControl->getClient()->triggerModeScriptEvent($eventName, $data, function ($exception) use ($eventName) {
if ($exception instanceof GameModeException) {
if ($exception->getMessage() != 'Not in script mode.') {
throw $exception;
}
Logger::logWarning($eventName . " can't be triggered because you are not in Scriptmode, start your server in Scriptmode!");
}
Logger::logWarning($eventName . " can't be triggered because you are not in Scriptmode, start your server in Scriptmode!");
}
});
}
/**