Skip to content

Commit 2ef9193

Browse files
committed
.
1 parent 63a37be commit 2ef9193

5 files changed

Lines changed: 322 additions & 85 deletions

File tree

.idea/workspace.xml

Lines changed: 63 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,25 @@ tasks {
8181
mainClass.set("dev.openrune.MainKt")
8282
classpath = sourceSets["main"].runtimeClasspath
8383
args = listOf(cacheID.toString(),gameType, environment)
84-
jvmArgs("-Xmx4G","-Dopenrune.perf.logs=true")
84+
jvmArgs("-Xmx8G")
8585
}
8686
}
8787

88-
registerBootTask("bootRunescape", -1,"RUNESCAPE3", "LIVE")
89-
registerBootTask("bootOldschool", 2518,"OLDSCHOOL", "LIVE")
90-
registerBootTask("bootSailing", -1,"OLDSCHOOL", "BETA")
88+
fun registerBootTaskDev(name: String, cacheID : Int,gameType: String, environment: String) {
89+
register<JavaExec>(name) {
90+
group = "application"
91+
description = "Boots the RuneScape cache with $gameType ($environment)"
92+
mainClass.set("dev.openrune.MainKt")
93+
classpath = sourceSets["main"].runtimeClasspath
94+
args = listOf(cacheID.toString(),gameType, environment)
95+
jvmArgs("-Xmx8G","-Dopenrune.perf.logs=true","-Dopenrune.table.logs=true")
96+
}
97+
}
98+
99+
registerBootTask("bootRunescape", -1, "RUNESCAPE3", "LIVE")
100+
registerBootTask("bootOldschool", 2518, "OLDSCHOOL", "LIVE")
101+
registerBootTaskDev("bootOldschoolDev", 2518, "OLDSCHOOL", "DEV")
102+
registerBootTask("bootSailing", -1, "OLDSCHOOL", "BETA")
91103

92104
register<JavaExec>("runDownloadAllCaches") {
93105
group = "application"

src/main/kotlin/dev/openrune/cache/diff/ConfigDiffType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ sealed class ConfigDiffType<T>(
255255

256256
data object OBJECTS : ConfigDiffType<ObjectType>(
257257
fileName = "objects",
258-
navGamevalType = GameValGroupTypes.OBJTYPES,
258+
navGamevalType = GameValGroupTypes.LOCTYPES,
259259
setup = {
260260
inTable("name" to ObjectType::name)
261261
searchBy(ObjectType::name)

src/main/kotlin/dev/openrune/server/endpoints/diff/DiffRouteCaches.kt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ internal const val MAX_CONFIG_DELTA_CACHE_ENTRIES = 500
3939
internal const val MAX_AVAILABLE_REVISIONS_CACHE_ENTRIES = 50
4040
internal const val MAX_REVISIONS_WITH_DATA_CACHE_ENTRIES = 50
4141
internal const val MAX_MANIFEST_HAS_CHANGES_CACHE_ENTRIES = 2000
42+
internal const val MAX_CONFIG_TABLE_SEARCH_CACHE_ENTRIES = 2000
43+
internal const val MAX_CONFIG_ROWS_CACHE_ENTRIES = 200
4244

4345
internal const val AVAILABLE_REVISIONS_CACHE_TTL_MS = 60_000L
46+
internal const val CONFIG_TABLE_SEARCH_CACHE_TTL_MS = 60 * 60 * 1000L
4447

4548
internal data class CachedConfigContent(val hash: String, val lines: List<Map<String, Any?>>)
4649

@@ -96,6 +99,27 @@ internal data class SpriteEtagCacheKey(
9699
val id: Int,
97100
)
98101

102+
internal data class ConfigTableSearchCacheKey(
103+
val game: String,
104+
val environment: String,
105+
val type: String,
106+
val base: Int,
107+
val rev: Int,
108+
val mode: String,
109+
val q: String,
110+
)
111+
112+
internal data class CachedConfigTableSearch(
113+
val expiresAtMs: Long,
114+
val matchingIds: List<Int>,
115+
)
116+
117+
/** Pre-built allRows list + id→row lookup, keyed by game/env/type/base/rev. */
118+
internal data class CachedConfigRows(
119+
val allRows: List<Map<String, Any?>>,
120+
val rowById: Map<Int, Map<String, Any?>>,
121+
)
122+
99123
internal data class ConfigBlockDto(
100124
val id: Int,
101125
val sectionId: String,
@@ -124,6 +148,11 @@ internal data class SpriteDelta(
124148
/** All diff-route bounded in-memory caches + single-flight locks (one place to tune sizes). */
125149
internal object DiffRouteCaches {
126150
val configTable = LruMutexCache<String, CachedConfigTable>(MAX_CONFIG_TABLE_CACHE_ENTRIES, 128)
151+
val configTableSearch = LruMutexCache<ConfigTableSearchCacheKey, CachedConfigTableSearch>(
152+
MAX_CONFIG_TABLE_SEARCH_CACHE_ENTRIES,
153+
512,
154+
)
155+
val configRows = LruMutexCache<GameEnvTypeBaseRevKey, CachedConfigRows>(MAX_CONFIG_ROWS_CACHE_ENTRIES, 64)
127156
val configContent = LruMutexCache<String, CachedConfigContent>(MAX_CONFIG_CONTENT_CACHE_ENTRIES, 128)
128157
val configContentComputeMutexes = ConcurrentHashMap<String, Mutex>()
129158

0 commit comments

Comments
 (0)