add team to Client
This commit is contained in:
@@ -43,6 +43,7 @@ namespace OpenRA.FileFormats
|
|||||||
public int SpawnPoint;
|
public int SpawnPoint;
|
||||||
public string Name;
|
public string Name;
|
||||||
public ClientState State;
|
public ClientState State;
|
||||||
|
public int Team;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Global
|
public class Global
|
||||||
|
|||||||
@@ -148,7 +148,9 @@ namespace OpenRA.Server
|
|||||||
PaletteIndex = ChooseFreePalette(),
|
PaletteIndex = ChooseFreePalette(),
|
||||||
Name = "Player {0}".F(1 + newConn.PlayerIndex),
|
Name = "Player {0}".F(1 + newConn.PlayerIndex),
|
||||||
Country = "Random",
|
Country = "Random",
|
||||||
State = Session.ClientState.NotReady
|
State = Session.ClientState.NotReady,
|
||||||
|
SpawnPoint = 0,
|
||||||
|
Team = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
Console.WriteLine("Client {0}: Accepted connection from {1}",
|
Console.WriteLine("Client {0}: Accepted connection from {1}",
|
||||||
@@ -324,6 +326,22 @@ namespace OpenRA.Server
|
|||||||
SyncLobbyInfo();
|
SyncLobbyInfo();
|
||||||
return true;
|
return true;
|
||||||
}},
|
}},
|
||||||
|
{ "team",
|
||||||
|
s =>
|
||||||
|
{
|
||||||
|
if (GameStarted)
|
||||||
|
{
|
||||||
|
SendChatTo( conn, "You can't change your team after the game has started" );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int team;
|
||||||
|
if (!int.TryParse(s, out team)) { Console.WriteLine("Invalid team: {0}", s ); return false; }
|
||||||
|
|
||||||
|
GetClient(conn).Team = team;
|
||||||
|
SyncLobbyInfo();
|
||||||
|
return true;
|
||||||
|
}},
|
||||||
{ "spawn",
|
{ "spawn",
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user