diff --git a/OpenRa.Game/GameRules/UserSettings.cs b/OpenRa.Game/GameRules/UserSettings.cs index 1fc1387018..8f0957429f 100644 --- a/OpenRa.Game/GameRules/UserSettings.cs +++ b/OpenRa.Game/GameRules/UserSettings.cs @@ -25,6 +25,7 @@ namespace OpenRa.GameRules public readonly string Map = "scm12ea.ini"; public readonly int Player = 1; public readonly string Replay = ""; + public readonly string PlayerName = ""; // Gameplay options public readonly bool RepairRequiresConyard = true; diff --git a/OpenRa.Game/World.cs b/OpenRa.Game/World.cs index 6d810e01b8..a846218475 100644 --- a/OpenRa.Game/World.cs +++ b/OpenRa.Game/World.cs @@ -32,6 +32,9 @@ namespace OpenRa Game.viewport.GoToStartLocation(LocalPlayer); Game.chat.AddLine(LocalPlayer, "is now YOU"); } + if (!string.IsNullOrEmpty(Game.Settings.PlayerName) && LocalPlayer.PlayerName != Game.Settings.PlayerName) + Game.IssueOrder(Order.Chat("/name " + Game.Settings.PlayerName)); + } public readonly Actor WorldActor; @@ -68,7 +71,9 @@ namespace OpenRa WorldActor = CreateActor("World", new int2(int.MaxValue, int.MaxValue), null); for (int i = 0; i < 8; i++) + { players[i] = new Player(this, i, Game.LobbyInfo.Clients.FirstOrDefault(a => a.Index == i)); + } Timer.Time( "worldActor, players: {0}" ); Queries = new AllQueries( this );