summaryrefslogtreecommitdiff
path: root/src/network/network_func.h
AgeCommit message (Collapse)Author
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-10Remove: old server announcement to Master ServerPatric Stout
As we now use the Game Coordinator for announcements, there is no longer a need to use the Master Server for this.
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-05-30Codechange: [Network] Use std::string to send the client name and rcon commandsrubidium42
2021-05-30Codechange: [Network] Use std::string for server side logic of kicking and ↵rubidium42
banning clients
2021-05-30Codechange: [Network] Let server rcon result use std::stringrubidium42
2021-05-30Codechange: [Network] Let server changing a client name use std::stringrubidium42
2021-05-29Fix: [Network] Prevent an empty server name to be set anywhererubidium42
2021-05-29Codechange: use separate pre and post callbacks for string settingsrubidium42
2021-05-15Codechange: [Network] Let chat communication 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 company ↵rubidium42
passwords
2021-05-13Codechange: move client name in settings to std::stringrubidium42
2021-05-08Codechange: [Network] Change ChatMessage's message to std::string and ↵rubidium42
simplify some code
2021-05-06Codechange: [Network] Move connection string parsing away from C-stringsrubidium42
2021-05-05Change: [Network] Update server's NetworkServerGameInfo only when neededrubidium42
Split the updating in a "static" version that only needs to be called when a new map is loaded or some settings are changed, and a "dynamic" version that updates everything that changes regularly such as the current game date or the number of spectators.
2021-05-01Fix #6598: Prevent invalid memory accesses when abandoning a join from ↵rubidium42
within a network game One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list. Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
2021-05-01Change: [Console] Show help when passing invalid company numberrubidium42
2021-04-29Change: [Network] Encapsulate logic about the connection string to the ↵rubidium42
network code (#23)
2021-04-29Codechange: use NetworkAddress instead of two host/port variables where possiblePatric Stout
This also means we no longer need last_host/last_port, but can just use a single last_joined setting.
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-27Codechange: [Network] Do not leak os_abstraction.h via network_funcrubidium42
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-20Codechange: split ParseConnectionString into two functionsPatric Stout
One also looks for a company, the other doesn't. There were more uses of the latter than the first, leaving very weird code all over the place.
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-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.
2015-09-19(svn r27400) -Fix [FS#6368] (r26449): when a dedicated server was paused ↵rubidium
with no clients the tick length was increased significantly, making any assumptions about the tick length used further down in the code are not true anymore. One of such assumptions was that one should readvertise every 15 minutes worth of original ticks, but due to the lengthening this timeframe would be more like 45-60 minutes. Now we'll take the operating system's millisecond counter instead
2014-09-07(svn r26788) -Add: Desync replay option to skip/replay failed commandsfrosch
2014-05-11(svn r26576) -Fix [FS#6003]: [Network] AIs would not reset certain network ↵rubidium
state information upon creation of their company
2014-02-23(svn r26370) -Doc: Desync debugging and command replaying.frosch
2012-01-04(svn r23751) -Codechange: rename NetworkUDPGameLoop to a more descriptive ↵rubidium
name, and move the UDP specific bits to network_udp
2011-08-13(svn r22738) -Fix [FS#4722] (r21854): Setting company passwords via the GUI ↵frosch
on servers (including starting a company with the default password) failed, so no client could join.
2011-04-22(svn r22366) -Codechange: make GetClientIP a function of the server's ↵rubidium
ClientSocket, after all the Socket is the bit that's associated with the network
2011-04-22(svn r22365) -Codechange: add overload of NetworkServerKickOrBanIP using the ↵rubidium
ClientID, which later resolves the IP address to ban. This to consolidate the knowledge about resolving IP addresses
2011-04-22(svn r22362) -Codechange: NetworkFindClientInfoFromClientID -> ↵rubidium
NetworkClientInfo::GetByClientID
2011-01-19(svn r21854) -Codechange: refactor the password setting methods to make it ↵rubidium
possible to change the password of other companies (on the server)
2011-01-03(svn r21701) -Codechange: ConsoleColour = TextColour, so make it that way ↵rubidium
and remove some unneeded casts
2010-12-14(svn r21512) -Change/Feature: make the delay of the chat messages timing out ↵rubidium
unrelated to the number of passed game days, i.e. don't stop aging chat messages when the server is paused
2010-10-17(svn r20973) -Add: chat sending and receiving support for remote admins ↵rubidium
(dihedral)
2010-10-17(svn r20967) -Add: infrastructure to send information to remote admins at ↵rubidium
specific intervals (dihedral)
2010-10-17(svn r20966) -Change: enable remote administration sockets (parts by Yexo ↵rubidium
and dihedral)
2010-08-29(svn r20689) -Codechange: Make some global functions used in 1 .cpp file ↵alberth
static in that file.
2010-08-29(svn r20678) -Codechange: Remove unused NetworkFindClientInfoFromIndex(), ↵alberth
NetworkFindClientInfoFromIP().
2010-08-28(svn r20674) -Codechange: Remove declared functions that do not exist ↵alberth
(anymore) otherwise.
2010-05-13(svn r19818) -Fix [FS#3784](r16004): kicking clients by IP didn't worksmatz
2010-04-17(svn r19651) -Fix [FS#3745]: when a company is sold, move connected clients ↵smatz
to spectators
2010-02-10(svn r19075) -Codechange: unhackify NetworkChangeCompanyPassword()smatz