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"

Network Send to Server not replicating

Hello,

I'm trying to make the movement of my character to run on server only and replicate to client in order to avoid cheats like speeding up or teleporting, so I built things in this way:

1- inputMoveRight and inputMoveFoward mapped are used in my PlayerController class. They call moveRIght and moveFoward custom events from the CHaracter. 2- moveFoward and moveRight custom events do the logic to move the Character, and these events are set as "Run On Server"; 3- Character "Replicates" flag is marked.

THe expected behavior is: a- Input from playerController calls movement events from Character (server only), b- CHaracter move on the server, and this movement should be replicated to the Client.

But this is what is happening: a-If I try to move in the Server window, the server CHaracter moves fine and replicates to client (I can see it moving in both windows) b-If I try to move in the Client window, nothing happen. CLient Character doesn't move eighter in server or client windows. c- If I change the "Run on Server" to "Not Replicated", it works fine on both client and server, but I don't know where the movement calculation is happening (I believe that it's happening in the client and replicating to server when I try to move in the client window, but it's not what I want). d- If I change to Multicast it works also on both client and server, but I think it's not being calculated in the server and being replicated as I desire. I want it to be calculated only on server and replicated, since players can modify their clients to cheat.

What am I doing wrong?? The tutorial's teacher did the same thing as I did almost (he did all in the Character class, no input from PlayerController), and he used it to spawn "bombs" instead of adding movement. The concept should be the same in both cases, right?

The same problem is happening with my Shoot action (again, input mapped called on PlayerController, that calls Character Shoot custom event, that calls WeaponClass (Actor) "PullTrigger" custom event, that calls "ServerAttemptToSpawnShoot", and this S.A.S.S. is marked as Run on server (it's a Weapon custom event). The ServerAttemptToSpawnShoot verify if it can shoot (on server, with authority guard), and if canSHoot is true, it spawns a "Bullet" (Actor with projectile movement component). Bullet AND Weapon are also marked with the "Replicates" flag. I think the Shoot problem is the same problem i'm facing in the Movement action replication, I'm not sure but maybe if I fix/understand one I'll automatically understand the other.

Bellow are my movement Blueprints (I can put in a reply the Shoot blueprint too if you need it, since it involves PlayerController, CHaracter, Weapon and Bullet it will be more print screens to post and the answerhub limits me in 5 images )

Please help me :)

alt text alt text alt text

Product Version: UE 4.10
Tags:
more ▼

asked Mar 03 '16 at 08:31 PM in Blueprint Scripting

avatar image

Lobz
71 3 5 8

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

0 answers: sort voted first
Be the first one to answer this question
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