Author |
Topic |
|
trdwll
New Member
7 Posts |
Posted - Aug 16 2021 : 09:29:59 AM
|
Can you fix the _Validate method to default return true?
This isn't a big deal, but I figured I'd see if you could add this in the next update as it's something small.
Thanks |
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Aug 16 2021 : 1:35:26 PM
|
I really don't understand what you are asking for here. VA tries to help you write your code, and navigate it, but we don't have a say in the default behaviour of Unreal Engine its self. Is that what you are asking about here?
Doing a search for symbols containing both RPC and Validate brings me to the file "UnrealNetwork.h" and the macro:
RPC_VALIDATE( expression )
which is defined to return false. If you want this to return true you can just edit this file and recompile Unreal Engine. |
zen is the art of being at one with the two'ness |
|
|
trdwll
New Member
7 Posts |
Posted - Aug 17 2021 : 04:19:41 AM
|
When you make an RPC like below and run create implementation it only generates the method like below.
UFUNCTION(Server, Reliable, WithValidation) void ServerRPC();
void AClass::ServerRPC_Implementation() {
}
bool AClass::ServerRPC_Validate() {
}
What I'm asking is to add return true to the _Validate method by default when the method is created.
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Aug 17 2021 : 08:43:54 AM
|
Are you looking for all _Validate functions to return true by default, or are you after a change that is limited to just a few _Validate functions? |
zen is the art of being at one with the two'ness |
|
|
trdwll
New Member
7 Posts |
Posted - Aug 17 2021 : 11:14:05 AM
|
Preferably all. Not sure if this would be an ideal feature for VAX. Mainly I thought about this, because when you override a method via Implement Virtual Methods it will add a Super call. In my experience with _Validate methods we just return true, but still, do some verification in our _Validate in certain circumstances. Really this is just me being lazy and not wanting to write return true for my _Validate methods.
Even if you don't want to have this added is there currently a way to do this when I generate the implementation? |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Aug 17 2021 : 1:09:42 PM
|
This is actually reasonable. I have put in a feature request for a separate VA refactoring Snippet to control the generated code for the _Validate version of the function when you use Create Implementation:
case=146109
if / when this is done, you would then be able to set the snippet so that the function defaults to return true, and perhaps throws a piece of logging, or an assert, to remind you to actually check this is what you intend. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|