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"

Is the player state stored on server?

Like the title says, is the player state stored on the server? I ask this because i want to know is it good/bad to use player state for game play logic (eg. health) or can it be hacked/compromised.

So if i do this within a server function :

Player->PlayerState->health += 10.f;

is that bad?

Product Version: Not Selected
Tags:
more ▼

asked Dec 30 '15 at 02:11 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

Every player (human or AI) will have a player state, it will live everywhere on the server and the client, it's values are replicated through variable replication. So to answer you question you have to decide where the authority of your logic is, the server can perform the logic changing the values and those are then replicated to the clients (this would be an example in the case of health logic). So yes do it on the server :D. Also if the server is hacked you can't actually do much about it.

more ▼

answered Dec 30 '15 at 02:16 PM

avatar image

Moss
6.4k 127 98 606

avatar image AndrewM47 Dec 30 '15 at 02:21 PM

One more question, If i create a variable in player state like say float health do i have to manually add it to replicate or does it replicate on its own since its stored in player state, and as for server being hacked i meant if the client is hacked and access client variables. Thanks for answering.

avatar image Moss Dec 30 '15 at 03:16 PM

You have to add it manually to get replicated. This guide might help you out. Don't forget to accept the answer :D

avatar image AndrewM47 Dec 30 '15 at 05:17 PM

Great thanks (i did accept but it unaccepted?)

(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