From 58e424fcfa817554d4b8c880eb66f29fe001b44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Jakubowski?= Date: Wed, 7 Feb 2024 17:41:27 +0100 Subject: [PATCH 1/5] Add scorn handler --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.py b/main.py index 9bf9961..6598457 100644 --- a/main.py +++ b/main.py @@ -450,6 +450,21 @@ def get_save_paths( continue save_meta.append((container["name"], file["path"])) + elif handler_name == "scorn": + # "1 container, 1 file" (1c1f). Each container contains only one file which name will be the name of the container. + # All filenames end with an extension, but without a dot as a separator, so it must be added manually + file_suffix = handler_args.get("suffix") + for container in containers: + fname = container["name"] + if fname.endswith('sav'): + fname = fname.removesuffix('sav') + '.sav' + elif fname.endswith('info'): + fname = fname.removesuffix('info') + '.info' + elif fname.endswith('dat'): + fname = fname.removesuffix('dat') + '.dat' + fpath = container["files"][0]["path"] + save_meta.append((fname, fpath)) + else: raise Exception('Unsupported XGP app "%s"' % store_pkg_name) From abda84f7de55a8bdb646909ed7de2c1a2f2a921a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Jakubowski?= Date: Wed, 7 Feb 2024 17:42:55 +0100 Subject: [PATCH 2/5] Add Scorn to games.json --- games.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/games.json b/games.json index 3164ca5..1befe0c 100644 --- a/games.json +++ b/games.json @@ -207,6 +207,12 @@ "name": "Railway Empire 2", "package": "KalypsoMediaGroup.RailwayEmpire2Win_e60j8nnj33ga6", "handler": "railway-empire-2" + }, + // Scorn + { + "name": "Scorn", + "package": "KeplerInteractive.1439274AB3A46_ymj30pw7xe604", + "handler": "scorn" } ] } From d1e3c3359cbde5b52c7e383372206d284a426532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Jakubowski?= Date: Wed, 7 Feb 2024 17:43:28 +0100 Subject: [PATCH 3/5] Add Scorn to README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c1bdada..ba7999c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Legend: ✅ Confirmed working, ❔ Unconfirmed, - Not available in the store | Railway Empire 2 | ❔ | ❔ | | Remnant 2 | ✅ | ❔ | | Remnant: From the Ashes | ❔ | ❔ | +| Scorn | ✅ | - | | Starfield | ✅ | - | | State of Decay 2 | ❔ | ❔ | | Totally Accurate Battle Simulator | ✅ | - | @@ -77,4 +78,4 @@ Run `main.py` with Python 3.10+. The script produces ZIP files for each of the s ## Thanks Thanks to [@snoozbuster](https://github.com/snoozbuster) for figuring out the container format at https://github.com/goatfungus/NMSSaveEditor/issues/306. -Also thanks to everyone that has [contributed](https://github.com/Z1ni/XGP-save-extractor/graphs/contributors) by adding support for new games. \ No newline at end of file +Also thanks to everyone that has [contributed](https://github.com/Z1ni/XGP-save-extractor/graphs/contributors) by adding support for new games. From b0a04d0dd23e477cee1af7d854260bc3349166b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Jakubowski?= Date: Wed, 7 Feb 2024 18:16:51 +0100 Subject: [PATCH 4/5] Cleaner Scorn code --- main.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/main.py b/main.py index 6598457..62408f8 100644 --- a/main.py +++ b/main.py @@ -263,11 +263,20 @@ def get_save_paths( if handler_name == "1c1f": # "1 container, 1 file" (1c1f). Each container contains only one file which name will be the name of the container. file_suffix = handler_args.get("suffix") + is_scorn = handler_args.get("is_scorn") for container in containers: fname = container["name"] if file_suffix is not None: # Add a suffix to the file name if configured fname += file_suffix + if is_scorn: + # Scorn has extensions at the end, but without the dot separator, so re-add them with the dot + if fname.endswith('sav'): + fname = fname.removesuffix('sav') + '.sav' + elif fname.endswith('info'): + fname = fname.removesuffix('info') + '.info' + elif fname.endswith('dat'): + fname = fname.removesuffix('dat') + '.dat' fpath = container["files"][0]["path"] save_meta.append((fname, fpath)) @@ -450,21 +459,6 @@ def get_save_paths( continue save_meta.append((container["name"], file["path"])) - elif handler_name == "scorn": - # "1 container, 1 file" (1c1f). Each container contains only one file which name will be the name of the container. - # All filenames end with an extension, but without a dot as a separator, so it must be added manually - file_suffix = handler_args.get("suffix") - for container in containers: - fname = container["name"] - if fname.endswith('sav'): - fname = fname.removesuffix('sav') + '.sav' - elif fname.endswith('info'): - fname = fname.removesuffix('info') + '.info' - elif fname.endswith('dat'): - fname = fname.removesuffix('dat') + '.dat' - fpath = container["files"][0]["path"] - save_meta.append((fname, fpath)) - else: raise Exception('Unsupported XGP app "%s"' % store_pkg_name) From 591005b437a2ab123282be4f48f71446219a8139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Jakubowski?= Date: Wed, 7 Feb 2024 18:17:52 +0100 Subject: [PATCH 5/5] Update games.json for new Scorn code --- games.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/games.json b/games.json index 1befe0c..3a4f728 100644 --- a/games.json +++ b/games.json @@ -58,6 +58,14 @@ "suffix": ".sav" } }, + { + "name": "Scorn", + "package": "KeplerInteractive.1439274AB3A46_ymj30pw7xe604", + "handler": "1c1f", + "handler_args": { + "is_scorn": true + } + }, { "name": "Yakuza 0", "package": "SEGAofAmericaInc.Yakuza0PC_s751p9cej88mt", @@ -207,12 +215,6 @@ "name": "Railway Empire 2", "package": "KalypsoMediaGroup.RailwayEmpire2Win_e60j8nnj33ga6", "handler": "railway-empire-2" - }, - // Scorn - { - "name": "Scorn", - "package": "KeplerInteractive.1439274AB3A46_ymj30pw7xe604", - "handler": "scorn" } ] }