Commit Graph

407 Commits (90bfae6480cec2e3290fbf299fc2fb264eb5da8d)

Author SHA1 Message Date
Buginator 90bfae6480 Fix endian issues, byte & packet counts for the logging.
Info / modifications by Safety0ff & I

closes ticket:1936
2.3: r11065

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@11067 4a71c877-e1ca-e34f-864e-861f7616d084
2010-07-10 21:10:53 +02:00
Safety0ff 82db22f458 qt-trunk: Set tcp_socket to NULL after free'ing it. Fixes #1869.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@11053 4a71c877-e1ca-e34f-864e-861f7616d084
2010-07-10 21:10:53 +02:00
Buginator 840c77d13c Fix headers conflicts (for windows + MSVC)
Move gettimeofday() from frame.c to timer.c (for windows)

Make sure we include the platform specific include before the others. (so we can correctly use WZ_OS_XXX and so on...)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@10854 4a71c877-e1ca-e34f-864e-861f7616d084
2010-07-10 21:10:49 +02:00
Buginator 0cf96267e6 MSVC fixes.
*NOTE* You *must* get the Qt: Framework, or Qt SDK, and set it up correctly!


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@10824 4a71c877-e1ca-e34f-864e-861f7616d084
2010-07-10 21:10:46 +02:00
Buginator e65f2688e7 Stage two merge.
Add new files for Qt.
Remove old files
Update build system (linux).
Remove SDL.
Remove QuesoGLC.
Remove Fontconfig & other all dependencies it had.  

CC & mingw (windows) & MSVC build systems are *NOT* updated / working yet.

**NOTE** MSVC people check types.h, "bool" != "BOOL" ! "bool" is a byte, "BOOL" is a int.

r8503 - r10787 (from  Qt branch)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/qt-trunk@10813 4a71c877-e1ca-e34f-864e-861f7616d084
2010-07-10 21:10:44 +02:00
Per Inge Mathisen e7c22ecc5c Put miniupnpc and iniparser license files into dist tarball
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10713 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-25 21:24:57 +02:00
Buginator 96bb80b314 Prevent the host from kicking themselves.
Prevent someone trying to kick the host, and kick them instead.

Thanks to effigy for the info
2.3: r10629 /r10630

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10633 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-19 12:52:41 +02:00
Buginator b33a761f9a Only concatenate the mod list to the version string when the client receives the version string from the host.
2.3:r10952

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10593 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-16 14:21:39 +02:00
Buginator 1d47645d07 Don't broadcast to other players about a new player in NET_CreatePlayer(), we will only do NETBroadcastPlayerInfo() when a player has passed all the verification steps.
This fixes ticket:1611

Correctly handle rejection of the verification process as well.

2.3:r10572

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10583 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:07 +02:00
Buginator 71a9f27b40 Clear the IP Ban list when you start to host the game, instead of when you shut down warzone.
Reset numBans back to 0 on list creation.

2.3:r10543

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10582 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:06 +02:00
Buginator 321bcc3505 Add some more netplay logging calls
2.3:r10542

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10581 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:06 +02:00
Buginator dd0ed35548 Add more logging data to our netplay logs.
2.3:r10484

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10579 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:06 +02:00
Buginator 5109e7a86f If ban list isn't created yet, then return false.
2.3:r10481


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10578 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:06 +02:00
Buginator 3cac32c84d Reset file handle to NULL after close.
Fixes ticket:1745

2.3:r10480

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10577 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:06 +02:00
Buginator 05655b6ea5 Add ability to ban IPs when the host kicks a player.
The ban list is *not* permanent, it will reset when host makes a new game.

Information about bans are in your netlog, for future references.

2.3:r10465, r10475, r10477

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10575 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:05 +02:00
Buginator 4ba8e9c34a Rework netlog to give more useful info
Add more counters to keep track of joins / drops / etc.

2.3:r10464

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10574 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-15 11:30:05 +02:00
Guangcong Luo aecdd1805a Change most references to "mods" to singular "mod", so people don't think using multiple mods is a good idea.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10498 4a71c877-e1ca-e34f-864e-861f7616d084
2010-04-12 11:59:31 +02:00
i-nod c8e35d7a29 Fix MSVC and MinGW builds. Closes #1694.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10370 4a71c877-e1ca-e34f-864e-861f7616d084
2010-03-20 14:04:57 +01:00
Cyp 50b41a9a64 Squelch control reaches end of non-void function warning. 2010-03-16 23:01:57 +01:00
Cyp acaa934203 Write from a separate thread, to avoid deadlocks were all players are stuck in writeAll. 2010-03-16 21:56:29 +01:00
Cyp 447e5b048a Rename hton functions to make mac happy. (Re: last refactor commit.) 2010-03-16 18:52:23 +01:00
Cyp 9de2f5c0c7 Refactor part of lib/netplay/netplay.c into lib/netplay/netsocket.cpp. 2010-03-16 16:59:49 +01:00
Cyp 92199e2a06 Only let host set player position/colour, send new players info about unallocated slots too.
Only letting host set player position/colour probably fixes a race condition occuring if a player changes name while the host moves the player.
Sending new players info about allocated slots fixes some weird cases with inconsistent positions (and missing slots), for example, if moving a player and starting a game, leaving the game (without closing the program), and starting a new game.
2010-03-10 21:08:15 +01:00
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