Is OnlineServices (aka OSSv2) compatible with Dedicated Servers?

So far I’m having a good experience with the plugins, however it doesn’t seem to support dedicated server. Reasons:

1- CreateSession requires LocalPlayer

On Sessions.h in OnlineServicesInterface) we have CreateSession, which needs this parameter:

/** Id handle for the local user which will perform the action */
FAccountId LocalAccountId;

This doesn’t seem possible to obtain without a LocalPlayer. I tried to pass it nullptr, but it fails. It does require the param.

For reference, Lyra’s code also doesn’t know what to do here.
On UCommonSessionSubsystem::CreateOnlineSessionInternalOSSv2 we find:

FCreateLobby::Params CreateParams;

if (LocalPlayer)
{
CreateParams.LocalAccountId = LocalPlayer->GetPreferredUniqueNetId().GetV2();
}
else if (bIsDedicatedServer)
{
// TODO what should this do for v2?
}

2- No space for multiple artifacts

Services uses a different way of writing artifacts on DefaultEngine.ini.

Subsystem (OSSv1) can be done on editor, you can add how many artifacts you want. On text you can write:

+Artifacts=(ArtifactName=“NAME”,ClientId=“CLIENT_ID”,ClientSecret=“CLIENT_SECRET”,ProductId=“PRODUCT_ID”,SandboxId=“SANDBOX_ID”,DeploymentId=“DEPLOYTMENT_ID”,ClientEncryptionKey=“CLIENT_ENCRYPTION_KEY”)

We can add how many lines we want. And we can reference the different artifacts.

Services (OSSv2) uses this on the file:

[OnlineServices.EOS]
ProductId=PRODUCT_ID
SandboxId=SANDBOX_ID
DeploymentId=DEPLOYTMENT_ID
ClientId=CLIENT_ID
ClientSecret=CLIENT_SECRET
ClientEncryptionKey=CLIENT_ENCRYPTION_KEY

There is only room for one.
The workaround has been to rewrite this whenever you want to build a server or a client. Which is impractical for quick iterations.

Has anyone managed to run a dedicated server and create sessions using OSSv2?

Posting for future surfers.

Whilst I do not have the dedicated servers setup yet, you can specify custom configs to be loaded in your build target, thus specifying the correct client id and secret for your client build and server build.

using UnrealBuildTool;
using System.Collections.Generic;

public class ProjectNameServerTarget: TargetRules
{
    public ProjectNameServerTarget(TargetInfo Target) : base(Target)
    {
        Type = TargetType.Server;
        DefaultBuildSettings = BuildSettingsVersion.V5;
        IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5;
        ExtraModuleNames.Add("ProjectName");

        /*
        This tells UBT to load configuration files in the 
        Config/Custom/Server directory.
        See: https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-build-tool-target-reference?application_version=5.5
        */
        CustomConfig = "Server"; 
    }
}

You can see this used in the Lyra project to load custom config directory for the EOS platform build.
LyraGameEOS.Target.cs
Config/Custom/EOS/DefaultEngine.ini

I will update this further once I have a full solution for dedicated servers using OSSv2.