summaryrefslogtreecommitdiff
path: root/src/network
AgeCommit message (Collapse)Author
2021-10-03Add: [Network] Keep the refresh button in lowered state while refreshing (#9600)Patric Stout
This gives user visual feedback that the refresh is still pending, and prevents people from clicking again and again thinking nothing is happening. This is especially true for connections that fall back to TURN, as that takes a few seconds to kick in. Additionally, prevent clicking on the button again while a refresh is pending. This is only delaying a successful result.
2021-09-19Add: [Network] external chat messages for remote admins (#9563)dP
2021-09-19Add: [Network] On join, log the ClientID + IP + Name clearly (#9558)Patric Stout
Additionally, reword the disconnect to match connect / join messages. Co-authored-by: Berbe <4251220+Berbe@users.noreply.github.com>
2021-09-11Add: support filtering content entries for patchpacks (#9541)Patric Stout
This changes nothing for us, but allows patchpacks to add the right pieces of code to start filtering content entries on patchpack only entries.
2021-09-09Fix #9535: Maintain a reverse dependency map of network content (#9538)Jonathan G Rennison
Fixes performance issues with dependency lookup when retrieving content list from the content server.
2021-09-05Fix: use-after-free after ↵Patric Stout
ClientNetworkCoordinatorSocketHandler::CloseAllConnections() (#9534) The function clears all stun-handlers. This causes all of those objects to be destroyed. A handler can have a pending connecter, which was only killed in case CloseConnection() was called. This is never the case when the object is destroyed. In result, the connecter could finish and cause a use-after-free by calling into the (now deleted) handler.
2021-09-01Fix #9388: thread unsafe use of NetworkAdminConsole/IConsolePrintRubidium
2021-08-31Fix a2051bad: SendCmdNames only sent one name per packet (#9528)Patric Stout
2021-08-28Fix: when DNS didn't resolve any IPs, the debug message was misleading (#9519)Patric Stout
2021-08-23Fix: [Network] show query errors in the server listing instead of error ↵Patric Stout
popup (#9506) When you are query several servers at once, it is rather unclear for which server you got a popup. Instead, show any errors on the server itself. This is only true for the query-part. Joining a server still gives an error popup to tell you about any issue.
2021-08-23Fix #9490: [Network] a full server couldn't be queried either (#9508)Patric Stout
You can now still query a full server, as long as the maximum amount of allowed connections isn't reached. This means that as long as there are not 255 clients connected to a server, you can always connect to query.
2021-08-23Fix #9501: [Network] crash when more than one game-info query was pending ↵Patric Stout
(#9502)
2021-08-23Fix c4b700f1: remove left-over debug statement (#9510)Patric Stout
2021-08-23Fix: [Network] don't show GameScript " (v0)" for old servers (#9507)Patric Stout
Old servers don't tell the GameScript they are running, so nothing should be shown. All values in NetworkGameInfo initialize as 0/empty, except for GS version. Someone has to be different from the rest, I guess.
2021-08-21Fix: [Network] crash when last-joined server that is no longer available (#9503)Patric Stout
If you update the server-list while not having last-joined selected and it is no longer available, the game crashed.
2021-08-19Fix d9c1d18f2: Wrong format string for console disconnect message.Michael Lutz
2021-08-18Fix #9492: show for what server a relay session is being created (#9494)Patric Stout
Currently it says "the server" which is a bit ambigious. Be more specific.
2021-08-18Fix: typo in the word "spectator" (tnx Heiki) (#9496)Patric Stout
2021-08-17Fix 6acf204d: crash when showing coordinator-error-messages (#9488)Patric Stout
2021-08-17Fix: report reuse of invite-code and switch to local game-type (#9487)Patric Stout
This prevents two servers battling for the same invite-code. Now the last one wins.
2021-08-16Fix: connecting with the same name thrice hangs the server (#9485)dP
2021-08-15Add: open Online Players GUI on starting/joining a server (#9479)Patric Stout
2021-08-14Remove: COMPANY_INFO packets and related code (#9475)Patric Stout
2021-08-14Feature: make "join game" button join the game, instead of first showing a ↵Patric Stout
lobby window (#9467) Nobody really paid attention to the lobby window, and it completely missed its purpose. Most people don't even wait for companies to show up, but just hit "New Company". This in turn means people create a lot of unneeded companies, while they "just want to watch the game" or join another company. Instead, "Join Game" now just joins the game as spectators.
2021-08-14Fix 508e465b: network servers didn't show invite-code / connection-type in ↵Patric Stout
Online Players GUI (#9478) The selector selects the first widget, which by accident was now only the server visibility.
2021-08-14Add: synchronize server name to clients and display in Online Players GUI ↵Patric Stout
(#9472)
2021-08-10Change: remove the ability to control "max spectators" (#9466)Patric Stout
Soon we will make "join game" join the game as spectator first, so limiting the amount of spectators makes no sense anymore in that context. Not sure it ever did make sense.
2021-07-21Cleanup: remove some references to the old master-serverRubidium
2021-07-21Fix: crash when joining a server again after a TCP disconnect (#9453)Patric Stout
"my_client" wasn't always free'd when a game ended. "my_client" keeps a reference inside the PT_NCLIENT pool. The rest of the code assumes that when you are not in a game, it can freely reset this pool. In result: several ways to trigger a use-after-free.
2021-07-20Feature: allow the use of TURN to connect client and server togetherPatric Stout
TURN is a last resort, used only if all other methods failed. TURN is a relay approach to connect client and server together, where openttd.org (by default) is the middleman. It is very unlikely either the client or server cannot connect to the STUN server, as they are both already connected to the Game Coordinator. But in the odd case it does fail, estabilishing the connection fails without any further possibility to recover.
2021-07-20Fix: [Network] rework when to close connections and inform Game Coordinator ↵Patric Stout
if needed
2021-07-18Feature: [Game Coordinator] Send NewGRF names to the clientRubidium
2021-07-18Feature: [Network] Optionally send NewGRF names with NewGRFs in GameInforubidium42
Before 8a2da49 the NewGRF names were synchronized using UDP packets, however those have been removed. With this a new version of the GameInfo packet is introduced that allows to specify the type of serialisation happens for NewGRFs. Either only the GRF ID and checksum, or those two plus the name of the NewGRF. On this request for local servers will send the NewGRFs names. The Game Coordinator will get the names on the first registration, and after that only the GRF ID and checksum.
2021-07-18Fix c921f6d: [Network] Documentation of Game Info packet was not updatedrubidium42
2021-07-18Remove: the concept of UnknownGRFsrubidium42
These were filled with "<Unknown>" (before 8a2da49) and later their name would get filled via UDP requests to the server. These UDP packets do not exist anymore, so they will always remain "<Unknown>". Remove that logic and just use the generic translated error GRF UNKNOWN string instead.
2021-07-17Feature: Persistant rotation of numbered auto/netsave after restart (#9397)Loïc Guilloux
It was always starting from 0 on openttd restart. Now the most recent auto/netsave number will be used as a base to generate the next filename.
2021-07-16Doc: explain in a bit more detail how we implemented STUNPatric Stout
2021-07-16Feature: allow the use of STUN to connect client and server togetherPatric Stout
This method doesn't require port-forwarding to be used, and works for most common NAT routers in home setups. But, for sure it doesn't work for all setups, and not everyone will be able to use this.
2021-07-16Codechange: allow Connect() to bind to a local addressPatric Stout
2021-07-14Add: inform clients what game-script a server is running (#9441)Patric Stout
Co-authored-by: The Dude <thedude@novapolis.net>
2021-07-11Fix: "Search LAN games" used the socket after it was closed (#9437)Patric Stout
Every outgoing connection, either TCP or UDP, triggered NetworkInitialize(), which triggered NetworkUDPInitialize() which first closes all connections. Now the problem was that "Search LAN games" found a server, added it to the list, after which (over TCP) it queries the server. This closes all UDP sockets (as that makes sense, I guess?), while the UDP was still reading from it. Solve this by simply stop initializing UDP every time we make an outgoing TCP connection; instead only do it on start-up.
2021-07-11Remove: includes to network/core/config.h from headers when only three cpp ↵Rubidium
files need it
2021-07-11Add: allow setting your server visibility to "invite-only" (#9434)Patric Stout
In this mode you do register to the Game Coordinator, but your server will not show up in the public server listing. You can give your friends the invite code of the server with which they can join.
2021-07-11Feature: join servers based on their invite codePatric Stout
This removes the need to know a server IP to join it. Invite codes are small (~7 characters) indentifiers for servers, which can be exchanged with other players to join the servers.
2021-07-11Change: groundwork to allow ServerAddress to use invite codesPatric Stout
Normally TCPConnecter will do a DNS resolving of the connection_string and connect to it. But for SERVER_ADDRESS_INVITE_CODE this is different: the Game Coordinator does the "resolving". This means we need to allow TCPConnecter to not setup a connection and allow it to be told when a connection has been setup by an external (to TCPConnecter) part of the code. We do this by telling the (active) socket for the connection. This means the rest of the code doesn't need to know the TCPConnecter is not doing a simple resolve+connect. The rest of the code only cares the connection is established; not how it was established.
2021-07-11Codechange: track servers with a ServerAddress instead of a NetworkAddressPatric Stout
This allows future extensions to have different ways of referencing a server, instead of forcing to use IP:port.
2021-07-11Feature: raise the maximum NewGRF limit to 255Patric Stout
2021-07-10Feature: allow setting (game) coordinator and content server connection ↵Rubidium
strings using environment variables OTTD_COORDINATOR_CS for the game coordinator defaults to coordinator.openttd.org:3976 OTTD_CONTENT_SERVER_CS for the content server defaults to content.openttd.org:3978 OTTD_CONTENT_MIRROR_CS for the content mirror server defaults to binaries.openttd.org:80
2021-07-10Cleanup: remove unused optional ctor parameter for NetworkGameListPatric Stout
2021-07-10Remove: unused UDP protocol partsPatric Stout