Cyp
9ad1bba74f
Try again at squelching the mac warnings.
...
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10131 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:44 +01:00
Cyp
9f1035b605
A tiny bit more cleanup, try to squelch mac warnings in multigifts.c.
...
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10130 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:44 +01:00
Christian Ohm
d5e35cd779
Include/declaration cleanup for src/wrappers.c/h.
...
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10093 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:39 +01:00
Christian Ohm
ce844cf2d1
Don't compare an uint8_t to -1.
...
In NETallowJoining, there was a whole block of unreachable code because of
this. Warning reported by dak180, patch reviewed by Per.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10077 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:37 +01:00
Cyp
4dc1b2a681
Fix the game getting completely messed up if anyone changes position or colour, and then someone leaves.
...
The problem was due to player positions and colours of a slot getting reset when someone leaves, resulting in multiple slots in the same position or with the same colour.
Also, clean up some weird declarations in the wrong place and stuff.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10068 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:37 +01:00
Per Inge Mathisen
924b6c5169
Changing object rotations to use 16 bit unsigned values instead of the current
...
mix of signed and floating point types. This allows us to use under and over
flow as features instead of failures. There are many conversions using DEG() and
UNDEG() in the code now - these should be read as TODO items for further work.
There is a high chance of bugs being introduced. Patch reviewed by Cyp_.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10067 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:37 +01:00
Per Inge Mathisen
5f7aea25a3
In preparation for newnet branch, turn object positions into int32 values and
...
introduce the new typedef Position to hold them. Patch reviewed by Cyp_.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10052 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-04 19:07:36 +01:00
Buginator
8ec55a5579
Handle socket clean up, then player cleanup, and then re-init the player who left.
...
Fixes the issue of seeing leave messages with the default AI color names, instead of the person who left name.
(2.3 r10004)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10010 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-25 05:50:39 +01:00
Buginator
c402fb2f2a
Committed wrong patch for r9992.
...
When host drops at that point, just close up shop, and set lobby error.
Thanks to Cyp for noticing.
(2.3 r10003)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10009 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-25 05:50:39 +01:00
Buginator
66d2fb68ec
Broadcast NET_HOST_DROPPED on host dropped in NET_fillBUffer()
...
(2.3 r9992)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10001 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-24 06:50:37 +01:00
Buginator
8a785d511c
If we run out of temp sockets, then we should error out, not "fix" the issue by reusing MAX_TMP_SOCKETS -1.
...
(2.3 r9988)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9998 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-24 06:50:37 +01:00
Buginator
15b25dcdfe
Add more LOG_NET debugging love.
...
No code changes (besides adding debug(LOG_NET...))
Change some LOG_WARNINGS to either LOG_ERROR (since they are) or LOG_INFO (since we should know about this)
(2.3 r9987, r9989)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9997 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-24 06:50:36 +01:00
Buginator
a485fa69c6
When we leave, only tell the host that we are leaving, and have the host tell everyone else about the player leaving.
...
(2.3 r9986)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9996 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-24 06:50:36 +01:00
Buginator
e8ff3ec7bf
Make sure we mark the socket invalid in the socket set when we are about to close the socket.
...
This will fix (hopefully) the remaining segfault issues in checkSockets().
(2.3 r9985)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9995 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-24 06:50:36 +01:00
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