change exploit order check to cope with PlayerId not matching ClientId, because it doesnt.
This commit is contained in:
@@ -19,8 +19,11 @@ namespace OpenRA.Network
|
||||
public static void ProcessOrder( World world, int clientId, Order order )
|
||||
{
|
||||
// Drop exploiting orders
|
||||
if (order.Subject != null && order.Subject.Owner != world.players[clientId])
|
||||
if (order.Subject != null && order.Subject.Owner.ClientIndex != clientId)
|
||||
{
|
||||
Game.Debug("Detected exploit order from {0}: {1}".F(clientId, order.OrderString));
|
||||
return;
|
||||
}
|
||||
|
||||
switch( order.OrderString )
|
||||
{
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace OpenRA
|
||||
public readonly string InternalName;
|
||||
public readonly CountryInfo Country;
|
||||
public readonly int Index;
|
||||
public readonly bool NonCombatant = false;
|
||||
public readonly bool NonCombatant = false;
|
||||
public readonly int ClientIndex;
|
||||
|
||||
public ShroudRenderer Shroud;
|
||||
public World World { get; private set; }
|
||||
@@ -50,7 +51,8 @@ namespace OpenRA
|
||||
Index = index;
|
||||
Palette = "player"+index;
|
||||
Color = pr.Color;
|
||||
Color2 = pr.Color2;
|
||||
Color2 = pr.Color2;
|
||||
ClientIndex = 0; /* it's a map player, "owned" by host */
|
||||
|
||||
PlayerName = InternalName = pr.Name;
|
||||
NonCombatant = pr.NonCombatant;
|
||||
@@ -75,7 +77,9 @@ namespace OpenRA
|
||||
InternalName = "Multi{0}".F(client.Index);
|
||||
Country = world.GetCountries()
|
||||
.FirstOrDefault(c => client != null && client.Country == c.Race)
|
||||
?? world.GetCountries().Random(world.SharedRandom);
|
||||
?? world.GetCountries().Random(world.SharedRandom);
|
||||
|
||||
ClientIndex = client.Index;
|
||||
|
||||
RegisterPlayerColor(world, Palette);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user