Commit Graph

52 Commits (03833edf3fc5c5f726f507d5352635fba9c7e475)

Author SHA1 Message Date
Cyp 8dc9d09904 Simplify orders a bit.
Droid orders are now contained in a DroidOrder structure, instead of order, orderX, orderY, orderX2, orderY2, orderDirection, psTarget, psTarStats members of DROID.
2011-12-30 22:57:50 +01:00
abomination a72c41aeec fix [s]BOOL[/s] bool by 4B0/\/\1|\|4710|\|
[Edit by Cyp: Removed a "typedef int bool;" when building on non-windows.]
2011-03-13 12:32:24 +01:00
Cyp a7730ccd15 Change "typedef struct {...} Blah;" into "struct Blah {...};".
Removed a few structs due to disuse.
2011-02-25 21:30:13 +01:00
Cyp ae2ce18314 Bump year.
sed -i 's/\(Copyright (C) .*-201\)0\( *Warzone 2100 Project\)/\11\2/' {src,lib/*{,/*}}/*.{c,cpp,h,y,l}
2011-02-25 18:45:27 +01:00
Per Inge Mathisen cead34eea3 Hack around some accumulated brokenness to make --selftest work again 2011-01-24 20:07:30 +01:00
Cyp 8b49291b5d Simplify NETbin interface.
Redundantly, the data length was redundantly sent twice, which was redundant.
2011-01-18 00:20:04 +01:00
Cyp 734d52984d Set bsocket = NULL when host drops, hopefully reduce the chance of crashing. 2011-01-01 23:24:25 +01:00
Cyp b8ae806f29 Remove the NETMESSAGE wrapper around NetMessage.
It wasn't compiling on Windows anymore, anyway — fixes ticket:2426...
2010-12-21 01:10:57 +01:00
Cyp 68b50aecda Remove bool, true, false defines, add NETauto() and move PACKAGED_CHECK somewhere more appropriate. 2010-12-20 21:41:51 +01:00
Cyp 3359fac395 Fix broken moveCalcBlockingSlide comparisons, and make DEG(42) evaluate to 7645 without use of floating point.
After making DEG avoid using float (unless given a float argument), had to fix moveCalcBlockingSlide to avoid out-of-range-comparison error-warnings.

The moveCalcBlockingSlide's int16_t instead of uint16_t was introduced in 6c811c1ecb.

Also, remove lots of unused stuff.
2010-11-16 18:33:20 +01:00
Cyp a0c1c9de0d Change droid experience from float to uint32_t.
Less floats generally reduces the risk of desynchs, don't know if the droid experience caused desynchs, but it might have been possible. Added experience to syncDebugDroid.

Also, fixed QualityFactor and droidResistance integer truncation and made single-player skirmish damage not affected by difficulty level either.
2010-11-16 14:18:01 +01:00
Cyp e8ebb11d4a Remove NETnull() function, which was potentially confusing.
NETnull() was equivalent to uint32_t zero = 0; NETuint32_t(&zero);, which no longer adds/removes 4 bytes of padding as advertised.
2010-10-23 18:02:56 +02:00
Cyp 6f60e686ae Remove NETuint32_tSmall, make all uint32_t's small, except for one uint32_tLarge.
(The large is a CRC, and CRCs are usually large numbers.)
2010-08-15 21:02:32 +02:00
Cyp 7c8df3a2e8 Merge remote branch 'origin/master' into newnet
Conflicts:
	lib/framework/wzapp_c.h
	src/power.c
	src/power.h
2010-08-01 20:41:45 +02:00
Cyp b59b089ca5 Merge remote branch 'origin/master' into newnet
Conflicts:
	lib/netplay/nettypes.c
	src/multibot.c
2010-07-30 22:51:33 +02:00
Buginator edb644a03b Fix (and add missing) headers to files.
2009  Warzone Resurrection Project -> 2010  Warzone 2100 Project

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@11298 4a71c877-e1ca-e34f-864e-861f7616d084
2010-07-28 18:58:33 +02:00
Cyp 212115faed newnet: Delay writing NET_SHARE_GAME_QUEUE until flush. 2010-07-17 11:49:55 +02:00
Cyp d3782834c7 newnet: Move logic in NETuint32_tSmall to the right place.
And add NETint32_tSmall, in case needed.
2010-07-10 16:56:09 +02:00
Cyp f7e1a91761 newnet: Group droid orders, efficiently encode small numbers. 2010-07-05 13:17:36 +02:00
Cyp 3505c31c0e newnet: Rename multibot.c -> multibot.cpp. 2010-07-02 09:30:59 +02:00
Cyp 8573291c68 Merge remote branch 'origin/master' into newnet
Conflicts:
	lib/netplay/Makefile.am
	lib/netplay/netplay.c
	macosx/Warzone.xcodeproj/project.pbxproj
	macosx/configs/Warzone-All.xcconfig
	src/multistat.h
	src/multisync.c
2010-03-17 14:26:32 +01:00
Cyp 79f5ef2f7a Merge remote branch 'origin/master' into newnet
Conflicts:
	lib/netplay/netplay.c
	lib/netplay/netplay.h
	lib/netplay/nettypes.c
	lib/netplay/nettypes.h
	src/multibot.c
	src/multistruct.c
	src/multisync.c
	src/order.c
	src/orderdef.h
	src/wavecast.cpp
2010-03-05 16:09:21 +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
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
Cyp 8077c761e4 newnet: Make GAME_DROIDDEST synchronised, improve synch recovery. 2010-02-22 14:21:01 +01:00
Cyp f978943eb6 newnet: Fix the host mixing up broadcast messages with messsages to the host, by making NetQueue even more message-oriented. Use -Wall -Werror on C++ files too, and fix the corresponding werrors. Don't use gameRand() from scripts, since the scripts are apparently only executed on the host. Add syncDebug() log function, which is only printed, if it would print different things on different clients. 2010-02-16 23:02:27 +01:00
Cyp 75b06b330a newnet: Use deltas to stop GAME_CHECK_DROID from breaking things that aren't already broken. 2010-02-15 20:56:59 +01:00
Cyp 864b830a44 newnet: Don't wait for dropped players to send NET_GAME_TIME. Add more comments and cleanup. 2010-02-15 20:56:58 +01:00
Cyp e9e30bcb27 newnet: Synch game queues, and play them back at the same rate on all clients. Multiplayer now "works" as it did before, with the advantage that it will be possible to remove the bMultiMessages hacks and implement real multiplayer support.
I even tested that campaign, skirmish, saving and loading still works.
2010-02-15 20:56:57 +01:00
Cyp 7e18c64533 newnet: Change NetQueue into a message queue instead of a byte queue and fix some things. Take into account that NETbeginDecode isn't always matched with NETend, just most of the time.
Apart from each player playing a completely different games, multiplayer seems to work now. The players can chat with each other.
So everything seems normal, just with slightly worse synchronisation; now with literally no synchronisation, instead of just practically no synchronisation.
Newly built trucks are doubled, due to listening to own game messages. Game messages ought to all be implied (and not sent), or sent but not executed until received.
2010-02-15 20:56:57 +01:00
Cyp 8991ed6e76 newnet: Replace use of NETMSG with NetQueue. Breaks multiplayer, which never really worked, anyway. Compiles, links and runs, but freezes in multiplayer. 2010-02-15 20:56:56 +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
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde 52b07e9cf0 Move piefixedpoint.h and pievector.h out of ivis, since they are quite generic
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6615 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:18 +00:00
Per Inge Mathisen 274ae7c9a4 Enforce strict function prototypes for autoconf builds, and fix function prototype problems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4487 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:34:55 +00:00
Giel van Schijndel 7785437073 return the success/failure status from the NETenum template
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4244 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 14:00:30 +00:00
Giel van Schijndel 6cd8e03773 Document NETstring (Doxygen documentation) and use strlcpy instead of memcpy to guarantee NUL-termination
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4241 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 13:48:25 +00:00
Giel van Schijndel f26ccb421d Wrap function-macro NETenum in a do{}while(0) loop
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4239 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 13:33:27 +00:00
Dennis Schridde 43fb8fd0d9 Add fixme for bug #11095.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3877 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-01 01:24:45 +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 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 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
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
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 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 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
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 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