Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Game.Debug messages from ValidateOrder. #16081

Merged
merged 1 commit into from Jan 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions OpenRA.Mods.Common/Traits/World/ValidateOrder.cs
Expand Up @@ -29,18 +29,17 @@ public bool OrderValidation(OrderManager orderManager, World world, int clientId

if (subjectClient == null)
{
Game.Debug("Order sent to {0}: resolved ClientIndex `{1}` doesn't exist", order.Subject.Owner.PlayerName, subjectClientId);
Log.Write("debug", "Order sent to {0}: resolved ClientIndex `{1}` doesn't exist", order.Subject.Owner.PlayerName, subjectClientId);
return false;
}

var isBotOrder = subjectClient.Bot != null && clientId == subjectClient.BotControllerClientIndex;

// Drop exploiting orders
// Drop orders from players who shouldn't be able to control this actor
// This may be because the owner changed within the last net tick,
// or, less likely, the client may be trying to do something malicious.
if (subjectClientId != clientId && !isBotOrder)
{
Game.Debug("Detected exploit order from client {0}: {1}", clientId, order.OrderString);
return false;
}

return order.Subject.AcceptsOrder(order.OrderString);
}
Expand Down