summaryrefslogtreecommitdiff
path: root/src/network/network_client.cpp
AgeCommit message (Collapse)Author
2021-10-19Fix #9624: compilation with RANDOM_DEBUGglx22
2021-09-19Add: [Network] external chat messages for remote admins (#9563)dP
2021-08-23Fix #9501: [Network] crash when more than one game-info query was pending ↵Patric Stout
(#9502)
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-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-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-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-10Codechange: use UpdateNetworkGameWindow() over manually marking window dirtyPatric Stout
2021-07-09Add #9188: netsave now keeps multiple version around, similar to autosave ↵Stephan
(#9395)
2021-06-26Codechange: [Network] Remove overload on NetworkValidateClientNamerubidium42
Rename the zero-parameter NetworkValidateClientName to NetworkValidateOurClientName to make it clearer it is performed on our client name, and to make it a non-overloaded function to aid with the variant being added a few commits later
2021-06-13Codechange: replace IConsolePrintF with IConsolePrint and fmt formattingrubidium42
Also make some strings more consistent with the rest of the console strings.
2021-06-13Change: improve some of the console messages related to networking (make ↵rubidium42
them more uniform) and convert to fmt
2021-06-13Codechange: convert printf DEBUG statements to fmt Debug statementsrubidium42
2021-05-30Codechange: [Network] Use std::string to determine an unique name for clientsrubidium42
2021-05-30Codechange: [Network] Use std::string to send the client name and rcon commandsrubidium42
2021-05-29Codechange: Rename window related DeleteXXX to match new behaviourglx22
2021-05-29Codechange: [Network] Use std::string in CommandPacketrubidium42
2021-05-29Codechange: use separate pre and post callbacks for string settingsrubidium42
2021-05-16Codechange: [Network] Let NetworkClientInfo use std::stringrubidium42
2021-05-16Codechange: [Network] Let NetworkCompanyInfo use std::stringrubidium42
2021-05-15Codechange: [Network] Let chat communication use std::stringrubidium42
2021-05-15Codechange: [Network] Let NetworkTextMessage use std::stringrubidium42
2021-05-14Codechange: [Network] Pass passwords as std::string to the network coderubidium42
2021-05-14Codechange: [Network] Use std::string for the internal handling of ↵rubidium42
admin/rcon passwords
2021-05-14Codechange: [Network] Use std::string for the internal handling of server ↵rubidium42
passwords
2021-05-14Codechange: [Network] Use std::string for the internal handling of company ↵rubidium42
passwords
2021-05-13Codechange: move client name in settings to std::stringrubidium42
2021-05-13Codechange: [Network] split CloseSocket and CloseConnection more clearly (#9261)Patric Stout
* Codechange: [Network] split CloseSocket and CloseConnection more clearly - CloseSocket now closes the actual OS socket. - CloseConnection frees up the resources to just before CloseSocket. - dtors call CloseSocket / CloseConnection where needed.
2021-05-12Change: reworked the debug levels for network facility (#9251)Patric Stout
It now follows very simple rules: 0 - Fatal, user should know about this 1 - Error, but we are recovering 2 - Warning, wrong but okay if you don't know 3 - Info, information you might care about 4 - 5 - Debug #1 - High level debug messages 6 - Debug #2 - Low level debug messages 7 - Trace information
2021-05-11Fix: [Network] clients leaving because of broken connections was not ↵Patric Stout
broadcasted (#9238) The code mixed up "client has quit but we already told everyone" with "client lost connection, handle this". Split up those two signals: - CLIENT_QUIT means we told everyone and the connection is now dead - CONNECTION_LIST means we should tell everyone we lost a client
2021-05-08Change: Use gender-neutral pronouns in console command messages (and ↵William Davis
comments) (#9203)
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-01Codechange: Move join information into a single structurerubidium42
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-27Change: no longer use UDP when entering the lobby of a serverPatric Stout
The lobby of a server requested some parts via UDP and some via TCP. This is strictly seen fine, but for future extensions it is a lot easier if just one protocol is used.
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-24Feature: rework in-game Online Players GUIPatric Stout
The GUI now more clearly shows some basic information about the server you joined, your client name (and the ability to change it), and what players are in which company. It also contains useful buttons to press to join companies, chat with other people, and for admins to kick/ban people. Additionally, renamed "advertised" to "visibility"; this has to do with future additions, but also because it is more clear in wording.
2021-04-24Codechange: encapsulate writing data from Packets into sockets/files/buffers ↵Rubidium
to prevent packet state modifications outside of the Packet
2021-04-24Codechange: move logic whether there is enough space in a packet to write ↵Rubidium
data into the Packet
2021-04-24Add: [Network] Validate the client name when receiving one from the serverrubidium42
This so names from other clients are known valid in the client as well, instead allowing some compromised/bad server to potentially crash clients upon certain expectations.
2021-04-24Add: [Network] Validate the client name server side, so no clients with ↵rubidium42
invalid names can actually join
2021-04-24Change: [Network] Prevent invalid client names being sent to the server when ↵rubidium42
changing it using the console/settings
2021-04-24Feature: [Network] Ensure players fill in a name instead of defaulting to ↵rubidium42
"Player"
2021-04-24Codechange: [Network] Introduce function to validate the client namerubidium42
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-02-27Codechange: [Network] replace _realtime_tick with std::chronoPatric Stout