diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-23 21:38:56 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-23 21:38:56 +0000 |
| commit | aec5ba5ca31f3d7c895beb658a93c353b2b8d5c1 (patch) | |
| tree | 068d2a3ad5e5bf290acf2d73b87e170bc9962069 /src/gun.c | |
| parent | 20ecf36f401adad01cc5ff67e411c596a8b523d5 (diff) | |
- zobratie zbrani/bonusov prebieha na server, a server tuto informaciu posiela clientom
- server checkuje, ci ma client spravnu verziu
- clientovy, ktory sa neprihlasil do hry prikazom hello, neposiela stavy aku su end, alebo deltux
- oprava malej chyby v textfiled
- posladna aktivita serveru/clienta zistuje druha strana na zaklade kazdeho prijateho packetu, nie iba podla
packetu ping
- server posile clientovy pakcety "error <code>" ) nespravny pikaz, veriza, timeout
git-svn-id: http://opensvn.csie.org/tuxanci_ng@33 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/gun.c')
| -rw-r--r-- | src/gun.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -11,6 +11,8 @@ #include "myTimer.h" #include "item.h" #include "gun.h" +#include "proto.h" +#include "net_multiplayer.h" #ifndef BUBLIC_SERVER #include "sound.h" @@ -231,6 +233,8 @@ static void putInGunMine(tux_t *tux) if( isFreeSpace(x, y, ITEM_MINE_WIDTH, ITEM_MINE_HEIGHT) ) { + item_t *item; + #ifndef BUBLIC_SERVER char msg[STR_SIZE]; playSound("put_mine", SOUND_GROUP_BASE); @@ -238,8 +242,15 @@ static void putInGunMine(tux_t *tux) appendTextInTerm(msg); #endif - addList(arena->listItem, newItem(x, y, ITEM_MINE, tux) ); + tux->shot[tux->gun]--; + + if( getNetTypeGame() != NET_GAME_TYPE_CLIENT ) + { + item = newItem(x, y, ITEM_MINE, tux); + proto_send_additem_server(PROTO_SEND_ALL, NULL, item); + addList(arena->listItem, item ); + } } } |