HandleJoystick();
}
-#if defined(NETWORK_AVALIABLE)
if (network.enabled)
HandleNetworking();
-#endif
switch (game_status)
{
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;
if (record_tape)
TapeStartRecording(new_random_seed);
-#if defined(NETWORK_AVALIABLE)
if (init_network_game)
{
SendToServer_StartPlaying();
return;
}
-#endif
InitGame();
}
{
/* 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)
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)
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();
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);
}
else if (tape.pausing)
{
-#if defined(NETWORK_AVALIABLE)
if (network.enabled)
SendToServer_ContinuePlaying();
else
-#endif
TapeTogglePause(TAPE_TOGGLE_MANUAL | TAPE_TOGGLE_PLAY_PAUSE);
}
break;
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)
#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 */
// 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;
}
}
}
-
-#endif /* NETWORK_AVALIABLE */
// 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"
}
while (r > 0);
}
-
-#endif /* NETWORK_AVALIABLE */
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();
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)
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)
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)