Quote:
Originally Posted by Bugsy
client_disconnect() is useful, I just try to avoid calling functions on players there. If it's data that is stored in variables then it's fine to do the actual save procedure at disconnect. In your case, I would store each players steam id in a global array of strings (retrieve at client_authorized), this will save you a native call @ disconnect as well. I just noticed that you are already retrieving authid into a global array at authorized and you even have a comment saying it will be used at disconnect for safe saving. I'm guessing you copied the code from somewhere?
PHP Code:
public client_authorized(Id) { get_user_authid(Id, g_Steam[Id], charsmax(g_Steam[])) // Lets get SteamID just once. Safe for client_disconnect saving
//...
public Save_PlayerLevel(id) { static szAuthId[33]; get_user_authid(id, szAuthId, 32);
I would get an application that can view your tables to make sure all of the data looks ok.
For your SQL, I would name the table something different than one of the fields. You are using a table named Level while having a field named Level. Maybe name your table 'tblLevels'?
|
Yeah, its jhobs code for disconnect i found on the mysql tutorial topic.
someone should really make a more detailed mysql tutorial with do's and dont's etc.
I will name the table something else, and i do not know any application since do not really know specifically what u mean by that.
Quote:
Originally Posted by Jhob94
If you change the map manually, it will be too fast and may not be able to save everyone's data. Plus it is not good to send so many queries at the same time. If he has the chance to save it on ham_killed, it's pointless to save it again on disconnect.
|
You are correct to 100%, some were not saved, others were.
Quote:
Originally Posted by Clauu
I don't think so, many queries will be if you;re updating sql data after every kill
Let's assume for a 32 players full server and a 20min for ex maptime, so in this 20 mins you will have 32*nr of kills queries to run.. kind a huge ammount of jobs for the mysql server but if you're saving at the.moment when player leaves the server then the ammount of queries will be much lower since in 20mins how much players can you have that leaves or joins the server? For ex in 5 min with a round time of 2 min can be made ~100kills and this for a non csdm server(nr of kills will be much greater on this), as an oposite will you have 100 connections/ disconnections in 5min? Much likely no
Also in threaded queries you don't have to free the query handle
|
That would be true, but not in this case, since im running a zombie server. most people will get infected.
so only zombies recieving a headshot can really die. but thats also a problem now.. what if a player doesnt recieve a headshot when zombie?, his data(level) wont be saved.
you also didnt see what jhob wrote.
So we gotta save when he gets infected and killed.. thats my best guess.
__________________