* Use the "SOCKET" typedef to represent socket descriptors (instead of "int")
* Add wrapper functions for getting & setting the last socket error ("errno" on Unix)
* Add a wrapper function for strerror, strsockerror, that works on Windows
* Use recv(2) and send(2) instead of read(2) and write(2) respectively
* Use INVALID_SOCKET and SOCKET_ERROR instead of -1 to find errors
* Move setting of sockets to blocking/non-blocking to a separate function
* Add Windows-specific wrapper functions for getaddrinfo() and freeaddrinfo()
- Currently work only from 2000 *or* XP upwards, documentation is fuzzy.
Addresses #435
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7289 4a71c877-e1ca-e34f-864e-861f7616d084
* Check for write_all() == -1 (error) instead of "< 0" and "!= size" to
see whether sending has failed.
* Don't just mark sockets as "invalid" on error (by setting them to
NULL), close them as well.
* Give decent error messages on write failure (most likely a disconnect)
Addresses #435
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7288 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure to pass CXXFLAGS to ./configure as well
* Allow for overriding of CFLAGS and CXXFLAGS when building for the building system
- CFLAGS_FOR_BUILD
- CXXFLAGS_FOR_BUILD
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7283 4a71c877-e1ca-e34f-864e-861f7616d084
* Use select(2) to wait for a connection on both sockets and accept(2)ing them in a separate thread
* This prevents IPv4 addresses from becoming IPv6 mapped, which might not be properly supported on all platforms
- The IPv6 mapped addresses where transferred back to clients
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7264 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure all turrets shoot at things they're ordered to shoot at
* Make sure all turrets shoot at things they're supposed to shoot at (this fixes all the multiturret behavior bugs)
* Stop an assert relating to auto-repair
* Internationalize "Hydra"
* Stop repair facility from trying to repair dead units
* Comment the update stage of DACTION_ATTACK and Repair Facility very well.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7260 4a71c877-e1ca-e34f-864e-861f7616d084
In this case, 'Remove unnecessary SDL includes.' Removed the #include for C99 types that we use on non C99 compilers.
In case your wondering, using SDL_stdinc.h, since SDL_types.h is Deprecated.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7250 4a71c877-e1ca-e34f-864e-861f7616d084
Droids with Hold Position and Fire-At-Will will fire upon anything that comes within range.
Droids waiting for repair with Fire-At-Will will fire upon anything that comes within range.
Droids waiting for repair will "snap out of" whatever they're doing and get repaired when it's their turn at a repair facility (fixes bug #92).
Droids returning for repair that lose sight of their target will try again (might fix bug #360).
Trucks will not help enemies build structures (generally only happened if two trucks were going for the same oil resource).
Repair facilities with nothing better to do will repair nearby units.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7233 4a71c877-e1ca-e34f-864e-861f7616d084
* Also disable IPV6_V6ONLY to make sure that (on systems that support the option) IPv4 is still supported, using the same socket
- This option works on Linux from 2.4.21 and 2.6 (according to "man ipv6")
- On FreeBSD this works from version 6 onward (lower versions might work, I only tested on 6 and 7 and didn't find any note in the manual)
- Furthermore, according to
http://en.wikipedia.org/wiki/IPv4_mapped_address:
* This works on Windows from Vista onward
* This works on NetBSD (version unspecified)
* This doesn't work on OpenBSD (as a design decision for security)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7225 4a71c877-e1ca-e34f-864e-861f7616d084
- Make sure to use the maxPlayers and currentPlayers variables found in the Game class, not the (non-existing) local variables
* Don't use Game.check() as it doesn't exist, use Protocol.check(Game) instead
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7224 4a71c877-e1ca-e34f-864e-861f7616d084