How to use the oni-save-parser.writeSaveGame function in oni-save-parser

To help you get started, we’ve selected a few oni-save-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RoboPhred / oni-duplicity / src / services / save-serializer / save-serializer.worker.ts View on Github external
function writeSave(command: WriteSaveCommand) {
  const injector = progressReporter(onProgress);

  try {
    const data = writeSaveGame(command.saveGame, injector);
    postMessage(writeSaveSuccess(data));
  } catch (e) {
    postMessage(writeSaveError(e));
  }
}
github RoboPhred / oni-duplicity / src / services / oni-save / save-serializer.worker.ts View on Github external
function writeSave(command: WriteSaveCommand) {
  const injector = progressReporter(onProgress);

  try {
    const data = writeSaveGame(command.saveGame, injector);
    postMessage(writeSaveSuccess(data));
  } catch (e) {
    postMessage(writeSaveError(e));
  }
}
github RoboPhred / oni-duplicity / src / services / save-editor / save-loader.worker.ts View on Github external
function doSave(data: SaveCommandData) {
  try {
    const buffer = writeSaveGame(data.save);
    const msg: DataSavedEvent = {
      type: "saved",
      buffer
    };
    postMessage(msg);
  } catch (e) {
    const msg: DataSavedEvent = {
      type: "saved",
      error: e,
      buffer: null
    };
    postMessage(msg);
  }
}