AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQL not loading or saving correctly? (https://forums.alliedmods.net/showthread.php?t=183611)

Y060N 04-24-2012 01:34

SQL not loading or saving correctly?
 
Well, people report losing their XP after playing and it saving fine for a week or more. It seems to happen to 1-2 people a day and I don't really want this to happen.

Right now I have it to read out of my vault file if they aren't inside the SQL because I converted over to SQL.

iBrazilian 04-24-2012 11:28

Re: SQL not loading or saving correctly?
 
I ran into this problem recently, don't recall the fix.

.Dare Devil. 04-24-2012 12:02

Re: SQL not loading or saving correctly?
 
if you saving a things on client_disconnect, then that may will happen ( no save correctly )

Y060N 04-24-2012 13:50

Re: SQL not loading or saving correctly?
 
When I strictly used nvault to save on client_disconnect, it never had this problem. Do you mind explaining why it is different with SQL?

<VeCo> 04-24-2012 14:19

Re: SQL not loading or saving correctly?
 
Where do you load this?

Y060N 04-24-2012 14:34

Re: SQL not loading or saving correctly?
 
I load it on client_putinserver, and I save it in client_disconnect

Exolent[jNr] 04-24-2012 14:34

Re: SQL not loading or saving correctly?
 
Quote:

Originally Posted by Y060N (Post 1695738)
When I strictly used nvault to save on client_disconnect, it never had this problem. Do you mind explaining why it is different with SQL?

You are threading queries on client disconnect.
When the map changes, all players are being sent the disconnect forward.
If there are any threaded queries left queued up when the map ends, they do not get executed.

Y060N 04-24-2012 14:36

Re: SQL not loading or saving correctly?
 
Well they might not get executed, so I will change that. But does that explain why their stats are getting reset? If it's not getting executed, then their stats should be the same as map start, but it seems that people are losing XP after 3-4 days of playing on the server.

As in all stats are brought to 0 and saved then.

Exolent[jNr] 04-24-2012 14:38

Re: SQL not loading or saving correctly?
 
You may be saving before the stats could be loaded for the player.
Such as:
1. Player joins
2. Queue to load stats
3. Player disconnects
4. Blank stats are saved
5. Player is not here, so loaded stats are discarded.

Y060N 04-24-2012 14:41

Re: SQL not loading or saving correctly?
 
So, you you suspect saving at the end of every round would be better? I understand the theory. One of my players is a good friend that got reset, and one time he got disconnected for being AFK. When he came back into the server all his stats were 0. He didn't connect and disconnect or anything like that.


All times are GMT -4. The time now is 07:52.

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