z4lab / z4lab-surftimer

A CS:GO Surftimer for the z4lab Community
https://z4lab.com
GNU General Public License v3.0
16 stars 9 forks source link

[BUG] Player points deleted after 1st map completion post-upgrade #91

Closed kmsraidboss closed 5 years ago

kmsraidboss commented 5 years ago

Describe the bug First map completion after upgrade causes all of player's points to be wiped.

I upgrade from Fluffy's version. Ran the DB update (fluffy-upgrade) successfully. Server is running fine with no errors at all. Upon initial joining of the server, all points, rank, etc. are retained from the database as they were. After a map is completed, all points in ck_playerrank for that player get changed to 0. Everything from "points" all the way through "finishedmapspro" gets changed to 0. From there, any time that person beats their map time, they do not get any points.

Nothing else seems effected. All map times stay in place. Only the person's points get completed deleted.

Expected behavior When map is completed, points should stay the same, or increase if the person's PB is beaten.

Screenshots

Additional context Just want to confirm a fully working server, no error logs at all, fully working database. Database upgrade went smoothly. All files from this timer copied over. I believe I had this issue when upgrading from ckSurf to Fluffy's but I can't remember the solution.

Will gladly add more info if I'm forgetting something.

13ace37 commented 5 years ago

It's nearly impossible that the timer is cleaning the whole ck_playerrank table.

Either your sm or mm isn't at the newest version or some other dependencies aren't. An other thing could be either wrong database settings or an wrong text encoding.

13ace37 commented 5 years ago

And another thing is that all critical sql queries will be shown in the console.

kmsraidboss commented 5 years ago

Good morning, thank you for your response. Here is some follow up:

Tested again this morning, found another way of making the same thing happen. I typed !profile, went to my profile (happened to be working with "normal" style), then pressed the "Refresh Profile" button, and my points disappeared. This is not deleting the whole table, only each individual user as they get their profile refreshed or beat a map (with or without PB). Here are before and after screenshots, taken about a minute apart

Before: https://imgur.com/a/rYHLQjk After: https://imgur.com/a/zETWT8i

I checked console.log , nothing there with any SQL queries or anything related. Nothing in my client console either. So this happens both when a person first beats a map, and when their profile is refreshed. After this happens, person does not gain any points for beating PB or improving ranks on that map. No map stats (personal times, etc.) are removed, only points info from ck_playerrank (as shown in images).

Thank you again for following up. Please let me know if you think of anything that I could try or could be overlooking. I'm sorry to waste your time with this. I attempted everything I could think of before coming here.

kmsraidboss commented 5 years ago

Found the problem.

It was because my cfg/sourcemod/surftimer.cfg had multi_server_mapcycle set to 1 (since my dev server is normally setup the same as my main servers) but because of the upgrade, the addons/sourcemod/configs/surftimer/multi_server_mapcycle.txt file was empty. So the plugin assumed there were no maps in the "ranked mapcycle" and wiped out all points.

After I filled in the multi server mapcycle with my normal list, I am no longer having the issue.

Thank you Ace for reaching out to help <3