define integer
#7

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
That is really bad advice. If you have only 4 players online and your server supports 500, you are looping through 496 empty variables and, seeing as it is all single threaded, the server has to complete it before continuing further with the script causing lag.

I know what you are going to say 'that loop will continue in a couple ms'. True, but that shouldn't matter. If you finish your work in 3 hours and you know that you could've saved 2 hours if you just kept score of how many people are actually there, then you save 2 hours. Same goes for the server. The server could've done it in less ms and in those ms could've done something else, serve another player for instance.
No, it is not. If you want to loop through the online players ONLY, then use foreach - this is what it does in the first place. Although, nobody talked about loops..
Reply


Messages In This Thread
define integer - by PawnoQ - 05.01.2014, 13:45
AW: define integer - by Nero_3D - 05.01.2014, 14:32
Re: define integer - by mamorunl - 05.01.2014, 15:06
Re: define integer - by SuperViper - 05.01.2014, 15:26
Re: define integer - by Ballu Miaa - 05.01.2014, 15:53
Re: define integer - by mamorunl - 05.01.2014, 17:08
Re: define integer - by Konstantinos - 05.01.2014, 17:33
Re: define integer - by Patrick - 05.01.2014, 17:35
Re: define integer - by mamorunl - 06.01.2014, 10:14
Re: define integer - by Konstantinos - 06.01.2014, 10:22

Forum Jump:


Users browsing this thread: 1 Guest(s)