Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Loss #22

Open
Maxi605 opened this issue Jul 29, 2018 · 8 comments
Open

Data Loss #22

Maxi605 opened this issue Jul 29, 2018 · 8 comments

Comments

@Maxi605
Copy link

Maxi605 commented Jul 29, 2018

Sometimes when a player DC's or gets kicked by the server (Maybe banned) his data gets deleted when he rejoins, he has 1.000.000 points (Example) and when he gets in again, 0.

@GuskiS
Copy link
Owner

GuskiS commented Jul 31, 2018

You mean karma saving thing? It is hard to understand this one.

@Maxi605
Copy link
Author

Maxi605 commented Aug 2, 2018

No, i'm talking about the data that saves the server like your points, kills as T, kills as D, kills as I, etc.

@GuskiS
Copy link
Owner

GuskiS commented Aug 2, 2018

They are called stats. Anyways, will check, but needs a bit more info.

@Maxi605
Copy link
Author

Maxi605 commented Aug 2, 2018

Not much info on it, when a client DC's sometimes it looses the stats, when i used a anti-retry, the player gets kicked for doing retry and then is when the stats gets lost, he starts from zero, we fixed that and it worked but it seems to be another trigger for it or something

@GuskiS
Copy link
Owner

GuskiS commented Aug 2, 2018

If you could do some sort of testing that could help.

format(temp, charsmax(temp), "SELECT * FROM ttt_stats WHERE player_name = ^"%s^"", g_szPlayerName[id]);

before this line, add log_amx("TTT - MySQL_Load: %d == %s", id, g_szPlayerName[id])

=======================================

if(SQL_NumResults(query) > 0)

before this line, add log_amx("TTT - MySQL_LoadData: %d == %s == %d", id, g_szPlayerName[id], SQL_NumResults(query))

=======================================

format(temp, charsmax(temp), "INSERT INTO ttt_stats (player_name, gwk, kills_i, kills_d, kills_t, rdm, innocent, detective, traitor, bomb_planted, bomb_exploded, bomb_defused, total_points) VALUES (^"%s^", '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d');",

before this line, add log_amx("TTT - table_insert: %d == %s", id, g_szPlayerName[id], name) where name is get_user_name functions result.

@GuskiS
Copy link
Owner

GuskiS commented Aug 2, 2018

Let me know if those results when something weird happens.
Also, do check if there are no duplicates in database for that player_name

@Maxi605
Copy link
Author

Maxi605 commented Aug 3, 2018

Ok, i'll give upload it to the server.

@Maxi605
Copy link
Author

Maxi605 commented Aug 3, 2018

The problem doesn't just happen with 1 name, it happens randomly (there's a trigger obviously) when the client attemps a conection to the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants