Some cleanup using ReSharper (mostly removing redundancies)
This commit is contained in:
@@ -128,7 +128,7 @@ namespace Barotrauma.Networking
|
||||
GUIMessageBox upnpBox = new GUIMessageBox("Please wait...", "Attempting UPnP port forwarding", new string[] {"Cancel"} );
|
||||
upnpBox.Buttons[0].OnClicked = upnpBox.Close;
|
||||
|
||||
DateTime upnpTimeout = DateTime.Now + new TimeSpan(0,0,5);
|
||||
//DateTime upnpTimeout = DateTime.Now + new TimeSpan(0,0,5);
|
||||
while (server.UPnP.Status == UPnPStatus.Discovering
|
||||
&& GUIMessageBox.VisibleBox == upnpBox)// && upnpTimeout>DateTime.Now)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public bool AutoRestart
|
||||
{
|
||||
get { return (ConnectedClients.Count == 0) ? false : autoRestart; }
|
||||
get { return (ConnectedClients.Count != 0) && autoRestart; }
|
||||
set
|
||||
{
|
||||
autoRestart = value;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Lidgren.Network;
|
||||
using System;
|
||||
|
||||
namespace Barotrauma.Networking
|
||||
namespace Barotrauma.Networking
|
||||
{
|
||||
static class NetBufferExtensions
|
||||
{
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Barotrauma.Networking
|
||||
namespace Barotrauma.Networking
|
||||
{
|
||||
static class NetConfig
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public NetworkEvent(NetworkEventType type, ushort id, bool allowClientSend, object data = null)
|
||||
{
|
||||
if (!allowClientSend && GameMain.Server != null) return;
|
||||
if (!allowClientSend && GameMain.Server == null) return;
|
||||
|
||||
eventType = type;
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
try
|
||||
{
|
||||
NetworkEvent.ReadData(message, sendingTime, resend);
|
||||
ReadData(message, sendingTime, resend);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Barotrauma.Networking
|
||||
{
|
||||
@@ -19,12 +18,12 @@ namespace Barotrauma.Networking
|
||||
|
||||
private GUIListBox listBox;
|
||||
|
||||
private Queue<ColoredText> lines;
|
||||
private readonly Queue<ColoredText> lines;
|
||||
|
||||
public int LinesPerFile
|
||||
{
|
||||
get { return linesPerFile; }
|
||||
set { linesPerFile = Math.Max(10, linesPerFile); }
|
||||
set { linesPerFile = Math.Max(value, 10); }
|
||||
}
|
||||
|
||||
public ServerLog(string serverName)
|
||||
|
||||
Reference in New Issue
Block a user