* Create another custom context manager (can be used in with-statement) for creating a connection to a given (host, port): "connection"
- Perform manual name-resolution, using each returned entry until one can be succesfully connected to (allows IPv4 + IPv6 through the same function)
* Use this context manager instead of connecting manually
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7305 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
* This removes the need to specify what type of protocol (e.g. BinaryProtocol vs. JsonProtocol) should be used
- Instead only the (Warzone) version needs to be specified, the constructor function (Protocol()) will figure out the correct protocol class to use
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7217 4a71c877-e1ca-e34f-864e-861f7616d084
- This removes the requirement for the socket handler to be aware of the size of a single game
- I.e. this allows variable sized games without another API change
* Read and write Protocol data directly from and to the sockets, decoding and encoding on the fly
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7209 4a71c877-e1ca-e34f-864e-861f7616d084