MCPcopy Create free account
hub / github.com/MaxBittker/rs-sdk / load

Method load

server/engine/src/engine/script/ScriptProvider.ts:35–39  ·  view source on GitHub ↗

* Loads all scripts from `dir`. * * @param dir The directory that holds the script.{dat,idx} files. * @returns The number of scripts loaded.

(dir: string)

Source from the content-addressed store, hash-verified

33 * @returns The number of scripts loaded.
34 */
35 static load(dir: string): number {
36 const dat = Packet.load(`${dir}/server/script.dat`);
37 const idx = Packet.load(`${dir}/server/script.idx`);
38 return this.parse(dat, idx);
39 }
40
41 static parse(dat: Packet, idx: Packet): number {
42 if (!dat.data.length || !idx.data.length) {

Callers

nothing calls this directly

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected