Inform client about changes in lobby options

This commit is contained in:
havok13888
2014-07-29 23:13:26 -05:00
parent de1c80af88
commit 65c77677d4
2 changed files with 34 additions and 0 deletions

View File

@@ -336,6 +336,10 @@ namespace OpenRA.Server
// Send initial ping
SendOrderTo(newConn, "Ping", Game.RunTime.ToString());
// Send Lobby info to newly connected client
if (!client.IsAdmin)
NotifyNewClientOfLobbyInfo(newConn);
if (Settings.Dedicated)
{
var motdFile = Path.Combine(Platform.SupportDir, "motd.txt");
@@ -355,6 +359,19 @@ namespace OpenRA.Server
catch (Exception) { DropClient(newConn); }
}
void NotifyNewClientOfLobbyInfo(Connection newConn)
{
SendOrderTo(newConn, "Message", "Diplomacy Changes: {0}".F(LobbyInfo.GlobalSettings.FragileAlliances));
SendOrderTo(newConn, "Message", "Allow Cheats: {0}".F(LobbyInfo.GlobalSettings.AllowCheats));
SendOrderTo(newConn, "Message", "Shroud: {0}".F(LobbyInfo.GlobalSettings.Shroud));
SendOrderTo(newConn, "Message", "Fog of war: {0}".F(LobbyInfo.GlobalSettings.Fog));
SendOrderTo(newConn, "Message", "Crates Appear: {0}".F(LobbyInfo.GlobalSettings.Crates));
SendOrderTo(newConn, "Message", "Build off Ally ConYards: {0}".F(LobbyInfo.GlobalSettings.AllyBuildRadius));
SendOrderTo(newConn, "Message", "Starting Units: {0}".F(LobbyInfo.GlobalSettings.StartingUnitsClass));
SendOrderTo(newConn, "Message", "Starting Cash: ${0}".F(LobbyInfo.GlobalSettings.StartingCash));
SendOrderTo(newConn, "Message", "Tech Level: {0}".F(LobbyInfo.GlobalSettings.TechLevel));
}
void SetOrderLag()
{
if (LobbyInfo.IsSinglePlayer)