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"

C++ Calling server functions on client?

Isn't the whole point of having code execute on the server to prevent "Hacker's" so they cant edit the property's, but unreal's version of server only code is having it called by the client and executed by the client!?!. Am i missing something here or is this actually the case?

If it's possible how do i implement code that is only executed on the server and called by the client. So the clients don't have the file installed on there machine. Its only on the server.

Product Version: Not Selected
Tags:
more ▼

asked Jan 25 '15 at 03:54 PM in C++ Programming

avatar image

AndrewM47
262 68 61 78

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

1 answer: sort voted first

Unreal is based on the concept of shared code but the execution is done on each side but holding full authority on the server. So the client code can be hacked but the server must remain the final authority about the action the client wants to execute. An example is the movement code, the client will simulate its movement and sending the actions to the serer which in turn does it's own simulation and correcting the client if needed (it can detect speed hacks among others).

When a client calls a server function it is actually an RPC call to the server and executed there, the underlying logic of the call itself is often the same code so that the simulation driven on both sides match. This does not mean that the client couldn't hack a value, for example if the clients sets the ground speed different to the server value than his simulation will be out of sync with the server simulation, the client will see itself jumping around due to the corrections or having issues when firing a gun.

What you want to do is to have extra functionality compiled out on the client but present on the server, you could do that by adding C++ preprocessor defines adding a module that is only added when creating your dedicated server builds. Make sure that the content matches on both sides, if not you wont be able to connect them together. Having only code on one side has another drawback that is that client side simulations are harder now because you have to code and maintain two versions of the code.

more ▼

answered Jan 25 '15 at 05:53 PM

avatar image

Moss
6.4k 127 98 606

(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