don't crash on in-game connection loss either

This commit is contained in:
Chris Forbes
2010-01-18 18:32:03 +13:00
parent 893dc15d81
commit 1b0187b089
3 changed files with 32 additions and 14 deletions

View File

@@ -53,6 +53,10 @@ namespace OpenRa.Graphics
{
Game.world.WorldRenderer.Draw();
Game.chrome.Draw();
if (Game.orderManager.IsNetplay &&
Game.orderManager.Sources.OfType<NetworkOrderSource>().First().State == ConnectionState.NotConnected)
Game.chrome.DrawDialog("Connection lost.");
}
else
{
@@ -64,7 +68,7 @@ namespace OpenRa.Graphics
switch (nos.State)
{
case ConnectionState.Connecting:
Game.chrome.DrawDialog("Connecting to {0}:{1}".F( Game.Settings.NetworkHost, Game.Settings.NetworkPort ));
Game.chrome.DrawDialog("Connecting to {0}:{1}...".F( Game.Settings.NetworkHost, Game.Settings.NetworkPort ));
break;
case ConnectionState.NotConnected:
Game.chrome.DrawDialog("Connection failed.");