Identity & Sessions
UCrimsonOnlineIdentityService
Wraps IOnlineIdentity. Handles platform login and logout, and reports the cached profile of each local player. Every function takes LocalUserNum (default 0) as its last parameter.
| Member | Description |
|---|---|
| Login(LocalUserNum = 0) | Starts platform login with empty credentials, which triggers the platform's auto-login flow. Result arrives on OnLoginComplete |
| Logout(LocalUserNum = 0) | Logs the local player out. Result arrives on OnLogoutComplete |
| GetLocalPlayerInfo(LocalUserNum = 0) | BlueprintPure. Returns FCrimsonOnlinePlayerInfo (DisplayName, PlatformUserId, LoginStatus, Platform) |
| GetLoginStatus(LocalUserNum = 0) | BlueprintPure. Returns ECrimsonLoginStatus: NotLoggedIn, UsingLocalProfile or LoggedIn |
| OnLoginComplete | Delegate: bool bSuccess, const FCrimsonOnlinePlayerInfo& PlayerInfo. Fires for both success and failure |
| OnLogoutComplete | Delegate: bool bSuccess |
Async node
Login (Online) (
UCrimsonAsyncAction_Login). Input pin: Local User Num (int32, default 0). Output pins On Success and On Failure, each carrying bSuccess and Player Info. On failure Player Info comes back with LoginStatus = NotLoggedIn.There is no IsLoggedIn helper
Test
GetLoginStatus(0) == ECrimsonLoginStatus::LoggedIn instead. UsingLocalProfile means the player has a local profile but no authenticated network session - treat it as offline for anything that needs the backend.UCrimsonOnlineSessionService
Wraps IOnlineSession for the full session lifecycle: Create -> Start -> (players join) -> End -> Destroy. Session names are FString and default to "GameSession", the name UE's own travel and URL logic expects. Settings come from FCrimsonSessionSettings.
FCrimsonSessionSettings
| Field | Type | Default | Description |
|---|---|---|---|
| MaxPlayers | int32 | 4 | Maximum public connections advertised for the session |
| bIsLanMatch | bool | false | LAN session - skips the platform matchmaking backend |
| bUsesPresence | bool | true | Advertise to friends through platform presence (Steam Rich Presence, Epic overlay) |
| bAllowInvites | bool | true | Allow platform friend invites into this session |
| bAllowJoinInProgress | bool | false | Allow players to join after StartSession |
| MapName | FString | empty | Travel URL or level long package name, used for server travel on join |
| GameModeName | FString | empty | Free-form game mode label advertised with the session |
Full API
| Member | Description |
|---|---|
| CreateSession(Settings, SessionName = "GameSession") | Creates and advertises a session; the caller becomes the host. Completes on OnSessionCreated |
| FindSessions(MaxResults = 20, LocalUserNum = 0) | Searches for sessions using the platform's default filter. Completes on OnSessionsFound |
| JoinSession(Result, SessionName = "GameSession") | Joins one FCrimsonSessionSearchResult returned by OnSessionsFound. Completes on OnSessionJoined |
| StartSession(SessionName = "GameSession") | Moves the session to in-progress. Completes on OnSessionStarted |
| EndSession(SessionName = "GameSession") | Moves the session to ended. Call before DestroySession. Completes on OnSessionEnded |
| DestroySession(SessionName = "GameSession") | Destroys the session and frees platform resources. Completes on OnSessionDestroyed |
| GetSessionState(SessionName = "GameSession") | BlueprintPure. Returns ECrimsonSessionState |
| IsSessionActive(SessionName = "GameSession") | BlueprintPure. True when GetSessionState is neither NoSession nor Destroying |
| OnSessionCreated | Delegate: bool bSuccess, const FString& SessionName |
| OnSessionsFound | Delegate: bool bSuccess, const TArray<FCrimsonSessionSearchResult>& Results |
| OnSessionJoined | Delegate: bool bSuccess, const FString& TravelURL - pass TravelURL straight to ClientTravel |
| OnSessionStarted | Delegate: bool bSuccess |
| OnSessionEnded | Delegate: bool bSuccess |
| OnSessionDestroyed | Delegate: bool bSuccess |
The connect string is handed to you
The service calls
IOnlineSession::GetResolvedConnectString internally and delivers the result as the TravelURL argument of OnSessionJoined. There is no separate GetResolvedConnectString function to call, and no player registration API - registration is left to the engine's session travel path.Host + client example
// Bind the delegates once (e.g. in your subsystem's Initialize), then call the actions.// Handlers must be UFUNCTIONs - these are dynamic multicast delegates.#include "CrimsonOnlineSubsystemGI.h"#include "Services/CrimsonOnlineSessionService.h"#include "Engine/World.h"void UMyMatchmaking::HostGame(){UCrimsonOnlineSessionService* Sessions =UCrimsonOnlineSubsystemGI::Get(this)->GetSessionService();Sessions->OnSessionCreated.AddDynamic(this, &UMyMatchmaking::HandleSessionCreated);FCrimsonSessionSettings Settings;Settings.MaxPlayers = 4;Settings.bUsesPresence = true;Settings.bAllowJoinInProgress = false;Settings.MapName = TEXT("Level_Arena");Sessions->CreateSession(Settings); // SessionName defaults to "GameSession"}void UMyMatchmaking::HandleSessionCreated(bool bSuccess, const FString& SessionName){if (bSuccess){UCrimsonOnlineSubsystemGI::Get(this)->GetSessionService()->StartSession(SessionName);}}// ---- CLIENT ----void UMyMatchmaking::FindAndJoin(){UCrimsonOnlineSessionService* Sessions =UCrimsonOnlineSubsystemGI::Get(this)->GetSessionService();Sessions->OnSessionsFound.AddDynamic(this, &UMyMatchmaking::HandleSessionsFound);Sessions->OnSessionJoined.AddDynamic(this, &UMyMatchmaking::HandleSessionJoined);Sessions->FindSessions(20);}void UMyMatchmaking::HandleSessionsFound(bool bSuccess,const TArray<FCrimsonSessionSearchResult>& Results){if (bSuccess && Results.Num() > 0){UCrimsonOnlineSubsystemGI::Get(this)->GetSessionService()->JoinSession(Results[0]);}}void UMyMatchmaking::HandleSessionJoined(bool bSuccess, const FString& TravelURL){if (bSuccess && !TravelURL.IsEmpty()){if (APlayerController* PC = GetWorld()->GetFirstPlayerController()){PC->ClientTravel(TravelURL, TRAVEL_Absolute);}}}