IndexDataBase

Group
player
Methods
3
Fields
None

Getting one

client:getIndexScripts()
client:getIndexConfig()
client:getIndex(…)

Methods

MethodReturnsDescription
isOverlayOutdated()booleanWhether any of Bento's script overlays in this index was kept back because the game's file changed and Bento could not re-apply its patch t…
getFileIds(number){number}?The ids of group groupId's files, ascending (empty for a group with no files), read from the client's own index of this archive; nil fo…
loadData(number, number){number}?File fileId of group groupId, as the game's cache holds it once unpacked: its bytes as signed numbers (-128 to 127; `bit32.band(b, 255)…

Returned by

MethodReturnsDescription
Client.getIndexIndexDataBase?Cache index id (archive id: 2 the config, 7 the models, 8 the sprites, 12 the scripts), or nil for one Bento does not serve. Served a…
Client.getIndexConfigIndexDataBaseThe config index (cache archive 2), whose groups are the cache's definitions (group 14 the varbits, listed with getFileIds(14)).
Client.getIndexScriptsIndexDataBaseThe clientscripts index (cache archive 12): whether Bento's script overlays still apply (isOverlayOutdated()).
Client.getIndexSpritesIndexDataBaseThe sprites cache index (archive 8), for getSprites.

Method details

isOverlayOutdated

isOverlayOutdated: (IndexDataBase) -> boolean

Whether any of Bento's script overlays in this index was kept back because the game's file changed and Bento could not re-apply its patch to it (it re-applies the patch where it can); once true it stays true. false for an index Bento overlays nothing in.

getFileIds

getFileIds: (IndexDataBase, number) -> {number}?

The ids of group groupId's files, ascending (empty for a group with no files), read from the client's own index of this archive; nil for a group the index does not list. A copy. On the game thread only; raises before the client has the archive's index and on a client whose table does not place its archive tables.

loadData

loadData: (IndexDataBase, number, number) -> {number}?

File fileId of group groupId, as the game's cache holds it once unpacked: its bytes as signed numbers (-128 to 127; bit32.band(b, 255) is the unsigned byte), a copy. nil for a group or file the index does not list, and for a file the client has not fetched yet: asking makes the client fetch it as it would for itself, so ask again on a later tick. Reading leaves the client's own copy of the file as it was. On the game thread only; raises before the client has the archive's index and on a client whose table has the cache file getter off.