From 932b71bf3e486fc38002bbcfba606085e48b6434 Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 16 Mar 2008 17:13:39 +0000 Subject: - aktualny stav git-svn-id: http://opensvn.csie.org/tuxanci_ng@21 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/publicServer.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/publicServer.c') diff --git a/src/publicServer.c b/src/publicServer.c index ae229d5..952628c 100644 --- a/src/publicServer.c +++ b/src/publicServer.c @@ -85,16 +85,25 @@ void findFreeSpace(int *x, int *y, int w, int h) void eventPublicServer() { - static my_time_t time = 0; + static my_time_t lastActive = 0; + my_time_t interval; + + eventNetMultiplayer(); if( time == 0 ) { - time = getMyTime(); + lastActive = getMyTime(); } - printf("time %d\n", getMyTime() - time ); + interval = getMyTime() - lastActive; + + if( interval < 50 ) + { + return; + } - time = getMyTime(); + printf("interval = %d\n", interval); + lastActive = getMyTime(); eventConflictTuxWithTeleport(arena->listTux, arena->listTeleport); eventConflictTuxWithShot(arena->listTux, arena->listShot); @@ -109,7 +118,6 @@ void eventPublicServer() eventListTux(arena->listTux); eventTimer(); - eventNetMultiplayer(); } void quitPublicServer() -- cgit v1.2.3