Saving players stats on changes or in timer? [MySQL]
#6

The best way is to just save the results immediately when you change the value of any stats (money, weapons, etc) via a threaded query that doesn't cache any results of the query, so the script doesn't have to 'wait' to finish the query function or even 'watch' it through a callback.

Quote:
Originally Posted by Dignity
View Post
Using a timer is inefficient. Imagine a timer running every 10 minutes on a 100 pb server.

Save when you change something in the script.
If you are doing it the right it way, using threaded queries without caching the results, it doesn't matter that you sync 100 players every 10mins with just one loop.

Quote:
Originally Posted by Garr
View Post
it would be better to have per player timers instead of looping through everyone connected. timers are not resource hogging features lol they work well and you can have a lot of them. heck, thousands of timers doesn't have much of a performance hit.
It doesn't matter if you loop through them when you use threaded queries without caching the results, as i also stated above.
Reply


Messages In This Thread
Saving players stats on changes or in timer? [MySQL] - by GospodinX - 21.10.2018, 14:28
Re: Saving players stats on changes or in timer? [MySQL] - by KinderClans - 22.10.2018, 15:04
Re: Saving players stats on changes or in timer? [MySQL] - by Dignity - 22.10.2018, 16:15
Re: Saving players stats on changes or in timer? [MySQL] - by DaniceMcHarley - 22.10.2018, 16:17
Re: Saving players stats on changes or in timer? [MySQL] - by Garr - 30.10.2018, 18:07
Re: Saving players stats on changes or in timer? [MySQL] - by BlackBank - 31.10.2018, 00:10
Re: Saving players stats on changes or in timer? [MySQL] - by TheToretto - 31.10.2018, 00:13
Re: Saving players stats on changes or in timer? [MySQL] - by BlackBank - 31.10.2018, 00:18
Re: Saving players stats on changes or in timer? [MySQL] - by TheToretto - 31.10.2018, 00:35
Re: Saving players stats on changes or in timer? [MySQL] - by BlackBank - 31.10.2018, 00:39
Re: Saving players stats on changes or in timer? [MySQL] - by TheToretto - 31.10.2018, 09:26
Re: Saving players stats on changes or in timer? [MySQL] - by Ermanhaut - 02.11.2018, 10:47
Re: Saving players stats on changes or in timer? [MySQL] - by TheToretto - 02.11.2018, 10:55
Re: Saving players stats on changes or in timer? [MySQL] - by AmigaBlizzard - 02.11.2018, 11:32
Re: Saving players stats on changes or in timer? [MySQL] - by IdonTmiss - 07.11.2018, 11:48
Re: Saving players stats on changes or in timer? [MySQL] - by Gammix - 12.11.2018, 22:56
Re: Saving players stats on changes or in timer? [MySQL] - by Alteh - 13.11.2018, 19:01
Re: Saving players stats on changes or in timer? [MySQL] - by DRIFT_HUNTER - 16.11.2018, 01:21

Forum Jump:


Users browsing this thread: 1 Guest(s)