From 74296b5f2f8b572d3037a9de23c2e8dd1c372a7b Mon Sep 17 00:00:00 2001 From: oroborus Date: Mon, 23 Jun 2008 14:52:45 +0000 Subject: - popora AI v moduloch - zjednodusenie sietoveho protokolu - oprava chyb git-svn-id: http://opensvn.csie.org/tuxanci_ng@68 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/tux.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/tux.c') diff --git a/src/tux.c b/src/tux.c index 710b253..c9d5ff2 100644 --- a/src/tux.c +++ b/src/tux.c @@ -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 : -- cgit v1.2.3