Mirage Source http://miragesource.net/forums/ |
|
New Suggestion for not throwing away so many loops... http://miragesource.net/forums/viewtopic.php?f=201&t=1277 |
Page 1 of 10 |
Author: | Obsidian [ Wed Jan 31, 2007 4:05 pm ] |
Post subject: | New Suggestion for not throwing away so many loops... |
Alright, my last suggestion, was to just use TotalOnlinePlayers for the count... the problem however, was that TotalOnlinePlayers only keeps the number... not the index (socket) number of the player. So let's say you had 5 people playing... and playes 2-4 quit. TotalOnlinePlayers would = 2, but TotalOnlinePlayer #2, would have to be shown as Index 5, but would be returned as 2. My suggestion, would be to go through, and while calculating TotalOnlinePlayers, if the player is "added" to the totalonlineplayer count... add the Number that they're being added in as (in this case 2), and then store their index in along with it. E.g., OnlinePlayer(2).Index = 5. Then just snag that back out of it later on when you use the TotalOnlinePlayers Loop. This could be a pretty substantial optimization... but i'm sure that there is again something that i've probably over looked. If you can think of a problem with this method please let me know. I'm going to add this to a blank MSE2 today, and if it works like it is supposed to, i'll go ahead and submit it to William as an optimization update for MSE2 |
Author: | Joost [ Wed Jan 31, 2007 4:17 pm ] |
Post subject: | |
If I were you, I'd just find the player with the highest index, and use that number, recounted every time a player logs in/out. Maybe it'll do 5 loops extra every now and then, but it saves a lot of trouble. |
Author: | grimsk8ter11 [ Wed Jan 31, 2007 7:31 pm ] |
Post subject: | |
In theory it would work, and you could shift the onlin players index instead of the players socket, but it really doesnt seem worth it. |
Author: | Obsidian [ Wed Jan 31, 2007 8:26 pm ] |
Post subject: | |
It's true. Seems like the best policy would be to just go back and rewrite about 90% of the server's logic code |
Author: | wanai [ Sun May 15, 2022 1:40 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
XVII |
Author: | wanai [ Sun May 15, 2022 1:41 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
373.1 |
Author: | wanai [ Sun May 15, 2022 1:42 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Thom |
Author: | wanai [ Sun May 15, 2022 1:43 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Repr |
Author: | wanai [ Sun May 15, 2022 1:45 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Jala |
Author: | wanai [ Sun May 15, 2022 1:46 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Diac |
Author: | wanai [ Sun May 15, 2022 1:47 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Will |
Author: | wanai [ Sun May 15, 2022 1:48 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
live |
Author: | wanai [ Sun May 15, 2022 1:49 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Caro |
Author: | wanai [ Sun May 15, 2022 1:50 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Dolb |
Author: | wanai [ Sun May 15, 2022 1:51 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Deni |
Author: | wanai [ Sun May 15, 2022 1:52 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
EXPE |
Author: | wanai [ Sun May 15, 2022 1:53 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Love |
Author: | wanai [ Sun May 15, 2022 1:55 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Wind |
Author: | wanai [ Sun May 15, 2022 1:56 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
With |
Author: | wanai [ Sun May 15, 2022 1:57 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Valu |
Author: | wanai [ Sun May 15, 2022 1:58 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Deni |
Author: | wanai [ Sun May 15, 2022 1:59 am ] |
Post subject: | Re: New Suggestion for not throwing away so many loops... |
Jule |
Page 1 of 10 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |