X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=cbfab54b20dae6f0bb8a34c653630f0e075dd0b1;hb=e7f36cd97c8580345714b4a22d6b4ad291e50ed6;hp=76ff5941d1545618b35b4f9d48c1d37d9d5be89d;hpb=d32496fdd3867910a188acba0ac132f66c99306c;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 76ff5941..cbfab54b 100644 --- a/src/init.c +++ b/src/init.c @@ -23,6 +23,7 @@ #include "gfxload.h" #include "gifload.h" #include "network.h" +#include "netserv.h" #ifdef DEBUG /* @@ -56,6 +57,14 @@ static void InitElementProperties(void); void OpenAll(int argc, char *argv[]) { + if (serveronly) + { + NetworkServer(server_port, serveronly); + + /* never reached */ + exit(0); + } + InitLevelAndPlayerInfo(); InitCounter(); @@ -83,6 +92,8 @@ void OpenAll(int argc, char *argv[]) void InitLevelAndPlayerInfo() { + int i; + local_player = &stored_player[0]; if (!LoadLevelInfo()) /* global level info */ @@ -90,13 +101,21 @@ void InitLevelAndPlayerInfo() LoadPlayerInfo(PLAYER_SETUP); /* global setup info */ LoadPlayerInfo(PLAYER_LEVEL); /* level specific info */ + + for (i=0; iconnected = TRUE; + local_player->local = TRUE; } void InitNetworkServer() { int nr_wanted; - if (standalone) + if (!network) return; nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED); @@ -115,7 +134,7 @@ void InitSound() { int i; - if (sound_status==SOUND_OFF) + if (sound_status == SOUND_OFF) return; #ifndef MSDOS @@ -126,7 +145,7 @@ void InitSound() return; } - if ((sound_device=open(sound_device_name,O_WRONLY))<0) + if ((sound_device = open(sound_device_name,O_WRONLY))<0) { Error(ERR_RETURN, "cannot open sound device - no sounds"); sound_status = SOUND_OFF; @@ -134,7 +153,7 @@ void InitSound() } close(sound_device); - sound_status=SOUND_AVAILABLE; + sound_status = SOUND_AVAILABLE; #ifdef VOXWARE sound_loops_allowed = TRUE; @@ -145,7 +164,7 @@ void InitSound() sound_loops_on = TRUE; #endif - for(i=0;i