diff --git a/Server/build.gradle b/Server/build.gradle index 2ea6a555e..c3e2ca901 100644 --- a/Server/build.gradle +++ b/Server/build.gradle @@ -26,7 +26,7 @@ dependencies { implementation 'com.google.guava:guava:29.0-jre' implementation 'mysql:mysql-connector-java:8.0.21' implementation 'io.github.classgraph:classgraph:4.8.98' - implementation 'org.jetbrains.kotlin:kotlin-reflect' + implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.20' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2' implementation files("libs/ConstLib-1.2.jar") implementation files("libs/PrimitiveExtensions-1.0.jar") diff --git a/Server/src/main/kotlin/rs09/game/ge/GrandExchange.kt b/Server/src/main/kotlin/rs09/game/ge/GrandExchange.kt index 6933fc243..b5e3a3ae5 100644 --- a/Server/src/main/kotlin/rs09/game/ge/GrandExchange.kt +++ b/Server/src/main/kotlin/rs09/game/ge/GrandExchange.kt @@ -32,6 +32,11 @@ object GrandExchange : CallBack { while(true) { SystemLogger.logGE("Updating offers...") OfferManager.update() + if(OfferManager.dumpDatabase){ + SystemLogger.logGE("Saving GE...") + OfferManager.save() + OfferManager.dumpDatabase = false + } Thread.sleep(60_000) //sleep for 60 seconds } }.start() diff --git a/Server/src/main/kotlin/rs09/game/ge/OfferManager.kt b/Server/src/main/kotlin/rs09/game/ge/OfferManager.kt index 8c76f1c79..8962ccb82 100644 --- a/Server/src/main/kotlin/rs09/game/ge/OfferManager.kt +++ b/Server/src/main/kotlin/rs09/game/ge/OfferManager.kt @@ -382,7 +382,6 @@ object OfferManager { if (!offer.isActive) { return } - GE_OFFER_LOCK.lock() for (o in OFFERS_BY_ITEMID[offer.itemID]!!) { if (o.sell != offer.sell && o.isActive) { exchange(offer, o) @@ -392,7 +391,6 @@ object OfferManager { } } buyFromBots(offer) - GE_OFFER_LOCK.unlock() } private fun getBuylimitAmount(offer: GrandExchangeOffer): Int { diff --git a/Server/src/main/kotlin/rs09/plugin/PluginManager.kt b/Server/src/main/kotlin/rs09/plugin/PluginManager.kt index f579146e7..879cd45b7 100644 --- a/Server/src/main/kotlin/rs09/plugin/PluginManager.kt +++ b/Server/src/main/kotlin/rs09/plugin/PluginManager.kt @@ -18,7 +18,6 @@ import rs09.game.system.SystemLogger import rs09.game.system.command.Command import java.util.* import java.util.function.Consumer -import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType /** * Represents a class used to handle the loading of all plugins. @@ -62,7 +61,7 @@ object PluginManager { var result = ClassGraph().enableClassInfo().enableAnnotationInfo().scan() result.getClassesWithAnnotation("core.plugin.Initializable").forEach(Consumer { p: ClassInfo -> try { - definePlugin(p.loadClass().newInstance() as Plugin) + definePlugin(p.loadClass().newInstance() as Plugin) } catch (e: InstantiationException) { e.printStackTrace() } catch (e: IllegalAccessException) {