Open milkyway0308 opened 2 months ago
Seems like a certain character is not valid for base64 encoding (btoa
is just base64 encoding).
Since I don't know korean at all do you, @milkyway0308 have a guess if there is any special character in that message that might be uncommon?
Okay, I'll try to find it.
I will mention it again after I find it.
I just found this SO answer that might be relevant: https://stackoverflow.com/a/26603875
@flx-sta Seems like I found it - triggerMessage contains locale message.
It's too long to write here, so I attach as file.
I suggest two main solutions to this problem:
Change save format or encoding. PokeRogue using btoa method, that not supports specific language. It can fix with change save format. I found error at game-data.ts#encrypt.
Filter out non-english messages. Looks like game save data contains too many informations - we can just delete it, and fix error. As you can see in the file, arena.tags[0].triggerMessage contains locale message, not message key.
Sorry for just offering an opinion, my Typescript skills are too poor for that.
P.S: Looks like official service are using AES as serialize solution, so I can say this problem only occurs at self hosted version of PokeRogue.
Well. that puts the priority quite down unfortunately. It's an interesting observation though. Having localized content inside the save-data..
Yes indeed. I think AES is a lot sturdier (and obv. safer)
Maybe I think we can use some trick at save data - Let me do some prototyping at this problem.
@flx-sta Here's some little trick for save file, fully test completed. I know this isn't the best way to fix it, but it's the best I could do.
Keeping base64 backward compatilibity, and changed format to AES.
Describe the bug
Game stopped after 193 wave with korean language spec.
To Reproduce
Expected behavior
Screenshots / Videos
Device Chrome, Self-hosted. Run with commit hash f8a15570fa50af0a6de83651447b9e0cdf153c2e.
Additional context Seems like korean language translation, or something out of range at latin1 spec, and save logic corrupted with failed encoding. If possible, suggest change encoding from latin1 to utf-8. Here's some stack trace :
Here's save file causing error. sessionData_Guest.zip