Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix the Save File being overriden in certain occassions, such as downgrading to versions between 0.5.2 and 0.3.0 #3727

Conversation

KoloInDaCrib
Copy link
Contributor

@KoloInDaCrib KoloInDaCrib commented Oct 18, 2024

Does this PR close any issues? If so, link them below.

3679

Briefly describe the issue(s) fixed.

Modifies the Save File so that it uses Enum Abstracts instead of Enum fields. Also adds a proper backup system, in case of something going horrible.

Include any relevant screenshots or videos.

2024-10-18.22-49-08.mp4

Note

Considering Enum fields are bugged, they are the only ones that get reset when changing from the current version to a version in the title. A fix to this would require a fix to haxe's Serializer classes, which is unlikely to happen (both flixel uses openfl to store things and openfl uses haxe's Serializer classes to store the data).

But also like who the hell would play on an older version after 0.3.0 like I get for previous versions but why this range lol

EliteMasterEric and others added 2 commits October 11, 2024 23:57
Note: The previous Enums DON'T get saved as Enums due to the Serializer Bug. Instead they get saved as Abstract Enums. The previous Enums were made deprecated as a form of backwards compatibility, however due to the Serializer Bug it is impossible to save current Enum Abstracts and previous Enums, and thus they are the only fields that get reset. To prevent this, a change to haxe's Serializer would have to be made.
@github-actions github-actions bot added large A large pull request with more than 100 changes haxe Issue/PR modifies game code labels Oct 18, 2024
@Hundrec
Copy link
Contributor

Hundrec commented Oct 18, 2024

Emergency save file hotfix yes please!

@EliteMasterEric
Copy link
Member

These particular changes do not resolve the problem as mentioned in #3679. Replacing enums with enum abstracts without proper workarounds will actually exacerbate the issue, and there is no case in which loadScoreBackups will EVER succeed because if the main save slot has bad data written to it, that same invalid data will be written to the backup slot.

Closed in favor of #3728.

@KoloInDaCrib KoloInDaCrib deleted the save-fix-and-some-organisation branch October 19, 2024 06:33
@KoloInDaCrib KoloInDaCrib restored the save-fix-and-some-organisation branch December 7, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
haxe Issue/PR modifies game code large A large pull request with more than 100 changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants