Commit Graph

89 Commits (a204e399d3eb40fdbdaa59c5a5d4e3a697b1eb3f)

Author SHA1 Message Date
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
Giel van Schijndel 7b025ea3e1 * Make our lobby protocol code endian safe (response of a "list" command now always is preceded by a 32bit long, unsigned, little endian integer)
* Remove parameter `BOOL async` of NETfindGame since it wasn't used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1628 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 17:31:12 +00:00
Giel van Schijndel 70c07901ae * Remove unused spectator functions: NETspectate and NETisSpectator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1626 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 11:36:46 +00:00
Giel van Schijndel a2d13bc53c * remove lib/netplay/netaudio_stub.c (only had empty functions)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1625 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 11:33:44 +00:00
Giel van Schijndel 1689bd9dc9 * Remove unused function NEThashFile
(This function was only used to generate a hash from the compiled Warzone executable, this hash was then used as a security value across the network. This method won't work when using different compilers, OSes, etc.)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1624 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 10:57:08 +00:00
Dennis Schridde 49b314f6a2 - Fix masterserver disconnect (patch by Gerard)
- Show hostname:port on connection errors
- Make gameserver and masterserver port configurable (as well as the masterserver name)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1512 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-21 13:46:28 +00:00
Ari Johnson c79ff3b3c4 Fix to #include order in r1496
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1497 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 14:46:38 +00:00
Dennis Schridde f6da22d739 _MACOSX_ -> WZ_OS_MAC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1496 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 12:40:50 +00:00
Ari Johnson 91535c6596 Converted MacOS port to use Xcode to produce a universal binary. Warzone
will henceforth require MacOS 10.4 "Tiger" to run.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1492 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-18 03:10:53 +00:00
Stefan Huehner aa1cb2ec14 Remove references to already removed header files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1431 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-10 18:29:58 +00:00
Gerard Krol 6671fa934e 1. Removed the terrible memory leaks from the resource system. 2. Fixed the memory leaks for the terrain tiles. 3. Fixed a lot of uninitialised
variables. 4. Commented out some unused sound code.
I just love Valgrind :)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1390 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-07 13:23:14 +00:00
Dennis Schridde 3b09a756df - Remove unneeded gettext files and instead create them via autopoint
- Remove unneeded checks from autogen.sh (all of them are also checked in configure.ac)
- Move AM_CPPFLAGS=-$(top_srcdir), which was included in nearly every Makefile, to configure.ac
- Remove -g from CFLAGS for usual builds. This should be set by the buildscripts instead
- Remove CFLAGS_OVERRIDE, which was rendered obsolete by the above change


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1332 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-02 17:21:05 +00:00
Stefan Huehner 59843ec8a2 Code-cleanup:
- make a lot of functions static
- remove unused extern declarations
- fix one function declarations () -> (void)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1254 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 20:23:35 +00:00
Dennis Schridde 2a74242eb3 - Replaced various vectors with Vector3i and Vector3f (idea by Watermelon)
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-16 16:20:16 +00:00
Gerard Krol 4465a061c1 Fix warnings, and revert r1241 for effects.c (validatePie really needs a prototype at the top)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1242 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-15 23:17:09 +00:00
Dennis Schridde 8a70df4064 Use some more advanced Automake techniques like noinst_HEADERS. Changes partly autogenerated by KDevelop, so this should be compatible with Automake 1.6.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1118 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 14:36:03 +00:00