Made the various signposts like cow and church sign authentic and persistent

This commit is contained in:
ceikry
2021-07-26 19:36:36 -05:00
parent 3d9a119071
commit 838edacba5
7 changed files with 100 additions and 11 deletions
@@ -0,0 +1,45 @@
package rs09
import org.json.simple.JSONObject
import rs09.ServerStore.getInt
object GlobalStats {
@JvmStatic
fun incrementDeathCount(){
getDailyDeathArchive()["players"] = getDailyDeathArchive().getInt("players") + 1
}
@JvmStatic
fun incrementDailyCowDeaths(){
getDailyDeathArchive()["lumbridge-cows"] = getDailyDeathArchive().getInt("lumbridge-cows") + 1
}
@JvmStatic
fun incrementGuardPickpockets(){
getGuardPickpocketArchive()["count"] = getGuardPickpocketArchive().getInt("count") + 1
}
@JvmStatic
fun getDailyGuardPickpockets(): Int {
return getGuardPickpocketArchive().getInt("count")
}
fun getDailyDeaths(): Int {
return getDailyDeathArchive().getInt("players")
}
@JvmStatic
fun getDailyCowDeaths(): Int {
return getDailyDeathArchive().getInt("lumbridge-cows")
}
private fun getDailyDeathArchive(): JSONObject {
return ServerStore.getArchive("daily-deaths-global")
}
private fun getGuardPickpocketArchive(): JSONObject {
return ServerStore.getArchive("daily-guard-pickpockets")
}
}