X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=6931936ee00a902d1aa55ba437dfa8dba5d5fa95;hb=59c2e609872b70cb4c458004cd9e2fe22c86a54b;hp=0a0c7580c460bd184622b944a91fb6e14d09b052;hpb=2fe0fbc2a34fd4b50081f1829931dea3ca2c4c1c;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 0a0c7580..6931936e 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(); @@ -96,9 +105,7 @@ void InitNetworkServer() { int nr_wanted; - standalone = FALSE; - - if (standalone) + if (!network) return; nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED); @@ -117,7 +124,7 @@ void InitSound() { int i; - if (sound_status==SOUND_OFF) + if (sound_status == SOUND_OFF) return; #ifndef MSDOS @@ -128,7 +135,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; @@ -136,7 +143,7 @@ void InitSound() } close(sound_device); - sound_status=SOUND_AVAILABLE; + sound_status = SOUND_AVAILABLE; #ifdef VOXWARE sound_loops_allowed = TRUE; @@ -147,7 +154,7 @@ void InitSound() sound_loops_on = TRUE; #endif - for(i=0;i