Graham
b320348ec7
Fix bug where music data file was closed on flush
...
Signed-off-by: Graham <gpe@openrs2.org>
2 years ago
Graham
bcc2fdf48e
Add @JvmStatic and @JvmOverloads to more cache methods
...
Signed-off-by: Graham <gpe@openrs2.org>
2 years ago
Graham
ba75306169
Annotate cache methods with default parameters with @JvmOverloads
...
This allows them to be used from Java.
Signed-off-by: Graham <gpe@openrs2.org>
2 years ago
Graham
ac9dc83031
Rename legacyData to legacy and make it public
...
This will be useful for determining if a cache is 3xx or JS5 when
importing it in the archiving service.
Signed-off-by: Graham <gpe@openrs2.org>
2 years ago
Graham
02f35fd014
Fix legacy DiskStore support
...
The archive IDs are offset by one in a legacy main_file_cache.dat cache.
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
407aff8dd8
Add support for .dat (instead of .dat2) file to DiskStore
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
cbb2a90388
Disable .dat2/.idx link if the cache is too big for a DiskStore
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
bc907d5309
Add support for reading existing .dat2m caches
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
b067020cad
Ignore trailing blocks with a non-zero next block pointer
...
While the client doesn't appear to be capable of producing a trailing
block with a non-zero next block pointer (though I may have misread the
code), there are caches out there in the wild with trailing non-zero
next block pointers.
When it is reading a group, the client ignores these.
Therefore, for compatibility with the client and existing caches, this
commit removes the StoreCorruptException thrown in this case.
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
d5d76f9301
Add DiskStoreZipWriter
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
f143eef142
Move Kotlin files from src/{main,test}/java to src/{main,test}/kotlin
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
ce5b76ef0f
Rename dev.openrs2 package to org.openrs2
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago
Graham
0afc7a563d
Add Store.open() method
...
It automatically determines whether to use a DiskStore or FlatFileStore.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
8bed0fc875
Rename getOrCreateIndex to createOrGetIndex
...
I think this flows slightly better.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
7ab567b7b9
Optimise DiskStore::list
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
1455379f20
Document thread safety of DiskStore and FlatFileStore
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
232ba32bbd
Enable explicit API mode
...
This already caught some cases of public members that should have been
private and one case where the inferred type was too specific.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
9f1b2dbc29
Add BufferedFileChannel
...
Similar to the equivalent class in the client.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
9de0b26da4
Throw exception in remove() if group ID is negative
...
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago
Graham
cea016d4ef
Add low-level cache interface
...
Unit tests to follow - I've been working on these classes for a few days
now, so I wanted to make sure they get backed up in the repository.
Signed-off-by: Graham <gpe@openrs2.dev>
4 years ago