tweaking vis on some Game stuff

This commit is contained in:
Chris Forbes
2010-05-07 20:55:34 +12:00
parent ebd62e41da
commit 9f7c844528

View File

@@ -165,8 +165,8 @@ namespace OpenRA
viewport.Center(loc); viewport.Center(loc);
} }
public static string CurrentHost = ""; internal static string CurrentHost = "";
public static int CurrentPort = 0; internal static int CurrentPort = 0;
internal static void JoinServer(string host, int port) internal static void JoinServer(string host, int port)
{ {
@@ -183,7 +183,7 @@ namespace OpenRA
return DateTime.UtcNow.ToString("OpenRA-yyyy-MM-ddThhmmssZ.rep"); return DateTime.UtcNow.ToString("OpenRA-yyyy-MM-ddThhmmssZ.rep");
} }
internal static void JoinLocal() static void JoinLocal()
{ {
if (orderManager != null) orderManager.Dispose(); if (orderManager != null) orderManager.Dispose();
orderManager = new OrderManager(new EchoConnection()); orderManager = new OrderManager(new EchoConnection());
@@ -191,22 +191,22 @@ namespace OpenRA
static int lastTime = Environment.TickCount; static int lastTime = Environment.TickCount;
public static void ResetTimer() static void ResetTimer()
{ {
lastTime = Environment.TickCount; lastTime = Environment.TickCount;
} }
public static int RenderFrame = 0; internal static int RenderFrame = 0;
internal static Chat chat = new Chat(); internal static Chat chat = new Chat();
public static int LocalTick = 0; internal static int LocalTick = 0;
const int NetTickScale = 3; // 120ms net tick for 40ms local tick const int NetTickScale = 3; // 120ms net tick for 40ms local tick
static Queue<Pair<int, string>> syncReports = new Queue<Pair<int, string>>(); static Queue<Pair<int, string>> syncReports = new Queue<Pair<int, string>>();
const int numSyncReports = 5; const int numSyncReports = 5;
public static void UpdateSyncReport() internal static void UpdateSyncReport()
{ {
if (!Settings.RecordSyncReports) if (!Settings.RecordSyncReports)
return; return;
@@ -242,7 +242,7 @@ namespace OpenRA
return sb.ToString(); return sb.ToString();
} }
public static void DumpSyncReport( int frame ) internal static void DumpSyncReport( int frame )
{ {
var f = syncReports.FirstOrDefault(a => a.First == frame); var f = syncReports.FirstOrDefault(a => a.First == frame);
if (f == null) if (f == null)
@@ -255,7 +255,7 @@ namespace OpenRA
Log.Write("{0}", f.Second); Log.Write("{0}", f.Second);
} }
public static void Tick() static void Tick()
{ {
if (packageChangePending) if (packageChangePending)
{ {
@@ -320,9 +320,9 @@ namespace OpenRA
MasterServerQuery.Tick(); MasterServerQuery.Tick();
} }
public static event Action LobbyInfoChanged = () => { }; internal static event Action LobbyInfoChanged = () => { };
public static void SyncLobbyInfo(string data) internal static void SyncLobbyInfo(string data)
{ {
var oldLobbyInfo = LobbyInfo; var oldLobbyInfo = LobbyInfo;
@@ -377,7 +377,7 @@ namespace OpenRA
public static void IssueOrder(Order o) { orderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */ public static void IssueOrder(Order o) { orderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */
public static void LoadShellMap(string map) static void LoadShellMap(string map)
{ {
LoadMap(map); LoadMap(map);
world.Queries = new World.AllQueries(world); world.Queries = new World.AllQueries(world);
@@ -391,7 +391,7 @@ namespace OpenRA
orderManager.StartGame(); orderManager.StartGame();
} }
public static void StartGame() internal static void StartGame()
{ {
LoadMap(LobbyInfo.GlobalSettings.Map); LoadMap(LobbyInfo.GlobalSettings.Map);
if (orderManager.GameStarted) return; if (orderManager.GameStarted) return;
@@ -463,12 +463,12 @@ namespace OpenRA
throw new InvalidOperationException( "Desync in DispatchMouseInput" ); throw new InvalidOperationException( "Desync in DispatchMouseInput" );
} }
public static bool IsHost internal static bool IsHost
{ {
get { return orderManager.Connection.LocalClientId == 0; } get { return orderManager.Connection.LocalClientId == 0; }
} }
public static Session.Client LocalClient internal static Session.Client LocalClient
{ {
get { return LobbyInfo.Clients.FirstOrDefault(c => c.Index == orderManager.Connection.LocalClientId); } get { return LobbyInfo.Clients.FirstOrDefault(c => c.Index == orderManager.Connection.LocalClientId); }
} }
@@ -529,7 +529,7 @@ namespace OpenRA
desktopResolution.Height); desktopResolution.Height);
} }
public static void Initialize(Settings settings) internal static void Initialize(Settings settings)
{ {
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly; AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
while (!Directory.Exists("mods")) while (!Directory.Exists("mods"))