removed preprocessor definition for network mode that is always true now
authorHolger Schemel <info@artsoft.org>
Thu, 14 Jun 2018 17:43:19 +0000 (19:43 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 18 Jun 2018 17:47:32 +0000 (19:47 +0200)
src/events.c
src/game.c
src/init.c
src/libgame/platform.h
src/netserv.c
src/network.c
src/tools.c

index 7972d1b53e0ddf37bd1973383675e25b414cd3ae..12477eea9ff14658ce7809b718a463329a35acee 100644 (file)
@@ -2222,10 +2222,8 @@ void HandleEventActions()
     HandleJoystick();
   }
 
-#if defined(NETWORK_AVALIABLE)
   if (network.enabled)
     HandleNetworking();
-#endif
 
   switch (game_status)
   {
index efb18c36f18b708f955f7d702bd7e49974ae7bba..13634a2c76122ab7b2a37f0482a5c123b1ecb90a 100644 (file)
@@ -3503,11 +3503,9 @@ void InitGame()
 
   network_player_action_received = FALSE;
 
-#if defined(NETWORK_AVALIABLE)
   /* initial null action */
   if (network_playing)
     SendToServer_MovePlayer(MV_NONE);
-#endif
 
   ZX = ZY = -1;
   ExitX = ExitY = -1;
@@ -11290,14 +11288,12 @@ void StartGameActions(boolean init_network_game, boolean record_tape,
   if (record_tape)
     TapeStartRecording(new_random_seed);
 
-#if defined(NETWORK_AVALIABLE)
   if (init_network_game)
   {
     SendToServer_StartPlaying();
 
     return;
   }
-#endif
 
   InitGame();
 }
@@ -11420,10 +11416,8 @@ void GameActionsExt()
   {
     /* try to get network player actions in time */
 
-#if defined(NETWORK_AVALIABLE)
     /* last chance to get network player actions without main loop delay */
     HandleNetworking();
-#endif
 
     /* game was quit by network peer */
     if (game_status != GAME_MODE_PLAYING)
@@ -11469,10 +11463,8 @@ void GameActionsExt()
       stored_player[i].effective_action = stored_player[i].action;
   }
 
-#if defined(NETWORK_AVALIABLE)
   if (network_playing)
     SendToServer_MovePlayer(summarized_player_action);
-#endif
 
   // summarize all actions at local players mapped input device position
   // (this allows using different input devices in single player mode)
@@ -14967,11 +14959,9 @@ void RequestQuitGameExt(boolean skip_request, boolean quick_quit, char *message)
     if (!skip_request)
       CloseDoor(DOOR_CLOSE_1);
 
-#if defined(NETWORK_AVALIABLE)
     if (network.enabled)
       SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER);
     else
-#endif
     {
       if (quick_quit)
        FadeSkipNextFadeIn();
@@ -15779,12 +15769,10 @@ static void HandleGameButtonsExt(int id, int button)
     case GAME_CTRL_ID_PANEL_PAUSE:
       if (network.enabled && game_status == GAME_MODE_PLAYING)
       {
-#if defined(NETWORK_AVALIABLE)
        if (tape.pausing)
          SendToServer_ContinuePlaying();
        else
          SendToServer_PausePlaying();
-#endif
       }
       else
        TapeTogglePause(TAPE_TOGGLE_MANUAL);
@@ -15801,11 +15789,9 @@ static void HandleGameButtonsExt(int id, int button)
       }
       else if (tape.pausing)
       {
-#if defined(NETWORK_AVALIABLE)
        if (network.enabled)
          SendToServer_ContinuePlaying();
        else
-#endif
          TapeTogglePause(TAPE_TOGGLE_MANUAL | TAPE_TOGGLE_PLAY_PAUSE);
       }
       break;
index 8dec027785859377910914d56630c8a05aeeadd9..ffb825943520cec7a3ddf10f7b3b21622e62527f 100644 (file)
@@ -5619,14 +5619,12 @@ void InitNetworkServer()
   if (!network.enabled)
     return;
 
-#if defined(NETWORK_AVALIABLE)
   if (!ConnectToServer(network.server_host, network.server_port))
     Error(ERR_EXIT, "cannot connect to network game server");
 
   SendToServer_PlayerName(setup.player_name);
   SendToServer_ProtocolVersion();
   SendToServer_NrWanted(setup.network_player_nr + 1);
-#endif
 }
 
 static boolean CheckArtworkConfigForCustomElements(char *filename)
