Commit Graph

370 Commits (1ed72f87abf0793051dea02837c10db91b64add7)

Author SHA1 Message Date
Giel van Schijndel 1ed72f87ab Don't use EPIPE when it doesn't exist
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9973 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-22 01:00:19 +01:00
Per Inge Mathisen 21bd0ffdc3 Fix assert if socket set not allocated but socket needs to be deleted. Patch reviewed by cybersphinx and Giel.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9968 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-22 00:50:38 +01:00
Per Inge Mathisen 9bbf6a655c Sync up network changes from 2.3
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9964 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-22 00:50:38 +01:00
Giel van Schijndel 2c09022412 NetPlay refactoring:
* Rename addSocket to more descriptive SocketSet_AddSocket
 * Rename delSocket to more descriptive SocketSet_DelSocket

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9952 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 21:50:20 +01:00
Giel van Schijndel 401723958c Make backtraces regarding FD_SET related crashes (see #1136) more useful
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9950 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 21:50:20 +01:00
Giel van Schijndel d96986488f Netcode, refactoring: move setting of (SOL_SOCKET, SO_NOSIGPIPE) to a function rather than duplicating code
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9939 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 16:50:45 +01:00
Giel van Schijndel 2322e1f03d Use a decently named constant for passing to setsockopt(SOL_SOCKET, SO_REUSEADDR)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9938 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 16:50:45 +01:00
Giel van Schijndel 36cd206534 Netcode: slight refactoring, move connection status checking into a separate predicate function: connectionIsOpen
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9937 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 16:50:44 +01:00
Buginator d03dbc0a87 If we were in the middle of a file transfer, and we abort out, close filehandle.
If a file exists, but we can't read it (for whatever reason), then leave the game 'nicely', and abort out of game, since it is a fatal error.
(2.3: r9923)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9927 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 06:50:54 +01:00
Giel van Schijndel f02cd084d9 Copy paste error, make sure to use the proper file descriptor
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9921 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 01:50:21 +01:00
Giel van Schijndel 4aa213a937 Do our very best *not* to receive SIGPIPE:
When possible do:
 * Set socket option SO_NOSIGPIPE
 * Pass MSG_NOSIGNAL to send(2)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9917 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 01:00:16 +01:00
Giel van Schijndel d4b0ab8c21 Socket API, writeAll: Detect disconnects *before* we're slapped in the face with SIGPIPE
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9913 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 00:50:15 +01:00
Giel van Schijndel cfaaf057f5 Be nice and act according to POSIX spec and check for EWOULDBLOCK as well as EAGAIN
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9912 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-21 00:00:26 +01:00
Buginator 6850d05a78 When player drops, and we were transferring a map to them, abort the send.
Reported by themac on IRC.

Show the progress of the map being sent, of each player, to the host.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9842 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-17 06:50:19 +01:00
Cyp e1bfee9a4c make: Better (hopefully) hack to fix broken dependency files.
Probably closes ticket:1590.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9817 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-15 20:51:08 +01:00
Buginator aeaab52615 Add a new directory name 'logs' (in config dir) to store all our netplay logs in.
fixes ticket:1564

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9778 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-11 20:14:35 +01:00
Buginator a6d88bda6b frontport r9645
"Change netplay.log to netplay-xxx_yyy.log where xxx is the date, and yyy is the time. So people can have a history of all their MP games, and they can upload said file to us.

This log is in the config directory!"


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9705 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:28:12 +01:00
Buginator dbdbd4f1a3 frontport r9644
"Change / add a few log WARNINGS to INFO instead, to track down why the game thinks that people have left when they haven't, and also fix the bug of not destroying the player who dropped / left feature(s).

fixes ticket:1020"

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9704 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:28:12 +01:00
Per Inge Mathisen b28f8d36e0 Remove client socket from socket set when a client unexpectedly disconnects, and let other
clients know about this event. Patch reviewed by Cyp_.  Closes ticket:1515


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9607 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:59 +01:00
Cyp 4e72da7a2a lib/netplay/netplay.c: Change two more don't-while loops into do-while loops.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9598 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:58 +01:00
Buginator 7266552505 Fix for 64bit compilers.
Reported by atis_home  (thanks!)

closes ticket:1523

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9594 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:58 +01:00
Buginator 46ea38f8d5 Merge r9584/9585
"Add sync counters to more accurately keep track of what is being synced and what isn't.

This information is saved in netplay.log in the config dir."


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9590 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:57 +01:00
Cyp c491a4b315 lib/netplay/netplay.c: Change don't-while loop into do-while loop.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9582 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:57 +01:00
Guangcong Luo d187d6fab4 Split bMultiPlayer into bMultiPlayer and bMultiMessages - fixes a ton of bugs relating to the game thinking it's not in multiplayer mode when it is, but has multi messages off.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9407 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:33 +01:00
Cyp b3c57ebb63 net: Set SO_REUSEADDR on sockets to avoid address already in use errors.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9391 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:27 +01:00
Cyp 6ddb1eadb2 cpp: Add extern "C" {} in headers.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9336 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:21 +01:00
Guangcong Luo 2025407222 Commit mod list patch #1415:
1. Adds a specific autoload folder, `mods/autoload/`. This is essential for a good mod community.
 2. Searches the `mods/` folder for global mods, as well as `mods/global/`. This is the first step in merging the three mod folders together, but I'm not planning on merging them completely in 2.3.
 3. Constructs a list of loaded mods, and displays the list in the VersionString (including the list of games in the lobby).
 4. Grays out games with incompatible mods in the NetPlay game list, and gives a warning in the tooltip: "Your loaded mods are incompatible with this game. (Check mods/autoload/?)"
 5. Gives a warning when a game with an incompatible mod is clicked: "You have an incompatible mod."
 6. Displays a list of mods above the Warzone logo.
 7. Lists mods in hosting screen, and warns hosts that all players need the same mods loaded.

Closes ticket:1415.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9291 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:13 +01:00
Christian Ohm 60c4f603da Use the configured game port instead of hardcoding it.
Also make the port variables static.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9269 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:11 +01:00
Per Inge Mathisen 12f9218c67 Fix for compiler warning for uninitialized variable
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9188 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:26:59 +01:00
Christian Ohm b0c4e40934 Include files needed for win32 cross-building.
Building from tarball still doesn't work, since nsis wants the gmo files in the
build dir while they are in the source dir.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9146 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:34 +01:00
Guangcong Luo 64e2425cf0 Update trunk VersionString.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9088 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:28 +01:00
Christian Ohm e0a74027e5 Change ASSERT to ASSERT_OR_RETURN in delSocket.
Closes #1368.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9068 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:25 +01:00
Guangcong Luo 0b4c58bd0b Commit patch #1375 - don't allow players to ignore kicks, add a kick button to the MP game setup screen, prevent spoofing a message from a different source, don't show "player left" message unless a player actually left.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9065 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:25 +01:00
Christian Ohm 4379fdcbd0 Fix possible segfault in miniupnp.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9041 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:22 +01:00
Guangcong Luo a815eaa82c Fix bug #1339 - trunk and 2.3-branch shouldn't be able to play with each other.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9017 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:09 +01:00
Christian Ohm c31d7e502f Do UPnP detection on "host game", not during startup.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9011 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:08 +01:00
Christian Ohm 069ab3cdbc Only forward port 2100, 9990 is not needed.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9010 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:08 +01:00
Christian Ohm 0e8107e3a1 Fix grammar, typos, don't translate kickPlayer messages.
Those are only shown in the log anyway, the in-game messages are still
translated.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8993 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:06 +01:00
Guangcong Luo 36c85d7c78 Fix bug #709 - lobby server doesn't update player count when player leaves a game.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8989 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:05 +01:00
Christian Ohm 9b554a2d6e Reject differing game versions, not the same.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8981 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:05 +01:00
Christian Ohm 92f53f68ff Shorten autokick message when version differs.
Was too long to be displayed completely.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8979 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:05 +01:00
Guangcong Luo d193b397fc Meant to commit these files in r8971.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8973 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:03 +01:00
Guangcong Luo 5bb3fc6132 Compare netcode versions rather than version strings - allows updating version strings while retaining netcode compatibility. Bump netcode version to 2.31.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8971 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:03 +01:00
Guangcong Luo e42645e66b Revert r8964 - apparently increasing the maximum number of games visible in the lobby breaks savegame compatibility.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8968 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:03 +01:00
Guangcong Luo be47ec5bfa Increase max game limit from 12 to 18 - now supported by new larger lobby!
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8964 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:02 +01:00
Christian Ohm 3637a83e38 Remove stray parenthesis.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8945 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:03:59 +01:00
Guangcong Luo e372d3d44e Fix bug #1311 - typos in netplay.c
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8939 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:03:59 +01:00
Guangcong Luo f2e9a412ac I've discovered why the netcode is so unstable. Everthing just assumes it'll be successful. At one point, there's an infinite loop waiting for an accept message. No possibility of receiving a rejection message, no timeout, nothing. At another point, the host just overwrites an existing player, if the game is full. I've fixed most of the ones I came into contact with, but there are probably many more left.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8938 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:03:58 +01:00
Guangcong Luo c10417b595 Disable some fields that should be disabled but weren't, in the multiplayer game join interface.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8929 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:03:56 +01:00
Guangcong Luo 1526b124d2 Fix a crash caused by typo in trunk netcode in r7288.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8850 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:27:02 +01:00