From 35185452d7546ab56aa0040d7c2d68795c3f813f Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 6 Apr 2008 17:25:52 +0000 Subject: - synchronizuju sa aj veci - preklady obsahuju aj font a velkost pismen - upravy aby to slo ( po stahnut tejto verzii sa hra musi odinstalovat a znova naonstalovat ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@43 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/server.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/server.c') diff --git a/src/server.c b/src/server.c index 5c11781..f3972d3 100644 --- a/src/server.c +++ b/src/server.c @@ -29,11 +29,6 @@ #include "publicServer.h" #endif -#ifdef SUPPORT_NET_UNIX_TCP -#include "tcp.h" -static sock_tcp_t *sock_server_tcp; -#endif - #ifdef SUPPORT_NET_UNIX_UDP #include "udp.h" static sock_udp_t *sock_server_udp; @@ -49,8 +44,6 @@ static list_t *listServerTimer; static my_time_t lastSyncClient; static int maxClients; -#if defined SUPPORT_NET_UNIX_UDP || defined SUPPORT_NET_SDL_UDP - static void delZombieCLient(void *p_nothink) { client_t *thisClient; @@ -83,14 +76,21 @@ static void delZombieCLient(void *p_nothink) static void eventPeriodicSyncClient(void *p_nothink) { - my_time_t currentTime; client_t *thisClientInfo; client_t *thisClientSend; + item_t *thisItem; tux_t *thisTux; int i, j; - currentTime = getMyTime(); - + for( i = 0 ; i < getCurrentArena()->listItem->count; i++) + { + thisItem = (item_t *) getCurrentArena()->listItem->list[i]; + + if( thisItem->type != ITEM_EXPLOSION || thisItem->type != ITEM_BIG_EXPLOSION ) + { + proto_send_additem_server(PROTO_SEND_ALL, NULL, thisItem); + } + } for( i = 0 ; i < listClient->count; i++) { @@ -126,8 +126,6 @@ static void eventSendPingClients(void *p_nothink) proto_send_ping_server(PROTO_SEND_ALL, NULL); } -#endif - void static initServer() { listClient = newList(); @@ -186,6 +184,8 @@ static client_t* newAnyClient() new->status = NET_STATUS_OK; new->buffer = newBuffer(LIMIT_BUFFER); + new->lastPing = getMyTime(); + new->lastEvent = getMyTime(); return new; } @@ -202,7 +202,6 @@ client_t* newUdpClient(sock_udp_t *sock_udp) printf("new client from %s:%d\n", str_ip, getSockUdpPort(sock_udp)); new = newAnyClient(); - new->lastPing = getMyTime(); new->socket_udp = sock_udp; return new; @@ -218,7 +217,6 @@ client_t* newSdlUdpClient(sock_sdl_udp_t *sock_sdl_udp) printf("new client from %d\n", getSockSdlUdpPort(sock_sdl_udp)); new = newAnyClient(); - new->lastPing = getMyTime(); new->socket_sdl_udp = sock_sdl_udp; return new; -- cgit v1.2.3