Fixed rangeban

This commit is contained in:
juanjp600
2016-09-03 18:15:36 -03:00
parent 6f25bee9e1
commit 2116a1a93a
4 changed files with 41 additions and 39 deletions

View File

@@ -55,19 +55,19 @@ namespace Barotrauma
const float NetworkUpdateInterval = 1.0f;
private float networkUpdateTimer;
private UInt32 lastUpdateID;
public UInt32 LastUpdateID
{
get { if (GameMain.Server != null && lastUpdateID < 1) lastUpdateID++; return lastUpdateID; }
set { if (GameMain.Server != null) return; lastUpdateID = value; }
public UInt32 LastUpdateID
{
get { if (GameMain.Server != null && lastUpdateID < 1) lastUpdateID++; return lastUpdateID; }
set { if (GameMain.Server != null) return; lastUpdateID = value; }
}
private Sprite backgroundSprite;
private GUITextBox serverMessage;
public string ServerMessage
{
get { return serverMessage.Text; }
set { if (GameMain.Server != null) return; serverMessage.Text = value; }
public string ServerMessage
{
get { return serverMessage.Text; }
set { if (GameMain.Server != null) return; serverMessage.Text = value; }
}
public GUIListBox SubList
@@ -413,10 +413,10 @@ namespace Barotrauma
GUIButton settingsButton = new GUIButton(new Rectangle(-100, 0, 80, 30), "Settings", Alignment.BottomRight, GUI.Style, infoFrame);
settingsButton.OnClicked = GameMain.Server.ToggleSettingsFrame;
settingsButton.UserData = "settingsButton";
GUIButton whitelistButton = new GUIButton(new Rectangle(-200, 0, 80, 30), "Whitelist", Alignment.BottomRight, GUI.Style, infoFrame);
whitelistButton.OnClicked = GameMain.Server.ToggleWhiteListFrame;
settingsButton.UserData = "settingsButton";
GUIButton whitelistButton = new GUIButton(new Rectangle(-200, 0, 80, 30), "Whitelist", Alignment.BottomRight, GUI.Style, infoFrame);
whitelistButton.OnClicked = GameMain.Server.ToggleWhiteListFrame;
whitelistButton.UserData = "whitelistButton";
if (subList.Selected == null) subList.Select(Math.Max(0, prevSelectedSub));
@@ -573,10 +573,10 @@ namespace Barotrauma
{
if (GameMain.Server == null) return false;
GameMain.Server.AutoRestart = tickBox.Selected;
lastUpdateID++;
GameMain.Server.AutoRestart = tickBox.Selected;
lastUpdateID++;
return true;
}
@@ -615,8 +615,8 @@ namespace Barotrauma
if (index < 0) index = 2;
if (index > 2) index = 0;
SetTraitorsEnabled((YesNoMaybe)index);
SetTraitorsEnabled((YesNoMaybe)index);
lastUpdateID++;
return true;
@@ -912,8 +912,8 @@ namespace Barotrauma
else if (GameMain.Client != null && GameMain.Client.HasPermission(ClientPermissions.Ban))
{
GameMain.Client.KickPlayer(userData.ToString(), true);
}
}
return false;
}
@@ -928,8 +928,8 @@ namespace Barotrauma
else if (GameMain.Client != null && GameMain.Client.HasPermission(ClientPermissions.Ban))
{
GameMain.Client.KickPlayer(userData.ToString(), true, true);
}
}
return false;
}
@@ -1084,11 +1084,11 @@ namespace Barotrauma
if (!string.IsNullOrWhiteSpace(seed))
{
LevelSeed = seed;
}
//textBox.Text = LevelSeed;
//textBox.Selected = false;
}
//textBox.Text = LevelSeed;
//textBox.Selected = false;
lastUpdateID++;
return true;