Commit Graph

104 Commits (cbccd3336c18529f4d56c3856ac27bfe557796e6)

Author SHA1 Message Date
Dennis Schridde 31a863a90b Setup eol-style CRLF for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3473 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 20:49:48 +00:00
Dennis Schridde d7bbab46af Set eol-style and mime-type for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3471 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:55:59 +00:00
Per Inge Mathisen f246839359 patch #928 ported map send/rev to new netAPI by Buginator with style fixes by me
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3431 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-11 21:39:41 +00:00
Giel van Schijndel 73d329fde8 * Fix a magic number (28) supposedly representing enum value NET_LEAVING (which is 18)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3423 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-09 23:07:36 +00:00
Freddie Witherden 9a312a7991 Commit the second part of patch #913 which removes (the defunct) AUDIOMSG system.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3335 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 13:38:19 +00:00
Freddie Witherden daad83d316 Make NETend(); return TRUE when we are finished decoding.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3331 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 10:32:59 +00:00
Per Inge Mathisen dc7a84da62 Log droid death and packet source. Beware: This will make net games incompatible
between before and after this commit.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-02 17:08:29 +00:00
Freddie Witherden 6a338c71ce Use the endian swapping functions provided by SDL.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3201 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 19:29:53 +00:00
Giel van Schijndel bc66705498 * In Vector3uw explicitly use uint16_t instead of UWORD
* Add a function NETVector3uw to use for passing Vector3uw objects more conveniently over the network

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3173 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 23:36:02 +00:00
Freddie Witherden e9ae19df7b Fix warning about redefinition of MIN/MAX on OS X (as arpa/inet.h also contains MIN MAX macros)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3081 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-16 18:32:38 +00:00
Giel van Schijndel c51bd8ae10 * Get rid of a large quantity of unused parameters
* Turn some signed integers ("int" or "SDWORD") into unsigned integers where it made more sence (and signed integers caused warnings about comparing signed with unsigned integers)
 * At some places cast to an unsigned integer (where the type of the expression is a signed integer but the result of it logically _always_ is an absolute value)
 * Remove unused struct-type EVENT_INIT
 * Convert use of malloc->memcpy->free to one single realloc call (and now make sure to actually check realloc's return value, which wasn't done with the malloc call)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3037 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-10 23:15:46 +00:00
