* Loads all scripts from `dir`. * * @param dir The directory that holds the script.{dat,idx} files. * @returns The number of scripts loaded.
(dir: string)
| 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) { |