Commit Graph

62 Commits (jgrpp)

Author SHA1 Message Date
Rubidium d9a04ba446 Codechange: make the MD5 hash/digest/checksum variables a std::array 1 year ago
Patric Stout 0d26359b5b
Fix: [Network] don't show GameScript " (v0)" for old servers (#9507)
Old servers don't tell the GameScript they are running, so nothing
should be shown.
All values in NetworkGameInfo initialize as 0/empty, except for GS
version. Someone has to be different from the rest, I guess.
3 years ago
rubidium42 09a7825d1e Remove: the concept of UnknownGRFs
These were filled with "<Unknown>" (before 8a2da49) and later their name would get filled via UDP requests to the server. These UDP packets do not exist anymore, so they will always remain "<Unknown>".
Remove that logic and just use the generic translated error GRF UNKNOWN string instead.
3 years ago
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.
3 years ago
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!
3 years ago
Patric Stout e1e2212e0e Codechange: track version of network servers to prune once out-of-date 3 years ago
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
3 years ago
rubidium42 f1dfa661a1 Codechange: [Network] Use std::string for NetworkGameInfo 3 years ago
rubidium42 dcef3209a6 Codechange: [Network] Use new/delete instead of calloc/free for NetworkGameList 3 years ago
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.
3 years ago
Patric Stout 69118d063f
Change: use TCP for everything except for master-server and initial server scan (#9130)
This means that pressing Refresh button and adding servers manually
now uses TCP.

The master-server and initial scan are still UDP as they will be
replaced by Game Coordinator; no need to change this now.

If we query a server that is too old, show a proper warning to the
user informing him the server is too old.
3 years ago
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.
3 years ago
Patric Stout a8afbe74bf Cleanup: remove write-only variable "hostname" in NetworkGameList 3 years ago
Michael Lutz 43cd892e0c Codechange: Replace custom linked list for GRF texts with STL vectors and strings. 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz 94c5269fa7 Codechange: Use atomic variables for thread synchronization where useful. 5 years ago
Michael Lutz 05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
5 years ago
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.
5 years ago
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 10 years ago
alberth 732e073261 (svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb) 12 years ago
rubidium 1adb9a5c85 (svn r24070) -Fix [FS#5098]: the 'last joined' server was not properly selected anymore (adf88) 12 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
rubidium 4d5dbf5170 (svn r22410) -Document: some more bits ;) 13 years ago
yexo 93533b603a (svn r22162) -Fix [FS#4533]: No update of NewGRF window when unknown GRF name becomes available 13 years ago
rubidium e1eeca6440 (svn r22029) -Fix [FS#4482]: the server list got not resorted/redrawn after NewGRFs were downloaded 14 years ago
frosch 3972c790c2 (svn r20957) -Codechange: Add another parameter to FindGRFConfig() to define search restrictions. 14 years ago
yexo 9a05f8004b (svn r20692) -Fix [FS#4055]: crash after downloading missing content 14 years ago
frosch 4bd32799f1 (svn r20286) -Codechange: Unify end of doxygen comments. 14 years ago
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 14 years ago
yexo d3c1be9abd (svn r20249) -Codechange: change the newgrf name/description from a char* to a GRFText* to make translations possible 14 years ago
rubidium 062dd0e24c (svn r19814) -Codechange: give some more unnamed enums a name, in case they consisted of unrelated values use static const (u)int 14 years ago
yexo a9c8dbc0a0 (svn r19255) -Codechange: encapsulate GRFIdentifier in GRFConfig instead of subclassing it 15 years ago
rubidium 1967084bc3 (svn r18746) -Fix [FS#3489]: clear the cached NewGRFs of a server when receiving a reply instead of when requesting the information. With slow/unstable network connections it would look like the NewGRF settings button went randomly missing. 15 years ago
rubidium c2221885f4 (svn r18027) -Codechange: make some unneededly global variables static and remove some unused variables 15 years ago
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 15 years ago
rubidium 55c0109ee0 (svn r17562) -Fix [FS#2972]: the NewGRF settings of (remote) network games did not get properly updated when the NewGRFs were rescanned causing reading of freed data 15 years ago
rubidium 07d2af338e (svn r17339) -Codechange: move thread related files to their own directory (like done for video, music, sound, etc) 15 years ago
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 15 years ago
rubidium 63c29124de (svn r16981) -Fix [FS#3062]: the last manually added server would not be saved 15 years ago
rubidium 3061d70387 (svn r16064) -Fix: memory leak when querying a server multiple times. 15 years ago
rubidium ebe0f9e7f7 (svn r15998) -Codechange: some coding style updates 15 years ago
rubidium c2dbc8270b (svn r15991) -Fix: don't add 0.0.0.0/:: to the server list; you can't connect to them in any case 15 years ago
rubidium 89d0eca6b7 (svn r15931) -Codechange: let the host and ban lists use of SmallVector. 15 years ago
rubidium 11723c40b2 (svn r15926) -Codechange: make the broadcast IP list less AF dependent. 15 years ago
rubidium c5160c7c8e (svn r15917) -Codechange: remove the latest traces of NetworkAddress::GetIP. 15 years ago
rubidium 1e205e01b8 (svn r15916) -Codechange: let the network game list use NetworkAddress 15 years ago
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 16 years ago
rubidium 6a3aaef486 (svn r15159) -Fix: move the UDP queries that resolve a hostname into threads so they don't freeze OpenTTD when for example the network connection got severed. Thanks to glx for writing the mutex implementation for Windows. 16 years ago
rubidium 5f3772a42c (svn r15157) -Codechange: wrap the hostname/ip and port into a single structure so we can pass either one of them and not convert an ip to a string and then back again. 16 years ago