x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Skip RPC validation

Hello, I need to add a couple of RPCs into my game, however I do not require in any way for these RPCs to be validated (they do not process any key game information). The compiler though demands me to use the validation anyway and won't compile. This really just slows down my work and it's really annoying especially when dealing with multiple RPCs. Is there a way to bypass/disable the warning and let the code compile without using the validation on every single RPC I add?

Product Version: UE 4.12
Tags:
more ▼

asked Aug 20 '16 at 04:52 PM in C++ Programming

avatar image

DELTA_12
121 15 20 25

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

From my own experience and research on this topic, the answer is no.

When defining server or client UFUNCTIONs in c++, the "WithValidation" option is required, and there is no "WithoutValidation" option allowed.

You must create the corresponding validation function

 bool MyFunction_Validate()
 {
   return true;
 }

in your c++ file. Even if you have no plans on using it.

more ▼

answered Aug 30 '16 at 02:56 PM

avatar image

TX_Alpha
115 8 12 20

avatar image ImVawx ♦♦ STAFF Aug 30 '16 at 03:51 PM

To extend on what TX.AlphaMale is saying:

The Validate call for Server functions is required, which is displayed in the compiling error if you do not have WithValidation:

 Server RPC missing 'WithValidation' keyword in the UPROPERTY() declaration statement.  Required for security purposes. 
avatar image Arty-McLabin Mar 05 '18 at 10:45 PM

it is truly awful. it hurts the performance and the development speed. at least Epic could generate one default returning true for us..

avatar image GarnerP57 Mar 07 '18 at 12:42 PM

Do you have some tests showing how much performance is being lost when it simply returns true? Sounds like you don't approve of the whole authoritative server setup where validation is one of the corner stones making it harder for players to cheat. If you only care about performance you should not use an authoritative server in the first place.

avatar image Arty-McLabin Mar 07 '18 at 03:26 PM

i didn't say or even imply that. cheat prevention is a very important aspect, but sometimes you just don't need validation when it comes to stuff which isn't potential for cheating.

why would you even need a validation function if you just return true on that one? there is no single benefit from it. only longer development time (copy-pasting that syntax), uglier code and a little performance hit. i don't have any tests because i have no other way but to comply with the engine as it is, but one doesn't need tests to compare performance of nothing vs small code

avatar image GarnerP57 Mar 07 '18 at 07:49 PM

You should look at the Unreal Header Tool to remove the need for validation. Nothing prevents you from removing the requirement. Just don't expect a revolution in the performance from skipping a simple return true function call though. You would avoid the need for typing in a validate function though.

avatar image Arty-McLabin Mar 07 '18 at 09:34 PM

sadly i would like to avoid that because i like to keep up with fresh new versions of UE and editing each version is just too much work that doesn't worth the time, because as you have mentioned, it's not a revolution. but indeed a lot of work.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question