diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-06-23 14:52:45 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-06-23 14:52:45 +0000 |
| commit | 74296b5f2f8b572d3037a9de23c2e8dd1c372a7b (patch) | |
| tree | 7fbd7b7f17269296d14b6ccbe0ae0da8b09d48fb /src/tux.c | |
| parent | 7af32f143eb8615163e1bc78a417434e18da0e71 (diff) | |
- popora AI v moduloch
- zjednodusenie sietoveho protokolu
- oprava chyb
git-svn-id: http://opensvn.csie.org/tuxanci_ng@68 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/tux.c')
| -rw-r--r-- | src/tux.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -356,7 +356,7 @@ static void eventTuxIsDeadWIthShot(tux_t *tux, shot_t *shot) if( getNetTypeGame() == NET_GAME_TYPE_SERVER ) { - proto_send_score_server(PROTO_SEND_ALL, NULL, author); + proto_send_newtux_server(PROTO_SEND_ALL, NULL, author); } } @@ -407,7 +407,7 @@ static void bombBallExplosion(shot_t *shot) if( getNetTypeGame() == NET_GAME_TYPE_SERVER ) { - proto_send_delshot_server(PROTO_SEND_ALL, NULL, shot); + proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id); proto_send_additem_server(PROTO_SEND_ALL, NULL, item); } } @@ -470,6 +470,22 @@ void eventConflictTuxWithShot(arena_t *arena) } } +static void interval() +{ + static my_time_t lastEvent = 0; + my_time_t curentTime; + + if( lastEvent == 0 ) + { + lastEvent = getMyTime(); + } + + curentTime = getMyTime(); + + printf("time = %d\n", curentTime - lastEvent); + + lastEvent = getMyTime(); +} void moveTux(tux_t *tux, int n) { @@ -482,6 +498,7 @@ void moveTux(tux_t *tux, int n) assert( tux != NULL ); arena = getCurrentArena(); + //interval(); if( tux->position != n ) { @@ -623,7 +640,7 @@ void actionTux(tux_t *tux, int action) { return; } - + switch( action ) { case TUX_UP : |