Per Inge Mathisen
c2fe7de339
The fix to bug #11829 : When three players join mp dialog, one drops, in r5258
...
had a little bug of its own, that made player 3, 5, and 7 drop instead. Fixed!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5521 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 20:36:59 +00:00
Per Inge Mathisen
58792b6df1
Fix erronous error reporting
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5517 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 16:21:00 +00:00
Per Inge Mathisen
e2064a4927
Add error check in NETsendGAMESTRUCT - dump warning to log if fails.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5516 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 11:50:18 +00:00
Per Inge Mathisen
a2ca8dedaf
Improve logging in NETbcast. Change parameter type of NETBroadcastPlayerInfo so
...
that it takes unsigned like all its users.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5515 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 11:20:47 +00:00
Per Inge Mathisen
117fa9e961
Cosmetic improvements to netplay debug log calls.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5514 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 11:02:55 +00:00
Per Inge Mathisen
94f523d9ef
Fix bug #11829 : When three players join mp dialog, one drops
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5258 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-16 19:39:42 +00:00
Giel van Schijndel
f9171b825f
Use sizeof instead of magic numbers
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5245 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-12 13:51:31 +00:00
Per Inge Mathisen
14460d938a
Make sure that packet size is turned into big endian before we send it.
...
This breaks network compatibility with everything older than this commit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5234 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-08 14:22:44 +00:00
Per Inge Mathisen
a05859644a
Fix two mistakes in r5176 (static string cleanup) that made us copy far
...
less from two strings than we should.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5233 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-08 13:30:05 +00:00
Giel van Schijndel
855ec725d4
Use sstrcpy|sstrcat instead of strlcpy|strlcat for manipulation of statically sized strings
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5176 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 13:46:49 +00:00
Per Inge Mathisen
1819c503c6
Make difficulty work when you start the campaign with the --game parameter.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5076 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:50:10 +00:00
Dennis Schridde
c67a3ef1be
More comments on previous patch, which was by Buginator.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5051 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 19:53:27 +00:00
Dennis Schridde
25c53e1c48
commandline argument --join <host> to join into a lobby directly from the commandline ((needs ChangeLog addition!))
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5050 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 19:09:29 +00:00
Dennis Schridde
0e21488f74
Last commit to solve bug #11656 , fix by Paul Wise <pabs>.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4954 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-07 10:09:20 +00:00
Dennis Schridde
7655a44069
Fix issue where hosting a game and then exiting before it starts would not stop warzone from listening on its port.
...
Signed-off-by: Dennis Schridde <devurandom@gna.org>
- Also seems to fix other issues, like weird number of AIs after host-stophost-hostagain.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4953 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-07 10:06:49 +00:00
Giel van Schijndel
510b633251
* Utilise ARRAY_SIZE to determine the amount of elements in a statically sized array
...
* Use sizeof(*ptr) instead of sizeof(type) in malloc & memset calls
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4892 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:19:15 +00:00
Giel van Schijndel
61c8bbc4b9
* Don't "Guarantee nul-termination" after snprintf as snprintf does that itself already (per the C99 spec)
...
* Use strlcpy for copying strings instead of snprintf "%s"
* Don't cast the return value from vsnprintf to (void)
* When we use va_start make sure to use va_end as well...
* Fix indentation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 14:21:41 +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
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
Per Inge Mathisen
be566a7d6d
Add -Wcast-align and -Wmissing-declarations to autoconf debug builds, and fix warnings.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4403 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 23:28:44 +00:00
Per Inge Mathisen
3dd337b73f
Fix variable that might be read unset. Reported by Valgrind.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4318 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 19:24:07 +00:00
Dennis Schridde
1c4901ce29
GCC says: "suggest parentheses around assignment used as truth value"
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4313 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:58:26 +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
Giel van Schijndel
dcc1536f58
Backport r4221 from the 2.1 branch to trunk:
...
* Fix warning regarding array bounds
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4304 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 15:40:13 +00:00
Giel van Schijndel
f4d10dd461
Reapply r3643 (or revert r3669): Port NETBroadcastPlayerInfo over to the new netcode API
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3799 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 13:53:17 +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
Giel van Schijndel
21927c7e74
Add a hack to allow receiving and processing of MSG_PLAYER_STATS in the right place
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3765 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-12 18:56:58 +00:00
Giel van Schijndel
84a36281a5
When retrieving games from the lobby abort on failure to prevent an infinite loop
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3762 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 21:20:25 +00:00
Giel van Schijndel
81fe501660
Bail out when we fail to receive the game count in the lobby code
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3759 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 19:51:24 +00:00
Per Inge Mathisen
ffc6d739a1
Improve some net debug log calls.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3758 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 19:26:23 +00:00
Per Inge Mathisen
29153d8fe4
Do not use two separate packet globals. Fixes problems with corrupted network data.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3757 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 19:22:42 +00:00
Giel van Schijndel
7493e9ea3f
Replace some magic numbers with HOST_DPID; patch by Buginator
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3756 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 18:25:35 +00:00
Per Inge Mathisen
d484e2bc98
Fix infinite loop when joining a game. An encode was supposed to be a decode.
...
Also remove some excess logging calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3755 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 17:19:12 +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
4cff4f49fe
Dump some dead code.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3750 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 11:47:07 +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
d5e7f01ef6
Change magic number to HOST_DPID and document HOST_DPID; file #3791 from patch #975 by Buginator
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3743 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-10 19:57:47 +00:00
Giel van Schijndel
65a3ff6a8b
perform endian swapping for MSG_PLAYER_INFO messages;
...
NOTE: reverting r3669 (or re-applying r3643) would be better, though unfortunately it doesn't work...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3729 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-09 18:29:58 +00:00
Giel van Schijndel
6d27eabf88
Revert r3643; this fixes #7
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3669 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 20:19:52 +00:00
Giel van Schijndel
70d7e095f0
When bailing out of packet decoding make sure to call NETend()
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3668 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 17:46:03 +00:00
Giel van Schijndel
208a399d73
Turn an ASSERTion into a debug(LOG_NET, as is not safe to simply assume that a player ID is correct (and as such we cannot just ASSERT on it)
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3667 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 16:58:48 +00:00
Giel van Schijndel
4a77f3d8b0
Use NETsendGAMESTRUCT and NETrecvGAMESTRUCT to send & receive GAMESTRUCTs endian safe
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3665 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 16:39:49 +00:00
Giel van Schijndel
730ef63107
Add functions NETsendGAMESTRUCT and NETrecvGAMESTRUCT to deal with sending & receiving of GAMESTRUCTs in an endian safe way
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3664 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 16:39:46 +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
4354be1e75
Put the "System Net Messages" in an enum rather than #defining them with custom numbers
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3660 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 14:39:12 +00:00