Commit Graph

35 Commits

Author SHA1 Message Date
Rubidium 72a44b0df6 Codechange: use references for handling received TCP packets 2024-02-05 16:30:49 +01:00
Rubidium c77a45ed86 Codechange: use std::unique_ptr for receiving network packets 2024-02-05 16:30:49 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Jonathan G Rennison 19ae88fb63 Fix: Error logging in game and admin server HandlePacket
Don't invent a packet type in the log message if we can't/don't
read a packet type at all.
Fix packet type not being logged when appropriate.
2023-06-25 12:02:32 +01:00
dP 31cf9e888b
Add: [Network] external chat messages for remote admins (#9563) 2021-09-19 23:09:06 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
rubidium42 8a918ce170 Codechange: [Network] Make admin name and version std::string 2021-05-30 10:15:22 +02:00
Patric Stout a403653805
Codechange: [Network] split CloseSocket and CloseConnection more clearly (#9261)
* 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-13 11:46:51 +02:00
Patric Stout b136e65cf9
Change: reworked the debug levels for network facility (#9251)
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-12 16:34:02 +02:00
Patric Stout 36e22f3a7b
Fix: [Network] clients leaving because of broken connections was not 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-11 12:26:16 +02:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
glx22 82573a5e73
Fix #8117: Memory leak in admin port (#8122) 2020-05-07 02:00:53 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
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.
2019-03-20 19:24:55 +01:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
rubidium 2e54c8fdfa (svn r26056) -Fix: a number of possibly uninitialised variables 2013-11-22 21:50:43 +00:00
planetmaker 7686587f02 (svn r25588) -Feature [FS#5643]: PING and PONG packets for admin port (Xaroth) 2013-07-11 20:31:39 +00:00
planetmaker 4a1bf704ee (svn r25587) -Add FS#5643: Conclude rcon output sent to admin clients with an RCON_END packet (Xaroth) 2013-07-11 19:57:40 +00:00
truebrain 3a535690d4 (svn r23623) -Add: allow bi-directional communication with the AdminPort and GameScript 2011-12-19 21:00:32 +00:00
rubidium de27205e6c (svn r23031) -Fix [FS#4804]: for the admin "bots" there was no distinction between bankruptcy and manual removal of companies even though the API suggested that 2011-10-15 20:42:32 +00:00
rubidium 99ec3a044a (svn r22403) -Document: some more network/core code 2011-05-01 13:29:40 +00:00
rubidium b2efd73773 (svn r22398) -Codechange: remove some defines from the tcp/admin code, so doxygen can create better documentation 2011-05-01 11:01:57 +00:00
rubidium 6546561360 (svn r21668) -Feature: command logging using the admin interface (dihedral) 2010-12-30 18:14:37 +00:00
rubidium b6c2216749 (svn r21358) -Codechange: make some network function names conform to coding style 2010-11-30 13:38:46 +00:00
rubidium a5d414a734 (svn r20975) -Add: logging of console output for remote admins (dihedral) 2010-10-17 17:43:01 +00:00
rubidium ad12a91cda (svn r20974) -Add: remote console (rcon) for remote admins (dihedral) 2010-10-17 17:41:52 +00:00
rubidium d9602f4ef9 (svn r20973) -Add: chat sending and receiving support for remote admins (dihedral) 2010-10-17 17:40:18 +00:00
rubidium 459514afe4 (svn r20972) -Add: company statistics updates at intervals to remote admins (dihedral) 2010-10-17 17:38:41 +00:00
rubidium ca5d9f7002 (svn r20971) -Add: company economy updates at intervals to remote admins (dihedral) 2010-10-17 17:38:16 +00:00
rubidium ae20cb4f3d (svn r20970) -Add: company change notification to remote admins (dihedral) 2010-10-17 17:37:45 +00:00
rubidium fe44944f32 (svn r20969) -Add: client info change notification to remote admins (dihedral) 2010-10-17 17:37:26 +00:00
rubidium 901c4a56bd (svn r20968) -Add: date notification of remote admins (dihedral) 2010-10-17 17:36:59 +00:00
rubidium b4ce7fad7f (svn r20967) -Add: infrastructure to send information to remote admins at specific intervals (dihedral) 2010-10-17 17:36:23 +00:00
rubidium 33ed4ddbfb (svn r20963) -Add: stubs for a remote administration connection 2010-10-17 17:31:03 +00:00