Scripting Question(MySql)
Hey everyone,
I wanna ask a simple question, which i cannot answer, so i need your help. In my server i save some stats via MySQL. When server crashes(CPU Overflow), the client_disconnect is called? What i mean? I mean that if the server crashes, the current player stats will be saved to MySQL? If no, how can prevent that? Thanks in advance. With Respect, Oxygen |
Re: Scripting Question(MySql)
If the server crashes, there is nothing to call as the process has already been terminated. You cannot do anything to make it call something on a crash.
|
Re: Scripting Question(MySql)
So you need to save at a different time/trigger, or fix the crash issue.
|
Re: Scripting Question(MySql)
So, making a task every minute to save stats would be a good idea?
|
Re: Scripting Question(MySql)
Quote:
keep both saving on disconnection and add a timer to save stats Code:
|
Re: Scripting Question(MySql)
What about constant "TASK_SAVE_INFO" ?
|
Re: Scripting Question(MySql)
You have a lot of options. Either at a set interval via set_task or a thinking entity, or some game event such as round start or round end.
|
Re: Scripting Question(MySql)
Quote:
it's used so that each task has a specific id that has something to do with the player's id for example, task_save_info = 1000, on player 32 the taskid will be 1032, you're gonna need that number to stop the task when a player leaves(which is important) but if all you want to do is save, you can do it for all players at once, I use this method because I'm not only saving a currency but I'm also giving players +1 for each minute played, so you get the point. |
Re: Scripting Question(MySql)
What i would do is save whenever the data is updated, unless its updated very frequently. Or events such as round end like bugsy suggested. :)
|
Re: Scripting Question(MySql)
In order to make an entity you have to do something like this.
PHP Code:
|
| All times are GMT -4. The time now is 09:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.