Sign In Register

How can we help you today?

Start a new topic
Answered

Unreal 4.12/14 calling GetAuthenticated

Hello,


I am stuck with a weird problem. I think that is something easy to solve, but I have been two days trying to fix this issue.


The problem is with a c++ project on Unreal. I want to check if the user is authenticated and I don't want to use UGameSparksComponent for this. Instead I am using this function:


bool XXXX::IsAuthenticated()

{

 return UGameSparksModule::GetModulePtr()->GetGSInstance().GetAuthenticated();

}


This function fails with the following log error:


error LNK2019: unresolved external symbol "public: bool __cdecl GameSparks::Core::GS::GetAuthenticated(void)const " (?GetAuthenticated@GS@Core@GameSparks@@QEBA_NXZ) referenced in function "public: bool __cdecl XXXX::IsAuthenticated(void)" (?IsAuthenticated@XXXX@@QEAA_NXZ)


but the next one works, and both are on the same file...


bool XXXX::IsGamesparksAvailable()

{

 return  UGameSparksModule::GetModulePtr()->GetGSInstance().GetAvailable();

}


The only diferent is that GetAvailable has its body on the .h, and GetAuthenticated on the .cpp...

Seems like a linking problem, but I have tried to Clean and build...delete build and intermediate folder on your plugin and my project...but the problem persists.


Could you help me with this? It would be apreciated.


Best regards!



Best Answer

1 person has this question

Hey,


I'm having this problem too. Any clue?


Best,

Ignacio


1 person likes this

Hi guys, I apologise for the late reply. 


The fix is done, the release is soon. I'll update this thread when the new update is out.


Cheers,

Omar


2 people like this

Hi Omar,


Thanks!!


I will wait your update gladly!!


Best, 

Jesús


1 person likes this

Thanks Omar!


I am going to test it right now :D


Best regards!!
Jesús

Hi Omar,


I am testing it and the problem seem fixed, but I am having troubles with the connection( I hadn't this error before). Something has changed? I am receiving this message on loop:


UGameSparksModuleLog: Create new connection

UGameSparksModuleLog: WebSocket closed

UGameSparksModuleLog: Received websocket error: DNS Lookup, TLS-handshake or websocket-handshake failed

UGameSparksModuleLog: Got websocket error. Please make sure, that you've setup you credentials.

UGameSparksModuleLog: Backing off for one seconds


And I do the connectio like follow:

UGameSparksComponent* GameSparksComponent = GameMode->CreateDefaultSubobject<UGameSparksComponent>(TEXT("GameSparksCom"));

 GameSparksComponent->OnGameSparksAvailableDelegate.AddDynamic(this, &UCloud::OnGameSparksAvailable);

 GameSparksComponent->Connect("player/XXXX", "XXXXXX", true);


Have I to change something?


Best regards!!

Jesús

Hi Omar,


I did some changes in my code and I used your new methods...I leave to receive the before message, but now I get a new one, and I am completely stucked:


MY CODE-->

 

UGameSparksComponent* GameSparksComponent = GameMode->CreateDefaultSubobject<UGameSparksComponent>(TEXT("GameSparksCom"));
 GameSparksComponent->OnGameSparksAvailableDelegate.AddDynamic(this, &UCloud::OnGameSparksAvailable);
GameSparksComponent->SetApiCredential("player");
GameSparksComponent->SetApiDomain("");
GameSparksComponent->Connect("XXXX", "XXXXXX", true);

 LOG-->


UGameSparksModuleLog: Create new connection

UGameSparksModuleLog: WebSocket callback: {"@class":".AuthenticatedConnectResponse","nonce":"mynonce","requestId":"0"}

UGameSparksModuleLog: Handle authentication connect response with immediate handshake

UGameSparksModuleLog: Send immediate request: {

    "@class": ".AuthenticatedConnectRequest",

    "hmac": "mymacid",

    "os": "Windows",

    "platform": "Windows",

    "deviceId": "mydeviceid"

}

UGameSparksModuleLog: Handshake request sent

UGameSparksModuleLog: WebSocket callback: {"@class":".AuthenticatedConnectResponse","error":"VALIDATION FAILURE","requestId":"0"}

UGameSparksModuleLog: Handle authentication connect response with immediate handshake

UGameSparksModuleLog: Got error during handshake. Please make sure, that you've setup you credentials.

UGameSparksModuleLog: Backing off for five seconds


Am I missing something?


Best regards!!

Jesús

I have found the problem!


The problem were on GameSparksModule, so I made a pull request to fix it. Now all works perfectly. I hope this helps!


https://bitbucket.org/gamesparks/gamesparks-cpp-unreal/pull-requests/3/gamesparksmodule-fixed-credentials-stage/diff


Best regards!!

Jesús

Hi Jesus,


Glad to hear you fixed the issue. I'll pass this information on to the SDK team.


Regards,

Liam

Hi Jesus,


why are you using the following:

GameSparksComponent->SetApiDomain("");

 

Can you try to connect without using that line?

 

And again I'm sorry for the late reply, we're having a transitional period here at GameSparks that means I don't have enough time on the forums.

 

Cheers,

Omar

Hi Omar.


Don't worry. Yes, I also tryed this way, but this problem was solved with the pull request that I sent a week ago and you accepted.


All is fine now!


Thansk again!

Best regards!

Jesús

Login to post a comment