Fix most of the style violations in Game.cs.

This commit is contained in:
Paul Chote
2013-12-18 21:41:12 +13:00
parent ff5cbc65c5
commit b96c36f38f

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
@@ -81,7 +81,6 @@ namespace OpenRA
static ConnectionState lastConnectionState = ConnectionState.PreConnecting;
public static int LocalClientId { get { return orderManager.Connection.LocalClientId; } }
// Hacky workaround for orderManager visibility
public static Widget OpenWindow(World world, string widget)
{
@@ -249,9 +248,9 @@ namespace OpenRA
{
get
{
var client= orderManager.LobbyInfo.ClientWithIndex(
orderManager.Connection.LocalClientId);
return ((client!=null) && client.IsAdmin);
var id = orderManager.Connection.LocalClientId;
var client = orderManager.LobbyInfo.ClientWithIndex(id);
return client != null && client.IsAdmin;
}
}
@@ -302,6 +301,7 @@ namespace OpenRA
Console.WriteLine("Renderer initialization failed. Fallback in place. Check graphics.log for details.");
}
}
Renderer = new Renderer();
try
@@ -323,11 +323,7 @@ namespace OpenRA
InitializeWithMod(Settings.Game.Mod);
if (Settings.Server.DiscoverNatDevices)
{
RunAfterDelay(Settings.Server.NatDiscoveryTimeout, () =>
UPnP.TryStoppingNatDiscovery()
);
}
RunAfterDelay(Settings.Server.NatDiscoveryTimeout, UPnP.TryStoppingNatDiscovery);
}
public static void InitializeWithMod(string mod)
@@ -378,21 +374,23 @@ namespace OpenRA
{
System.Threading.Thread.Sleep(100);
if ((server.State == Server.ServerState.GameStarted)
&& (server.Conns.Count<=1))
if (server.State == Server.ServerState.GameStarted && server.Conns.Count <= 1)
{
Console.WriteLine("No one is playing, shutting down...");
server.Shutdown();
break;
}
}
if (Settings.Server.DedicatedLoop)
{
Console.WriteLine("Starting a new server instance...");
continue;
}
break;
}
Environment.Exit(0);
}
else
@@ -453,7 +451,7 @@ namespace OpenRA
public static void Debug(string s, params object[] args)
{
AddChatLine(Color.White, "Debug", String.Format(s,args));
AddChatLine(Color.White, "Debug", string.Format(s, args));
}
public static void Disconnect()