27.08.2008, 17:37
Quote:
Originally Posted by Wadabak
I've did this:
1) Registered my self, it was writen correctly. 2) Changed my name in the file and saved it. 3) Reregistered myself. But as the changed name of the file hasn't been reloaded in the cache the system didn't knew it and overwrited the previous one. |
If you want to reload the info, better use DJSON_cache_ReloadFile(filename[]) once or use for example dj(file[],path[],use_cached_value) with use_cached_value = false, this will "force" to load from file always. No caching is used here. Even though I do not suggest that for big files.
Quote:
Originally Posted by Wadabak
A question: Is the long delay normal, like ~1-2 seconds with 8 writings?
This is not a problem because I am going to use this only in register/login/disconnect so the player won't notice it during his gameplay. |
In first place do:
pawn Код:
djAutocommit(false); // after that line, it will only flush the data on djCommit
djSetInt("Accounts.json", "Draco/Health",100);
djSetInt("Accounts.json", "Draco/Money",10000);
... more ...
djSetInt("Accounts.json", "Wadabak/Health",30);
djSetInt("Accounts.json", "Wadabak/Money",500);
djCommit("Accounts.json"); // at this point, it will "flush" all the data into the file!
djAutocommit(true); // after that line, it will automactily flush the data on each call
Quote:
Originally Posted by Wadabak
Also if you don't mind, can I release the register system I am making? Because this may be confusing for new users.
|
- Draco