Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server IP cache #1154

Closed
heinrich5991 opened this issue Sep 23, 2013 · 4 comments
Closed

Server IP cache #1154

heinrich5991 opened this issue Sep 23, 2013 · 4 comments

Comments

@heinrich5991
Copy link
Contributor

For situations where the masters are down, it would be nice to have the server lists from previous sessions cached.

@minus7
Copy link
Member

minus7 commented Jan 5, 2015

A more detailed explanation: When Teeworlds is started and the master servers are not reachable, no server list is available. The suggestion is to save the list of servers to a file on disk when it is received from the master servers, so on later starts of the game this list can be used as a fallback.
(@winterismute)

@heinrich5991
Copy link
Contributor Author

Always reading the server list from disk and only updating it with the master servers seems to be the best version – it can start up immediately and only later request the server lists.

@winterismute
Copy link
Contributor

Ok, I had some more free time.
I have decided to do this first and then when this is kind of finalized move to #1281 . The commit, if I did not overlook something fundamental, should implement the feature. We read the initial servers from a file, and after every server list update, we also save to file to update this "cache".

The only thing is that I can not test it fully (I can only verify stuff gets loaded and saved) because from master I am afraid I have to do something in order to get a correct list of server from the master servers because there was some retro-compatibility going on. Could somebody point me to what I should change in the code to have server coming from the master servers?

@Henningstone
Copy link
Contributor

Henningstone commented Feb 12, 2016

I wonder if anybody is still interested in this?

I implemented it here: https://github.com/Henningstone/AllTheHaxx/blob/master/src/engine/client/serverbrowser.cpp#L700-L824
It works very well and saves quite everything. I load the serverlist from cache at client startup instead of requesting it, so the client provides it instantly. No need to wait 20 seconds for 1000 servers any longer.

I can create a revised version for vanilla 0.7 if you like. To try it, just download and compile AllTheHaxx source code ;)

@oy oy added this to the 0.7.1 milestone Nov 19, 2018
oy added a commit that referenced this issue Nov 19, 2018
@oy oy closed this as completed Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants