Commit Graph

2073 Commits (79ed9b96e83e8740e05a5d2a75d06e95467cb514)

Author SHA1 Message Date
Buginator 70ebec41b0 Fix compile issue
Thanks to stiv for the report.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7679 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-09 23:44:18 +02:00
Buginator cdbe56c1c5 Merge netplay (anti-dpid) branch to trunk.
netplay branch ceases to exists anymore.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7678 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-09 23:44:17 +02:00
Per Inge Mathisen 8c16a47ef0 Fix broken sources after 'make clean' in tarball generated by 'make dist'. Reported by 'JimPansen' in the forums.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7671 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-09 23:44:11 +02:00
Buginator cbe998956a Slight cleanup of glOrtho parameters that should be double floats.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7660 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-05 16:21:06 +02:00
Buginator bff6a7c84e Change texLoad to a bool function, to correctly handle tertiles that are of the wrong depth.
This is in response to refs ticket:578 where the wrong tertile depth is used on some tiles, causing GL drivers to crash.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7658 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-05 16:21:06 +02:00
Guangcong Luo d6e036a25d Fix compile error.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7651 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-05 16:21:05 +02:00
Buginator 2fd30d2818 The hack from r7341 seems to break Mac OS X compiles.
Added #if guards around the hack.

Thanks to Vermithrax for the heads up.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7593 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-30 19:24:49 +02:00
Giel van Schijndel 452c507de1 Networking:
* Only clean up the IPv4 socket if we are able to enable IPv4 mapping of IPv6 addresses ''and'' are able to create an IPv6 socket
 * Add some more debug messages to be able to see what sockets could be created
 * Close sockets when they've become useless/invalid

This should fix #534 for real (unlike r7541, which fixed it and then reintroduced another bug causing the same symptom).


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7543 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:31 +02:00
Giel van Schijndel c2f8273762 Make setting up of the IPv4 and IPv6 sockets indepent:
* Allow failure for setting up of one of the sockets
  - More accurately: require only one socket to succeed
 * Try to use the IPv4 to IPv6 mapping feature if the host OS provides it
  - This allows us to use only a single socket on those systems for both listening to IPv4 and IPv6

This should fix #534.



git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7541 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:30 +02:00
Giel van Schijndel 7e6afc09cb #include all required headers (<netinet/in.h> for sockaddr_in and sockaddr_in6)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7540 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:30 +02:00
Giel van Schijndel 1b11d622f1 Exceptionhandler: Remove signal descriptions for signals that are either non fatal or simply not handled by our signal handler
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7539 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:29 +02:00
Giel van Schijndel 7bb1474692 FreeBSD #defines alloca() in <stdlib.h>, not <alloc.h> (that's a Linux/glibc thing), so make the #included file platform dependent
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7538 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:29 +02:00
Giel van Schijndel 9182f1161b Make the fact that we're stripping NUL chars more explicit (see r7437)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7496 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:23 +02:00
Buginator bebb4e773a set the volume of the FMV based on the user's preferences
fixes ticket:526

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7490 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:23 +02:00
Buginator 8a87d1985e Fix strlcpy() & strlcat() to use ASSERT_OR_RETURN
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7478 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:21 +02:00
Buginator 9a3f1046be Fix windows crash dump report, by returning back a c_str() instead of a string.
Fixes ticket:519

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7476 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:21 +02:00
Per Inge Mathisen fb980b636c Ease up on the volume of repeat testing done on the audio code.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7407 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:32 +02:00
Giel van Schijndel 52c8ba24e4 Revert accidentilly committed revisions r7394, r7395 and r7396 (part of a private branch)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7398 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:31 +02:00
Giel van Schijndel af40e39f77 Move construction/allocation code for JSON structures to json_value.[ch]
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7396 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:30 +02:00
Giel van Schijndel ef5a01eeb9 Add a JSON tokenizer (lexer), parser and serializer
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7395 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:30 +02:00
Giel van Schijndel aaa1efe4bb Add a function for UTF-8 encoding
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7394 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:30 +02:00
Buginator 1855990fa8 Change non-fatal debug messages in the sound code from LOG_ERROR to LOG_WARNING instead.
fixes ticket:427

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7382 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-10 19:18:13 +02:00
Buginator b60b1ad10b Fix prototype to match function's definition.
(was missing a const)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7381 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-10 19:18:13 +02:00
Giel van Schijndel 3e5254af26 Only (attempt to) disable IPV6_V6ONLY on systems where it's #defined
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7378 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-10 19:18:11 +02:00
Giel van Schijndel 3dfb215c8b Add IPv6 support to the lobby protocol
* Add a new field: secondaryHosts, an array of two fallback hosts
  - Canibalize the entire "misc" field and part of the "extra" field for this
  - When connecting, first try the primary "host" field, then fall back to the hosts in secondaryHosts (in order)
 * Add a new field: gameId, used on the lobby server to link multiple lobby connections to a single game entry
  - First (attempt to) connect to the lobby with all available address families (currently IPv4 and IPv6)
  - Then ask for a gameId from the lobby server using the first established lobby connection
  - Set the gameId field in the GAMESTRUCT to the one retrieved
  - Transmit the GAMESTRUCT using a "addg" command to the lobby over each lobby connection
  - The lobby then compares all incoming ID numbers with ID numbers already present
  - If there's a match it will use the GAMESTRUCT already present and only add a new hostname to the list

