summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/publicServer.c18
-rw-r--r--src/server.c8
2 files changed, 14 insertions, 12 deletions
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()
diff --git a/src/server.c b/src/server.c
index d2f6598..2e3e141 100644
--- a/src/server.c
+++ b/src/server.c
@@ -593,7 +593,6 @@ void selectServerUdpSocket()
static struct timeval tv = { .tv_sec = 0, .tv_usec = 50000 };
fd_set readfds;
int max_fd;
- unsigned int z;
#ifndef BUBLIC_SERVER
tv.tv_sec = 0;
@@ -602,7 +601,7 @@ void selectServerUdpSocket()
#ifdef BUBLIC_SERVER
tv.tv_sec = 0;
- tv.tv_usec = 0;
+ tv.tv_usec = 50000;
#endif
FD_ZERO(&readfds);
@@ -613,11 +612,6 @@ void selectServerUdpSocket()
select(max_fd+1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &tv);
-#ifdef BUBLIC_SERVER
- z = tv.tv_usec;
- usleep( 50000 - z );
-#endif
-
/*
printf("%d\n", tv.tv_usec);
*/