player name setting

This commit is contained in:
Alli
2010-02-04 20:50:23 +13:00
parent c6168d318e
commit 95d545ff41
2 changed files with 6 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ namespace OpenRa.GameRules
public readonly string Map = "scm12ea.ini"; public readonly string Map = "scm12ea.ini";
public readonly int Player = 1; public readonly int Player = 1;
public readonly string Replay = ""; public readonly string Replay = "";
public readonly string PlayerName = "";
// Gameplay options // Gameplay options
public readonly bool RepairRequiresConyard = true; public readonly bool RepairRequiresConyard = true;

View File

@@ -32,6 +32,9 @@ namespace OpenRa
Game.viewport.GoToStartLocation(LocalPlayer); Game.viewport.GoToStartLocation(LocalPlayer);
Game.chat.AddLine(LocalPlayer, "is now YOU"); 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; public readonly Actor WorldActor;
@@ -68,7 +71,9 @@ namespace OpenRa
WorldActor = CreateActor("World", new int2(int.MaxValue, int.MaxValue), null); WorldActor = CreateActor("World", new int2(int.MaxValue, int.MaxValue), null);
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{
players[i] = new Player(this, i, Game.LobbyInfo.Clients.FirstOrDefault(a => a.Index == i)); players[i] = new Player(this, i, Game.LobbyInfo.Clients.FirstOrDefault(a => a.Index == i));
}
Timer.Time( "worldActor, players: {0}" ); Timer.Time( "worldActor, players: {0}" );
Queries = new AllQueries( this ); Queries = new AllQueries( this );