2f107db...5202af9

This commit is contained in:
Joonas Rikkonen
2019-03-18 21:42:26 +02:00
parent 58c92888b7
commit 044fd3344b
395 changed files with 27417 additions and 19754 deletions
@@ -6,32 +6,31 @@ namespace Barotrauma
{
partial class NetLobbyScreen : Screen
{
public bool IsServer;
public string ServerName = "Server";
private UInt16 lastUpdateID;
public UInt16 LastUpdateID
{
get { if (GameMain.Server != null && lastUpdateID < 1) lastUpdateID++; return lastUpdateID; }
get
{
#if SERVER
if (GameMain.Server != null && lastUpdateID < 1) lastUpdateID++;
#endif
return lastUpdateID;
}
set { lastUpdateID = value; }
}
//for guitextblock delegate
public string GetServerName()
{
return ServerName;
}
private string levelSeed = "";
public void SetLevelDifficulty(float difficulty)
{
difficulty = MathHelper.Clamp(difficulty, 0.0f, 100.0f);
#if SERVER
if (GameMain.Server != null)
{
GameMain.Server.SelectedLevelDifficulty = difficulty;
GameMain.Server.ServerSettings.SelectedLevelDifficulty = difficulty;
lastUpdateID++;
}
#endif
#if CLIENT
levelDifficultyScrollBar.BarScroll = difficulty / 100.0f;
#endif
@@ -39,15 +38,48 @@ namespace Barotrauma
public void ToggleTraitorsEnabled(int dir)
{
#if SERVER
if (GameMain.Server == null) return;
lastUpdateID++;
int index = (int)GameMain.Server.TraitorsEnabled + dir;
int index = (int)GameMain.Server.ServerSettings.TraitorsEnabled + dir;
if (index < 0) index = 2;
if (index > 2) index = 0;
SetTraitorsEnabled((YesNoMaybe)index);
#endif
}
public void SetBotCount(int botCount)
{
#if SERVER
if (GameMain.Server != null)
{
if (botCount < 0) botCount = GameMain.Server.ServerSettings.MaxBotCount;
if (botCount > GameMain.Server.ServerSettings.MaxBotCount) botCount = 0;
GameMain.Server.ServerSettings.BotCount = botCount;
lastUpdateID++;
}
#endif
#if CLIENT
(botCountText as GUITextBlock).Text = botCount.ToString();
#endif
}
public void SetBotSpawnMode(BotSpawnMode botSpawnMode)
{
#if SERVER
if (GameMain.Server != null)
{
GameMain.Server.ServerSettings.BotSpawnMode = botSpawnMode;
lastUpdateID++;
}
#endif
#if CLIENT
(botSpawnModeText as GUITextBlock).Text = TextManager.Get(botSpawnMode.ToString());
#endif
}
public void SetBotCount(int botCount)
@@ -79,9 +111,11 @@ namespace Barotrauma
public void SetTraitorsEnabled(YesNoMaybe enabled)
{
if (GameMain.Server != null) GameMain.Server.TraitorsEnabled = enabled;
#if SERVER
if (GameMain.Server != null) GameMain.Server.ServerSettings.TraitorsEnabled = enabled;
#endif
#if CLIENT
(traitorProbabilityText as GUITextBlock).Text = enabled.ToString();
(traitorProbabilityText as GUITextBlock).Text = TextManager.Get(enabled.ToString());
#endif
}
}