From e26600d0887bab244c2f5bc83602ff5e9978f511 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 17 Sep 2017 20:03:18 +0300 Subject: [PATCH] Added MP campaign setup to the dedicated server & some console commands for managing the campaign --- .../Source/GameSession/GameSession.cs | 9 --- .../Source/Screens/CampaignSetupUI.cs | 11 ++-- .../BarotraumaServer/BarotraumaServer.csproj | 4 +- .../BarotraumaServer/Source/DebugConsole.cs | 20 +++++- .../Source/GameSession/GameSession.cs | 7 --- .../Source/Screens/NetLobbyScreen.cs | 42 ++++++++----- .../BarotraumaShared/Source/DebugConsole.cs | 63 ++++++++++++++++++- .../GameSession/GameModes/CampaignMode.cs | 31 ++++++++- .../GameModes/MultiplayerCampaign.cs | 49 ++++++++++++++- .../Source/GameSession/GameSession.cs | 11 +++- .../BarotraumaShared/Source/Map/Map/Map.cs | 13 ++++ 11 files changed, 218 insertions(+), 42 deletions(-) delete mode 100644 Barotrauma/BarotraumaServer/Source/GameSession/GameSession.cs diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs index 12a8d9e90..e63c9b25a 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameSession.cs @@ -8,15 +8,6 @@ namespace Barotrauma private InfoFrameTab selectedTab; private GUIButton infoButton; private GUIFrame infoFrame; - - public Map Map - { - get - { - CampaignMode mode = (GameMode as CampaignMode); - return (mode == null) ? null : mode.Map; - } - } private RoundSummary roundSummary; public RoundSummary RoundSummary diff --git a/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs b/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs index 9840dc18b..9aa92c607 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/CampaignSetupUI.cs @@ -63,15 +63,18 @@ namespace Barotrauma "Are you sure you want to choose a shuttle as your vessel?", new string[] { "Yes", "No" }); - msgBox.Buttons[0].OnClicked = (button, obj) => { StartNewGame?.Invoke(selectedSub, saveNameBox.Text, seedBox.Text); return true; }; + string savePath = SaveUtil.CreateSavePath(isMultiplayer ? SaveUtil.SaveType.Multiplayer : SaveUtil.SaveType.Singleplayer, saveNameBox.Text); + msgBox.Buttons[0].OnClicked = (button, obj) => { StartNewGame?.Invoke(selectedSub, savePath, seedBox.Text); return true; }; msgBox.Buttons[0].OnClicked += msgBox.Close; msgBox.Buttons[1].OnClicked = msgBox.Close; return false; } - - string savePath = SaveUtil.CreateSavePath(isMultiplayer ? SaveUtil.SaveType.Multiplayer : SaveUtil.SaveType.Singleplayer, saveNameBox.Text); - StartNewGame?.Invoke(selectedSub, savePath, seedBox.Text); + else + { + string savePath = SaveUtil.CreateSavePath(isMultiplayer ? SaveUtil.SaveType.Multiplayer : SaveUtil.SaveType.Singleplayer, saveNameBox.Text); + StartNewGame?.Invoke(selectedSub, savePath, seedBox.Text); + } return true; }; diff --git a/Barotrauma/BarotraumaServer/BarotraumaServer.csproj b/Barotrauma/BarotraumaServer/BarotraumaServer.csproj index aa93102bf..82c8da31b 100644 --- a/Barotrauma/BarotraumaServer/BarotraumaServer.csproj +++ b/Barotrauma/BarotraumaServer/BarotraumaServer.csproj @@ -66,7 +66,6 @@ - @@ -123,6 +122,9 @@ + + +