From ad4f9593333a732f4220463977d0d435f6bfdb3b Mon Sep 17 00:00:00 2001 From: oroborus Date: Mon, 18 Aug 2008 15:14:03 +0000 Subject: - audio sa da vypnut pomocou prametra "--noaudio" - server vo svojom defualt konfigu podporuje verziu "test" - oprava chyby, server prestal po case odosileat streli ( suvysi s IDmanagerom ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@219 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- data/conf/server.conf | 6 +++--- src/audio/audio.c | 5 +++++ src/base/idManager.c | 3 ++- src/base/shot.c | 5 +++++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/data/conf/server.conf b/data/conf/server.conf index 074d164..933f424 100644 --- a/data/conf/server.conf +++ b/data/conf/server.conf @@ -1,10 +1,10 @@ NAME defalt gameserver IP4 0.0.0.0 -IP6 ::1 +#IP6 ::1 PORT4 2200 -PORT6 2206 +#PORT6 2206 MAX_CLIENTS 32 ARENA BAIACO8B @@ -15,4 +15,4 @@ MAX_ITEM 10 LOG_FILE tuxanci-server.log SCORE_FILE height-score.txt -SUPPORT_CLIENTS 0.20.0 svn195 svn194 svn193 svn192 svn191 svn190 +SUPPORT_CLIENTS test 0.20.0 svn195 svn194 svn193 svn192 svn191 svn190 diff --git a/src/audio/audio.c b/src/audio/audio.c index 9436791..cc9d81e 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -20,6 +20,11 @@ bool_t isAudioInicialized() */ void initAudio() { + if( isParamFlag("--noaudio") ) + { + return; + } + if (SDL_Init(SDL_INIT_AUDIO) == -1) { fprintf(stderr, _("Unable to initialize audio: %s\n"), SDL_GetError()); return; diff --git a/src/base/idManager.c b/src/base/idManager.c index 63667bf..ee6792c 100644 --- a/src/base/idManager.c +++ b/src/base/idManager.c @@ -74,7 +74,8 @@ static int findNewID() } do{ - ret = ( random() % (listID->count + 8 ) ) + 1; + //ret = ( random() % (listID->count + 8 ) ) + 1; + ret = random() % MAX_ID + 1; }while( isRegisterID(ret) != -1 ); //printf("new ID %d\n", ret); diff --git a/src/base/shot.c b/src/base/shot.c index c5cbc05..244da70 100644 --- a/src/base/shot.c +++ b/src/base/shot.c @@ -313,6 +313,7 @@ static void action_check(space_t *space, shot_t *shot, client_t *client) if( isValueInList(client->listSeesShot, shot->id) == 0 ) { addList(client->listSeesShot, newInt(shot->id) ); + printf("proto_send_shot_server(PROTO_SEND_ONE, client, shot);\n"); proto_send_shot_server(PROTO_SEND_ONE, client, shot); } } @@ -336,6 +337,7 @@ void checkShotIsInTuxScreen(arena_t *arena) { thisClient = (client_t *)listClient->list[i]; thisTux = (tux_t *)thisClient->tux; + int del = 0; if( thisTux == NULL || thisTux->control != TUX_CONTROL_NET ) { @@ -350,7 +352,10 @@ void checkShotIsInTuxScreen(arena_t *arena) while( thisClient->listSeesShot->count > 100 ) { delListItem(thisClient->listSeesShot, 0, free); + del++; } + + //if( del > 0 )printf("del = %d\n", del); } } -- cgit v1.2.3