Steam Dedicated server fails to properly connect to GameServers API

Hey,

When using new Steam Socket plugin with Steam OSS, it seems Dedicated server does not call TriggerOnSteamServerLoginCompletedDelegates when connected to GameServer API. Repro seems like build a dedicated server using Steam Socket + Steam OSS and observe server output (+ it won’t be visible in Steam servers list).

As of UE 5.8.1 there are several callbacks FOnlineAsyncTaskManagerSteam, but it seems one callback is missing - FOnlineAsyncTaskManagerSteam::OnSteamServersConnectedGS

Based on some community discussions it looks like a regression.

There are several ways of fixing that, including async task, or simpler version

I adjusted code from Unreal Source Discord server discussion (courtesy to user _giru, link to message). After that change dedicated server works correctly (starts, connectes to GameServer API, announces server etc).

/**
 *  GameServer API version of connected to the Steam backend callback
 */
void FOnlineAsyncTaskManagerSteam::OnSteamServersConnectedGS(SteamServersConnected_t* CallbackData)
{
    FOnlineSessionSteamPtr SessionInt = StaticCastSharedPtr<FOnlineSessionSteam>(SteamSubsystem->GetSessionInterface());
 
    if (!SessionInt.IsValid())
    {
       return;
    }
 
    if (SessionInt->bSteamworksGameServerConnected)
    {
       return;
    }
 
    const FUniqueNetIdSteamRef ServerId = FUniqueNetIdSteam::Create(SteamGameServer()->GetSteamID());
 
    SessionInt->bSteamworksGameServerConnected = true;
    SessionInt->GameServerSteamId = ServerId;
    AsyncTask(ENamedThreads::GameThread, [Subsystem = SteamSubsystem, ServerId]()
    {
       if (!Subsystem)
       {
          return;
       }
 
       Subsystem->TriggerOnSteamServerLoginCompletedDelegates(true);
    });
}

I could prepare PR on github, though I’m not sure if AsyncTask here is enough, or something more complicated FOnlineAsyncEvent<FOnlineSubsystemSteam> is required.

Does Epic have any plans to fix it? What is current state of this plugin?

p.s. There are smaller things I’ve spotted, like Steam “Game Servers” always show servers as not having password, because OnlineSessionAsyncServerSteam.cpp lists this as TODO; or NumOpenPrivateConnections commented out in GetServerKeyValuePairsFromSession func. I assume this is highly experimental/WIP even on ue6-main

void GetServerKeyValuePairsFromSession(const FOnlineSession* Session, FSteamSessionKeyValuePairs& KeyValuePairs)
{
...
    //KeyValuePairs.Add(STEAMKEY_NUMOPENPRIVATECONNECTIONS, FString::FromInt(Session->NumOpenPrivateConnections));
    //KeyValuePairs.Add(STEAMKEY_NUMOPENPUBLICCONNECTIONS, FString::FromInt(Session->NumOpenPublicConnections));
}
 
void UpdatePublishedSettings(UWorld* World, FNamedOnlineSession* Session)
{
...
// @TODO ONLINE Password protected or not
  SteamGameServerPtr->SetPasswordProtected(false);
}

Best regards,

Bohdan

[Attachment Removed]

Hi,

We’ve received similar reports with Steam dedicated servers, and we do have a potential fix shelved at CL 44788599. This adds back the OnSteamServersConnectedGS callback as well as the FOnlineAsyncEventSteamServerConnectedGS notification event for triggering the login completed delegates.

Could you try integrating this change to see if it resolves the issue?

Thanks,

Alex

[Attachment Removed]

Hello, Alex,

I’ve applied CL 44788599 instead of my changes, built, and apparently dedicated server works as intended (both Linux and Windows), server logs to GS Api and advertises as expected.

Should I keep this as a local patch, or you have plans to unshelve+check in CL at some point?

Best regards,

Bohdan

[Attachment Removed]

Hi,

Great, I’m glad that’s working for you!

I believe we do have plans to eventually check in that CL, but I can’t provide any estimate as to when that may happen. In the meanwhile, you may want to keep that as a local patch.

Thanks,

Alex

[Attachment Removed]