Skip to content

Commit

Permalink
Steam sample- better logs and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Leinnan committed Nov 13, 2024
1 parent 2f746ed commit 9a46b8e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ jobs:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
key: docs-${{ github.ref }}
restore-keys: docs-
path: |
.venv
- run: bash docs_build.sh
- run: python -m mkdocs build
working-directory: ./Docs
10 changes: 8 additions & 2 deletions Docs/docs/samples/basic/steam-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ Now, you'll need to configure a Beamable realm so you can use it:
15. In main folder (in the built game's folder where the executable is) create `steam_appid.txt` file with Steam Application ID as only content.

Now, you are ready to sign into a game using Steam.
## Playing the sample through PIE

## Playing the sample

!!! warninig "Starting the sample"
Testing the Steam integration from the editor should be performed in `Standalone Game` mode. Steam integration can encounter challenges when running in PIE mode.


In order to test the sample:

Expand All @@ -65,7 +70,8 @@ In order to test the sample:

#### What can you do with this sample?

**This sample is NOT a template you can start your own repository from.**
!!! warning
This sample is NOT a template you can start your own repository from.

However, its Beamable code components are free for you to copy and use in your own project. Here's what these are:

Expand Down
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,30 @@ class BEAMPROJ_STEAMDEMO_API USteamDemoMainMenu : public UBeamLevelSubsystem
UFUNCTION()
void OnBeamableUserReady(const FUserSlot& UserSlot)
{
UE_LOG(LogTemp, Warning, TEXT("SteamDemoLogs Initializing after beamable Ready"));
if (GetWorld()->WorldType == EWorldType::PIE || GetWorld()->WorldType == EWorldType::Editor)
{
UE_LOG(LogTemp, Error, TEXT("SteamDemoLogs, This sample cannot be tested from PIE or Editor, it is required to run as Standalone."))
this->OnLoginCompleteDelegate.Broadcast(false,TEXT("This sample cannot be tested from PIE or Editor, it is required to run as Standalone."));
return;
}
UE_LOG(LogTemp, Warning, TEXT("SteamDemoLogs Initializing OnBeamableUserReady"));
UGameInstance* GameInstance = GetWorld()->GetGameInstance();
UBeamRuntime* Runtime = GameInstance->GetSubsystem<UBeamRuntime>();
FUserSlot TargetSlot = FUserSlot(TEXT("Player0"));
FBeamRealmUser User;
const bool userGrabbed = UserSlots->GetUserDataAtSlot(TargetSlot, User, this);
if (!userGrabbed)
{
UE_LOG(LogTemp, Error, TEXT("SteamDemoLogs, NO USER!"))
UE_LOG(LogTemp, Error, TEXT("SteamDemoLogs, Failed to get the Beamable User Data!"));
this->OnLoginCompleteDelegate.Broadcast(false,TEXT("Failed to get the Beamable User Data"));
return;
}
const auto AccountID = User.AccountId.AsString;
ISteamUser* SteamAccount = SteamUser();
if (!SteamAccount)
{
UE_LOG(LogTemp, Error, TEXT("SteamDemoLogs, NOT A STEAM USER"))
this->OnLoginCompleteDelegate.Broadcast(false,TEXT("NOT A STEAM USER"));
UE_LOG(LogTemp, Error, TEXT("SteamDemoLogs, Steam User is null. Check if the Steam SDK is initialized correctly and the game has valid settings."))
this->OnLoginCompleteDelegate.Broadcast(false,TEXT("Failed to get Steam user info. Check if the Steam SDK is initialized correctly and the game has valid settings."));
return;
}

Expand Down

0 comments on commit 9a46b8e

Please sign in to comment.