Good way to create top player system
#4

Just use callback OnPlayerDeath or whatever.
As soon as someone kills another player, update your table.
You don't need a timer for that.
Suppose your timer has just executed and the next iteration is 15 minutes away.
Your player makes 5 more kills and leaves the server several minutes before the next timer iteration.

His variables are cleared upon leaving and those 5 kills have not been saved.

Just save whenever there is a kill.

You won't get lag if you use threaded queries.
Players don't kill 5 other players in a second.
Even then, sending 5 queries at once won't lag at all.

You could also retrieve the updated kill-list after each kill.
Using threaded queries, you send the query to sort the kill-list by mysql itself and it executes in the background.
When mysql has the result, it will call a callback in your script and you can simply read it and update your textdraws or whatever you use to display the ordered list.

Even when this happens every second, it won't lag.

Big MMORPG servers process alot more queries for 6000 players at once and it doesn't lag at all.
Surely mysql can handle your little server with only 50 players and a handful of queries every second.
Reply


Messages In This Thread
Good way to create top player system - by dominik523 - 10.05.2015, 08:07
Re: Good way to create top player system - by [KHK]Khalid - 10.05.2015, 08:28
Re: Good way to create top player system - by dominik523 - 10.05.2015, 09:59
Re: Good way to create top player system - by PowerPC603 - 10.05.2015, 10:21
Re: Good way to create top player system - by Vince - 10.05.2015, 10:25
Re: Good way to create top player system - by Jimmy0wns - 10.05.2015, 10:26
Re: Good way to create top player system - by dominik523 - 10.05.2015, 10:27
Re: Good way to create top player system - by [KHK]Khalid - 10.05.2015, 10:28
Re: Good way to create top player system - by Mauzen - 10.05.2015, 11:19
Re: Good way to create top player system - by dominik523 - 10.05.2015, 12:11

Forum Jump:


Users browsing this thread: 1 Guest(s)