Constructor
# new RSCache(cacheRootDir, progressFunc)
Parameters:
Name | Type | Description |
---|---|---|
cacheRootDir |
string
|
|
progressFunc |
function
|
Progress function callback. Passes 1 parameter which is the amount of progress from the last step (not total progress) |
Methods
# async getAllDefs(indexId, archiveId, options)
Helper method to map getAllFiles results to definitions
Parameters:
Name | Type | Description |
---|---|---|
indexId |
Number
|
IndexType
|
Can be a number or IndexType |
archiveId |
Number
|
Can be a number but also can be a ConfigType if IndexType is CONFIG |
options |
options
|
Definition
# async getAllFiles(indexId, archiveId, options)
Gets all of the files from an archive and loads their definitions if possible.
Parameters:
Name | Type | Description |
---|---|---|
indexId |
Number
|
IndexType
|
Can be a number or IndexType |
archiveId |
Number
|
Can be a number but also can be a ConfigType if IndexType is CONFIG |
options |
options
|
Array<File>
# async getDef(indexId, archiveId, fileId, options)
Helper method to map getFile results to its definition
Parameters:
Name | Type | Default | Description |
---|---|---|---|
indexId |
Number
|
IndexType
|
Can be a number or IndexType | |
archiveId |
Number
|
Can be a number but also can be a ConfigType if IndexType is CONFIG | |
fileId |
Number
|
0 | Id of the definition to get from the archive |
options |
options
|
Definition
# async getFile(indexId, archiveId, fileId, options)
Gets a single file from an archive and load its definition if possible.
Parameters:
# getIndex(index)
Get a cache Index file.
Parameters:
Name | Type | Description |
---|---|---|
index |
Number
|
IndexType
|
# async getItem(id, options)
Helper method to get an Item definition
Parameters:
Name | Type | Description |
---|---|---|
id |
Number
|
Item Id |
options |
options
|
ItemDefinition
# async getNPC(id, options)
Helper method to get a NPC definition
Parameters:
Name | Type | Description |
---|---|---|
id |
Number
|
NPC Id |
options |
options
|