summaryrefslogtreecommitdiff
path: root/src/network/network_func.h
AgeCommit message (Collapse)Author
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
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-12(svn r18052) -Codechange/Fix: make the 'pause' chat message when actually ↵rubidium
executing the pause command. This to prevent showing paused and especially unpaused to be shown when the state doesn't change. Output now mentions whether pause changes keep the game paused and what reasons for pausing there 'currently' are.
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-17(svn r17562) -Fix [FS#2972]: the NewGRF settings of (remote) network games ↵rubidium
did not get properly updated when the NewGRFs were rescanned causing reading of freed data
2009-08-21(svn r17248) -Fix: add GPL license notice where appropriaterubidium
2009-06-10(svn r16555) -Feature [FS#570]: ability to enter server and company password ↵smatz
via command line when joining a server (based on patch by Progman, Ammler and planetmaker)
2009-05-19(svn r16360) -Codechange: don't use _network_playas as a 'second' ↵rubidium
_local_company, but only as a storage location for the company you want to join in MP.
2009-05-10(svn r16269) -Codechange: use gcc's ability to check parameters sent to ↵smatz
printf-like functions -Fix: wrong number of parameters or wrong parameter types sent to printf-like functions at several places
2009-04-10(svn r16022) -Fix (r15159): sometimes the unregister "query" thread could be ↵rubidium
delayed so much that the network stuff was already closed and the packet would never reach the master server causing the server to appear online longer than necessary.
2009-04-10(svn r16014) -Feature(-ish): allow binding to several IPs; ↵rubidium
[network]:server_bind_ip doesn't exist anymore. Add the IPs/hostnames to [server_bind_addresses]
2009-04-04(svn r15947) -Codechange: replace uint32 client_ip with NetworkAddress ↵rubidium
client_address.
2009-04-03(svn r15931) -Codechange: let the host and ban lists use of SmallVector.rubidium
2009-03-19(svn r15773) -Fix [FS#2475]: number of active clients wasn't always properlyrubidium
2009-03-06(svn r15628) -Fix [FS#2705]: kicking/banning a client from the Client list ↵smatz
window crashed the server
2009-02-09(svn r15425) -Codechange: some color->colour changes and type safety.rubidium
2009-01-23(svn r15242) -Feature: allow moving clients between companies/spectators by ↵rubidium
the server and the clients themselves (dihedral)
2009-01-21(svn r15200) -Feature: give server admins a tool to combat profanity in nick ↵rubidium
names (based on patch by dihedral)
2009-01-20(svn r15163) -Change/Fix: use a non-blocking method to resolve the hostname ↵rubidium
and connect to game servers.
2009-01-20(svn r15157) -Codechange: wrap the hostname/ip and port into a single ↵rubidium
structure so we can pass either one of them and not convert an ip to a string and then back again.
2009-01-19(svn r15155) -Codechange: remove unused return valuerubidium
2009-01-10(svn r14949) -Cleanup: pointer coding stylerubidium
2008-12-29(svn r14764) -Codechange: make the '***' chat messages like "Game paused ↵rubidium
(not enough players)" fully translateable.