GithubHelp home page GithubHelp logo

guthix / jagex-store-5 Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 12.0 1.01 MB

A library for modifying Jagex Store 5 game files

License: Apache License 2.0

Kotlin 100.00%
filesystem game jagex js5 runetek

jagex-store-5's People

Contributors

bartvhelvert avatar mahabal avatar nozemi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jagex-store-5's Issues

Writing new groups not working

Adding a brand-new group doesn't seem to actually write said group into the cache.
The code used to write:

        if (serverOnlyCache) {
            val basGroup = runCatching { configArchive.readGroup(BaseAnimationSetConfig.id) }
                .getOrElse { Js5Group(BaseAnimationSetConfig.id, 0, 1) }
            ConfigArchive.configs.basConfigs.toSortedMap().forEach { (id, value) ->
                basGroup.files[id] = Js5File(id, null, value.encode(serverOnlyCache))
            }
            configArchive.writeGroup(basGroup, appendVersion = true)
        }
        cache.writeArchive(configArchive)

BaseAnimationSetConfig.id = 15
Number of files being encoded = 1

Edit: After some investigating, I've found out the issue to be the fact that it adds in the middle of the groups. The map behind the groups must be sorted for some reason, so adding this:

            val settings = configArchive.groupSettings.toSortedMap()
            configArchive.groupSettings.clear()
            settings.forEach { (key, value) -> configArchive.groupSettings[key] = value }

Right before the cache.writeArchive(configArchive) solved the issue.

The same issue applies for individual files. They must be sorted manually by the user, or else it corrupts the cache and writes the ids completely weird.

Fix Container doc

The image shows the version being encrypted, this is actually not true

Implement unknown hash

It stores the CRC-32 of the uncompressed data (the other CRC hash stores the CRC-32 of the compressed data).

-Thanks to Graham

Can't find container 16 on last revision osrs

Hello,
I'm trying to use the library to decode the osrs cache for last revision.
I get this error:

15:36:25.212 [main] DEBUG io.guthix.cache.js5.container.disk.Js5DiskStore - Reading index file 255 container 14 15:36:25.213 [main] DEBUG io.guthix.cache.js5.container.disk.Js5DiskStore - Reading index file 255 container 15 15:36:25.213 [main] WARN io.guthix.cache.js5.container.disk.Js5DiskStore - Could not read index file 255 container 16 because the index does not exist Exception in thread "main" java.lang.IndexOutOfBoundsException at io.netty.buffer.EmptyByteBuf.readUnsignedByte(EmptyByteBuf.java:534) at io.guthix.cache.js5.container.Js5Container$Companion.decode(Js5Container.kt:111) at io.guthix.cache.js5.container.Js5Container$Companion.decode$default(Js5Container.kt:110) at io.guthix.cache.js5.container.heap.Js5HeapStore$Companion.open(Js5HeapStore.kt:61)

Has I understand the lib does not support last revision at the moment.
I am willing to contribute but I have only little comprehension of osrs cache format.

Do you have any clue or idea on how to fix that issue?
Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.