This feature preserves a list of all servers that were found during
lookups with the "Find" item on the menu for at least 30 days.
Under options there is an item called Server cache which allows
you select a number of hours, minutes or days or "off" If you
choose to turn it on, the cache that is younger than the time period
selected is dumped into the list the user sees when they
select "find" Items that are updated by finding them in the server
list are updated. Items that are not found in the server list are
visibly marked as "cached" and have an age specified on them.
Items that are beyond 20 minutes old are darkened and have ?-s
in place of player counts. With this part of the feature
implemented the intial list appears faster, but there is a more
obvious lag that happens at least on dialup when the list is
actually read off of the list server. *But* you can look back up to
30 days and see which servers are apparently off line.
File wise, the cache is a binary file that is stored under the
bzcache directory. Items over 30 days old are flushed *if* we
were able to updated at least that many items when we
connected to the list server. Hence 20 old items can be flushed if
we found and updated at least 20 items. This prevents a user
who rarely plays from zeroing out their cache. Also the settings in
the options menu do not affect what is saved in the cache, it just
effects what the user sees displayed under the "find" menu.
The most useful feature is that when errors happen with the list
server, the entire cache (30 days of it) is dumped into the current
listing. Hence even if your list server fails, you still have at least
*30 days* worth of servers to choose from. In this case the
options setting makes no difference, all items are shown. The
default setting in the options menu is "off" and this feature still
works in this case.
programming wise, this was done under windows w/ vc++ and
you *might* have to change things to get them to compile under
other platforms. I also moved a fair amount of items into menus.h
from menus.cxx, I believe I need at least the ServerMenu
declaration in menus.h, while perhaps the other things I moved
into the header file aren't needed there.
vs 04 16 03 source
Logged In: YES
user_id=619820
A simple way of demonstrating this is to open up the client, do a find,
close the client down. Now rename the list server name in bzflag.bzc or
whatever it is to nonsense. Now restart the client. You should see the
same list, more or less even when the client fails to find the list server.
The file name of the cache also uses the first 7 chars of Version to form
the filename hence BZFS107Servers.bzs is the file for this version in the
cache directory. As newer versions are created, the cache will be
separate for them.
improved performance of "find" menu
Logged In: YES
user_id=619820
I just vastly improved the performance of adding entries under the find
menu. It had been sorting via a horrible sorting algorithm *each* and
every time an item was added. I changed it to maintain "servers" as a
sorted list and insert in the correct place when an item was added. No
more "ugggggg.. I can't move the cursor" when it finds the items
anymore.
fstream added - some changes for unix
Logged In: YES
user_id=619820
Exchanged fstreams for FILE*, added some changes for Unix per lars
suggestions. All items that are cached are greyed out & after 1/2 hour
player counts for cached items are zeroed out -- when the cache is
saved to disk.
fixes to make GCC happy - thanks lars
Logged In: YES
user_id=619820
Have tested under linux ........ seems ok.
Logged In: YES
user_id=66583
updated to current CVS
newest version (6/1)
Logged In: YES
user_id=66583
Applied to CVS, Thanx!