Description

I appears to be possible to replicate a value and when the value gets to the client(s), it doesn't match what was sent from the server.

In the project, ReplicatedActor is created by the Authority. When the ReplicatedActor is created, the Authority will generate four structs, which have a integer and a TArray of uint8, to be stored into an TArray. That TArray is replicated out to the clients so the server and clients have the same list.

Each frame following, the Authority chooses one of the four values, makes sure it exists in the array, which was generated at the start and replicated out, before assigning it to a RepNotify variable. There is a small chance that the RepNotify will be fired on the client side and the resulting replicated value will not match any of the four that were generated (which both client and server have).

As an example, this is what happens when they dont match:

[2016.11.02-19.31.01:353][116]LogTemp:Error: Client side mismatch, printing difference...
[2016.11.02-19.31.01:353][116]LogTemp: Client: 32 171 40 161 222 146 124 242 173 137 36 62
[2016.11.02-19.31.01:353][116]LogTemp:Warning: 32 171 40 72 222 146 124 242 173 137 36 62
[2016.11.02-19.31.01:353][116]LogTemp:Warning: 60 166 228 72 145 103 41 158 250 103 250 18
[2016.11.02-19.31.01:353][116]LogTemp:Warning: 199 234 138 168 158 108 143 39 223 26 15 96
[2016.11.02-19.31.01:353][116]LogTemp:Warning: 2 100 191 161 72 125 169 112 183 8 54 8

As you can see, the client version that was replicated in the RepNotify function is 1 value is different than the array that was generated and replicated at the start. In the case above the client recieved 161 in element 4 where the value replicated out was 72.

Attached is the log as well.

Steps to Reproduce
  1. Download attached project
  2. Right-click on .uproject and generate Visual Studio files
  3. Open .sln and debug project as Development Editor
  4. In Editor, make sure that in play settings there is 2 clients and no dedicated server
  5. Make sure that "default" map is open.
  6. PIE

RESULT:

Sometimes, the replication of a struct that holds a TArray of uint8 values will replicate with one of the values being incorrect in the sequence.

EXPECTED:

Replicated data always matches on the client side, what was replicated from the authority

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

18
Login to Vote

Won't Fix
ComponentUE - Networking
Affects Versions4.13.1
CreatedNov 2, 2016
ResolvedAug 18, 2021
UpdatedAug 18, 2021