Newcomer1989 / TSN-Ranksystem

A PHP Bot that assigns time based server groups on TeamSpeak3.
https://ts-ranksystem.com
GNU General Public License v3.0
144 stars 60 forks source link

Null value as factor (boost function) #72

Closed Rustoria-Servers closed 8 years ago

Rustoria-Servers commented 8 years ago

There's no errors in the logs, the bot as a whole works fine. It still gives server groups, removes boosts, takes boosts into account. But the only problem the statistics don't update on the website, the server ones do. The client ones however do not. For example all the data on the mystatistics.php page are outdated and don't update. Same with the Top users pages.

mightyBroccoli commented 8 years ago

Is your cronjob with the worker.php script working correctly ? You could check cour cronjobs and possibly add some && echo "1" >> ./testfile after the cronjob line to be sure.

Rustoria-Servers commented 8 years ago

I imagined it'd be that, I've added that and I'll let you know. The ./testfile would be located in /root/ I'm guessing?

Rustoria-Servers commented 8 years ago

Yep the worker.php crontab is working fine, I have a testfile with the output 1.

Shad86 commented 8 years ago

really all are outdated?

Because some of them need time to be up to date for example top of week and top of month.

you can give us a screen of the site where we can also see in what way you mean that there are outdated? (dont forget to remove sensible data)

regards

Shad86

Rustoria-Servers commented 8 years ago

https://gyazo.com/0f864d88ccf2ea46cf86d021de7879be Those stats in the box haven't refreshed in days.

Shad86 commented 8 years ago

hm thats wierd i just connected to your teamspeak to see if its really not giving me stats but for me it is working.

it generates time:

Total online time: 0 days, 0 hours, 2 mins, 15 secs

My Question for you now is:

if you are on the teamspeak, on the right side on the stat page also stands that you are connected(usually then your name is there)?

Rustoria-Servers commented 8 years ago

Really? That's very strange, for everyone who's on the top all page, they're having the same issues.

Shad86 commented 8 years ago

yeah here -> https://puu.sh/qmk7T/5664be764c.gif its working without any issues

Rustoria-Servers commented 8 years ago

Then why would a select few be having this issue do you think?

Shad86 commented 8 years ago

hm thats a good question maybe that few people using a vpn or proxy.

That would be a possible reason. (As i know that gets improved on the next update.)

Rustoria-Servers commented 8 years ago

I've never used a VPN while I've been on my server, but I still experience the issue. I wish I knew the cause of this so I could either fix it, or report it here. Right now there's no where to start.

Rustoria-Servers commented 8 years ago

Maybe it has to do with the time boosts? I've just removed my level, it used to give it me back straight away. It still does with the users that are not having the issue. But I'm now levelless xD

Newcomer1989 commented 8 years ago

Please look at your index stats page. You can see that the Ranksystem was not working between 31.07.2016 23:28 and 01.08.2016 18:06. You are sure, it is still not working for all that people?

Rustoria-Servers commented 8 years ago

This is because the server was down, I was experiencing this problem way before that downtime.

Newcomer1989 commented 8 years ago

Again... The problem still exists? Also for other people?

Rustoria-Servers commented 8 years ago

Not for everyone nope, maybe this is working for all new people since that downtime, but not working for the original/old people marked in the database?

Rustoria-Servers commented 8 years ago

The other solution could be due my online time in the last 7 days is longer than 7 days?

Shad86 commented 8 years ago

he have a boost what you get after voting or/and after giving the site a like - i have now 2 boosts and its now like freezing for me too the rankup just stuck also after removing the 2 boost groups

Newcomer1989 commented 8 years ago

I think this could be the problem.

2016-08-01 20:59:13.943282   INFO      Removed servergroup 52 from user Ryan (unique Client-ID: 35UxXv+9j/MjMUMbNTtMdck6RGg=; Client-database-ID 2).
2016-08-01 20:59:13.957800   INFO      Removed servergroup 52 from user Ryan (unique Client-ID: 35UxXv+9j/MjMUMbNTtMdck6RGg=; Client-database-ID 2).
2016-08-01 20:59:13.972628   INFO      Removed servergroup 52 from user Ryan (unique Client-ID: 35UxXv+9j/MjMUMbNTtMdck6RGg=; Client-database-ID 2).

What is the servergroup 52? Are you inside of this group? Have the Ranksystem query user the permission to revoke this group?

Do not use servergroups, which are defined for the Ranksystem and give that manually!

Other thing could be the Ranksystem on your machine runs twice or more often. Please check this also!

Rustoria-Servers commented 8 years ago

We've found the issue, big thanks to Shad86, I'm using multiple boosts at the same time. The last boost you specify is the boost it uses. My last boost I used in this case, was a boost that was boosting by '0'. I also have a system that you can claim 2 time boosts. Of course I didn't know the Ranksystem only supports one boost group. This was my main issue, definitely advise for you to add support for multiple boosts in the future!

Newcomer1989 commented 8 years ago

Can you please post your boost config here?

In best case the wrong one and also the working one.

Rustoria-Servers commented 8 years ago

66=>2=>86400,67=>5=>86400,25=>1=>86400

Rustoria-Servers commented 8 years ago

66=>2=>86400,67=>5=>86400,25=>1=>86400 - Working for only the last of the 3 assigned. 66=>2=>86400,67=>5=>86400,25=>0=>86400 - Wasn't working

Newcomer1989 commented 8 years ago

Ok, I will take this as suggestion to enable a check, the value of the factor is 0. If the factor is zero, you will be not able to save the config inside the webinterface. Comes with release 1.1.1.

This was my main issue, definitely advise for you to add support for multiple boosts in the future!

This will definitly not supported, not now and not in future. To give people more then one boost group at the same time makes no sense for me. The problem would be also how should this handled? Take the highest factor or the lowest or multiply it? And next question is how to handle the time, which are perhaps different. Its much more easy and still possible now: Create a config, with the result you want to get, then you only need to give a person one group.