Steenamaroo updated PlayerRanks with a new update entry:
1.1.4

Player Ranks
Player ranks and stats database
Total Downloads: 4,901 - First Release: Mar 4, 2017 - Last Update: May 29, 2018
- 5/5, 19 likes
-
@Steenamaroo No Update Attachment Found when pressing the download button.
-
-
It double-posted and hung when I launched the update.
I'll reattach to see if that helps. -
Steenamaroo updated PlayerRanks with a new update entry:
1.1.4
[DOUBLEPOST=1492281301][/DOUBLEPOST]Fixed. -
@Steenamaroo, there is a problem while you use /pr tops and try to close UI, it just create new UI without closing old one
-
Thank you, Sami. I'll look into it ASAP.
I haven't dismissed your names issue.
I wasn't able to recreate, even using all the names you sent me, but if it's still happening for you I'll need to dig deeper.
Please let me know. -
-
Great news.
As I said, I don't really know much about SQL but I know I was getting console reports from v1.1.2 long after I updated to 1.1.3, for example.
There's every chance you were getting lingering errors , I suppose, but don't be afraid to PM or post here if it happens again.
The close issue - I can't replicate it either.
Is your server and oxide 100% up to date? There is an issue with the cursor resetting to centre screen at intervals.
Any chance that's related? -
Currently you're using timer.Once to trigger the save and not timer.Every, which is why it only saves once after the first 30 minutes but doesn't again repeat after another 30 minutes.
To fix this change from
Code:timer.Once(saveTimer * 60, () => SaveTrigger());
Code:timer.Every(saveTimer * 60, () => SaveTrigger());
Code:void SaveTrigger() { timer.Once(saveTimer * 60, () => SaveData()); //publicly reports saving on the timer Puts("Player Ranks Local Database Was Saved."); if (useMySQL) { LoadMySQL(); } }
Code:void SaveTrigger() { SaveData(); //publicly reports saving on the timer Puts("Player Ranks Local Database Was Saved."); if (useMySQL) { LoadMySQL(); } }
Code:void OnServerSave() { if (initialized) SaveTrigger(); //saves the database when the server saves }
Code:bool HasPermission(string id, string perm) => permission.UserHasPermission(id, perm); //Line 26 bool initialized; //Add this under as new line 27
Code:void OnServerInitialized() { lang.RegisterMessages(messages, this); PRData = Interface.Oxide.DataFileSystem.GetFile("PlayerRanks"); LoadData(); LoadVariables(); cmd.AddChatCommand($"{chatCommandAlias}", this, "cmdTarget"); CheckDependencies(); if (useTimedTopList) { timer.Once(TimedTopListTimer * 60, () => pvpkills()); } foreach(BasePlayer player in BasePlayer.activePlayerList) { OnPlayerInit(player); } timer.Once(saveTimer * 60, () => SaveTrigger()); if (useMySQL) { LoadMySQL(); }
Code:void OnServerInitialized() { lang.RegisterMessages(messages, this); PRData = Interface.Oxide.DataFileSystem.GetFile("PlayerRanks"); LoadData(); LoadVariables(); cmd.AddChatCommand($"{chatCommandAlias}", this, "cmdTarget"); CheckDependencies(); if (useTimedTopList) { timer.Once(TimedTopListTimer * 60, () => pvpkills()); } initialized = true; foreach(BasePlayer player in BasePlayer.activePlayerList) { OnPlayerInit(player); }
Last edited by a moderator: Apr 19, 2017 -
Hi,
Thanks for pointing that out.
I'd rather have the customisable timer for people who want SQL saved at more frequent intervals.
I changed the saving system in a rush because the saveloop was getting called by several things, but I didn't realise I forgot to loop it.
I also didn't know timer.Every was a thing, so thanks for that.
Just having this under onserverinitialised
Code:timer.Every(saveTimer * 60, () => { SaveData(); Puts("Player Ranks Local Database Was Saved."); if (useMySQL) { LoadMySQL(); } } );//publicly reports saving on the timer
Code:void SaveData() { PRData.WriteObject(data); //silently saves the database at other times, such as pr del...pr wipe etc }
Saves on the user-timer are printed to console, and saves that happen on del/wipe/pr save etc are not.
Basically, it was fine before but I didn't want console save spam every time an admin command was carried out.
Will tidy it up in next V. Thank you.
I'm also just going to escape special characters in the mysql save.
Thank you Sami for your time and input on that.Last edited by a moderator: Apr 19, 2017 -
Steenamaroo updated PlayerRanks with a new update entry:
1.1.5
-
-
Wulf Community Admin
-
Code:
Failed to call hook 'OnExplosiveThrown' on plugin 'PlayerRanks v1.1.5' (InvalidCastException: Cannot cast from source type to destination type.)
-
Thank you. Will sort.
-
[DOUBLEPOST=1492719401][/DOUBLEPOST]@Steenamaroo Just realized something without using OnServerSave() or there being a console command that you can add to auto run, there isn't a method to save before automatic restarts. Maybe add a option in the config to use OnServerSave or a Timer? Not sure how difficult that would be. -
Thanks for your thoughts, man.
It saves on Unload, which I thought would cover-all, but recently learned that plugins don't necessarily unload under all server-restart/stop circumstances.
If I server.restart via rcon I'll see everything unload one by one, but if I restart via GameServers control panel, that doesn't happen.
I'll add config true/false for savetimer.
If it's false, then OnServerSave will be the default. -
Were there any additional circumstances? -
I also scanned all plugins for "OnExplosiveThrown" and only yours used that hook.