メインコンテンツまでスキップ

How to Handle Login Connection Errors

Last updated on June 23, 2025

When a login request fails due to connection issues, it’s important to handle the error gracefully to ensure a smooth player experience. Here are different ways to handle this issue effectively:

  • Display a clear and informative message based on the HTTP API error, so players understand why the login attempt failed.
  • Provide an option for the player to manually retry logging in instead of forcing them to restart the game.
  • Implementing game-level automatic retry logic which can help improve the experience by attempting to reconnect a few times before requiring manual intervention.

If the login request error is not handled properly, the game might encounter several issues that negatively impact the player experience. Here are some examples:

  • Infinite Login process. The player could be stuck in an endless login attempt. The player is never able to log in, and the login screen keeps reappearing.
  • Poor User Feedback. Without proper error handling, the game might show no feedback or show unclear messages when the login fails. The player never knows what exactly makes the login step has failed.

This code example shows how to catch and identify an HTTP API request error while logging in. You can choose different ways to handle the error depending on the error code or message.

...
auto ABSubsystem = IOnlineSubsystem::Get(ACCELBYTE_SUBSYSTEM);

auto IdentityInterface = ABSubsystem->GetIdentityInterface();

int32 LocalUserNum = 0;

// Auto-detect the login methods based on the configuration
FOnlineAccountCredentialsAccelByte Credentials{};

// Login
IdentityInterface->AddOnLoginCompleteDelegate_Handle(LocalUserNum,
FOnLoginCompleteDelegate::CreateLambda([](int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& LoginError)
{
if (bWasSuccessful)
{
// Do something when the login is successful.
}
else
{
// Implement a solution to handle failed request.
}
}));
IdentityInterface->Login(LocalUserNum, Credentials);
...

Currently, if a login request fails, the AGS OSS does not provide details about whether the failure was caused by an HTTP API timeout or another issue.

Login Queue

Network disruptions can occur not only during scheduled maintenance but also during high-traffic events, such as game launches or in-game events with more players than expected. When this happens, repeatedly attempting to log in can overwhelm the servers, making the issue worse and preventing more players from accessing the game.

To prevent this, it's a good practice to implement a login queue system. A login queue helps manage incoming requests by allowing players to connect in a controlled manner instead of all at once. This improves server stability, reduces failed login attempts, and ensures a smoother experience for players trying to enter the game.

On this page