Using localForage-cordovaSQLiteDriver w/ YEP_SaveCore.js and rpg_managers.js

ACECORP

Founder & Entrepreneur
Veteran
Joined
Apr 6, 2016
Messages
253
Reaction score
39
First Language
English
Primarily Uses
RMMV
I successfully deployed localForage-cordovaSQLiteDriver to my RMMV ionic/cordova project.

My SQLIte Database is now accessible and writable through the localForage-cordovaSQLiteDriver interface.

I wrote a simple javascript file to test writing data to it and reading data from it, so that's how I know.

My question is twofold:

(1) Am I correct in my understanding that the rpg_managers.js file is the file that deals with all localstorage.setItem(key, value) commands? - I assume this is Yes, but I just want to double check.

(2) The second and more important question is for anyone with understanding to some of the 3rd party save plugins like Yanfly Save Core work. In Yanfly save core (YEP_SaveCore.js), I don't see him explicitly calling localstorage.setItem and from what I see, he is using he datamanager class. Does this mean his save core plugin is ultimately using the localstorage.setitem and localstorage.getitem commands that are in rpg_managers.js?

The reason I ask is because I need to identify the base area that actually commits the save data, and I need to change that to use the localForage-cordovaSQLiteDriver I deployed. I am hoping the YEP_SaveCore.js is indeed using the rpg_managers.js localstorage,setitem and get item as shown below because that means i can ultimately modify this ever so slightly to use the localforage driver I have configured and I can then save to sqlite very easily instead of saving to the default localstorage.

Code:
StorageManager.backup = function(savefileId) {
    if (this.exists(savefileId)) {
        if (this.isLocalMode()) {
            var data = this.loadFromLocalFile(savefileId);
            var compressed = LZString.compressToBase64(data);
            var fs = require('fs');
            var dirPath = this.localFileDirectoryPath();
            var filePath = this.localFilePath(savefileId) + ".bak";
            if (!fs.existsSync(dirPath)) {
                fs.mkdirSync(dirPath);
            }
            fs.writeFileSync(filePath, compressed);
        } else {
            var data = this.loadFromWebStorage(savefileId);
            var compressed = LZString.compressToBase64(data);
            var key = this.webStorageKey(savefileId) + "bak";
            localStorage.setItem(key, compressed);
        }
    }
};
Anyone who can add anything of value about how YEP_SaveCore.js might work or use what's in rpg_managers.js would be greatly appreciated.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top