Error when Building Client with Unreal Plugin and Setup

Hello,

Setting up a project and getting this error:

Here is my usage code for connecting/authenticating to the docker container I have running.

public:
ASSPlayerController() : Super()
{
NClientParameters parameters;
parameters.serverKey = “defaultkey”;
parameters.host = “127.0.0.1”;
parameters.port = 7350;
const NClientParameters& params = parameters;
NClientPtr client = createDefaultClient(NClientParameters());
this->NakamaClient = client;
}

NClientPtr NakamaClient;
virtual void Tick(float DeltaTime) override
{
	Super::Tick(DeltaTime);
	this->NakamaClient->tick();
}

UFUNCTION(BlueprintCallable,Category="Nakama")
	void StartSession()
{
	auto loginFailedCallback = [](const NError& error)
	{
		GEngine->AddOnScreenDebugMessage(-1, 100, FColor::Red, *FString::Printf(TEXT("Session Auth Failed %s"), toString(error).c_str()));
	};

	auto loginSucceededCallback = [](NSessionPtr session)
	{
		GEngine->AddOnScreenDebugMessage(-1, 100, FColor::Green, TEXT("Session Auth Success on Callback"));
	};

	std::string deviceId = "unique device id";

	this->NakamaClient->authenticateDevice(deviceId,opt::nullopt,opt::nullopt,{},loginSucceededCallback,loginFailedCallback);

Any help is appreciated.

@blakemcclaren welcome :wave:

It looks like you aren’t passing the parameters object into createDefaultClient().

What if you change that line to:
NClientPtr client = createDefaultClient(parameters);

I recommend reading a bit about C++ constructors and passing references.

I have tried:

	NClientPtr client = createDefaultClient(NClientParameters());
	NClientPtr client = createDefaultClient(NClientParameters(paramters));
	NClientPtr client = createDefaultClient(NClientParameters(params));
	NClientPtr client = createDefaultClient(parameters);
	NClientPtr client = createDefaultClient(params);

All have the same error. I think its a library issue or something, but I will read up on constructors today. I am new and learning, so it could be anything.

error:
Severity Code Description Project File Line Suppression State
Error C2664 ‘NakamaWrapper::NClientPtr NakamaWrapper::createDefaultClient(const NakamaWrapper::NClientParameters &)’: cannot convert argument 1 from ‘NClientParameters’ to ‘const NakamaWrapper::NClientParameters &’ soccersim L:\ue4games\soccersim\Source\soccersim\Public\SSPlayerController.h 30

Thanks for the response.