|
RuneHive-Game
|
Represents a file system of Caches and Archives.
More...
Public Member Functions | |
| Archive | getArchive (int id) |
Gets an Archive for the specified id, this method fails-fast if no archive can be found. | |
| ByteBuffer | getArchiveHashes () throws IOException |
Returns the cached archiveHashes if they exist, otherwise they are calculated and cached for future use. | |
| Cache | getCache (int id) |
Gets a Cache for the specified id, this method fails-fast if no cache can be found. | |
| ByteBuffer | getFile (int cacheId, int indexId) throws IOException |
Returns a ByteBuffer of file data for the specified index within the specified Cache. | |
Static Public Member Functions | |
| static FileSystem | create (String directory) throws IOException |
Constructs and initializes a FileSystem from the specified . | |
Static Public Attributes | |
| static final int | ANIMATION_INDEX = 2 |
| Represents the id of the animations cache. | |
| static final int | CONFIG_ARCHIVE = 2 |
| Represents the id of the configurations archive. | |
| static final int | CONFIG_INDEX = 0 |
| Represents the id of the configurations cache. | |
| static final int | INTERFACE_ARCHIVE = 3 |
| Represents the id of the interface archive. | |
| static final int | MANIFEST_ARCHIVE = 5 |
| Represents the id of the manifest archive. | |
| static final int | MAP_INDEX = 4 |
| Represents the id of the tool.mapviewer and landscape cache. | |
| static final int | MEDIA_ARCHIVE = 4 |
| Represents the id of the media and sprite archive. | |
| static final int | MIDI_INDEX = 3 |
| Represents the id of the sounds and music cache. | |
| static final int | MODEL_INDEX = 1 |
| Represents the id of the model cache. | |
| static final int | SOUND_ARCHIVE = 8 |
| Represents the id of the sound and music archive. | |
| static final int | TEXTURES_ARCHIVE = 6 |
| Represents the id of the textures archive. | |
| static final int | TITLE_ARCHIVE = 1 |
| Represents the id of the title screen archive. | |
| static final int | WORD_ARCHIVE = 7 |
| Represents the id of the word archive - user for storing profane or illegal words not allowed to be spoken in-game. | |
Private Member Functions | |
| FileSystem (Cache[] caches, Archive[] archives) | |
Constructs a new FileSystem with the specified Caches and Archives. | |
Private Attributes | |
| ByteBuffer | archiveHashes |
| The cached archive hashes. | |
| final Archive[] | archives |
All of the Archives within this FileSystem. | |
| final Cache[] | caches |
All of the Caches within this FileSystem. | |
Static Private Attributes | |
| static final String | DATA_PREFIX = "main_file_cache.dat" |
Represents the prefix of this FileSystems main cache files. | |
| static final String | INDEX_PREFIX = "main_file_cache.idx" |
Represents the prefix of this FileSystems index files. | |
| static final int | MAXIMUM_ARCHIVES = 9 |
| Represents the maximum amount of archives within this file system. | |
| static final int | MAXIMUM_INDICES = 256 |
| Represents the maximum amount of indices within this file system. | |
Represents a file system of Caches and Archives.
Definition at line 24 of file FileSystem.java.
Constructs a new FileSystem with the specified Caches and Archives.
| caches | All of the Caches within this FileSystem. |
| archives | All of the Archives within this FileSystem. |
Definition at line 98 of file FileSystem.java.
References archives, and caches.
Referenced by create().
|
static |
Constructs and initializes a FileSystem from the specified .
directory
| directory | The directory of the FileSystem. |
FileSystem instance. | IOException | If some I/O exception occurs. |
Definition at line 111 of file FileSystem.java.
References archives, caches, CONFIG_INDEX, DATA_PREFIX, com.runehive.fs.cache.archive.Archive.decode(), FileSystem(), INDEX_PREFIX, MAXIMUM_ARCHIVES, and MAXIMUM_INDICES.
Referenced by com.runehive.RuneHive.processSequentialStartupTasks().
| Archive com.runehive.fs.cache.FileSystem.getArchive | ( | int | id | ) |
Gets an Archive for the specified id, this method fails-fast if no archive can be found.
| id | The id of the Archive to fetch. |
Archive for the specified id. | NullPointerException | If the archive cannot be found. |
Definition at line 148 of file FileSystem.java.
References archives.
| ByteBuffer com.runehive.fs.cache.FileSystem.getArchiveHashes | ( | ) | throws IOException |
Returns the cached archiveHashes if they exist, otherwise they are calculated and cached for future use.
Archive. | IOException | If some I/O exception occurs. |
Definition at line 189 of file FileSystem.java.
References archiveHashes, CONFIG_INDEX, getFile(), and MAXIMUM_ARCHIVES.
| Cache com.runehive.fs.cache.FileSystem.getCache | ( | int | id | ) |
Gets a Cache for the specified id, this method fails-fast if no cache can be found.
| id | The id of the Cache to fetch. |
Cache for the specified id. | NullPointerException | If the cache cannot be found. |
Definition at line 161 of file FileSystem.java.
References caches.
Referenced by getFile().
| ByteBuffer com.runehive.fs.cache.FileSystem.getFile | ( | int | cacheId, |
| int | indexId ) throws IOException |
Returns a ByteBuffer of file data for the specified index within the specified Cache.
| cacheId | The id of the cache. |
| indexId | The id of the index within the cache. |
ByteBuffer of file data for the specified index. | IOException | If some I/O exception occurs. |
Definition at line 175 of file FileSystem.java.
References getCache().
Referenced by getArchiveHashes().
|
static |
Represents the id of the animations cache.
Definition at line 33 of file FileSystem.java.
|
private |
The cached archive hashes.
Definition at line 87 of file FileSystem.java.
Referenced by getArchiveHashes().
|
private |
All of the Archives within this FileSystem.
Definition at line 84 of file FileSystem.java.
Referenced by create(), FileSystem(), and getArchive().
|
private |
All of the Caches within this FileSystem.
Definition at line 81 of file FileSystem.java.
Referenced by create(), FileSystem(), and getCache().
|
static |
Represents the id of the configurations archive.
Definition at line 45 of file FileSystem.java.
Referenced by com.runehive.RuneHive.processSequentialStartupTasks(), com.runehive.fs.cache.decoder.AnimationDefinitionDecoder.run(), and com.runehive.fs.cache.decoder.ObjectDefinitionDecoder.run().
|
static |
Represents the id of the configurations cache.
Definition at line 27 of file FileSystem.java.
Referenced by create(), and getArchiveHashes().
|
staticprivate |
Represents the prefix of this FileSystems main cache files.
Definition at line 75 of file FileSystem.java.
Referenced by create().
|
staticprivate |
Represents the prefix of this FileSystems index files.
Definition at line 78 of file FileSystem.java.
Referenced by create().
|
static |
Represents the id of the interface archive.
Definition at line 48 of file FileSystem.java.
|
static |
Represents the id of the manifest archive.
Definition at line 54 of file FileSystem.java.
Referenced by com.runehive.fs.cache.decoder.MapDefinitionDecoder.run().
|
static |
Represents the id of the tool.mapviewer and landscape cache.
Definition at line 39 of file FileSystem.java.
Referenced by com.runehive.fs.cache.decoder.RegionDecoder.run().
|
staticprivate |
Represents the maximum amount of archives within this file system.
Definition at line 69 of file FileSystem.java.
Referenced by create(), and getArchiveHashes().
|
staticprivate |
Represents the maximum amount of indices within this file system.
Definition at line 72 of file FileSystem.java.
Referenced by create().
|
static |
Represents the id of the media and sprite archive.
Definition at line 51 of file FileSystem.java.
|
static |
Represents the id of the sounds and music cache.
Definition at line 36 of file FileSystem.java.
|
static |
Represents the id of the model cache.
Definition at line 30 of file FileSystem.java.
|
static |
Represents the id of the sound and music archive.
Definition at line 66 of file FileSystem.java.
|
static |
Represents the id of the textures archive.
Definition at line 57 of file FileSystem.java.
|
static |
Represents the id of the title screen archive.
Definition at line 42 of file FileSystem.java.
|
static |
Represents the id of the word archive - user for storing profane or illegal words not allowed to be spoken in-game.
Definition at line 63 of file FileSystem.java.