TALES of the VALIANT
  1. #1

    Trying to send a /save command via code

    I know this has something to with the manager_chat.lua script, as an example of something similar I see this:

    Comm.registerSlashHandler("w", ChatManager.processWhisper, "[charactername] [message]");

    but nothing regarding adding support for "/save". Any ideas? Thanks!

  2. #2
    Comm.activateSlashCommand("save");

    Discussed here:
    https://www.fantasygrounds.com/forum...l=1#post548481
    Last edited by jharp; January 6th, 2025 at 02:09. Reason: added link to prior discussion.

  3. #3
    Quote Originally Posted by jharp View Post
    Comm.activateSlashCommand("save");

    Discussed here:
    https://www.fantasygrounds.com/forum...l=1#post548481
    That works, thanks!

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,263
    I'm curious - FG saves the database held in memory to the campaign db.xml file automatically every 5 minutes, what's the use case to force this save?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    Well for me, FoWEnhanced makes use to save FoW data.

  6. #6
    Quote Originally Posted by Trenloe View Post
    I'm curious - FG saves the database held in memory to the campaign db.xml file automatically every 5 minutes, what's the use case to force this save?
    I have a lot of experience with this, it seems that for my purposes, it does NOT go to memory first, it goes to the disk. I wrote some custom code that auto applies spell effects and the way I achieved this is by adding a node to the combat tracker for the creature being targetted. This all works fine when i test myself, however, when players are connected it seems to go all haywire and only works periodically. The only thing I could pin it down to was the fact that it was not writing to the disk in time. Saving seems to work.

  7. #7
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    27,229
    Blog Entries
    1
    FG doesnt read from disk during the game - it only writes to the disk. Once the table has loaded all ruleset, extension and database are loaded into memory and run from there.
    Is it possible its a database permissions issue? Where in the DB are you writing the data to?

  8. #8
    Quote Originally Posted by damned View Post
    FG doesnt read from disk during the game - it only writes to the disk. Once the table has loaded all ruleset, extension and database are loaded into memory and run from there.
    Is it possible its a database permissions issue? Where in the DB are you writing the data to?
    Yes, I have run into that too, but the fact that /save seems to solve the problem makes me think that it reads from the disk, or something, I don't know, but writing nodes and reading from them in a short amount of time otherwise is VERY flaky. I have been testing this for quite a while too.

Thread Information

Users Browsing this Thread

There are currently 6 users browsing this thread. (0 members and 6 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
  •  
GI JOE RPG Launch

Log in

Log in