This is the last change, part of, and closes #452

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7364 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-09 23:29:55 +02:00
Giel van Schijndel 3b80e3a63c Add client side IPv6 support
* Properly format IPv6 addresses (so that parsing later on will work again)
 * Resolve names to all address families, not just IPv4

Addresses #452

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7363 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-09 23:29:54 +02:00
Giel van Schijndel 4a90601536 Add partial server side IPv6 support
Implement a "dual stack", i.e. listen on both IPv4 and IPv6 addresses.
This change doesn't affect the socket API itself.

Addresses #452

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7362 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-09 23:29:54 +02:00
Giel van Schijndel 6739e6aa20 When drawing formatted text treat *real* newline characters ('\n') as newlines as well
- Not just the special formatting character '@'

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7346 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:42 +02:00
Giel van Schijndel 6fdc07b3f9 For the purpose of error messages set the error to ECONNRESET when we got disconnected while doing a readAll()
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7345 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:42 +02:00
Buginator 3042114be5 Work around for drivers that report VBO, but don't have full openGL 1.5 implementation.
This is the case for the current radeon open source drivers, and possibly others.

Patch by: suokko (Pauli Nieminen)
see: http://developer.wz2100.net/ticket/216
reference ticket:216



git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7341 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:41 +02:00
Buginator b9aea91c74 Move 'server_not_there' to a more correct location.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7333 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:40 +02:00
Buginator e26ca45678 When we get a error in readLobbyResponse(), we need to put a stop to hitting the server, since this will cause massive slowdowns.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7330 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:40 +02:00
Giel van Schijndel d02f591709 Lobby protocol; change the way the "addg" command works:
* Make the "addg" command return a status code (ranging 200-299 on success) and message (MOTD on succes)
 * Don't use the "motd" command anymore to check the lobby status, instead use the returned status code for that purpose.
 * Allow MOTD strings of arbitrary length (by sending along the length)

This modification ensures that ''proper'' connectivity checking is being performed on the game server (and reported to the user accurately).

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7323 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:40 +02:00
Per Inge Mathisen 870c18b66d Make sure game time variables are properly initialized first time we refer to them. Detected by valgrind.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7318 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:39 +02:00
Buginator 967b1bcb74 Reset version string back to "trunk", accidentally changed in r7079.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7315 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:39 +02:00
Giel van Schijndel 38cfef4e6d Make sure to #undef the errno Exxxx symbols on Windows to prevent collision with the predefined ones by MinGW
Also lets :sort the Exxxx #define list

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7308 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:38 +02:00
Buginator 7e1a1d714c Slight fixes for the BSD socket overhaul to make it compile OK on MSVC again.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7307 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:38 +02:00
Giel van Schijndel 9fa9402919 Work around MSVC's weak & stinky preprocessor:
* Duplicate the entire ASSERT() call instead of conditionally expanding its parameter
  - Depending on whether we are or are not compiling on Windows

Thanks go to Buginator for reporting this.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7306 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:38 +02:00
Giel van Schijndel fcf40c7eb2 For incoming connections print the address from which the connection originates.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7303 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:38 +02:00
Giel van Schijndel a3cbe4c0c3 Use a single function for address to text translation (instead of duplicating code)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7302 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:37 +02:00
Giel van Schijndel dc70524cd2 Take advantage of SocketAccept's non-blocking nature
Just go ahead and try to accept incoming connections without waiting for
a notification that connections are pending.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7301 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:37 +02:00
Giel van Schijndel 63b6d37a94 Make SocketAccept non-blocking
This way it is no longer required to first explicitly check whether
connections are pending (through checkSockets, which select(2)s) and
only then accept(2) it. Now you can attempt to accept the connection,
and if one is available it'll get returned, NULL otherwise.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7300 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:37 +02:00
Giel van Schijndel 36f536fcdb Check for EAGAIN as well to confirm connect(2) has started
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7299 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:37 +02:00
Giel van Schijndel 73a29daefd * Use camelCase instead of CamelCase and under_squores (as requested by Per, see #435)
* Rename read_all to readNoInt because that function is a read(2) variant that doesn't get interrupted by signals (EINTR)
 * Add Doxygen comments to readNoInt and writeAll

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7298 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:37 +02:00
Giel van Schijndel a8f8357904 Mark the server socket as not-ready when we've just accept(2)ed on it
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7296 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:36 +02:00
Giel van Schijndel 99c1ed95e8 Always use SocketClose to clean up sockets
Additionally make SocketClose work properly on Windows as well.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7295 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:36 +02:00
Giel van Schijndel 0bc6be39b1 Fix logic in handling return value of addSocket
When a socket set is full (in addSocket) print a debug message

This is the last change, part of, and closes #435

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7294 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:36 +02:00
Giel van Schijndel ba9d49acd5 Get rid of duplicated code
Addresses #435

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7293 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:36 +02:00
Giel van Schijndel ab6b694420 Bugfix: set SOCKET_ERROR to -1 to *correctly* check for errors
Addresses #435

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7292 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:36 +02:00
Giel van Schijndel a9070e60a9 For non-blocking sockets lets not block on read_all()
Addresses #435

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7291 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:36 +02:00