Dennis Schridde c64b565f14 Patch #872 by Buginator. Untested by me since in Bugs we trust. ;)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3020 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 19:10:34 +00:00
Freddie Witherden 05fdb3af34 Updated the network primitives functions
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2870 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-25 12:12:03 +00:00
Dennis Schridde 9cc0a628c1 Do parts of the proposed changes in "[Warzone-dev] build issues in FreeBSD system" by Yaroslav Kolomiyets from 24.10.2006:
- SDL header includes don't use SDL/ anymore (raw Makefiles and MSVC Project adapted).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2863 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-24 11:49:51 +00:00
Giel van Schijndel aef7af381e * Make function NETsetupTCPIP const correct
* Don't #include <unistd.h> in source:trunk/src/clparse.c as we don't need it
 * Rename a debug message to use the correct function name as prefix (bitimage.c)
 * Utilize snprintf instead of sprintf, at two locations


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2796 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 17:08:41 +00:00
Per Inge Mathisen fe27053bf7 Fix bug in last commit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2664 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:51:02 +00:00
Per Inge Mathisen ec0836efdc Fix type punning warning where we cast an array as a struct pointer in netplay.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2663 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:49:39 +00:00
Giel van Schijndel 0374c67a12 * Add a doxygen comment to source:trunk/lib/framework/strlfuncs.h describing macro STR_L_FUNC_TRUNCATION_DETECT
* Replace (the last) strncpy() call in nettyps.c with a strlcpy() call


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2647 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 20:20:35 +00:00
Giel van Schijndel f5602b4778 * Replace a large amount of strncpy() calls with the safer strlcpy()
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:18:52 +00:00
Giel van Schijndel 6b4cba1700 * Rename pLevelName to aLevelName (hungarian notation is a pain. Especially when it's wrong!)
* Get rid of several magic numbers
 * Some const correctness
 * Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 14:35:35 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Dennis Schridde c7b00fadaf More work on the ICC front:
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Dennis Schridde 47dc79ee1e Formating to match EvilGuru's current version. (14)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2463 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-21 20:43:15 +00:00
Dennis Schridde fbd3a9c394 Use Unix PATH_MAX as default and thus move all "fixes" to Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2425 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:59:05 +00:00
Giel van Schijndel 94db796167 * Fix a typo in nettypes.c this should fix bug #9791
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2405 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-17 17:54:26 +00:00
Giel van Schijndel 7e3d161574 * Add BOOL NETfloat(float* fp) to nettypes.h so that it can actually be used
* Fix a spelling error in a comment in nettypes.c


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2402 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-17 14:02:17 +00:00
Giel van Schijndel 52bc608d17 * Fix MSVC compilation by assuming all platforms supported by MSVC provide IEEE754 floats
This fixes bug #9791

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2401 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-17 11:37:39 +00:00
Dennis Schridde 8334d13138 Prevent a symbol conflict of our DATADIR with that from /usr/mingw32/mingw/include/objidl.h via lean-and-mean.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2389 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-16 20:12:46 +00:00
Giel van Schijndel 74e64738fa * Add network primitives by Freddie Witherden <EvilGuru>
* Modify them slighly to use get/set functions for the package direction (instead of a global accessable to all files which forward declare it)
 * Add a NETfloat to the set of primitives
 * Modify NETstring to use strnlen1 instead of strnlen which is a GNU extension to the C library (strnlen1 has been copied from gettext 0.16.1 which is GPLv2+)
NB: rerun your buildsystems
NB2: Xcode requires an update

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2358 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-08 18:50:28 +00:00
Giel van Schijndel 393e753f60 * Update buildsystems for the addition of lib/netplay/nettypes.[ch] in r2160:
* autoconf/automake buildsystem
  * raw makefiles
  * Code::Blocks project file
 * lib/netplay/nettypes.[ch]:
  * set svn:eol-style and svn:mime-type
  * add a GPL header to the file
  * add include guards to the header file (nettypes.h)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2245 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-28 13:41:51 +00:00
Per Inge Mathisen 898b9c5d72 Move a lot of code around for cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2192 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 15:31:27 +00:00
Per Inge Mathisen c6190a85f2 More cleanup. More debug log message. Send player ID as a single char instead
of the old pointer casting with alignment issues.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2189 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 19:33:46 +00:00
Per Inge Mathisen 0cb6023b76 Clean up source and add comments to explain what is going on.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2188 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:59:57 +00:00
Per Inge Mathisen 5d0a52460d Remove NETsetMessageSize
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2185 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:25:33 +00:00
Per Inge Mathisen 1df2199ce8 Remove final pieces of encryption code. Warning: This touches some seriously
unstable code. Bugs may follow!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2184 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-24 18:22:04 +00:00
Per Inge Mathisen dcfe102699 Fix bug in removal of baba player in campaign if too many human players.
Also add some fallback in case server sends us a bad player number.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2160 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-22 11:12:50 +00:00
Per Inge Mathisen 6a25589a62 Add network statistics logging, to figure out which parts of the code consume
the most network bandwidth. Look in in the netplay.log file for this info.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2113 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-15 15:26:23 +00:00
Per Inge Mathisen e509767d23 Clean out some unused code from netplay.c|h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2109 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-15 13:48:22 +00:00
Per Inge Mathisen d3271aa386 Remove now quite useless encryption and anti-cheat code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1953 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-24 13:38:22 +00:00
Per Inge Mathisen 80026d553c Tiny cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1848 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-12 17:16:26 +00:00
Giel van Schijndel b28d8bbdf6 * Fix array out of bounds access
patch by vs2k5

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1845 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-11 01:04:39 +00:00
Giel van Schijndel dcb2c3350f * turn some usages of WinAPI types (*WORD) into their native C counterparts (e.g. int, unsigned int, etc.)
* make integers unsigned at places where we never, ever use signed values for their values
 * move some variables into a more local scope (i.e. the only scope where they're used)
 * turn some mixed tab/spaces indentation usage into tabs-only
 * remove unused (and commented out) conditional compilation macro USE_DIRECTPLAY_PROTOCOL


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1798 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-03 15:51:56 +00:00
Dennis Schridde 6fa36aa0e9 + const, - unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1795 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-03 13:46:50 +00:00
Giel van Schijndel 856830a0e4 Cleanup:
* Remove some forward declarations of deprecated, unused and undefined functions
 * Remove some unused functions which only said: "return TRUE;"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1692 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 19:36:21 +00:00
Giel van Schijndel b22dbc7fe5 * Remove netusers_stub.c. Its only contained function was NETuseNetwork, which granted direct write access to global var NetPlay.bComms. This was camouflaged as a nice function call, so instead we now use it directly as it is: accessing/modifying a global variable.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1690 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-23 18:48:36 +00:00
Giel van Schijndel 6e5038d237 use (u)intX_t types for structs send accross the network (for the size guarantees)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1672 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 22:55:12 +00:00
Stefan Huehner d30dcb1520 2 small fixes in function declarations : () -> (void)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1663 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-20 13:51:53 +00:00
Per Inge Mathisen fc3d29124d Weed out some deadwood from the multiplayer code, and fix a warning.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1653 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-17 14:00:15 +00:00
Giel van Schijndel 48f37b22d9 * Fix wrong interpretation of number of games (only the first byte of the 32bit long unsigned integer was used)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1630 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 18:52:29 +00:00
Giel van Schijndel 0a590a79af * Use network byte-order (big-endian) for size of game list as response to "list" command
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1629 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 18:19:22 +00:00