Commit Graph

85 Commits (1ed72f87abf0793051dea02837c10db91b64add7)

Author SHA1 Message Date
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
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
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 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 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 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
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 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
Buginator 79037573f0 frontport r8717
"Add new flag to keep track of when Host is alive.

Add a popup window notification for when the Host drops, and also notify the host when *they* quit, that the game will be over for everyone else (because of the network model)

Fix heap corruption when the host's connection was severed in the NET_fillBuffer() function.

Fix a socket error when we tried to write to a NULL socket.

Note: added two strings that need translating"


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8743 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:47 +01:00
Buginator 38f66c5f9e frontport r8667
"Rewrite the stupid file transfer routines.
* It will now only send the file to the person that needs it.

* Adds abort code to the file routines as well, and also tries to detect when the Host is using a malformed filename to host a map.

* Make sure user can't hit the 'ready' button when the map transfer is ongoing.

* Get rid of the silly delays (Much faster transfers)

NOTE: we are still capped by fps. 
fixes ticket:1128
fixes ticket:1127
refs ticket:215 (still can't transfer 'map packs')"

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8734 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:45 +01:00
Buginator 5a2509a26d frontport r8651
"Add config variable 'UPnP' to enable/disable UPnP detection / routines.  1=on, 0=off, default is ON.
"

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8732 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:45 +01:00
Guangcong Luo aabbca68d8 Move map download progress to players list, so you can still chat while it happens. Also update players list instantly, instead of every 2 seconds (except slider changes, which are updated every 0.5 seconds). Also fix taken position detection (fixes bug #1137).
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8602 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 17:12:48 +01:00
Buginator 8018d99190 Add new message of NET_HOST_DROPPED to deal with when host quits game, we should quit as well (lobby)
Add more debug lines when we drop/leave players
(r8538)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8550 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 17:12:44 +01:00
Buginator 06e0716a14 *Change* MaxMsgSize is now 16K
*Change* MAX_BYTESPERSEC is now 14K (was hitting limit in 4p games old limit was 6K)
*Change* relax timings of ping & scoreboard to alleviate the bandwidth strain a bit
(r8381)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8520 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:13 +01:00
Christian Ohm a7ae06572d Integrate miniupnpc.
This should bring it up to about the state of the patches and comments in
ticket #1073, without the threaded device detection. Timeout is 500ms, that
should be enough to detect a LAN device, and doesn't delay startup too much.

Port r8447 plus the fixes for it in r8449, r8453, r8455 and r8456 to trunk.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8460 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:20:02 +01:00
Buginator 0ec13ebdf5 Data Integrity is reimplemented. Version string has been updated, so the new data checks can work correctly.
If all players do not run the same mods or have the same data as the HOST, then they will be kicked.  This is done to prevent crashes to the game.

Closes ticket:961

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8213 4a71c877-e1ca-e34f-864e-861f7616d084
2009-10-06 22:09:59 +02:00
Per Inge Mathisen b86f0f85cc Improve documentation of PLAYER.allocated field. Improve asserts for indexing into some player methods.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7826 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:27 +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
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 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
Giel van Schijndel 7297008ed5 Fix spelling error: rename "ERROR_WRONGVESION" to "ERROR_WRONGVERSION"
Thanks to Kreuvf for noting the mistake.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7275 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:33 +02:00
Giel van Schijndel f6b3c04c8c Backport r7244 into trunk from the 2.2 branch
Move GAMESTRUCT_VERSION to the top of GAMESTRUCT, thus allowing versioning to work properly at all times

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7246 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:30 +02:00
Giel van Schijndel e16e034ec7 Use 40 bytes for the "host" (IP address) in GAMESTRUCT, this allows for using IPv6 without breaking protocol combatility again
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7239 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:30 +02:00
Giel van Schijndel acd07fc7b4 * Add functions for retrieving the masterserver's hostname and port and game hosting port
* Use these functions to save configuration values (instead of duplicating them)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7091 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:23 +02:00
Buginator e9446f60b4 Backport r7084 to trunk also.
"remove dead code left in accidentally
Move a enum to netplay.h, and fix #include files so netplay.h comes before multiint.h"




git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7085 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-19 23:45:25 +02:00
Buginator c2e5d2462f Adds password support to warzone.
Adds feedback from the lobby server.

Notes: You have to enter a password *first*, and then either host the game, or join a game.

Thanks to elio for the new icons!


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7079 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-19 23:45:25 +02:00
Buginator 7a6fa22b1e Version checking code.
If client connects to host, and they don't respond (within 7secs) to the version packet, then it will auto-kick them.
If client sends wrong version in the version packet, then it will auto-kick them.

Also adds kick message support, for the different types of kicks that we do.

merged from r6992
NOTE: trunk won't connect with 2.2.  This is *on purpose*, just testing version checking code for now.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7014 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-12 14:12:06 +02:00
Guangcong Luo fac8b8ffb9 Commit patch #366: Show "Connection error" in case of connection error
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@6998 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-12 14:12:05 +02:00
Buginator e1e42928ee Players no longer drop from game after too much data has been sent to them. (Usually happens in longer games, when there is more data that needs to be sent)
Closes ticket:315
Fixes ticket:218

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6881 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-20 20:40:49 +01:00
Buginator 9e0767ecfd * Fixes memory leak.
* Fixes eventFireCallbackTrigger which was called multiple times.

* LOG_NET is to *only* be used for network traffic, not for sync issues.

* Adds visual display about when player leaves/drops.

* Adds / cleans up debug messages concerning connection issues.

* Adds new message type NET_PLAYER_DROPPED, (as opposed to NET_PLAYER_LEAVING). One is when we lose a connection, the other is when a player quits 'normally'.


Will be adding icons from Ticket #247 done by Zarel soon.

NOTE: please use --debug net if you have connection issues!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6677 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-21 22:09:58 +00:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Giel van Schijndel 5f5489b650 * Stuff SESSIONDESC.dwUser[1-4] in an array: SESSIONDESC.dwUserFlags\[4]
* Rewrite NETgetGameFlagsUnjoined such that it's not hardcoded for its `flag` parameter anymore

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6150 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 12:58:59 +00:00
Per Inge Mathisen 704117f85c Fix various doxygen errors and warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5992 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-11 18:25:34 +00:00
Giel van Schijndel ef72bf0a43 * "Upgrade" the function comments for NETsendGAMESTRUCT and NETrecvGAMESTRUCT to Doxygen comments
* Restore the empty lines removed in r5732
 * Add a note to GAMESTRUCT containing a list of elements that need to be updated when GAMESTRUCT's definition changes

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5770 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 21:34:18 +00:00
Per Inge Mathisen 9da6c7eb96 Netplay bugfixes from Buginator, with changes by me.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4560 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-11 18:35:53 +00:00
Roman C 78f4b01231 Implemented 'Ready' button for the lobby. The game starts when all players have clicked on it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4555 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-09 20:05:09 +00:00
Roman C 674db841fa Fix a bug in whosResponsible() which caused execution of AI scripts on a client instead of the host in some cases.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4540 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-07 17:31:57 +00:00
Dennis Schridde 10f2ccfd56 TRUE->true, FALSE->false (except in scripts)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:51:17 +00:00
Per Inge Mathisen 775637ef95 Fix some -Wextra warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4307 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:02:11 +00:00
Per Inge Mathisen f1a62097bf Netcode: Make NetDir static, and remove some unnecessary function parameters.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3798 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 13:39:23 +00:00
Per Inge Mathisen c614aabe31 Reorganize the packet definitions to avoid duplication and scatter of data.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3787 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-15 20:55:38 +00:00
Per Inge Mathisen 0fbcf9399b Fix another NetMsg vs duplicate buffer bug. Also assert corect packet type
when decoding them.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3774 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-13 20:25:12 +00:00
Per Inge Mathisen afb59e5e99 Clean up declaration of NETsetupTCPIP
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3771 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-13 17:22:43 +00:00
Per Inge Mathisen 917187ca7d Clean out some excess global defines.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3753 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 16:23:20 +00:00
Per Inge Mathisen 907f684f8a Remove remains of old external launcher program lobby.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3752 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 16:00:17 +00:00
Per Inge Mathisen b8ecac8f77 Remove the final remains of the old ugly network code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3746 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 21:03:00 +00:00
Per Inge Mathisen 160afd4e7a Remove some unused code from netplay.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3744 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 20:08:39 +00:00
Giel van Schijndel 0c7ade394d * Remove message type MSG_PLAYER_DATA as it sends/receives void* data chuncks which is __not__ endian safe (not to mention struct padding)
* Don't maintain player stats in lib/netplay/netplay.c; instead maintain them in src/multistat.c
 * Add a new net message type (NET_PLAYER_STATS) to exchange player stats


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3661 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 14:39:31 +00:00
Giel van Schijndel b76b958bb7 Move sending & receiving of MSG_PLAYER_DATA over to the new netcode API
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3645 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-02 14:45:08 +00:00