bool ...::Multi_..._Validate(...)
{
AController* OwnerController = this->GetOwner()->GetInstigatorController();
if (OwnerController->IsValidLowLevel() && OwnerController->IsLocalController())
{
return false;
}
return true;
}
void ...::Multi_..._Implementation(...)
{
/* executes ... on clients */
this->exec...(...);
}
I try to find a way to exclude the owning client from the multicast, is the validation executed on all clients, or only once serverside?
Thanks.
It can run on either, or both. It depends on the RPC. If the RPC is marked as:
UFUNCTION(Client, WithValidation)
void MyClientRPC();
It’ll require a Validation method on the client.
Client to Server always requires validation, so anything marked as a Server RPC will require a validation method.
I don’t think you can use validation to “filter” messages. If you fail the Validation call, the Client is normally disconnected immediately (because it’s assumed they’re a cheater/hacker/doing bad stuff).
For more reading on Validation:
Ohh, that’s really good to know, thank you!