Jonathan G Rennison
43980639de
Merge branch 'master' into jgrpp
...
# Conflicts:
# .gitignore
# CMakeLists.txt
# src/3rdparty/optional/optional.hpp
# src/group_cmd.cpp
# src/industry_cmd.cpp
# src/misc_gui.cpp
# src/video/sdl2_v.cpp
3 years ago
Patric Stout
8fbf5bef60
Fix: workarounds for two emscripten bugs in the network stack
4 years ago
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>
4 years ago
TechGeekNZ
cf8ea74733
Update: Merge branch 'jgrpp_master_cmake' into jgrpp_cmake
4 years ago
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.
4 years ago
Jonathan G Rennison
ef7e658dee
Network: Remove static buffer form of NetworkAddress::GetAddressAsString
...
This is used in multiple threads concurrently
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
e804173595
Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector.
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
frosch
396dde1636
(svn r27092) -Fix/Add [FS#6186]: Compilation on OS/2 (smedles)
10 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
planetmaker
c24374f99c
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
12 years ago
rubidium
bd64bf6372
(svn r23193) -Codechange: don't cast away const unneededly
13 years ago
rubidium
289133be14
(svn r22695) -Fix [FS#4697]: mark addresses that could not be resolved as 'do not resolve anymore' as well, instead of trying to resolve them each and every time the address is accessed
13 years ago
rubidium
eb299736c1
(svn r21886) -Codechange: move documentation towards the code to make it more likely to be updated [n].
14 years ago
frosch
98250ad8da
(svn r20951) -Codechange: Add SmallMap::Contains() and use it.
14 years ago
rubidium
6b35de215c
(svn r19385) -Fix [FS#3684]: [IPv6] Netmask calculations were wrong if cidr >= 32.
14 years ago
rubidium
d6cded5380
(svn r17693) -Cleanup: remove some unneeded includes
15 years ago
rubidium
7fbc33dae1
(svn r17248) -Fix: add GPL license notice where appropriate
15 years ago
smatz
d4971a22d0
(svn r16265) -Fix (r16238): wrong format string for debug output
15 years ago
rubidium
951b9e7615
(svn r16238) -Change: improve/clarify some network related debug "error" messages by adding more information to them. Also give some clues on how to fix certain issues (like failing advertising).
15 years ago
rubidium
47e2901e18
(svn r16034) -Fix: compile warnings generated by 64 bits MSVC.
15 years ago
rubidium
460fbc7c92
(svn r16007) -Fix (r16004): when we want to bind to both IPv4 and IPv6, make the master socket do that too; too bad getaddrinfo can't handle binding to any address on any port at the same time :(
15 years ago
rubidium
28bce241fd
(svn r16005) -Fix: assertion when there is no last joined server; when you've got an unresolved address, the hostname cannot be resolved either so return it as-is.
15 years ago
rubidium
8477e92386
(svn r16004) -Fix (r16000): explicitly binding to an IPv4 socket would try to register an IPv6 address (only if it could ofcourse)
15 years ago
rubidium
0f0cc67d62
(svn r15990) -Codechange: provide a thread safe variant of GetAddressAsString.
15 years ago
rubidium
080095ade5
(svn r15984) -Codechange: prepare the UDP receiver to process multiple types of returned server lists.
15 years ago
rubidium
cd8da0d69e
(svn r15982) -Codechange: use GetAddressAsString to get the name instead of passing the hostname and the IP into a string.
15 years ago
rubidium
9d6edae94d
(svn r15981) -Fix: don't print the address family when writing the IP+port to the config file.
15 years ago
rubidium
18146572b0
(svn r15980) -Codechange: don't try to bind to the same socket twice; it's quite pointless.
15 years ago
rubidium
c2152fa31f
(svn r15979) -Codechange: tweak the debug/warning levels of some of the messages when binding
15 years ago
rubidium
20e82c46d3
(svn r15976) -Codechange: make it a bit more clear for what (type of) address binding fails
15 years ago
rubidium
1eb4aa971e
(svn r15975) -Codechange: register each of the IPs we have bound to to the masterserver
15 years ago
rubidium
c0f8214218
(svn r15972) -Codechange: remove unneeded parameter
15 years ago
rubidium
6db7f15b3a
(svn r15970) -Codechange: make it possible to resolve a single address into multiple sockets.
15 years ago
rubidium
fdddfd6269
(svn r15968) -Codechange: do not allocate a buffer for NetworkAddresses so passing it around is easier.
15 years ago
rubidium
616cac0c54
(svn r15951) -Fix (r15946) [FS#2803]: ofcourse a couple of OSes/compilers do not provide a nice 'interface', so we have to do it the ugly way.
15 years ago
glx
5eed35ef54
(svn r15950) -Fix (r15946): mingw compilation
15 years ago
rubidium
2fd9f0fffa
(svn r15946) -Codechange: move netmask matching to NetworkAddress and add some support for IPv6 netmask matching.
15 years ago
rubidium
7cf4639255
(svn r15944) -Codechange: disable IPv4 over IPv6 sockets as there is no default value and not all OSes actually support IPv4 over IPv6 so making it the same on all OSes eases debugging and such
15 years ago
rubidium
ce06df313d
(svn r15941) -Codechange: jonty-comp's wish partly implemented (content server) ;)
15 years ago
rubidium
1463b00b48
(svn r15940) -Codechange: move setting reuse address to the binding process.
15 years ago
rubidium
2bfc9ca50c
(svn r15934) -Fix: work around Solaris' inability to "parse" 0 as defined in the specifications.
15 years ago
glx
65d10e66f0
(svn r15933) -Fix (r15920): mingw doesn't know getaddrinfo() and freeaddrinfo() either
15 years ago
rubidium
47602d7b60
(svn r15925) -Codechange: remove _network_server_bind_ip as it's pretty AF dependant.
15 years ago
rubidium
dccfba6e20
(svn r15924) -Codechange: replace NetworkResolveHost with something less AF dependant.
15 years ago
rubidium
632d74c6b1
(svn r15922) -Codechange: unify the ways to listen on a socket
15 years ago
rubidium
ba5aafb9bb
(svn r15921) -Fix: some OSes don't like sizeof(sockaddr_storage) but want sizeof(sockaddr) or whatever is 'valid' for the given protocol
15 years ago
rubidium
c7b6469dab
(svn r15920) -Codechange: make the (TCP) connecting less AF dependent.
15 years ago