More drop messages.
This commit is contained in:
@@ -185,6 +185,8 @@ namespace OpenRA.Server
|
|||||||
{
|
{
|
||||||
Log.Write("server", "Rejected connection from {0}; game is already started.",
|
Log.Write("server", "Rejected connection from {0}; game is already started.",
|
||||||
newConn.socket.RemoteEndPoint);
|
newConn.socket.RemoteEndPoint);
|
||||||
|
|
||||||
|
SendOrderTo(newConn, "ServerError", "The game has already started");
|
||||||
DropClient(newConn);
|
DropClient(newConn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -194,7 +196,6 @@ namespace OpenRA.Server
|
|||||||
var mods = handshake.Mods;
|
var mods = handshake.Mods;
|
||||||
|
|
||||||
// Check that the client has compatable mods
|
// Check that the client has compatable mods
|
||||||
|
|
||||||
var valid = mods.All( m => m.Contains('@')) && //valid format
|
var valid = mods.All( m => m.Contains('@')) && //valid format
|
||||||
mods.Count() == Game.CurrentMods.Count() && //same number
|
mods.Count() == Game.CurrentMods.Count() && //same number
|
||||||
mods.Select( m => Pair.New(m.Split('@')[0], m.Split('@')[1])).All(kv => Game.CurrentMods.ContainsKey(kv.First) &&
|
mods.Select( m => Pair.New(m.Split('@')[0], m.Split('@')[1])).All(kv => Game.CurrentMods.ContainsKey(kv.First) &&
|
||||||
@@ -203,6 +204,8 @@ namespace OpenRA.Server
|
|||||||
{
|
{
|
||||||
Log.Write("server", "Rejected connection from {0}; mods do not match.",
|
Log.Write("server", "Rejected connection from {0}; mods do not match.",
|
||||||
newConn.socket.RemoteEndPoint);
|
newConn.socket.RemoteEndPoint);
|
||||||
|
|
||||||
|
SendOrderTo(newConn, "ServerError", "Your mods don't match the server");
|
||||||
DropClient(newConn);
|
DropClient(newConn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,10 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
{
|
{
|
||||||
var occupantConn = server.conns.FirstOrDefault( c => c.PlayerIndex == occupant.Index );
|
var occupantConn = server.conns.FirstOrDefault( c => c.PlayerIndex == occupant.Index );
|
||||||
if (occupantConn != null)
|
if (occupantConn != null)
|
||||||
|
{
|
||||||
|
server.SendOrderTo(occupantConn, "ServerError", "Your slot was closed by the host");
|
||||||
server.DropClient(occupantConn);
|
server.DropClient(occupantConn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server.SyncLobbyInfo();
|
server.SyncLobbyInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user