AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   OciXCrom's Rank System [XP|Levels|Ranks] (https://forums.alliedmods.net/showthread.php?t=308540)

xeloxded 07-03-2018 13:37

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
For some reason sometimes it wont save my exp correctly, it will reset to 0, yesterday i gave myself 1000 exp but then (next day) it was on 0 again
SAVE_TYPE = 0
Using same nick

EDIT: On change map it will save but if I turn off server it will reset

OciXCrom 07-03-2018 19:04

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
How are you turning off your server exactly? If you're not doing it properly, the plugin won't be able to save the data.

xeloxded 07-03-2018 19:26

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Well, just closing it, but what do you mean "correctly" I mean, what if ""for some reason"" server gets shutdown (power went off, DDOS), it will loss data, not sure but I dont think thats right.
or when do you need to restart your server for whatever reason (Installing a new module or maintenance, for example)

OciXCrom 07-04-2018 08:10

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
"Just closing it" by pressing the X button is not considered a proper shutdown. This won't call any of the plugin's functions which need to detect when the map ends and the players disconnect to save the data. Not only this plugin, but none of your plugins that save stuff in the end will save them. Use the "exit" command to shut it down and "restart" to restart it.

xeloxded 07-04-2018 08:16

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Thats what I did, but still, for some reason EXP will go to 0 regardless.
I was testing with SteamID but it will save correctly

Also it makes no sense, because i am playing x map, got 10 exp and then change map it will save then close or rr server and it will go to 0 again

OciXCrom 07-04-2018 08:46

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Not sure why that is happening. I added some logs in the code that will print what's going in the logs/crxranks.log file. Leave it running for a while and upload the log file when you experience this again.

I'll upload the code in pastebin, since alliedmods has a weird bug at the moment - https://pastebin.com/9r9jEeTG

xeloxded 07-04-2018 12:33

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Quote:

L 07/04/2018 - 12:24:29: Log file started (file "cstrike/addons/amxmodx/logs/crxranks.log") (game "cstrike") (amx "1.8.3-dev+5154")
L 07/04/2018 - 12:24:29: Plugin precache started.
L 07/04/2018 - 12:24:30: Plugin init started.
L 07/04/2018 - 12:24:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:24:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:24:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: Deathrun [BOT] disconnected.
L 07/04/2018 - 12:24:56: Saving data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:24:56: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:56: The plugin has ended.
L 07/04/2018 - 12:25:30: Plugin precache started.
L 07/04/2018 - 12:25:30: Plugin init started.
L 07/04/2018 - 12:25:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:25:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:25:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:25:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:26:55: Plugin precache started.
L 07/04/2018 - 12:26:55: Plugin init started.
L 07/04/2018 - 12:26:56: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:26:58: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:00: Deathrun [BOT] connected.
L 07/04/2018 - 12:27:02: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:27:43: Plugin precache started.
L 07/04/2018 - 12:27:43: Plugin init started.
L 07/04/2018 - 12:27:44: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:27:45: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:46: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:48: Loading data for TEST [STEAM_0:0:173190571]
Maybe it has something to do with the fact that Deathrun comes with a BOT?
I just did the following, choose a map, give 100 exp, change to the same map while being connected, 100 exp still, then restart sv, 0 EXP.

OciXCrom 07-04-2018 13:04

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Let's add some colors to those logs so we can easily find what we need.

Quote:

L 07/04/2018 - 12:24:29: Log file started (file "cstrike/addons/amxmodx/logs/crxranks.log") (game "cstrike") (amx "1.8.3-dev+5154")
L 07/04/2018 - 12:24:29: Plugin precache started.
L 07/04/2018 - 12:24:30: Plugin init started.
L 07/04/2018 - 12:24:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:24:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:24:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: Deathrun [BOT] disconnected.
L 07/04/2018 - 12:24:56: Saving data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:24:56: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:56: The plugin has ended.
L 07/04/2018 - 12:25:30: Plugin precache started.
L 07/04/2018 - 12:25:30: Plugin init started.
L 07/04/2018 - 12:25:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:25:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:25:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:25:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:26:55: Plugin precache started.
L 07/04/2018 - 12:26:55: Plugin init started.
L 07/04/2018 - 12:26:56: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:26:58: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:00: Deathrun [BOT] connected.
L 07/04/2018 - 12:27:02: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:27:43: Plugin precache started.
L 07/04/2018 - 12:27:43: Plugin init started.
L 07/04/2018 - 12:27:44: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:27:45: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:46: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:48: Loading data for TEST [STEAM_0:0:173190571]
You can clearly see that your server isn't behaving properly. The functions that are called when the server starts (the plugin precache and plugin init messages) are printed 4 times in the file, but the function that is supposed to be called when the plugin ends (the plugin has ended message) is called only once. This means that out of 4 map changes, only 1 was successful and the data was saved there. During the other 3 changes, no data was saved because the server didn't change the map properly. As you can see the data wasn't saved in these cases either. You probably have some plugin that is crashing the server when the map ends or causing some other kind of problem. This is not something that I can fix because the problem is not in this plugin.

xeloxded 07-04-2018 13:15

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
I have nothing else more than Deathrun Manager, your custom chat, Ranks and Knife there (and Joropito multimod) so yeah, not sure what is going on

Its strange too because even if the data wasnt saved later, first map I testeed was where I gave me EXP and then it saved correctly

OciXCrom 07-04-2018 15:30

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
The Deathrun Manager itself can be causing the problem - if I recall correctly, its code isn't very good. I suggest you disable any other plugins and enable them 1 by 1 to see which one is causing the problem. You can use the error logs generated from my plugin to help you in the process.


All times are GMT -4. The time now is 15:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.