Skip to content

Commit 94b62dd

Browse files
authored
Implement fake multiplayer flag (#52)
`SPAWN.INI->[Settings]->ForceMultiplayer=false ; bool`
1 parent d222a7b commit 94b62dd

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/Spawner/Spawner.Config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void SpawnerConfig::LoadFromINIFile(CCINIClass* pINI)
8383
MaxAhead = pINI->ReadInteger(pSettingsSection, "MaxAhead", MaxAhead);
8484
PreCalcMaxAhead = pINI->ReadInteger(pSettingsSection, "PreCalcMaxAhead", PreCalcMaxAhead);
8585
MaxLatencyLevel = (byte)pINI->ReadInteger(pSettingsSection, "MaxLatencyLevel", (int)MaxLatencyLevel);
86+
ForceMultiplayer = pINI->ReadBool(pSettingsSection, "ForceMultiplayer", ForceMultiplayer);
8687
}
8788

8889
{ // Tunnel Options

src/Spawner/Spawner.Config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class SpawnerConfig
121121
int MaxAhead;
122122
int PreCalcMaxAhead;
123123
byte MaxLatencyLevel;
124+
bool ForceMultiplayer;
124125

125126
// Tunnel Options
126127
int TunnelId;
@@ -192,6 +193,7 @@ class SpawnerConfig
192193
, MaxAhead { -1 }
193194
, PreCalcMaxAhead { 0 }
194195
, MaxLatencyLevel { 0xFF }
196+
, ForceMultiplayer { false }
195197

196198
// Tunnel Options
197199
, TunnelId { 0 }

src/Spawner/Spawner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ bool Spawner::StartScenario(const char* pScenarioName)
291291
{ // Set SessionType
292292
if (Spawner::Config->IsCampaign)
293293
pSession->GameMode = GameMode::Campaign;
294-
else if (Game::PlayerCount > 1)
294+
else if (Game::PlayerCount > 1 || Spawner::Config->ForceMultiplayer)
295295
pSession->GameMode = GameMode::Internet; // HACK: will be set to LAN later
296296
else
297297
pSession->GameMode = GameMode::Skirmish;

0 commit comments

Comments
 (0)