ugly hacked async connection

This commit is contained in:
Chris Forbes
2010-01-18 18:08:10 +13:00
parent b7c5b9e265
commit f6e70f74e3
4 changed files with 77 additions and 21 deletions

View File

@@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using OpenRa.Traits;
using OpenRa.Orders;
namespace OpenRa.Graphics
{
@@ -55,7 +56,24 @@ namespace OpenRa.Graphics
}
else
{
Game.chrome.DrawLobby();
if (Game.orderManager.IsNetplay)
{
var nos = Game.orderManager.Sources.OfType<NetworkOrderSource>().First();
switch (nos.State)
{
case ConnectionState.Connecting:
Game.chrome.DrawDialog("Connecting to server...");
break;
case ConnectionState.NotConnected:
Game.chrome.DrawDialog("Connection failed.");
break;
case ConnectionState.Connected:
Game.chrome.DrawLobby();
break;
}
}
else
Game.chrome.DrawLobby();
}
var c = Game.chrome.HitTest(mousePos) ? Cursor.Default : Game.controller.ChooseCursor();