BUGFIX: Fix corrupted save in Steam cloud (#1341)

This commit is contained in:
catloversg 2024-06-02 23:04:42 +07:00 committed by GitHub
parent 54d099e552
commit 2ee548a140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -192,9 +192,9 @@ async function pushSaveDataToSteamCloud(saveData, currentPlayerId) {
* *
* Instead of implementing it, the old code (encoding in base64) is used here for backward compatibility. * Instead of implementing it, the old code (encoding in base64) is used here for backward compatibility.
*/ */
const content = saveData.toString("base64"); const content = Buffer.from(saveData).toString("base64");
log.debug(`Uncompressed: ${saveData.length} bytes`); log.debug(`saveData: ${saveData.length} bytes`);
log.debug(`Compressed: ${content.length} bytes`); log.debug(`Base64 string of saveData: ${content.length} bytes`);
log.debug(`Saving to Steam Cloud as ${steamSaveName}`); log.debug(`Saving to Steam Cloud as ${steamSaveName}`);
try { try {