|
rs-cache
I've made a simple-to-use basic RuneScape cache utility. It has some very basic reading capabilities and supports item/npc definition loading.
The crate is currently (as of writing this thread) at version 0.6.4. The crate is passively maintained, meaning more features will be added in the
future once I require them for my own server project.
Links:
You can find rs-cache on crates.io or on github.
To get started try looking at the documentation or the README.
The crate contains integration tests and examples to make using rs-cache as easy as possible, you can also find more examples in the documentation.
The following features are currently provided:
- Reading from the cache.
- Huffman buffer access.
- Checksum with simple-to-use validation.
- Compression and decompression:
- Gzip
- Bzip2
- LZMA
- OSRS Loaders
- ItemLoader
- NpcLoader
- ObjectLoader
- RS3 Loaders
- ItemLoader
At this time there are no other crates that offer OSRS or RS3 cache utilities so I figured I would fill the void. This is my first crate and my understanding of RSPS's could be better.
I wanted to share this crate anyway to make it easier for other people to start their own servers using rust and as a personal learning experience.
More loaders are planned in future releases as well as support for writing to the cache (in both protocols).
If you have any feedback that would improve any aspect of my crate, please let me know! You can do this by creating an issue.
I hope this crate is of some use to anyone. Thank you for reading!
Last edited by excl150; 09-02-2021 at 12:01 AM. Reason: Updated post to reflect crate changes.
Nice work! If I can give some recommendations after writing a cache library myself:
1. Don't push your full cache to git. You can extract groups from the cache and push those for integration tests.
2. Split domain codecs and file codecs. So put your "definitions" in a different crate. This makes it so you can re-use the core part for multiple different games.
3. Use Jagex naming. See https://github.com/guthix/Jagex-Store-5 for more information or check the NXT/TFU artifacts.
I'm not sure if my core is reusable for other games because I'm reading the entire cache into memory, this way I can return slices.
The problem is RS3's cache is too large so I might need something like a BufReader around a file handle for reading.
At the moment I'm only trying to support OSRS but I might look into making it generic enough to support more different games.
About splitting domain codecs and file codecs: do you mean as a sub-crate of rs-cache or as a stand-alone crate?
These recommendations are really helpful, thank you!
The repository you linked looks amazing with how detailed it is! I'm going to give it a look and apply some changes to my crate.
See, the repository I linked as an example. I have Jagex-Store-5 as a general purpose library for reading/writing data. It can be used for JS5 client/servers or for game specific implementations. I currently only support 1 game (OSRS) which is in a different repository: https://github.com/guthix/OldScape-Cache. It uses Jagex-Store-5 to read/write the data. Reading all the data into memory can be good for stuff like file servers but other than that it's probably not that useful. I created an abstraction for just reading raw data and reading files/groups/archives. You can then also support multiple back-ends like from memory, from disk or from a remote server.
Does this also grab anims for items from cache?
No, I have not yet looked into getting animation ids for items. I'm using the RuneLite client as reference and I believe they refer to them asSequenceDefinition
s.
I'm working on adding all of the definitions but lately I got a bit distracted with other stuff. I will get to sequences in the future though, I just don't know when.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |