Split Protocol version into Handshake vs Orders.
Handshake is kept at 7. Orders is incremented to 8 to reflect immediate order changes.
This commit is contained in:
@@ -278,7 +278,7 @@ namespace OpenRA.Server
|
||||
|
||||
// Send handshake and client index.
|
||||
var ms = new MemoryStream(8);
|
||||
ms.WriteArray(BitConverter.GetBytes(ProtocolVersion.Version));
|
||||
ms.WriteArray(BitConverter.GetBytes(ProtocolVersion.Handshake));
|
||||
ms.WriteArray(BitConverter.GetBytes(newConn.PlayerIndex));
|
||||
SendData(newConn.Socket, ms.ToArray());
|
||||
|
||||
@@ -363,6 +363,16 @@ namespace OpenRA.Server
|
||||
return;
|
||||
}
|
||||
|
||||
if (handshake.OrdersProtocol != ProtocolVersion.Orders)
|
||||
{
|
||||
Log.Write("server", "Rejected connection from {0}; incompatible Orders protocol version {1}.",
|
||||
newConn.Socket.RemoteEndPoint, handshake.OrdersProtocol);
|
||||
|
||||
SendOrderTo(newConn, "ServerError", "Server is running an incompatible protocol");
|
||||
DropClient(newConn);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if IP is banned
|
||||
var bans = Settings.Ban.Union(TempBans);
|
||||
if (bans.Contains(client.IpAddress))
|
||||
|
||||
Reference in New Issue
Block a user