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"

FString is not replicated if only casing changes

Unlike names, strings are not case insensitive. However, strings are not replicated if only their casing changes.

Eg. if a replicated FString property has a value of "Hello World", changing it to "HeLLo wORlD" does not replicate the new value.

Discovered this while changing player name by calling PlayerState->SetPlayerName() on the server, then fixing a casing mistake, resulting in the server seeing the fix, but not the clients.

Product Version: Not Selected
Tags:
more ▼

asked May 01 '14 at 08:14 AM in Bug Reports

avatar image

MulleDK19
2.7k 161 274 254

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

1 answer: sort voted first

This is actually normal and expected. The underlying replication code is using the == operator on FString, which is case insensitive.

more ▼

answered May 01 '14 at 02:28 PM

avatar image MulleDK19 May 02 '14 at 10:25 AM

Right, so that's the cause. I still don't see how it's not a bug though. I don't think players seeing different names for the same player is a minor thing. Or any other replication for that matter. I guess I'll either have to change the engine code or rely on RPCs for string replication.

avatar image [Epic] John Pollard STAFF May 02 '14 at 02:32 PM

I think your idea of using RPC's is a great one. It would be a lot more efficient. Replicating strings will require the replication path for that actor to compare each character of the string every time that actor is considered. With RPC's, since you know when the name change occurs, you can take advantage of that knowledge, and only send when it changes.

I'll bring this up internally though, as it's definitely an interesting case. The only concern is when someone doesn't expect the value to replicate when the case changes (maybe this is rare?). On the receiving end, if they use the standard equality operator of FString, it will still say they are equal, and that could be considered strange. I'll definitely bring this up internally though.

Thanks for bringing this to our attention.

(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