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 connectionI 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:[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...
Code:void Unload() { unloadUsers(() => { _sqLite.CloseDb(_sqLiteConnection); foreach (var player in mainPlayers) { CuiHelper.DestroyUi(player, "Main"); } foreach (var arena in arenas.Values) { arena.Unload(); } }); }
Solved Save data to SQLite database on unload
Discussion in 'Rust Development' started by CombatTag, Dec 6, 2016.