game.envelope_active = FALSE;
- game.centered_player_nr = game.centered_player_nr_next = -1; /* focus all */
+ /* set focus to local player for network games, else to all players */
+ game.centered_player_nr = (network_playing ? local_player->index_nr : -1);
+ game.centered_player_nr_next = game.centered_player_nr;
game.set_centered_player = FALSE;
+ if (network_playing && tape.recording)
+ {
+ /* store client dependent player focus when recording network games */
+ tape.centered_player_nr_next = game.centered_player_nr_next;
+ tape.set_centered_player = TRUE;
+ }
+
+#if 0
+ printf("::: focus set to player %d [%d]\n",
+ game.centered_player_nr, local_player->index_nr);
+#endif
+
for (i = 0; i < NUM_BELTS; i++)
{
game.belt_dir[i] = MV_NONE;
{
int i;
+#if 0
+ Error(ERR_NETWORK_CLIENT, "advancing frame counter from %d to %d",
+ FrameCounter, FrameCounter + 1);
+#endif
+
/* advance frame counters (global frame counter and time frame counter) */
FrameCounter++;
TimeFrames++;
void StartGameActions(boolean init_network_game, boolean record_tape,
long random_seed)
{
-#if 1
unsigned long new_random_seed = InitRND(random_seed);
if (record_tape)
TapeStartRecording(new_random_seed);
-#else
- if (record_tape)
- TapeStartRecording(random_seed);
-#endif
#if defined(NETWORK_AVALIABLE)
if (init_network_game)
game_status = GAME_MODE_PLAYING;
-#if 0
- InitRND(random_seed);
-#endif
-
InitGame();
}
if (!network_player_action_received)
return; /* failed to get network player actions in time */
+
+ /* do not yet reset "network_player_action_received" (for tape.pausing) */
}
if (tape.pausing)
return;
+ /* at this point we know that we really continue executing the game */
+
+#if 1
+ network_player_action_received = FALSE;
+#endif
+
recorded_player_action = (tape.playing ? TapePlayAction() : NULL);
if (tape.set_centered_player)
ScrollPlayer(&stored_player[i], SCROLL_GO_ON);
}
+#if 0
network_player_action_received = FALSE;
+#endif
ScrollScreen(NULL, SCROLL_GO_ON);
{
#if defined(NETWORK_AVALIABLE)
if (options.network)
- SendToServer_StopPlaying();
+ SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER);
else
#endif
{
switch (id)
{
case GAME_CTRL_ID_STOP:
- RequestQuitGame(TRUE);
+ if (tape.playing)
+ TapeStop();
+ else
+ RequestQuitGame(TRUE);
break;
case GAME_CTRL_ID_PAUSE:
#endif
{
tape.pausing = FALSE;
- DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0);
+ DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF, 0);
}
}
break;