index 2fe3be79d5e0a76320ac52e9e991ffb5f5a3fadc..6587f9e3380b3d8aef14760568b1c716f74d93f6 100644 (file)
 #endif
 
 
-/* ========================================================================= */
-/* this should better go into "system.h" or "features.h" (yet to be created) */
-/* ========================================================================= */
-
-#if defined(PLATFORM_UNIX) || defined(TARGET_SDL)
-#define NETWORK_AVALIABLE
-#endif
-
 #endif /* PLATFORM_H */
index 02a014fd86f3757a6b3891bbb302b7cfb2007d1c..4fd8461076fa0c3a5332ca500f9b0c9d2ed916f4 100644 (file)
@@ -9,20 +9,16 @@
 // netserv.c
 // ============================================================================
 
-#include "libgame/platform.h"
-
-#if defined(NETWORK_AVALIABLE)
-
 #include <fcntl.h>
 #include <sys/time.h>
 #include <signal.h>
 #include <errno.h>
 
-#include "main.h"
-
 #include "libgame/libgame.h"
 
 #include "netserv.h"
+#include "main.h"
+
 
 static int clients = 0;
 static int onceonly = 0;
@@ -657,5 +653,3 @@ void NetworkServer(int port, int serveronly)
     }
   }
 }
-
-#endif /* NETWORK_AVALIABLE */
index 742cea5792e6a0cd639b851b12a4c92f2916c329..2bc8f5c4d477984d761f3094b9fe820e93d3a24d 100644 (file)
@@ -9,19 +9,14 @@
 // network.c
 // ============================================================================
 
-#include "libgame/platform.h"
-
-#if defined(NETWORK_AVALIABLE)
-
 #include <signal.h>
 #include <sys/time.h>
 
-#include "main.h"
-
 #include "libgame/libgame.h"
 
 #include "network.h"
 #include "netserv.h"
+#include "main.h"
 #include "game.h"
 #include "tape.h"
 #include "files.h"
@@ -697,5 +692,3 @@ void HandleNetworking()
   }
   while (r > 0);
 }
-
-#endif /* NETWORK_AVALIABLE */
index 7e80c6f8a97183964dd159c66507f922221d8773..aac531f02f3964afc8504d3cbbbe3372c67628b4 100644 (file)
@@ -4392,13 +4392,11 @@ static boolean RequestDoor(char *text, unsigned int req_state)
 
   SetMouseCursor(CURSOR_DEFAULT);
 
-#if defined(NETWORK_AVALIABLE)
   /* pause network game while waiting for request to answer */
   if (network.enabled &&
       game_status == GAME_MODE_PLAYING &&
       req_state & REQUEST_WAIT_FOR_INPUT)
     SendToServer_PausePlaying();
-#endif
 
   old_door_state = GetDoorState();
 
@@ -4534,13 +4532,11 @@ static boolean RequestDoor(char *text, unsigned int req_state)
     SetDrawBackgroundMask(REDRAW_FIELD);
   }
 
-#if defined(NETWORK_AVALIABLE)
   /* continue network game after request */
   if (network.enabled &&
       game_status == GAME_MODE_PLAYING &&
       req_state & REQUEST_WAIT_FOR_INPUT)
     SendToServer_ContinuePlaying();
-#endif
 
   /* restore deactivated drawing when quick-loading level tape recording */
   if (tape.playing && tape.deactivate_display)
@@ -4562,13 +4558,11 @@ static boolean RequestEnvelope(char *text, unsigned int req_state)
 
   SetMouseCursor(CURSOR_DEFAULT);
 
-#if defined(NETWORK_AVALIABLE)
   /* pause network game while waiting for request to answer */
   if (network.enabled &&
       game_status == GAME_MODE_PLAYING &&
       req_state & REQUEST_WAIT_FOR_INPUT)
     SendToServer_PausePlaying();
-#endif
 
   /* simulate releasing mouse button over last gadget, if still pressed */
   if (button_status)
@@ -4621,13 +4615,11 @@ static boolean RequestEnvelope(char *text, unsigned int req_state)
     SetDrawBackgroundMask(REDRAW_FIELD);
   }
 
-#if defined(NETWORK_AVALIABLE)
   /* continue network game after request */
   if (network.enabled &&
       game_status == GAME_MODE_PLAYING &&
       req_state & REQUEST_WAIT_FOR_INPUT)
     SendToServer_ContinuePlaying();
-#endif
 
   /* restore deactivated drawing when quick-loading level tape recording */
   if (tape.playing && tape.deactivate_display)