poggit / libasynql

Asynchronous MySQL access library for PocketMine plugins.
https://poggit.github.io/libasynql
Apache License 2.0
134 stars 44 forks source link

PM4: CommonThreadPartsTrait::setClassLoaders() change #63

Closed Muqsit closed 3 years ago

Muqsit commented 3 years ago

Recently, PM4 removed CommonThreadPartsTrait::setClassLoader(?ClassLoader) and added CommonThreadPartsTrait::setClassLoaders(?ClassLoader[]) which appends an array of class loaders to existing class loaders of a given thread (https://github.com/pmmp/PocketMine-MP/commit/5fbc7681b04fe702fcbd43940b9d325e5c216707).

This PR registers two class loaders onto SqlSlaveThreadServer::getInstance()->getLoader() (to load DEVirion plugin's VirionClassLoader class) and DEVirion's class loader (to load virions classes) when running in a dev environment (!libasynql::isPackaged()).

This PR removes CommonThreadPartsTrait::registerClassLoader() method call from SqlSlaveThread::onRun() as CommonThreadPartsTrait calls this method by itself in it's final CommonThreadPartsTrait::run() method before it calls CommonThreadPartsTrait::onRun() (or in this case, SqlSlaveThread::onRun()).

Related Issues: