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"

Is executing a "Run on Owning Client" event from the Server secure?

I'm trying to wrap my head around how certain calls work together. I'm concerned about how and where I'm running certain sections of code because I want it to be secure. For example, if I ran something like this:

alt text

...would the "Very Important Variable" be liable to alteration by the player on the client machine? Or is it safe because that event was run on the server? I notice that when I add a Switch Has Authority after the Client event (that is being run by the Server) like this:

alt text

...the variable is not set, though I'm not sure if that necessarily means the code is running on the client itself. Is this safe? If not, what's the recommended way of setting an important variable for a specific client such that they cannot alter it?

Product Version: UE 4.21
bp1.png (185.1 kB)
bp2.png (151.0 kB)
more ▼

asked Apr 12 '19 at 09:16 PM in Blueprint Scripting

avatar image

39 4 9 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If you have a variable that your clients should not be able to manipulate you can not add functions for the client to manipulate that variable.

The "execute on server" event can be called from the client and in your example sets the variable which would allow the clients to do whatever with it.

Execute on owning clients gets called on the owner of the actor, if it is a client it will never have authority and your client important things will never do anything.

If you only want your server to change this data use replication.

alt text

this will automatically set the value on your clients without any chance of the clients to change it on the server.

Don't forget to switch on replication on the actor you have the data on otherwise nothing will happen.

If you need your clients to react to the variable change use the RepNotify and do your reaction in the created function.

rep.png (20.6 kB)
more ▼

answered Apr 12 '19 at 11:25 PM

avatar image

Lardo Deepdelver
786 5 4 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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