summaryrefslogtreecommitdiff
path: root/src/network/network_client.cpp
AgeCommit message (Collapse)Author
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
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2021-01-05Change: move "give money" from client-list to company windowPatric Stout
This is a much better location for this button, as you send money from one company to another company, not from player to player. This is based on work done by JGRPP in: https://github.com/JGRennison/OpenTTD-patches/commit/f82054339124cc6b89c5f4f9dac2d9da62f0108b and surrounding commits, which took the work from estys: https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311 We did modify it to fix several bugs and clean up the code while here anyway. The callback was removed, as it meant a modified client could prevent anyone from seeing money was transfered. The message is now generated in the command itself, making that impossible.
2021-01-02Fix: prevent clients making emergency saves twice if server disconnects (#8477)Patric Stout
This was clearly overlooked during the initial implementation.
2020-12-27Codechange: Convert some more FIO functions to take std::string.Michael Lutz
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2020-12-16Change: send network error to the server before making an emergency save (#8387)Pavel Stupnikov
2020-02-04Feature #7756: Allow server to supply a reason to kicked/banned clientsBjarni Thor
This commit adds the missing feature of allowing the server owner to provide a reason for kicking/banning a client, which the client sees in a pop-up window after being kicked. The implementation extends the network protocol by adding a new network action called NETWORK_ACTION_KICKED that is capable of having an error string, unlike the other network error packages. Additionally, the kick function broadcasts a message to all clients about the kicked client and the reason for the kick.
2019-12-21Codechange: Replace network related FOR_ALL with range-based for loopsglx
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-04-29Codechange: Remove Company/OwnerByte typesCharles Pigott