Added MP campaign setup to the dedicated server & some console commands for managing the campaign

This commit is contained in:
Joonas Rikkonen
2017-09-17 20:03:18 +03:00
parent 9114ae658f
commit e26600d088
11 changed files with 218 additions and 42 deletions
@@ -72,11 +72,27 @@ namespace Barotrauma
int index = -1;
if (int.TryParse(string.Join(" ", args), out index))
{
GameMain.NetLobbyScreen.SelectedModeIndex = index;
if (index > 0 && index < GameMain.NetLobbyScreen.GameModes.Length &&
GameMain.NetLobbyScreen.GameModes[index].Name == "Campaign")
{
MultiplayerCampaign.StartCampaignSetup();
}
else
{
GameMain.NetLobbyScreen.SelectedModeIndex = index;
}
}
else
{
GameMain.NetLobbyScreen.SelectedModeName = string.Join(" ", args);
string modeName = string.Join(" ", args);
if (modeName.ToLowerInvariant() == "campaign")
{
MultiplayerCampaign.StartCampaignSetup();
}
else
{
GameMain.NetLobbyScreen.SelectedModeName = modeName;
}
}
NewMessage("Set gamemode to " + GameMain.NetLobbyScreen.SelectedModeName, Color.Cyan);
}));