mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Reserve the deleted marker for tombstones
Imports and uploads could carry deleted: false, which the loader took for a tombstone on the next restart. The schemas now reject the property, and the loader only treats deleted: true as a tombstone and strips the key from entries already saved with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
feb3253bec
commit
9ecd497f1e
4 files changed
+40
-12
No files matched your search
@@ -31,10 +31,13 @@ export type IpcPlayerData = {
|
||||
components?: Record<string, boolean> | unknown[],
|
||||
}
|
||||
|
||||
// Marks tombstones in player_sync.json
|
||||
const jsonReserved = { deleted: Type.Optional(Type.Never()) };
|
||||
const jsonPlayerData = Type.Object({
|
||||
generation: Type.Integer({ minimum: 0 }),
|
||||
epoch: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
name: Type.String(),
|
||||
...jsonReserved,
|
||||
});
|
||||
|
||||
// The parts of an import that module/serialize.lua relies on, item stacks are checked by the Lua deserializer
|
||||
@@ -150,6 +153,7 @@ const jsonImportedPlayerData = Type.Object({
|
||||
crafting_queue: Type.Optional(jsonCraftingQueue),
|
||||
recipe_notifications: Type.Optional(Type.String()),
|
||||
components: Type.Optional(jsonTable),
|
||||
...jsonReserved,
|
||||
});
|
||||
|
||||
export class AcquireResponse {
|
||||
|
||||
Reference in new issue
Block a user