Hi,
I am using Statistics.db as a dependency and i am experiencing some odd behaviour i was wishing you could have a look at.
When i fire up my server locally and call the hook 'API_GetAllData' from my plugin i get an empty object
var playerData = StatisticsDB.CallHook("API_GetAllData");
Puts(playerData.ToString()); // {}When i join the server (i am the only player just testing locally) if i call the hook again it responds with:
var playerData = StatisticsDB.CallHook("API_GetAllData");
Puts(playerData.ToString());
/**
{
"I_LEFT_THE_STEAMID_OUT": {
"LastUpdate": 1632402747,
"Joins": 1,
"Leaves": 0,
"Kills": 0,
"Deaths": 0,
"Suicides": 0,
"Shots": 0,
"Headshots": 0,
"Experiments": 0,
"Recoveries": 0,
"VoiceBytes": 0,
"WoundedTimes": 0,
"CraftedItems": 0,
"RepairedItems": 0,
"LiftUsages": 0,
"WheelSpins": 0,
"HammerHits": 0,
"ExplosivesThrown": 0,
"WeaponReloads": 0,
"RocketsLaunched": 0,
"SecondsPlayed": 1,
"Names": [
"Murky"
],
"IPs": [
"*.*.*.*"
],
"TimeStamps": [
1632402747
],
"CollectiblePickups": {},
"PlantPickups": {},
"Gathered": {}
}
}
*/Through my play session it updates correctly.
If i restart the server using 'restart 0' or 'quit' and manually restart it, it reports an empty object again.
When i then try to join it reports fresh data.
When i inspect the sqlite database after a while the data is outdated.
After i use 'save' command it seems to update the database.
If i restart the server again it reports an empty array.
If i join it reports fresh data.
So it seems like the player data cache and database are not in sync?
I noticed an exception when restarting or stopping server:
Failed to call hook 'Unload' on plugin 'StatisticsDB v1.2.6'See the whole output here: https://imgur.com/VSjOEDw
Any ideas what is producing this behaviour?
Thanks!