ロビーサービスに接続する
Overview
The Lobby service is a component under the Play service which acts as the main hub for your player activity. This service provides a continuous connection between your players and also acts as the entry point for the game client to interact with the Friends and Presence services.
This How-to will walk you through connecting your game to the AccelByte Gaming Services (AGS) Lobby service using AccelByte OSS (OSS), Unreal Engine, and Unity.
Prerequisite
- Access to the AGS Admin Portal.
- If you're using Unreal Engine or Unity, you must have installed the AccelByte Unreal or Unity SDK. This includes credentials for your game client:
- Client ID
- Client Secret
Connect your game to the Lobby service
To connect your game to the Lobby service, follow the SDK installation steps for your game engine.
- AccelByte OSS
- Unreal Engine
- Unity
There are two ways to connect to the Lobby service in the AccelByte Online Subsystem (OSS):
Automatically connect to the Lobby
Set the bAutoLobbyConnectAfterLoginSuccess
parameter to true in the [OnlineSubsystemAccelByte]
inside the DefaultEngine.ini
file. Once set, OSS will try to connect to the lobby upon a successful user login.
Manually connect to the Lobby
If the automatic option does not work, you can manually call FOnlineIdentityAccelByte::ConnectAccelByteLobby
by running this command.
// Manually connect to lobby
int32 LocalUserNum = 0;
FOnlineIdentityAccelBytePtr IdentityInterface = StaticCastSharedPtr<FOnlineIdentityAccelByte>(OnlineSubsystem->GetIdentityInterface());
AB_TEST_TRUE(IdentityInterface.IsValid());
IdentityInterface->ConnectAccelByteLobby(LocalUserNum);
AccelByte::FRegistry::Lobby.Connect();
AccelBytePlugin.GetLobby().Connect();
What's next?
After you have connected your game to the Lobby service, your game lobby is created. Configure the settings for your game's lobby in the AGS Admin Portal. See Configure the Lobby service.