X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=b048083108d3fbe97c6f653798aed31f1c84094c;hb=c4b26cf489dcc65a00bfcc05f7898700d2f0c9e4;hp=ecafc3b848cc3932394cf38ebf9184248b621782;hpb=1cacebfb41c20889c904155001a5b88ace962348;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index ecafc3b8..b0480831 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 /* @@ -33,7 +34,7 @@ struct PictureFileInfo { char *picture_filename; - BOOL picture_with_mask; + boolean picture_with_mask; }; struct IconFileInfo @@ -56,6 +57,14 @@ static void InitElementProperties(void); void OpenAll(int argc, char *argv[]) { + if (options.serveronly) + { + NetworkServer(options.server_port, options.serveronly); + + /* never reached */ + exit(0); + } + InitLevelAndPlayerInfo(); InitCounter(); @@ -83,25 +92,80 @@ void OpenAll(int argc, char *argv[]) void InitLevelAndPlayerInfo() { + int i; + + +#if 0 + + /* initialize local setup */ + setup.sound_on = TRUE; + setup.sound_loops_on = FALSE; + setup.sound_music_on = FALSE; + setup.sound_simple_on = FALSE; + setup.toons_on = TRUE; + setup.direct_draw_on = FALSE; + setup.scroll_delay_on = FALSE; + setup.soft_scrolling_on = TRUE; + setup.fading_on = FALSE; + setup.autorecord_on = FALSE; + setup.quick_doors = FALSE; + for (i=0; iconnected = TRUE; + local_player->local = TRUE; } void InitNetworkServer() { int nr_wanted; - if (standalone) + if (!options.network) return; nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED); - if (!ConnectToServer(server_host, server_port)) + if (!ConnectToServer(options.server_host, options.server_port)) Error(ERR_EXIT, "cannot connect to multiplayer server"); SendToServer_Nickname(local_player->alias_name); @@ -121,14 +185,14 @@ void InitSound() #ifndef MSDOS if (access(sound_device_name,W_OK)<0) { - Error(ERR_RETURN, "cannot access sound device - no sounds"); + Error(ERR_WARN, "cannot access sound device - no sounds"); sound_status = SOUND_OFF; return; } if ((sound_device = open(sound_device_name,O_WRONLY))<0) { - Error(ERR_RETURN, "cannot open sound device - no sounds"); + Error(ERR_WARN, "cannot open sound device - no sounds"); sound_status = SOUND_OFF; return; } @@ -138,11 +202,19 @@ void InitSound() #ifdef VOXWARE sound_loops_allowed = TRUE; - sound_loops_on = TRUE; + + /* + setup.sound_loops_on = TRUE; + */ + #endif #else sound_loops_allowed = TRUE; - sound_loops_on = TRUE; + + /* + setup.sound_loops_on = TRUE; + */ + #endif for(i=0; i