Close the remaining ways an accepted import fails to restore

Imports no longer accept the cutscene controller, which needs waypoints
to restore. Logistic filters and the basic item stack fields now have the
types and limits Factorio enforces, and the inventory summary skips
malformed items and counts repeated exported items once instead of
expanding them.

Lua's JSON loses precision past 2^50, so a generation there could no
longer be counted up and uploads were discarded. Imports now start over
from generation 1 when the stored or imported generation is at that limit.
Instances holding a copy from another epoch take the stored generation
instead of keeping their own higher one when there is no data to download.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-19 19:50:37 +00:00
1 parent 9ecd497f1e
commit 39df22be65
6 files changed
+167 -20

No files matched your search

+4 -1
View File
@@ -295,7 +295,10 @@ export default async function(context: ControllerPluginContext) {
// A new epoch makes every instance drop its copy, including ones with an unconfirmed upload
let stored = storedVersion(playerName);
playerData.name = playerName;
playerData.generation = Math.max(playerData.generation, stored.generation + 1);
// Start over from generations at or past the limit, instances that know epochs download the import anyway
let imported = playerData.generation < msg.generationLimit ? playerData.generation : 0;
let next = stored.generation < msg.generationLimit ? stored.generation + 1 : 1;
playerData.generation = Math.max(imported, next);
playerData.epoch = stored.epoch + 1;
playerDatastore.set(playerName, playerData);
tombstones.delete(playerName);