STAR TREK 2d20
  1. #1

    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 ?

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    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.

  3. #3
    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.

  4. #4

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in