Commit Graph

548 Commits

Author SHA1 Message Date
Patric Stout cee8174d02 Codechange: track servers with a ServerAddress instead of a NetworkAddress
This allows future extensions to have different ways of referencing
a server, instead of forcing to use IP:port.
2021-07-11 20:38:42 +02:00
Patric Stout f4dd2d88c7 Feature: raise the maximum NewGRF limit to 255 2021-07-11 12:16:07 +02:00
Rubidium e99134654b Feature: allow setting (game) coordinator and content server connection strings using environment variables
OTTD_COORDINATOR_CS for the game coordinator defaults to coordinator.openttd.org:3976
OTTD_CONTENT_SERVER_CS for the content server defaults to content.openttd.org:3978
OTTD_CONTENT_MIRROR_CS for the content mirror server defaults to binaries.openttd.org:80
2021-07-10 23:09:45 +02:00
Patric Stout 6212d0a8da Remove: unused UDP protocol parts 2021-07-10 20:17:07 +02:00
Patric Stout 8a2da49413 Remove: old server listing via Master Server
This removes all UDP from the game except for a local broadcast
to find LAN games.

So long Master Server, and tnx for all the fish!
2021-07-10 20:17:07 +02:00
Patric Stout aa93d76223 Add: use Game Coordinator to get latest public server listing 2021-07-10 20:17:07 +02:00
Patric Stout b1280fd17e Add: use Game Coordinator to annouce public servers 2021-07-10 20:17:07 +02:00
Patric Stout 852e056d6f
Fix 9e32c618: network revision was always empty (#9419)
Shadowing the variable you intend to write in tends to do that ;)
2021-07-08 12:29:16 +02:00
Patric Stout d38079d053
Fix f7e390bd: freeaddrinfo() is not guaranteed to handle a nullptr graceful (#9404) 2021-06-29 23:02:25 +02:00
Rubidium f904aef176 Cleanup: use nullptr instead of 0 or NULL 2021-06-17 16:18:30 +02:00
rubidium42 a8b3afb236 Codechange: [Network] Use string_view for network compatability check 2021-06-15 06:13:00 +02:00
rubidium42 49dcf0c772 Codechange: [Network] Simplify constructing the HTTP request with fmt 2021-06-15 06:13:00 +02:00
rubidium42 53b4786037 Codechange: [Network] Let NetworkError return its std::string instead of a C-string 2021-06-15 06:13:00 +02:00
rubidium42 667301e3ec Codechange: [Network] Make hostname/client IP return strings instead of a C-string 2021-06-15 06:13:00 +02:00
rubidium42 a91e29b656 Codechange: [Network] Let IsInNetmask use std::string 2021-06-15 06:13:00 +02:00
rubidium42 36705f1dc0 Codechange: [Network] Simplify formatting of network addresses to string 2021-06-15 06:13:00 +02:00
rubidium42 9e32c618f9 Fix: [Network] Determining GetNetworkRevisionString could overflow and underflow its buffer
Tagged releases are not affected
2021-06-14 23:05:18 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
rubidium42 845fded2a0 Fix #9361, a2051ba: [Network] Off by one in CanWriteToPacket
Previously it did not allow writing a byte to a packet that was of size limit - 1 anymore.
2021-06-13 10:31:02 +02:00
rubidium42 bb8fd00760 Cleanup: [Network] Remove C-string Recv_string and its last use 2021-06-10 21:53:19 +02:00
rubidium42 e2417193c9 Cleanup: [ContentInfo] Remove some functions that are not needed anymore 2021-06-10 20:09:44 +02:00
rubidium42 e3717ae903 Codechange: [ContentInfo] Use std::string instead of string buffers 2021-06-10 20:09:44 +02:00
rubidium42 df181bb641 Codechange: [ContentInfo] Use a vector for dependencies instead of custom allocation 2021-06-10 20:09:44 +02:00
rubidium42 9c424ab741 Codechange: [ContentInfo] Use StringList for tags instead of custom allocations 2021-06-10 20:09:44 +02:00
rubidium42 dfb89f3891 Codechange: [ContentInfo] Do not use memset/memcpy to make it possible to use vector/string 2021-06-10 20:09:44 +02:00
rubidium42 6bb3f034e4 Cleanup: [ContentInfo] Remove unused function 2021-06-10 20:09:44 +02:00
rubidium42 8a918ce170 Codechange: [Network] Make admin name and version std::string 2021-05-30 10:15:22 +02:00
Patric Stout ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
2021-05-29 11:21:38 +02:00
milek7 7607277380 Fix: Network on Haiku, remove old code for BeOS 2021-05-24 08:56:18 +02:00
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
Rubidium bb9121dbd4 Fix: comparison of narrow type to wide type in loop (potential for infinite loops) 2021-05-15 10:16:10 +02:00
Rubidium 031e91de6e Fix: [Network] Check on CIDR for netmask check considered everything valid 2021-05-15 10:16:10 +02:00
rubidium42 c73d64adf9 Codechange: move passwords in settings to std::string 2021-05-13 23:13:17 +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
Rubidium 187a3f20bf Codechange: remove pointless close call due to resolving virtual functions statically in destructors
In the destructors of many of the network related classes Close() is called, just like the
top class in that hierarchy. However, due to virtual functions getting resolved statically
in the destructor it would always call the empty Close() of the top class.
Document the other cases where a virtual call is resolved statically.
2021-05-13 10:03:26 +02:00
Patric Stout d7ce61f106
Fix #9255: [Network] TCPConnecter crashes when hostname not found (#9259) 2021-05-13 08:13:48 +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
Patric Stout 8f4a612a7c
Change: reworded many of the network errors during connect/listen (#9230)
Also changed some levels to 0, as a failing listen() is something
we should tell the user about. Hiding this information is a bit
evil.
2021-05-10 13:40:28 +02:00
Patric Stout 1b75a29d12 Fix: destroying a TCPConnecter that was still resolving made illegal writes
Basically, we should join the resolve thread before we destruct
the object.
2021-05-08 17:26:10 +02:00
Patric Stout 664a8c3e85 Codechange: move connection_string to private for TCPConnecter
The most common case never needs access to it anymore. Make the
one exception to this explicit. This means the fact that we
store it is now an implementation detail.
2021-05-08 17:26:10 +02:00
Patric Stout f187708b3b
Fix f7e390bd: getpeername() doesn't work on closed sockets (#9213) 2021-05-08 11:57:41 +02:00
Patric Stout f7e390bdc0
Feature: use Happy Eyeballs to make network connections (TCP-only) (#9199)
Hostnames like "content.openttd.org" resolve into multiple IPv4 and IPv6.
It is possible that either of the IPs is not working, either due to
a poorly configured OS (having IPv6 but no valid route), broken network
paths, or a service that is temporary unavailable.

Instead of trying the IPs one by one, waiting for a 3s timeout between
each, be a bit more like browsers, and stack attempts on top of each
other with slight delays. This is called Happy Eyebells.

Initially, try the first IPv6 address. If within 250ms there is no
connection yet, try the first IPv4 address. 250ms later, try the
second IPv6 address, etc, till all addresses are tried.

If any connection is created, abort all the other (pending) connections
and use the one that is created. If all fail 3s after the last connect(),
trigger a timeout for all.
2021-05-06 23:13:35 +02:00
rubidium42 f1dfa661a1 Codechange: [Network] Use std::string for NetworkGameInfo 2021-05-06 21:45:36 +02:00
rubidium42 6c4a65eeb8 Codechange: [Network] Use std::string for NetworkAddress' host name 2021-05-06 20:33:26 +02:00
Patric Stout f94fb93779
Codechange: use connection_string in favour of NetworkAddress (#9197)
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-05 23:21:14 +02:00
Rubidium ead30dc725 Cleanup: [Network] Remove variable from NetworkGameInfo that is only used during deserialisation 2021-05-05 21:01:23 +02:00
rubidium42 e7581fd42d Change: [Network] Update server's NetworkServerGameInfo only when needed
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-05 21:01:23 +02:00
rubidium42 72bd62fd70 Codechange: [Network] Use a single NetworkServerGameInfo object at server side and serialize that for the clients 2021-05-05 21:01:23 +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
rubidium42 e097c83c83 Codechange: move some OS abstraction method implementations out of the header 2021-05-01 19:36:22 +02:00
rubidium42 22720332eb Codechange: encapsulate network error handling 2021-05-01 19:36:22 +02:00
rubidium42 0eb17a70af Codechange: rename NetworkError to ShowNetworkError 2021-05-01 19:36:22 +02:00
rubidium42 a61696d6c5 Change: [Network] Encapsulate logic about the connection string to the network code (#23) 2021-04-29 20:12:11 +02:00
Patric Stout be37a2cab8 Codechange: use NetworkAddress instead of two host/port variables where possible
This also means we no longer need last_host/last_port, but can
just use a single last_joined setting.
2021-04-29 20:12:11 +02:00
Patric Stout 99f998805b Codechange: use std::string over stack-based strings if possible 2021-04-29 20:12:11 +02:00
Patric Stout a8afbe74bf Cleanup: remove write-only variable "hostname" in NetworkGameList 2021-04-29 20:12:11 +02:00
Patric Stout 96dc0d04ec
Fix b3003dd1: swap SERVER_GAME_INFO with CLIENT_GAME_INFO (#9129)
The idea is that if you query an older server that does not support
this packet yet, the client receives an error. The assumption was
that on every "illegal packet" the connection would be closed. This
turns out to be false.

Now CLIENT_GAME_INFO aligns with the old PACKET_CLIENT_NEWGRFS_CHECKED,
which does a pre-check (which fails), and an error is sent back
and the connection is closed.

This is not a nice solution, but it is the best we got.
2021-04-28 23:09:03 +02:00
Milek7 a341852cd5
Fix: missing <limits> include in network/core/packet.h (#9123) 2021-04-27 23:22:03 +01:00
Patric Stout b57d845e55 Codechange: refactor CheckGameCompatibility() from existing function
Later commits use this function in other places too.
2021-04-27 20:18:53 +02:00
Patric Stout b3003dd163 Add: ability to retrieve game info from server over TCP 2021-04-27 20:18:53 +02:00
Patric Stout 84c75a7b9a Codechange: be explicit in pointer comparisons 2021-04-27 20:18:53 +02:00
Patric Stout cb2ef1ea4b Codechange: move all NetworkGameInfo related functions to a single file
It currently was a bit scattered over the place. Part of
NetworkGameInfo is also the GRF Identifiers that goes with it.
2021-04-27 20:18:53 +02:00
Patric Stout 8fa53f543a
Change: [Network] lower TCP connect() timeout to 3s (#9112)
Currently we use default OS timeout for TCP connections, which
is around 30s. 99% of the users will never notice this, but there
are a few cases where this is an issue:

- If you have a broken IPv6 connection, using Content Service is
  first tried over IPv6. Only after 30s it times out and tries
  IPv4. Nobody is waiting for that 30s.
- Upcoming STUN support has several methods of establishing a
  connection between client and server. This requires feedback
  from connect() to know if any method worked (they have to be
  tried one by one). With 30s, this would take a very long time.

What is good to mention, is that there is no good value here. Any
value will have edge-cases where the experience is suboptimal. But
with 3s we support most of the stable connections, and if it fails,
the user can just retry. On the other side of the spectrum, with 30s,
it means the user has no possibility to use the service. So worst case
we annoy a few users with them having the retry vs annoying a few
users which have no means of resolving the situation.
2021-04-27 20:18:43 +02:00
rubidium42 015e3b412e Cleanup: remove #ifdefs for compiling the old content server 2021-04-27 19:58:03 +02:00
rubidium42 84985c1223 Codechange: [Network] Do not leak os_abstraction.h via fios.h 2021-04-27 18:17:34 +01:00
rubidium42 cf8c1aa860 Change: [Network] Use string error messages instead of numeric error numbers that need to be looked up 2021-04-27 18:17:34 +01:00
rubidium42 65c5a64719 Fix: [Network] errno and strerror do not handle network errors on Windows 2021-04-27 18:17:34 +01:00
Charles Pigott 43b6f6915b Fix 8a95fee4: Missing initialiser in Packet constructor 2021-04-26 06:45:37 +02:00
Rubidium 21f58ab437 Change: use 32 KiB packets to transfer the savegame 2021-04-25 21:27:54 +02: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 38d15fc9b7 Codechange: move the logic shrinking of the packets into the Packet itself 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
Patric Stout ce6a744278 Doc: server name doesn't need to be advertised to be valid
Strictly seen the comment is true, as it says 'e.g.', but it is
misleading. The server name is just that: the name of the server
as configured. No need to mention advertising.
2021-04-20 17:34:04 +02:00
Patric Stout cd757d53ca Codechange: remove always-empty "address" from NetworkContentSocketHandler
When ever you saw this debug lines (which you never should), they
showed an empty address. It is also not very useful to have, as it
always points to a known server anyway.
2021-04-20 17:34:04 +02:00
Patric Stout 31897eaa7d Codechange: split ParseConnectionString into two functions
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.
2021-04-20 17:34:04 +02:00
Patric Stout 05612d60ae Remove: "language" field from server/client
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-04-20 17:24:38 +02:00
Patric Stout f4bd3fff5e Remove: "map_name" from server announcements / listing
The idea back in the days was nice, but it never resulted in
anything useful. Most servers either read "(loaded game)" or
"Random Map", neither being useful. It was meant for heightmaps,
so you could find a server that was using a specific one .. but
there are many things wrong with that idea. Mostly, servers tend
to save and load savegames from time to time, after which the
original heightmap used was lost.

All in all, removing map_name all together is just better.
2021-04-20 17:24:38 +02:00
Rubidium d2fe8c2842 Change: warn the user about the resolving of an address being extra very slow 2021-04-12 21:10:21 +02:00
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 2021-04-07 09:31:47 +02:00
Patric Stout 53c28a8ec9 Codechange: [Network] replace _realtime_tick with std::chrono 2021-02-27 00:36:14 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Patric Stout 8fbf5bef60 Fix: workarounds for two emscripten bugs in the network stack 2020-12-15 15:46:39 +01:00
Patric Stout d15dc9f40f Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.

Co-authored-by: milek7 <me@milek7.pl>
2020-12-15 15:46:39 +01:00
duck 1bc7047af7
Doc: Acknowledge integer type mismatch in certain admin packets using AdminUpdateType (#8238) 2020-06-27 18:21:17 +02:00
Jonathan G Rennison 1ac0d4a5b2 Fix: Thread unsafe use of NetworkAddress::GetAddressAsString
Remove static buffer form of NetworkAddress::GetAddressAsString.
This is used in multiple threads concurrently, and is not thread-safe.

Replace it with a form returning std::string.
2020-06-21 11:47:56 +01:00
Jonathan G Rennison b0f192abc4 Fix: Racy use of flags in TCPConnecter::CheckCallbacks
conected and aborted flags are used concurrently from multiple threads.
2020-06-18 19:57:34 +02:00
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
glx22 82573a5e73
Fix #8117: Memory leak in admin port (#8122) 2020-05-07 02:00:53 +02:00
glx 41232f18c1 Codechange: Replace network related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Joe Stringer b4f1056097 Fix: [Cygwin] Fix missing AI_ADDRCONFIG declaration
Fixes the following complaints:

src/network/core/address.cpp: In member function 'const sockaddr_storage* NetworkAddress::GetAddress()':
src/network/core/address.cpp:134:55: error: 'AI_ADDRCONFIG' was not declared in this scope
   this->Resolve(this->address.ss_family, SOCK_STREAM, AI_ADDRCONFIG, nullptr, ResolveLoopProc);

Signed-off-by: Joe Stringer <joe@wand.net.nz>
2019-10-07 21:36:00 +02:00
Charles Pigott 71a3e83468 Fix: GCC9's warnings about deprecated implicit assignment operators 2019-09-30 14:00:06 +01:00
PeterN 0ab6244f6b
Fix #7165: Missed another 'Append() --> push_back()' replacement (#7548) 2019-04-27 20:47:32 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 2019-04-09 22:45:15 +02:00
Michael Lutz 05bc2ed7cb Codechange: Replace custom thread code with C++11 thread objects.
We assume a conforming C++11 compiler environment that has a valid <thread>-header.
Failure to run a real thread is handled gracefully.
2019-04-06 11:27:39 +02:00
stormcone b913c92aa7 Fix #7165: Missed 'Append() --> push_back()' replacement 2019-03-26 22:20:56 +00:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson 2bc2de9034 Codechange: Replaced SmallVector::Find() with std::find() 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson ca2f33c6d0 Codechange: Replaced SmallVector::Erase() with std::vector::erase() 2019-03-26 20:15:57 +00:00
Henry Wilson 8460952240 Codechange: Replaced SmallVector::Find() const with suitable alternatives
The use of std::none_of in network/core/host.cpp is driven by the non-const
comparison operator use by NetworkAddress. A future commit should address
the const_casts in that class to ensure const-correctness.
2019-03-26 20:15:57 +00:00
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
peter1138 07de9d6c3f Codechange: Use override keyword in networking classes. 2019-03-24 17:38:42 +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
Patric Stout 1c5ea33099 Fix: warnings when compiling for a recent version of Haiku
This might break older Haiku versions, but it is hard to tell.
2019-03-05 22:22:00 +01:00
Patric Stout f58db44ff2 Remove: BeOS support (deprecated by Haiku)
In 10 years there is no commit to change how BeOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), BeOS is no longer
support. SDL2 suggests to use Haiku instead of BeOS.
2019-03-05 22:03:00 +01:00
Patric Stout 7784d77713 Remove: MorphOS / AmigaOS support
In 10 years there is no commit to change how MorphOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), MorphOS is no longer
support. There is an SDL2 port for MorphOS, but it is not maintained
by upstream SDL2, and nobody can currently test it out.

If anyone wants to re-add MorphOS, please do (revert this patch,
fix the problems, and create a Pull Request). If you need any help
doing so, let us know! It is not that we don't like MorphOS, it is
that we don't have anyone fixing the problems :(
2019-03-05 22:03:00 +01:00
Thomas den Hollander 412e6132b6 Fix: CompanyEconomy documentation
Company income was described as an unsigned integer, but it should be signed.
2019-02-12 19:26:21 +00:00
Niels Martin Hansen 5f8354f358 Change: Make a shortened network revision string for use in server queries 2019-02-03 18:00:16 +01:00
Niels Martin Hansen c511b0e801 Change: Increase NETWORK_REVISION_LENGTH to 33 bytes 2019-02-03 18:00:16 +01:00
Charles Pigott fe8c24e081 Codechange: Remove unnecessarily defined functions under MinGW 2019-01-17 21:55:15 +00:00
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 2018-12-27 18:09:16 +01:00
Niels Martin Hansen 4fb76db42f Feature #986: Automatic save when losing connection to a network game 2018-06-23 15:22:31 +02:00
J0an Josep cfb8092397 Fix b4b98e5165: Use FALLTHROUGH attribute with correct indentation. 2018-04-30 21:52:40 +02:00
Patric Stout 85adde7485 Remove: PSP support 2018-04-29 15:32:16 +02:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
frosch ec9a920aab (svn r27729) -Codechange: Do not count static NewGRF when checking for the maximum number of NewGRFs in a game.
-Codechange: Remove LAST_GRF_SLOT and MAX_NEWGRFS. Now NETWORK_MAX_GRF_COUNT is the only constant to specify the maximum number of non-static NewGRF.
-Codechange: Increase the number of file slots, effectively increasing the maximum number of static NewGRF and baseset GRFs.
2017-01-14 13:12:49 +00:00
frosch 31f046bd9b (svn r27670) -Add: [FS#6471] Assign descriptive names to (GNU pthread) threads. (JGR) 2016-10-30 17:29:33 +00:00
frosch 396dde1636 (svn r27092) -Fix/Add [FS#6186]: Compilation on OS/2 (smedles) 2014-12-24 17:17:18 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00: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 b3e93d6520 (svn r26057) -Fix: a number of possibly uninitialised variables 2013-11-23 13:12:19 +00:00
rubidium 2e54c8fdfa (svn r26056) -Fix: a number of possibly uninitialised variables 2013-11-22 21:50:43 +00:00
rubidium fad4fa09ba (svn r26046) -Fix: handle a number of failure conditions from methods called in the network code 2013-11-22 21:41:19 +00:00
rubidium 5eac3a77d2 (svn r25597) -Fix [FS#5635]: [Content] When the server closed the connection, the client would for eternity try to read a packet and never timeout making it impossible to reconnect 2013-07-13 09:26:11 +00:00
rubidium e6ae8cf420 (svn r25593) -Cleanup: remove a few stale #defines 2013-07-13 06:18:16 +00:00
planetmaker bb7f08f8db (svn r25590) -Codechange: Align doxygen comments again 2013-07-12 17:15:13 +00:00
planetmaker 2e390613a6 (svn r25589) -Fix [FS#5646]: Ensure that sent and received length of json strings are the same (based on patch by Xaroth) 2013-07-12 17:11:16 +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
rubidium 51f0d11ee3 (svn r25573) -Change: make content list appear faster by allowing some window redraws in between 2013-07-07 10:37:16 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
alberth 732e073261 (svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb) 2012-12-01 13:12:39 +00:00
frosch a443375d44 (svn r24674) -Fix (r24466, r23234) [FS#5358]: Downloaded heightmaps could not be used anymore. (sbr) 2012-11-08 21:41:00 +00:00