summaryrefslogtreecommitdiff
path: root/src/network/network_internal.h
AgeCommit message (Collapse)Author
2021-07-10Add: use Game Coordinator to annouce public serversPatric Stout
2021-07-10Codechange: track version of network servers to prune once out-of-datePatric Stout
2021-05-30Codechange: [Network] Use std::string to determine an unique name for clientsrubidium42
2021-05-15Codechange: [Network] Let NetworkTextMessage use std::stringrubidium42
2021-05-14Codechange: [Network] Use std::string for the internal handling of company ↵rubidium42
passwords
2021-05-09Fix: lobby window doesn't close if no connection could be established (#9223)Patric Stout
2021-05-08Fix: only query a manually added server if it isn't there yetPatric Stout
But always mark it as manually, no matter if it was there or not.
2021-05-06Feature: use Happy Eyeballs to make network connections (TCP-only) (#9199)Patric Stout
Hostnames like "content.openttd.org" resolve into multiple IPv4 and IPv6. It is possible that either of the IPs is not working, either due to a poorly configured OS (having IPv6 but no valid route), broken network paths, or a service that is temporary unavailable. Instead of trying the IPs one by one, waiting for a 3s timeout between each, be a bit more like browsers, and stack attempts on top of each other with slight delays. This is called Happy Eyebells. Initially, try the first IPv6 address. If within 250ms there is no connection yet, try the first IPv4 address. 250ms later, try the second IPv6 address, etc, till all addresses are tried. If any connection is created, abort all the other (pending) connections and use the one that is created. If all fail 3s after the last connect(), trigger a timeout for all.
2021-05-06Codechange: [Network] Move connection string parsing away from C-stringsrubidium42
2021-05-05Codechange: use connection_string in favour of NetworkAddress (#9197)Patric Stout
We now resolve the connection_string to a NetworkAddress in a much later state. This means there are fewer places constructing a NetworkAddress. The main benefit of this is in later PRs that introduce different types of NetworkAddresses. Storing this in things like NetworkGameList is rather complex, especially as NetworkAddress has to be mutable at all times. Additionally, the NetworkAddress is a complex object to store simple information: how to connect to this server.
2021-05-01Codechange: rename NetworkError to ShowNetworkErrorrubidium42
2021-05-01Change: [Console] Show help when passing invalid company numberrubidium42
2021-04-30Change: use TCP for everything except for master-server and initial server ↵Patric Stout
scan (#9130) This means that pressing Refresh button and adding servers manually now uses TCP. The master-server and initial scan are still UDP as they will be replaced by Game Coordinator; no need to change this now. If we query a server that is too old, show a proper warning to the user informing him the server is too old.
2021-04-29Change: [Network] Encapsulate logic about the connection string to the ↵rubidium42
network code (#23)
2021-04-27Codechange: move all NetworkGameInfo related functions to a single filePatric Stout
It currently was a bit scattered over the place. Part of NetworkGameInfo is also the GRF Identifiers that goes with it.
2021-04-20Remove: "language" field from server/clientPatric Stout
The original idea was that people could find a server they could talk in their native language on. This isn't really used in that way. There are several reasons for removing this: - the client also sends his "language" to the server, but nothing is doing anything with this. - flags are a bad way to represent languages, and over the years we had several (rightfully) complaints about this. - most servers have their language set to "All", and prefix the servername with the language it is about. This is a much more efficient way to do the same. All in all, this feature should go back to the drawing board. Maybe it could work in another form, but this form is not it.
2021-04-12Change: move some things only relevant to UDP from network.cpp to ↵Rubidium
network_udp.cpp
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-04-10Codechange: Use null pointer literal instead of the NULL macroHenry Wilson
2019-03-20Remove: ENABLE_NETWORK switchPatric Stout
This switch has been a pain for years. Often disabling broke compilation, as no developer compiles OpenTTD without, neither do any of our official binaries. Additionaly, it has grown so hugely in our codebase, that it clearly shows that the current solution was a poor one. 350+ instances of "#ifdef ENABLE_NETWORK" were in the code, of which only ~30 in the networking code itself. The rest were all around the code to do the right thing, from GUI to NewGRF. A more proper solution would be to stub all the functions, and make sure the rest of the code can simply assume network is available. This was also partially done, and most variables were correct if networking was disabled. Despite that, often the #ifdefs were still used. With the recent removal of DOS, there is also no platform anymore which we support where networking isn't working out-of-the-box. All in all, it is time to remove the ENABLE_NETWORK switch. No replacement is planned, but if you feel we really need this option, we welcome any Pull Request which implements this in a way that doesn't crawl through the code like this diff shows we used to.
2014-04-23(svn r26488) -Codechange: perform the appropriate length checks when getting ↵rubidium
a client name
2014-02-23(svn r26370) -Doc: Desync debugging and command replaying.frosch
2013-11-23(svn r26057) -Fix: a number of possibly uninitialised variablesrubidium
2013-11-22(svn r26056) -Fix: a number of possibly uninitialised variablesrubidium
2012-03-25(svn r24070) -Fix [FS#5098]: the 'last joined' server was not properly ↵rubidium
selected anymore (adf88)
2012-01-22(svn r23843) -Fix: minor issue with replaying ;)rubidium
2012-01-17(svn r23822) -Fix-ish: when replaying make sure companies get created even ↵rubidium
if their creating client doesn't exist during the replay
2011-05-05(svn r22424) -Document: some more bitsrubidium
2011-04-22(svn r22363) -Codechange: NetworkFindClientStateFromClientID -> ↵rubidium
NetworkClientSocket::GetByClientID
2011-01-22(svn r21886) -Codechange: move documentation towards the code to make it ↵rubidium
more likely to be updated [n].
2011-01-19(svn r21853) -Codechange: HashCurrentCompanyPassword is only used by ↵rubidium
servers, so move it to network_server.* (dihedral)
2011-01-03(svn r21701) -Codechange: ConsoleColour = TextColour, so make it that way ↵rubidium
and remove some unneeded casts
2010-10-24(svn r21029) -Codechange: split the map downloading packet + 3-state enum ↵rubidium
into 3 separate packets
2010-10-15(svn r20936) -Codechange: make server side packet sending methods class methodsrubidium
2010-10-15(svn r20935) -Codechange: only let the server side use a pool of connected ↵rubidium
sockets
2010-10-15(svn r20934) -Codechange: move NetworkGetClientName to the server's socketrubidium
2010-10-15(svn r20933) -Codechange: move some more client related methods and such to ↵rubidium
network_client.cpp
2010-10-15(svn r20929) -Codechange: make NetworkCloseClient a class methodrubidium
2010-10-15(svn r20925) -Codechange: make the client send commands have a slightly more ↵rubidium
sensible name
2010-08-28(svn r20674) -Codechange: Remove declared functions that do not exist ↵alberth
(anymore) otherwise.
2010-08-18(svn r20549) -Codechange: centralise the handling of the incoming commands ↵rubidium
(from clients and the server)
2010-04-13(svn r19620) -Fix: desync when a command is received and in the queue while ↵rubidium
a client starts joining, i.e. save the game state. This can happen in two ways: with frame_freq > 1 a command received in a previous frame might not be executed yet or when a command is received in the same frame as the join but before the savegame is made. In both cases the joining client would not get all commands to get in-sync with the server (and the other clients).
2010-04-10(svn r19596) -Fix (r19593): dedicated server always fast forwarding if ↵glx
compiled without DEBUG_DUMP_COMMANDS
2010-04-09(svn r19593) -Codechange: improve loading/executing the desync logsrubidium
2010-02-09(svn r19072) -Fix [FS#3599]: possible read/write after free when the client ↵rubidium
triggered the server to close the connection
2010-01-15(svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, ↵rubidium
if a header require a header make it include that header
2009-11-23(svn r18251) -Codechange: make the join status window big font awarerubidium
2009-11-09(svn r18027) -Codechange: make some unneededly global variables static and ↵rubidium
remove some unused variables
2009-10-04(svn r17699) -Codechange: move #ifdef ENABLE_NETWORK till after the ↵rubidium
'generic' includes so compilation without network support doesn't get broken as easily by changes in header files
2009-09-22(svn r17617) -Codechange: make the server side packet handling be more like ↵rubidium
the client side's handling, i.e. return the connection status -Fix: do not do invalid reads when a packet handling function closed a connection