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"

How to override IsNetworkCompatible to true?

Hi, how can I make FNetworkVersion::IsNetworkCompatible to always return true without building engine from source code? I have to install the whole engine from source if I can't make this. Thanks in advance.

Product Version: UE 4.21
Tags:
more ▼

asked Dec 29 '18 at 06:27 PM in C++ Programming

avatar image

SalihBalkan
429 16 29 58

avatar image Evigmae Dec 29 '18 at 06:34 PM

hi, what are you trying to achieve with this?

avatar image SalihBalkan Dec 29 '18 at 07:33 PM

I want to completely disable version control in my release builds. I will build from source while distributing but I don't want to build from source yet, so I want to use builds compiled from different computers. I don't want any version mismatch errors.

avatar image Evigmae Dec 29 '18 at 07:44 PM

are you on a team with more than 1 programmer?

avatar image SalihBalkan Dec 29 '18 at 08:19 PM

I am alone for now but I use two computers. They produce different version hashes. This is apparently a override feature but I just don't know how to use it: FNetworkVersion::FIsNetworkCompatibleOverride FNetworkVersion::IsNetworkCompatibleOverride;

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

1 answer: sort voted first

There's a static delegate you can bind to, see FNetworkVersion::IsNetworkCompatibleOverride. You could bind to that and have it always return true regardless of the versions given.

 FNetworkVersion::IsNetworkCompatibleOverride.BindLambda([](uint32 LocalNetworkVersion, uint32 RemoteNetworkVersion)
 {
     return true;
 });

There's also FNetworkVersion::GetLocalNetworkVersionOverride which you can bind to to override the version generation logic.

more ▼

answered Dec 29 '18 at 10:11 PM

avatar image

Jamie Dale STAFF
7.4k 176 66 304

avatar image SalihBalkan Dec 29 '18 at 10:14 PM

Thank you very much, but where should I put this code to? Anywhere in cpp classes of my project?

avatar image Jamie Dale STAFF Dec 29 '18 at 10:33 PM

Somewhere during your game module initialisation. It would probably also be worth wrapping it in an #if !BUILD_SHIPPING block to make sure you don't accidentally ship the override code!

avatar image SalihBalkan Dec 31 '18 at 01:20 PM

I am adding this code but getting this error: Use of undeclared identifier: FNetworkVersion

I included these but still same: #include "Runtime/Core/Public/Misc/NetworkVersion.h" #include "Runtime/Core/Private/Misc/NetworkVersion.cpp"

Could you please help me? I am poor at C++.

avatar image SalihBalkan Dec 31 '18 at 01:48 PM

Okay I resolved it by adding these lines only to header:

#include "Runtime/Core/Public/Misc/NetworkVersion.h"

struct FNetworkVersion;

avatar image Jamie Dale STAFF Dec 31 '18 at 08:22 PM

If your module is dependant on the "Core" module (which basically everything is). then that include can just be:

 #include "Misc/NetworkVersion.h"

You also shouldn't need the forward declaration of the type since you're including it.

(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