Skip to content

Commit

Permalink
Add manual server side fix for #540
Browse files Browse the repository at this point in the history
  • Loading branch information
GregHib committed May 23, 2024
1 parent 6ed2c76 commit e2f1e16
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package world.gregs.voidps.cache.config.decoder

import world.gregs.voidps.buffer.read.Reader
import world.gregs.voidps.cache.Cache
import world.gregs.voidps.cache.Config.STRUCTS
import world.gregs.voidps.cache.config.ConfigDecoder
import world.gregs.voidps.cache.config.data.StructDefinition
Expand All @@ -12,6 +13,18 @@ class StructDecoder(

override fun create(size: Int) = Array(size) { StructDefinition(it) }


override fun load(cache: Cache): Array<StructDefinition> {
val definitions = super.load(cache)
// Manually fix values see https://github.com/GregHib/void/issues/540
val extras = definitions[1330].extras as MutableMap<String, Any>
extras["1296"] = 3
extras["1297"] = 19
extras["1298"] = 2
extras["1299"] = 37
return definitions
}

override fun StructDefinition.read(opcode: Int, buffer: Reader) {
if (opcode == 249) {
readParameters(buffer, parameters)
Expand Down

0 comments on commit e2f1e16

Please sign in to comment.