Commit Graph

39 Commits

Author SHA1 Message Date
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Michael Lutz a05fd7aa50 Change: [Network] Transfer command data as serialized byte stream without fixed structure.
The data will be transmitted as the length followed by the serialized data. This allows the command
data to be different for every command type in the future.
2021-12-16 22:28:32 +01:00
rubidium42 bb8fd00760 Cleanup: [Network] Remove C-string Recv_string and its last use 2021-06-10 21:53:19 +02:00
rubidium42 7bcc472f73 Add: [Network] Reading std::string from a packet 2021-05-03 17:56:05 +02:00
rubidium42 ba409e8c45 Add: [Network] Writing std::string to a packet 2021-05-03 17:56:05 +02:00
Milek7 a341852cd5
Fix: missing <limits> include in network/core/packet.h (#9123) 2021-04-27 23:22:03 +01:00
Rubidium d6000c2ec5 Codechange: differentiate between UDP, TCP and compatibility MTU values 2021-04-25 21:27:54 +02:00
Rubidium 8b302761d4 Codechange: allow different limits in packet sizes 2021-04-25 21:27:54 +02:00
Rubidium 75386873b7 Codechange: use std::vector instead of a fixed size array for Packets 2021-04-24 20:42:01 +02:00
Rubidium 450178d780 Codechange: add accessor for the packet type to Packet and make the internal state of Packet private 2021-04-24 20:42:01 +02:00
Rubidium 3abefdf561 Codechange: remove public access to the next pointer in Packet 2021-04-24 20:42:01 +02:00
Rubidium f71fb0f54a Codechange: encapsulate reading the size of a Packet 2021-04-24 20:42:01 +02:00
Rubidium 6f161f6559 Codechange: encapsulate the logic about how many bytes can be sent from a buffer in to a Packet 2021-04-24 20:42:01 +02:00
Rubidium d4f027c03b Codechange: encapsulate writing data from Packets into sockets/files/buffers to prevent packet state modifications outside of the Packet 2021-04-24 20:42:01 +02:00
Rubidium 98aa561cf7 Codechange: encapsulate reading data from sockets into Packets to prevent packet state modifications outside of the Packet 2021-04-24 20:42:01 +02:00
Rubidium a2051bad50 Codechange: move logic whether there is enough space in a packet to write data into the Packet 2021-04-24 20:42:01 +02:00
Rubidium c545cc9d70 Codechange: move more logic about packet size validity and reading into Packet 2021-04-24 20:42:01 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00: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 fefe22b4aa (svn r23590) -Codechange: make the string validation settings better expandable 2011-12-18 18:37:54 +00:00
rubidium 536c581923 (svn r22401) -Codechange: replace some defines in the udp code so doxygen can create better documentation 2011-05-01 12:18:34 +00:00
rubidium 9c83a8975f (svn r21357) -Codechange: make it possible to resize the packet's buffer 2010-11-30 13:22:29 +00:00
frosch 4bd32799f1 (svn r20286) -Codechange: Unify end of doxygen comments. 2010-08-01 19:44:49 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
smatz eb72a0095f (svn r17746) -Codechange: 'operator new' doesn't return NULL, NetworkSend_Init() is useless 2009-10-09 11:03:00 +00:00
rubidium 5ff6053326 (svn r17699) -Codechange: move #ifdef ENABLE_NETWORK till after the 'generic' includes so compilation without network support doesn't get broken as easily by changes in header files 2009-10-04 20:00:56 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium 07e135547e (svn r15135) -Fix/Change: allow str_validate (part of receiving strings from the network) to pass newlines instead of replacing them with question marks, but only when asked to do so. 2009-01-18 13:12:57 +00:00
rubidium 11da45ee55 (svn r14949) -Cleanup: pointer coding style 2009-01-10 00:31:47 +00:00
rubidium 36bb92ae24 (svn r9050) -Codechange: Foo(void) -> Foo() 2007-03-07 11:47:46 +00:00
celestar 0ed4b64e64 (svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives). 2007-02-23 08:37:33 +00:00
rubidium 500f9a971a (svn r8546) -Codechange: add a seperate (wrapper) functions to send/receive booleans. 2007-02-02 23:16:58 +00:00
rubidium 16ce6def09 (svn r8523) -Codechange: move all the Network(Recv|Send)_(uintXX|string) functions to Packet. 2007-02-01 23:26:44 +00:00
rubidium 99f860e686 (svn r8521) -Codechange: initial step in converting Packet to a class; make and use constructors and functions related to the reading/saving the packet size. 2007-02-01 22:30:35 +00:00
KUDr f9462a50e9 (svn r8479) -Fix (r8459): Silenced VC warning C4099: 'Packet' : type name first seen using 'class' now seen using 'struct'
-Codechange: 'typedef struct Packet' changed to 'struct Packet'
2007-01-31 09:51:22 +00:00
rubidium f66b373b52 (svn r8083) -Codechange: make a NetworkSocketHandler as base for all sockets and move a little of NetworkClientState functionality to the NetworkSocketHandler. Move the rest of the NetworkClientState to the new NetworkTCPSocketHandler class/struct, which is not yet implemented in an object oriented manner. The UDP socket handler now extends the NetworkSocketHandler instead of having a reference to a NetworkClientState. 2007-01-12 20:19:49 +00:00
rubidium 73079f83bc (svn r7836) -Codechange: some constness for network/core. 2007-01-04 21:48:52 +00:00
rubidium b2f85eb044 (svn r7834) -Codechange: cleanup the includes of network/core a little; include headers in headers when the header needs types/constants defined in them. 2007-01-04 21:21:14 +00:00
rubidium 66bbf336c6 (svn r7759) -Merge: makefile rewrite. This merge features:
- A proper ./configure, so everything needs to be configured only once, not for every make.
 - Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies.
 - A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC.
 - Proper support for OSX universal binaries.
 - Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files.
 - Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files.

Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy.
2007-01-02 19:19:48 +00:00
Renamed from network/core/packet.h (Browse further)