- properly set 'netgame' in C/S situations to disable cheats and make the game continue running when the menu/console are active

This commit is contained in:
Rachael Alexanderson 2018-04-28 10:04:22 -04:00
parent 10388f83ef
commit bb235ab572
4 changed files with 13 additions and 28 deletions

View file

@ -246,33 +246,9 @@ void Network::D_CheckNetGame()
Printf("using alternate port %i\n", port); Printf("using alternate port %i\n", port);
} }
// parse network game options, netgame = false;
// player 1: -host <numplayers> multiplayer = false;
// player x: -join <player 1's address> consoleplayer = 0;
if ((i = Args->CheckParm("-host")))
{
doomcom = I_InitNetwork(port);
//HostGame(i);
}
else if ((i = Args->CheckParm("-join")))
{
if ((i == Args->NumArgs() - 1) ||
(Args->GetArg(i + 1)[0] == '-') ||
(Args->GetArg(i + 1)[0] == '+'))
I_FatalError("You need to specify the host machine's address");
doomcom = I_InitNetwork(0);
doomcom->Connect(Args->GetArg(i + 1));
//JoinGame(i);
}
else
{
// single player game
netgame = false;
multiplayer = false;
//numplayers = numnodes = 1;
consoleplayer = 0;
}
v = Args->CheckValue("-dup"); v = Args->CheckValue("-dup");
if (v) if (v)

View file

@ -65,9 +65,13 @@
#include "events.h" #include "events.h"
#include "i_time.h" #include "i_time.h"
extern bool netserver, netclient;
NetSinglePlayer::NetSinglePlayer() NetSinglePlayer::NetSinglePlayer()
{ {
netgame = false; netgame = false;
netclient = false;
netserver = false;
multiplayer = false; multiplayer = false;
consoleplayer = 0; consoleplayer = 0;
players[0].settings_controller = true; players[0].settings_controller = true;

View file

@ -154,6 +154,7 @@ bool netgame; // only true if packets are broadcast
bool multiplayer; bool multiplayer;
bool multiplayernext = false; // [SP] Map coop/dm implementation bool multiplayernext = false; // [SP] Map coop/dm implementation
bool netclient; // clientside playsim bool netclient; // clientside playsim
bool netserver = false; // used to enforce 'netplay = true'
player_t players[MAXPLAYERS]; player_t players[MAXPLAYERS];
bool playeringame[MAXPLAYERS]; bool playeringame[MAXPLAYERS];
@ -2851,6 +2852,7 @@ void G_TimeDemo (const char* name)
void G_InitServerNetGame(const char *mapname) void G_InitServerNetGame(const char *mapname)
{ {
netgame = true; netgame = true;
netserver = true;
netclient = false; netclient = false;
multiplayer = true; multiplayer = true;
multiplayernext = true; multiplayernext = true;
@ -2867,6 +2869,7 @@ void G_InitServerNetGame(const char *mapname)
void G_InitClientNetGame(int player, const char* mapname) void G_InitClientNetGame(int player, const char* mapname)
{ {
netgame = true; netgame = true;
netserver = false;
netclient = true; netclient = true;
multiplayer = true; multiplayer = true;
multiplayernext = true; multiplayernext = true;

View file

@ -150,6 +150,8 @@ extern bool sendpause, sendsave, sendturn180, SendLand;
void *statcopy; // for statistics driver void *statcopy; // for statistics driver
FLevelLocals level; // info about current level FLevelLocals level; // info about current level
extern bool netserver; // serverside playsim
extern bool netclient; // clientside playsim
//========================================================================== //==========================================================================
@ -350,7 +352,7 @@ void G_NewInit ()
} }
G_ClearSnapshots (); G_ClearSnapshots ();
netgame = false; netgame = (netclient || netserver);
multiplayer = multiplayernext; multiplayer = multiplayernext;
multiplayernext = false; multiplayernext = false;
if (demoplayback) if (demoplayback)