diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-16 19:22:06 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-16 19:22:06 +0000 |
| commit | 51aae47ae08ad61507f219c24ed6d9321c866f45 (patch) | |
| tree | ab111374d581adb66d718c39275d39a7fd4bc30a /src | |
| parent | 13d754c917ebcf1be913bd35f4c0e44468edeb52 (diff) | |
- upravy, hlavne siete
git-svn-id: http://opensvn.csie.org/tuxanci_ng@23 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src')
| -rwxr-xr-x | src/Makefile | 4 | ||||
| -rwxr-xr-x | src/Makefile-publicServer | 4 | ||||
| -rw-r--r-- | src/arenaFile.c | 13 | ||||
| -rwxr-xr-x | src/director.c | 2 | ||||
| -rw-r--r-- | src/main.c | 2 | ||||
| -rw-r--r-- | src/publicServer.c | 7 | ||||
| -rw-r--r-- | src/server.c | 4 |
7 files changed, 24 insertions, 12 deletions
diff --git a/src/Makefile b/src/Makefile index 9c2938f..67e442b 100755 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ #CC = /usr/local/gcc/bin/gcc CC = gcc -CFLAGS = -g -O0 -DSUPPORT_NET_SDL_UDP -DDISTDIR=\"$(DISTDIR)\" `sdl-config --cflags` -I../include -Wall +CFLAGS = -g -O0 -DSUPPORT_NET_SDL_UDP -DDISTDIR=\"$(DISTDIR)\" -I../include -Wall `sdl-config --cflags` #CFLAGS = -O2 -DDISTDIR=\"$(DISTDIR)\" `sdl-config --cflags` -I../include -Wall LIBS = `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL_net @@ -165,4 +165,4 @@ screen_table.o: screen_table.c ../include/screen_table.h $(CC) $(CFLAGS) -o screen_table.o -c screen_table.c clean: - rm -rf *.o *.c~ *.h~ tuxanci-ng + rm -rf *.o *.c~ ../include/*.h~ Makefile~ tuxanci-ng diff --git a/src/Makefile-publicServer b/src/Makefile-publicServer index 4d9df5e..8c4f90f 100755 --- a/src/Makefile-publicServer +++ b/src/Makefile-publicServer @@ -4,7 +4,7 @@ CC = gcc DISTDIR:=/usr/ -CFLAGS = -g -O0 -DBUBLIC_SERVER -DSUPPORT_NET_UNIX_UDP -DDISTDIR=\"$(DISTDIR)\" -I../include -Wall +CFLAGS = -g -O0 -DBUBLIC_SERVER -DSUPPORT_NET_UNIX_UDP -I../include -Wall #CFLAGS = -O2 -DDISTDIR=\"$(DISTDIR)\" `sdl-config --cflags` -I../include -Wall LIBS = @@ -86,5 +86,5 @@ pipe.o: pipe.c ../include/pipe.h $(CC) $(CFLAGS) -o pipe.o -c pipe.c clean: - rm -rf *.o *.c~ *.h~ publicserver + rm -rf *.o *.c~ ../include*.h~ Makefile-publicServer~ publicserver diff --git a/src/arenaFile.c b/src/arenaFile.c index f13750a..a58f3be 100644 --- a/src/arenaFile.c +++ b/src/arenaFile.c @@ -296,7 +296,13 @@ void initArenaFile() isArenaFileInit = TRUE; listArenaFile = newList(); +#ifndef BUBLIC_SERVER p = loadDirector(PATH_ARENA); +#endif + +#ifdef BUBLIC_SERVER + p = loadDirector(PUBLIC_SERVER_PATH_ARENA); +#endif for( i = 0 ; i < p->list->count ; i++ ) { @@ -307,8 +313,13 @@ void initArenaFile() if( strstr(line, ".map") != NULL && strstr(line, "~") == NULL ) { char path[STR_PATH_SIZE]; - sprintf(path, PATH_ARENA "%s", line); +#ifndef BUBLIC_SERVER + sprintf(path, PATH_ARENA "%s", line); +#endif +#ifdef BUBLIC_SERVER + sprintf(path, PUBLIC_SERVER_PATH_ARENA "%s", line); +#endif printf("load map %s\n", line); addList(listArenaFile, loadTextFile(path)); } diff --git a/src/director.c b/src/director.c index 9c11cb2..e0b16b9 100755 --- a/src/director.c +++ b/src/director.c @@ -3,6 +3,7 @@ #include <sys/types.h> #include <stdlib.h> #include <string.h> +#include <stdio.h> #include <unistd.h> #include <assert.h> @@ -41,6 +42,7 @@ director_t* loadDirector(char *s) } new->path = strdup(path); + printf("new->path = %s\n", new->path); dir = opendir(new->path); @@ -154,8 +154,6 @@ int main(int argc, char *argv[]) { srand( (unsigned) time(NULL) ); - printf("dist dir = %s\n", DISTDIR); - my_argc = argc; my_argv = argv; diff --git a/src/publicServer.c b/src/publicServer.c index 1108a20..8206062 100644 --- a/src/publicServer.c +++ b/src/publicServer.c @@ -19,7 +19,7 @@ #include "publicServer.h" #include "net_multiplayer.h" -static int arenaId = 0; +static int arenaId; static arena_t *arena; arena_t* getWorldArena() @@ -39,7 +39,7 @@ void initPublicServer() initShot(); initTimer(); - + arenaId = getArenaIdFormNetName( getParamElse("--arena", "FAGN") ); arena = getArena(arenaId); addNewItem(arena->listItem, NULL); @@ -103,8 +103,9 @@ void eventPublicServer() { return; } - +/* printf("interval = %d\n", interval); +*/ lastActive = getMyTime(); eventConflictTuxWithTeleport(arena->listTux, arena->listTeleport); diff --git a/src/server.c b/src/server.c index 5e4d40b..032a210 100644 --- a/src/server.c +++ b/src/server.c @@ -594,7 +594,7 @@ static void eventClientUdpSelect(sock_udp_t *sock_server) void selectServerUdpSocket() { - static struct timeval tv = { .tv_sec = 0, .tv_usec = 50000 }; + struct timeval tv; fd_set readfds; int max_fd; @@ -605,7 +605,7 @@ void selectServerUdpSocket() #ifdef BUBLIC_SERVER tv.tv_sec = 0; - tv.tv_usec = 50000; + tv.tv_usec = 5000; #endif FD_ZERO(&readfds); |