added server-driven local player choosing

This commit is contained in:
Chris Forbes
2009-12-01 22:54:25 +13:00
parent ee3699ae0e
commit 805327a557
4 changed files with 49 additions and 19 deletions

View File

@@ -33,7 +33,11 @@ namespace OpenRa.Game
public static Dictionary<int, Player> players = new Dictionary<int, Player>();
public static Player LocalPlayer { get { return players[localPlayerIndex]; } }
public static Player LocalPlayer
{
get { return players[localPlayerIndex]; }
set { localPlayerIndex = value.Index; }
}
public static BuildingInfluenceMap BuildingInfluence;
public static UnitInfluenceMap UnitInfluence;

View File

@@ -104,7 +104,9 @@ namespace OpenRa.Game
}
case "AssignPlayer":
{
break; /* todo: set LocalPlayer based on this */
Game.LocalPlayer = order.Player;
Game.chat.AddLine(Pair.New(order.Player.PlayerName, "is now YOU."));
break;
}
case "StartGame":
{