Commit Graph

48 Commits (d7659713dc107cae02e41718751524eadaaebfc3)

Author SHA1 Message Date
Lukas Werling fd857ef771 Improve "unexpected address family" asserts 2017-01-13 18:32:11 +01:00
Lukas Werling 16b511b75d Use UDP address from puncher to derive TCP address
This is necessary for dual stack connections where the masterserver will
only an IPv6 address and the netpuncher will only return a UDP address/port.
2017-01-13 18:32:11 +01:00
Lukas Werling 33a32cb6bd Implement netpunching for IPv6 2017-01-13 18:32:01 +01:00
Lukas Werling 725e99bb9c Convert addresses from puncher to IPv4
Addresses from the puncher would show as [::ffff:1.2.3.4] and be a bit
confusing.
2017-01-09 20:35:43 +01:00
Lukas Werling 5d803d3be3 Improve "could not find connection" error message 2017-01-09 20:35:04 +01:00
Nicolas Hake 102047f537 Implement IPv6 support to C4NetIO 2017-01-09 20:34:43 +01:00
Lukas Werling 8d9eedffe4 Reset C4NET2IO_DUMP_LEVEL to 1 (#1869) 2016-12-19 17:30:19 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Julius Michaelis e61dcbe4c3 Extend the netpuncher: clients can ask hosts for a connection initiation to circumvent port restricted NATs 2016-10-23 22:34:43 +02:00
Lukas Werling 7177c261b3 Bring back and fix the netpuncher
As carrier-grade NATs are becoming common, many players cannot host
Clonk games at all. The simple STUN-like netpuncher from Clonk Rage
which was removed three years ago is already effective against some
DS-Lite NATs.

With some extensions, we should be able to make it work with more
restrictive NATs as well.

This reverts commit 72002cc366.
2016-09-08 21:10:06 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Sven Eberhardt 28e794654c Add network option to disable UPnP.
Also add some more UPnP failure messages to log.
2016-01-24 00:11:14 -05:00
Nicolas Hake 72002cc366 Kill netpuncher
Another piece of code that hasn't been tested in ages, gone. The default
puncher address was still pointing to clonk.de, which I'm very certain
isn't providing UDP hole punching services anymore.

Instead of a bespoke hole punching implementation we should use a STUN
lib.
2015-12-13 16:11:08 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Nicolas Hake 2d1e4caabc Remove a superfluous endianness test
We're not supporting BE systems, and even when we did, I'm not sure this
test could ever have done something.
2015-02-11 20:41:35 +01:00
Nicolas Hake 2ef2c637a7 Remove several instances of disabled legacy code 2015-01-18 22:59:45 +01:00
Nicolas Hake aa6b1384a7 Fix build with C4NET2IO_DUMP_LEVEL > 1
Instead of using the preprocessor to filter out debugging code, we might
want to make more use of the optimizer's DCE. That way, renaming and
moving a function or variable won't immediately break a rarely tested
configuration.
2015-01-15 16:33:20 +01:00
Sven Eberhardt 98093961ec Add packet logging option.
This should reduce log spam in network games.
2015-01-03 18:15:41 +01:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Tobias Zwick 5bcd762206 C4TimeMilliseconds returns a StdCopyStrBuf to avoid memory errors 2013-12-09 00:49:58 +07:00
Tobias Zwick e9eea97864 make rest of the code not use C4TimeMilliseconds-pointers but instead use the infinity field. 2013-12-09 00:49:57 +07:00
Tobias Zwick bdc895655d add AsString method to C4TimeMilliseconds 2013-12-08 16:28:58 +07:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Tobias Zwick 94c618d153 add new type C4TimeMilliseconds for time measurements to solve problems when GetTime() overflows (#251)
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
2013-12-04 19:35:07 +07:00
Tobias Zwick a8a8322dfb use %u to format unsigned ints (times) 2013-12-04 12:51:46 +07:00
Sven Eberhardt 6407c7cd2b Some more fixes for time_t change.
Some format strings had to be adjusted and clients always had ping timeout on join. Let's hope this fixes it.
2013-12-01 16:34:47 +01:00
Nicolas Hake 52fd2679cd Fix line endings broken by ecf538c, 7b9c1d5, and ceca8b8 2013-11-29 14:18:48 +01:00
Tobias Zwick 7b9c1d5a9e refactor: consistently use time_t t... variables for times in network system, scheduler, gui
The network used to cast GetTime() to int, but GetTime() is an unsigned long. This might cause problems if GetTime() returns big integers (see #251). To solve this, the StdSchedulerProc interface had to be extended with another function in order to eliminate the magic return value -1 of GetNextTick for "no scheduled execution".
2013-11-29 17:28:04 +07:00
Peter Wortmann 4b63957285 Close connection if a packet can't be sent
I am still completely mystified why this seems to happen so often in
practice. Hopefully the extra logging will give us some clues in
future. And closing the connection immediately gives us a small chance
at recovering from this situation.
2013-03-02 20:51:17 +00:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Philipp Kern e037300801 Fix spelling mistake: ressource -> resource. 2012-10-21 22:20:43 +02:00
Günther Brammer 3ec624bb7a win32: Clean up some leftover old frontend User Messages 2012-03-04 19:15:16 +01:00
Nicolas Hake 33b8fa83d3 Correct file path capitalization 2012-01-15 22:45:04 +01:00
Nicolas Hake 683800c33c win32: Add UPnP port mapping support 2012-01-15 21:27:16 +01:00
Armin Burgmeier 98f4b6f1c6 Print a warning instead of a failed assertion if C4Network2IO broadcast fails 2011-12-29 21:51:52 +01:00
Armin Burgmeier c17e272b38 Allow PID_ConnRe packets from not-yet-accepted connections
This fixes joining games in local networks where the PID_ConnRe
packet can arrive earlier than the main thread manages to flag
the connection as accepted.
2011-12-29 19:39:25 +01:00
Armin Burgmeier 934637f8f0 Linux: Obtain local addresses by enumerating network devices
Instead of resolving local hostname. This makes network work with erroneous
or missing entries in /etc/hosts.
2011-11-20 20:45:58 +01:00
Peter Wortmann 6835b7939d Fixed some warnings, security 2011-10-08 13:02:15 +01:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Günther Brammer 6c2a89eaf8 Replace timeGetTime with a platformneutral GetTime wrapper 2011-03-13 17:25:35 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Benjamin Herr 4378de147c Rerun astyle with missing \ added 2010-03-28 20:58:01 +02:00
Günther Brammer b4e37b070b Change all indentation with spaces to use tabs instead
This is a whitespace-only patch. Hopefully, it'll only affect rarely-changed
parts of the engine, since all regularly maintained pieces should already
use tabs.
2010-03-27 17:05:02 +01:00
Benjamin Herr f3b35227ea avoid lots of gcc warnings 2010-01-25 05:00:59 +01:00
Nicolas Hake 52bde5a579 Remove BIG_C4INCLUDE define 2009-10-20 06:21:12 +02:00
Günther Brammer 572d00c32e Move all source files
This might make stuff easier to find.
2009-08-10 17:59:18 +02:00