Hey
I am trying to get nakama and unreal work together. Therefore I followed the nakama-unreal client guide and setup a basic setting. I am trying to authenticate an user against the server. The cURL
test works fine. My idea is to execute a request in the PreLogin
Method of an Unreal GameMode
class. The code looks like this:
#if WITH_SERVER_CODE
auto loginFailedCallback = [&ErrorMessage](const NError& error)
{
ErrorMessage = FString(error.message.c_str());
};
auto loginSucceededCallback = [](NSessionPtr session)
{
UE_LOG(LogTemp, Warning, TEXT("Authentication successful"));
};
auto email = UGameplayStatics::ParseOption(Options, "email");
auto password = UGameplayStatics::ParseOption(Options, "password");
UE_LOG(LogTemp, Warning, TEXT("Login attempt with: %s, %s"), *email, *password);
nakamaClient->authenticateEmail(TCHAR_TO_UTF8(*email), TCHAR_TO_UTF8(*password), "", false, {}, loginSucceededCallback, loginFailedCallback);
#endif
As the guide hints in the Tick section I execute a tick on the nakama client every game objects tick. My code runs and I get the “Login attempt with…” log message. But the request is never executed. Does anybody got an idea?
Regards,
Mark