1. I'm trying to save all of my cached user data to a sqlite db when the server is unloaded. All of the sql queries are done async so I have a action that is called once all of the users are unloaded. The problem is that after this method is called oxide will forcibly close the db connection before all of the settings are saved so I can't save all of the settings. Here is the message of when the server closes the connection
    Code:
    [Oxide] 22:00 [Warning] Unclosed sqlite connection (Data Source=C:\Users\derek\Documents\rust\Windows Server\server\ctdev\oxide\data\CTGames.db;Version=3;), by plugin 'CTGames', closing...
    I know this current solution is flawed and was just wondering if there was a standard solution to this or if anyone had experience with an issue like this that could help.
    Code:
           void Unload()
            {
                unloadUsers(() =>
                {
                    _sqLite.CloseDb(_sqLiteConnection);
                    foreach (var player in mainPlayers)
                    {
                        CuiHelper.DestroyUi(player, "Main");
                    }                foreach (var arena in arenas.Values)
                    {
                        arena.Unload();
                    }
                });
            }
     
  2. Just thought I would post the solution I came up with for my problem. The SQL requests are done async so if you attempt to make requests in the unload method chances are that oxide will destroy the SQL connection before the requests are completed. The way I worked around this is by saving the cached user data to disk and then when the OnServerInit method is called I open a new SQL connection and save the necessary player data.