* Process savegame * @returns {saveTrackRecord}
()
| 1696 | * @returns {saveTrackRecord} |
| 1697 | */ |
| 1698 | async getInfo() { |
| 1699 | try { |
| 1700 | if ( !fs.existsSync(this.#filePath) ) { |
| 1701 | throw new Error(`file does not exist: ${this.#filePath}`) |
| 1702 | } |
| 1703 | |
| 1704 | const thisXML = this.#xmlParser.parse(fs.readFileSync(this.#filePath, 'utf-8'))?.inputbinding ?? null |
| 1705 | |
| 1706 | if ( thisXML === null ) { |
| 1707 | throw new Error(`Parsing file failed: ${this.#filePath}`) |
| 1708 | } |
| 1709 | |
| 1710 | return thisXML |
| 1711 | |
| 1712 | } catch (err) { |
| 1713 | this.#log.notice(err) |
| 1714 | } |
| 1715 | return null |
| 1716 | } |
| 1717 | } |
| 1718 | |
| 1719 | module.exports = { |
no test coverage detected