question

powershotgames avatar image
powershotgames asked

Opening MyGameServer.exe with PlayFab GSDK Plugin Installed, shutsdwon immediately? Help

Hey everyone,

First time trying to upload a server to PlayFab Multiplayer Service. I have followed the instructions step by step until the Plugin GSDK installation with C++.

Before I could open my Dedicated Server "MyGameServer.exe -log" with log console and connect with client with no problem.

When going to next step to install Plugin GSDK with C++, I get told to create own game instance. After creating and coding as they show, I try to open it again and it just shutsdown.

Is it something I need to understand or do before open it? Or maybe not supposed to open it yet?

So I continued anyways to open it with LocalMultiplayerAgent.exe as they say in next step and here I am stuck, still just shutsdown.

I've been doing the same thing as the pages tell me to do over and over and it doesn't work.

Something I noticed is the code they are showing.

From UMyGameInstance to UThirdPersonGameInstance and it just gives errors when compiling because it doesnt exists, so I changed back to UMyGameInstance.

This is the code I mean:

void UMyGameInstance::OnStart()
{
    UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Reached onStart!"));
    UGSDKUtils::ReadyForPlayers();
}

void UMyGameInstance::OnGSDKShutdown()
{
    UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Shutdown!"));
    FPlatformMisc::RequestExit(false);
}

bool UMyGameInstance::OnGSDKHealthCheck()
{
    UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Healthy!"));
    return true;
}

void UThirdPersonGameInstance::OnGSDKServerActive()
{
    /**
     * Server is transitioning to an active state.
     * Optional: Add in the implementation any code that is needed for the game server when
     * this transition occurs.
     */
    UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Active!"));
}

void UThirdPersonGameInstance::OnGSDKReadyForPlayers()
{
    /**
     * Server is transitioning to a StandBy state. Game initialization is complete and the game
     * is ready to accept players.
     * Optional: Add in the implementation any code that is needed for the game server before
     * initialization completes.
     */
    UE_LOG(LogPlayFabGSDKGameInstance, Warning, TEXT("Finished Initialization - Moving to StandBy!"));
}



// Also it says to creat new Init if not exist. And also shows UThirdPersonGameInstance. is this right?


void U[YourGameInstanceClassName]::Init()
{
    FOnGSDKShutdown_Dyn OnGSDKShutdown;
    OnGSDKShutdown.BindDynamic(this, &UMyGameInstance::OnGSDKShutdown);
    FOnGSDKHealthCheck_Dyn OnGSDKHealthCheck;
    OnGSDKHealthCheck.BindDynamic(this, &UMyGameInstance::OnGSDKHealthCheck);
    FOnGSDKServerActive_Dyn OnGSDKServerActive;
    OnGSDKServerActive.BindDynamic(this, &UThirdPersonGameInstance::OnGSDKServerActive);
    FOnGSDKReadyForPlayers_Dyn OnGSDKReadyForPlayers;
    OnGSDKReadyForPlayers.BindDynamic(this, &UThirdPersonGameInstance::OnGSDKReadyForPlayers);


    UGSDKUtils::RegisterGSDKShutdownDelegate(OnGSDKShutdown);
    UGSDKUtils::RegisterGSDKHealthCheckDelegate(OnGSDKHealthCheck);
    UGSDKUtils::RegisterGSDKServerActiveDelegate(OnGSDKServerActive);
    UGSDKUtils::RegisterGSDKReadyForPlayersDelegate(OnGSDKReadyForPlayers);
}
sdksmultiplayer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Made Wang avatar image
Made Wang answered

I have not been able to reproduce this issue, please refer to gsdk/ThirdPersonMPGSDKSetup.md at main PlayFab/gsdk (github.com) to check your code. If this issue still exists, please provide the full code of your GameInstance and the Unreal version so that we can further troubleshoot.

Also, did you configure MultiplayerSettings.json when testing locally? You can use MpsAgent/LocalMultiplayerAgent/SettingsJsonGenerator at main PlayFab/MpsAgent (github.com) to configure it.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.