Some cleanup using ReSharper (mostly removing redundancies)

This commit is contained in:
Regalis
2016-03-12 15:32:34 +02:00
parent ae4e4d8f34
commit d1580328ed
99 changed files with 197 additions and 483 deletions

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -1,7 +1,4 @@
using Lidgren.Network;
using System;
namespace Barotrauma.Networking
namespace Barotrauma.Networking
{
static class NetBufferExtensions
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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)