Maintaining Client-Server Version Numbers

I am having trouble understanding how to properly develop separate Client and Server versions of a project. I know they need to be built by the same source - which to my knowledge has been done. My issue is that I will have some client blueprints or settings that will differ from the dedicated server. To name one, UI and login setup.

Perhaps I just have the wrong theoretical process to do this?

I have:

  • Installed 4.15 Source
  • Created two separate projects,
    near identical ThirdPerson blueprint maps.
    Named one project Client and the
    other project Server. I have placed
    them in the source directory so they
    both show up in the visual basics
    Solution Explorer.
  • Followed through a tutorial to use
    UnrealFrontEnd to create a dedicate
    server for the ‘Server’ Project.
  • Once all changes are made in UE4, I
    re-build the solution for the whole
    engine in Visual Basics. Than build
    solutions for each project
    individually. (I’ve also tried just re-building just the whole engine).

Some success:

  • Since the ‘Server’ project has been
    packaged for both a client and
    dedicated server… I can open the
    dedicated server than use the
    “WindowsNoEditor” version to connect
    to the dedicated server. I can
    connect multiple windows and see
    every character moving around fine, so the
    dedicated server appears to be
    working properly.

I have this quote from one post that may be what I need or what I am looking for but I am predominantly a blueprint developer. What is the process to do this in as C++ task?

You can handle the version checks on
your own binding the
IsNetworkCompatibleOverride delegate
of FNetworkVersion to you own handler.
You can also bind the
GetLocalNetworkVersionOverride
delegate of FNetworkVersion to use
your own version system, for instance
a simple int so that different version
can connect together.

The image below is my error when trying to connect my ‘Client’ project to my ‘Server’ dedicated server. (I hope that doesnt sound confusing):

Create a C++ Class from Editor (Blueprint Library).

#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "NetworkVersion.h"
#include "MyGameBluePrintLib.generated.h"

/**
 * 
 */
UCLASS()
class MYGAME_API UMyGameBluePrintLib : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
public:
	UMyGameBluePrintLib();

private:
	/*
	Client can't connect to Server if this Number not fit.
	*/
	uint32 getServerClientSyncVersion();
	
	
};

#include "MyGame.h"
#include "MyGameBluePrintLib.h"


UMyGameBluePrintLib::UMyGameBluePrintLib() {


		FNetworkVersion::GetLocalNetworkVersionOverride.BindUObject(this, &UMyGameBluePrintLib::getServerClientSyncVersion);

}

uint32 UMyGameBluePrintLib::getServerClientSyncVersion() {
	return 123456;
}

Thanks a ton for this!!!

I tried briefly yesterday night but I couldnt get it to work. I am going to re-try tonight I may have modified some of my NetworkVersion files that are causing problems.

Does it matter what type of C++ class I make? I made a blank class but thinking about it now I should have done a blueprint class… I think?

With a fresh source install and correctly choosing the C++ Class as a Blueprint Library Function it worked like a charm.

Exactly what I was looking for! Thank You!

Thank you very much Socke81! This saved me from compiling the whole engine just to fix version mismatch error.

Hey everyone, this sounds like the problem I am having but I don’t know for sure.
How do I tell if it’s the version number or something else which gives me the Session Not Found error when trying to connect my slightly-different version of the game for Android with the original version for PC (this worked in the past by the way, when they had the same project file. I had to separate them out because Android doesn’t support one of the non-essential plugins I used for some fun menu effects).

Here’s my post if any of you would be willing to look at it and give me a clue:

Nevermind it works! I just had to shut down my VPN I didn’t realize I had left running!

Hi TheMainShark ,

Sorry for my silly question, what did u do with that cpp code after this?
did u call it in blueprint? or just leave it there, it will running automatically like begin play.

Hi

Sorry for my silly question.
I have a same problem like you. And trying to solve with this code.

So what do I need to do with this code? Do I need to call from my blueprint gamemode or something?
Or this code already running from start like a “beginplay”?

If the code still works (is three years old) then the version check in the engine is overwritten. When the engine makes a request, it does not use the normal one but the one from the code example. So always the version 123456.