Improved the GE database access to use a basic reference counter for the connection that automatically closes the connection when no one is using it anymore

Grand Exchange now uses the GE sqlite database's price index table to track price changes
Removed the old price index (confusingly called GrandExchangeDatabase.java)
Grand Exchange prices are now dynamic and influenced by trades (weighted stepping average price)
Fixed GE interfaces not loading on login
This commit is contained in:
Ceikry
2022-05-20 11:23:30 +00:00
committed by Ryan
parent 01a4292123
commit 334bc77d06
20 changed files with 422 additions and 475 deletions
@@ -570,7 +570,7 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
val offerAmounts = HashMap<Int,Int>()
val offerPrice = HashMap<Int,Int>()
val offers = GrandExchange.getBotOffers().filter { getItemName(it.itemID).contains(searchTerm, true) }
val offers = GrandExchange.getBotOffers().filter { getItemName(it.itemID).contains(searchTerm, true) || getItemName(it.itemID).equals(searchTerm, true) }
for(offer in offers)
{
@@ -682,7 +682,7 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
}
fun showOffers(player: Player, searchTerm: String){
val offers = GrandExchange.getValidOffers().filter { getItemName(it.itemID).contains(searchTerm, true) }
val offers = GrandExchange.getValidOffers().filter { getItemName(it.itemID).contains(searchTerm, true) || getItemName(it.itemID).equals(searchTerm, true) }
val buyingAmount = HashMap<Int, Int>()
val buyingHighest = HashMap<Int, Int>()
val sellingAmount = HashMap<Int,Int>()
@@ -114,6 +114,7 @@ object ServerConfigParser {
ServerConstants.CELEDT_DATA_PATH = data.getPath("paths.cele_drop_table_path")
ServerConstants.SERVER_GE_NAME = data.getString("world.name_ge") ?: ServerConstants.SERVER_NAME
ServerConstants.RULES_AND_INFO_ENABLED = data.getBoolean("world.show_rules", true)
ServerConstants.BOTS_INFLUENCE_PRICE_INDEX = data.getBoolean("world.bots_influence_ge_price", true)
}