A clear and concise description of what the bug is.
> mw unload lobby-1
[14:53:24] [Server thread/INFO]: Unloading world "endermanbugzjfc"
[14:53:24] [Server thread/INFO]: [MultiWorld] World unloaded.
> mw load lobby-1
[14:53:27] [Server thread/INFO]: Preparing world "endermanbugzjfc"
[14:53:27] [Server thread/CRITICAL]: poggit\libasynql\base\QueueShutdownException: "You cannot schedule a query on an invalidated queue." (EXCEPTION) in "/home/container/virions/libasynql.phar/src/poggit/libasynql/base/QuerySendQueue" at line 40
Sample code
Level unload event:
public function onPMMPLevelUnloadEvent(\pocketmine\event\level\LevelUnloadEvent $e) : void {
$w = $e->getLevel();
if (substr($w->getFolderName(), 0, 5) !== 'lobby') return;
if ($this->lobbydb instanceof DataConnector) $this->lobbydb->close();
}
Level load event:
public function onPMMPLevelLoadEvent(\pocketmine\event\level\LevelLoadEvent $e) : void {
$w = $e->getLevel();
if (substr($w->getFolderName(), 0, 5) !== 'lobby') return;
$w->stopTime();
$this->lobbydb = libasynql::create($this->main, self::CONNECTION, self::SQL_FILE);
$this->lobbydb->executeGeneric(self::SQL_SCRIPTS['init']['parkour']);
$this->lobbydb->waitAll();
}
Expected behavior
I have a sqlite for the lobby level. So basically I want to make it when I load the level the database will be connected also when the level unloads, it closes. However, it only worked at the first load. Although I added the code above to close the connection, the second time it loads, it just gave me the error above.
Describe the bug
A clear and concise description of what the bug is.
Sample code
Level unload event:
Level load event:
Expected behavior I have a sqlite for the lobby level. So basically I want to make it when I load the level the database will be connected also when the level unloads, it closes. However, it only worked at the first load. Although I added the code above to close the connection, the second time it loads, it just gave me the error above.
Environment OS: Linux PocketMine version: 3.15.0