Make SavedData more resistant to crashes while writing
Bradley19 opened this issue ยท 6 comments
Expected: When Storing building Drive is formatted with unique identifiers, when Formatted drive is used, places the same structure if fits within current pylons/dimensions in both dimensions
Actual: When Storing Building Drive is unformatted, and has no unique identifiers, and no unique meta data, when a newly crafted drive is used at new coordinates, it will place the same structure, or a random one if there are Mutiple, if a structure does not fit the pylons it will place what will fit leaving the rest in the void, and if a smaller drive is used, has a chance to overwrite parts of currently stored structures, creating a new barrier by overwriting Mutiple blocks, habitually the blocks are deleted, and if the larger structure is placed, the smaller barrier that was created, now exists outside of the drives, causing there to be areas of inaccessibility, when the area should otherwise be accessible.
Have the spatial drives formatted at a separate device (Spatial Computer), that checks chunks in the spatial dimension for a reasonable amount of open space that the drive can hold then use the coordinates (length, width, height and location,) of said space, as the unique identifiers, thus allowing for Mutiple drives to be used at the same time, thus preventing overwriting, and will allow for other devices to use the coordinates as a target, aka spatial io port, and pylons.
Environment: Sever multiplayer, Fabric 1.19.2-1.12.5, AE 11.7.1 Fabric.
Works properly in single player
I didn't understand a thing.
Did you duplicate formatted spatial storage cells in creative?
it sounds like he used a freshly crafted cell in a new pylon setup and instead of forming a new dimension he gets a random stored dimension in return but only in multiplayer
Ah I see. This could have been caused by a server crash causing the world saved data to not be stored properly.
The sever does tend to crash when larger structures crash is there a way to prevent this besides limiting structure size?
What happened is likely that something went wrong while AE2 was saving the list of all the spatial storage zones, and so the file got reset. In your case, there is sadly nothing that can be done except restoring the ae2_spatial_storage
file to an earlier version from a backup.
On our side we can make saving more robust by writing to a separate file first and then renaming it: https://github.com/refinedmods/refinedstorage/blob/7b4f733fac4d6bfbdf5d0e17390ef464794c9918/src/main/java/com/refinedmods/refinedstorage/apiimpl/util/RSSavedData.java#L23.