Quote:
Originally Posted by fysiks
It really depends on what you are doing. Definitely not recommended to use any type of think forward. Also, the very last point that you should update is on disconnect (not after). Just going by common sense here.
|
i wanted to update the db in speedometer think :-D
it worked perfectly but how i said, i was disconnected from the server but the stats was still @ updating.
everytime i refreshed the table, i saw new Speed values in tables.
i think it caused by traffic or so :-(
Quote:
Originally Posted by Hunter-Digital
Hmm, I think client_connect() triggers when player is accepted to server while in loading, but if the player cancells in loading the client_disconnect() doesn't trigger unless the player has entered the game.
So, if that's surely true , you should use client_putinserver() for adding to db.
You should test it tough, add server prints to console upon connect and disconnect, connect to the server and then cancel while loading.
And just a small note: about your team comment, are those numbers from their actual team (like [cs_]get_user_team) ? Because in-game, the spectators are team 3.
And about your updating stuff... where do you actually update the stats ? All I see is INSERT and DELETE... because if you're having trouble deleting that when player left, you can do it just fine in the update sequence, just check is_user_connected() (or better: a global variable) and check it before updating then delete player and skip to next one.
And if you don't have a updating sequence already, set_task() on 5-30 seconds will do just fine.
|
Hmm... you'r right. i wanted to have it realisticer and add on the page as status :
Connecting
Connected
Spec
Fleer
Cather
thats point2. i have my own teams. a counter-terrorist can be in team 2 or 3. better said, this willbe changed every round.
first round are Ts the team 2 and next round are CTs as team 2 defined.
PHP Code:
/*team :
0 = connecting
1 = spectating
2 = Catcher
3 = Fleer
*/
and how i said, i upadte the stats in my speed think. if its needed i can paste it here ( im now online with laptop )
anyways for first thanks for answers.
i think its better to add a cvar for the task to set the update task.
__________________