Sign In Register

How can we help you today?

Start a new topic

Keep getting timeout

Hello,


I'm currently trying to get AuthenticationRequest working but i keep getting: error": "timeout". I am implementing this in C++


Source:

   

void AuthenticationRequest_Response(GameSparks::Core::GS&, const GameSparks::Api::Responses::AuthenticationResponse& response)
{
	if (response.GetHasErrors())
	{
		std::cout << "something went wrong during the authentication" << std::endl;
		std::cout << response.GetErrors().GetValue().GetJSON().c_str() << std::endl;
	}
	else
	{
		std::cout << "you successfully authenticated to GameSparks with your credentials" << std::endl;
		std::cout << "your displayname is " << response.GetBaseData().GetString("displayName").GetValue().c_str() << std::endl;
	}
}

void RegistrationRequest_Response(GS& gsInstance, const GameSparks::Api::Responses::RegistrationResponse& response)
{
	if (response.GetHasErrors() && response.GetErrors().GetValue().GetString("USERNAME").GetValue() != "TAKEN")
	{
		std::cout << "something went wrong during the registration" << std::endl;
		std::cout << response.GetErrors().GetValue().GetJSON().c_str() << std::endl;
	}
	else
	{
		// Login immediately when gamesparks is available
		GameSparks::Api::Requests::AuthenticationRequest request(gsInstance);
		request.SetUserName("Player007");
		request.SetPassword("password");
		request.Send(AuthenticationRequest_Response);
	}
}

void GameSparksAvailable(GameSparks::Core::GS& gsInstance, bool available)
{
	std::cout << "\nGameSparks is " << (available ? "available" : "not available") << std::endl;

	if (available)
	{
		// Try with right credentials
		GameSparks::Api::Requests::AuthenticationRequest requestRight(gsInstance);
		requestRight.SetUserName("Player007");
		requestRight.SetPassword("password");
		requestRight.Send(AuthenticationRequest_Response);
	}
}

int main(int argc, char* argv[])
{
       //// ....

        GS gs;
	GameSparksConfiguration::NativePlatformDescription platform;
	gsstl::string message;
	platform.DebugMsg(message);
	gs.Initialise(&platform);
	gs.GameSparksAvailable = GameSparksAvailable;
 
       //// ....
}

   


Inside GameSparksConfiguration::NativePlatformDescription platform; i am setting SetRequestTimeoutSeconds to 15


Cheers,

Darren


Hi Darren,


Is the SDK making any sort of connection before you try the AuthenticationRequest ? Can you share the error logs that you are getting here ? 


Thanks,

Liam

Hi Liam,


After posting this problem i figured out that i was passing my delta time in gs.Update(deltaTime) instead of gs.Update(0.1) which was affecting the time out. Katie O' Sullivan helped me figure this out. All fixed now. Thanks for the response. 


Cheers,

Darren

Login to post a comment