Handshake mod versions and map. Bump the protocol version.

This commit is contained in:
Paul Chote
2010-12-31 13:20:32 +13:00
parent e2d1eec56e
commit 486fa9a978
4 changed files with 63 additions and 12 deletions

View File

@@ -13,6 +13,6 @@ namespace OpenRA.Server
public static class ProtocolVersion
{
// you *must* increment this whenever you make an incompatible protocol change
public static readonly int Version = 6;
public static readonly int Version = 7;
}
}

View File

@@ -167,7 +167,12 @@ namespace OpenRA.Server
preConns.Add(newConn);
// Dispatch a handshake order
DispatchOrdersToClient(newConn, 0, 0, new ServerOrder("HandshakeRequest", lobbyInfo.Serialize()).Serialize());
var request = new HandshakeRequest()
{
Map = lobbyInfo.GlobalSettings.Map,
Mods = lobbyInfo.GlobalSettings.Mods.Select(m => "{0}@{1}".F(m,Mod.AllMods[m].Version)).ToArray()
};
DispatchOrdersToClient(newConn, 0, 0, new ServerOrder("HandshakeRequest", request.Serialize()).Serialize());
}
catch (Exception) { DropClient(newConn); }
}