Thread: Forcing the DB to save
-
June 2nd, 2019, 15:31 #1
- Join Date
- Sep 2017
- Posts
- 39
Forcing the DB to save
Is there a function that forces the DB to save ?
For example I create a window called "locked_window" and give it a name "newWindow".
I can do that by typing the following command in the chat:
/openwindow locked_window newWindow
If I immediately open the DB.xml file, no trace of "newWindow"
However, if I then type /save in the chat window and reopen the DB.xml, here it is.
Since I plan to basically check if the title of locked_window is empty and if not to copy "newWindow" to a new node, forcing a save of the DB would be helpful. How can I do that ?
-
June 2nd, 2019, 16:47 #2
Fantasy Grounds doesnt read from the db.xml within a session - only at the start of the session.
The rest of the session it works from a copy that is loaded in memory.
This copy is written to disk on exit and every 5mins.
The data that you seek is in the db - it just may not be in the db instance that you can see right now...
type /save to force the write so you can check your code - but the game itself can access it already.
-
June 2nd, 2019, 22:58 #3
- Join Date
- Sep 2017
- Posts
- 39
Thank you for the info.
I have an additional thing I am struggling with: how can I get a databasenode to delete itself on an OnClose event ?
I have tried getDatabaseNode().delete(); and it crashes utterly fantasy ground.
-
June 2nd, 2019, 23:55 #4
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks