mordentral / AdvancedSessionsPlugin

Advanced Sessions Plugin for UE4
https://www.vreue4.com
MIT License
597 stars 141 forks source link

Misleading error message. #43

Closed mader-levap closed 2 years ago

mader-levap commented 2 years ago

This project has at least one misleading error message that wasted few hours of my life.

In CreateSessionCallbackProxyAdvanced.cpp almost at beginning we have

    if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
    {
        Sessions->CreateSession(*Helper.UserID, NAME_GameSession, Settings);
    }
    else
    {
        FFrame::KismetExecutionMessage(TEXT("Invalid Player controller when attempting to start a session"), ELogVerbosity::Warning);
        Sessions->ClearOnCreateSessionCompleteDelegate_Handle(CreateCompleteDelegateHandle);

        // Fail immediately
        OnFailure.Broadcast();
    }

Guess what happens when PlayerControllerWeakPtr is fine, but Helper.UserID is not. That's right, error message that is lying in your face.

mordentral commented 2 years ago

I would argue its not all that out of line considering its a failure state for either the Player Controller or the NetID for the player controller.

Curious how you ran into that throwing with a valid PC though, what were you doing?

mader-levap commented 2 years ago

Whops, misclicked. This misleading error happens when you execute CreateAdvancedSession node without using LoginUser node first. At least that message is very easy to fix and I already did that on my local copy of this plugin.

else
{
    // If both are invalid, bad UserID is almost certainly caused by bad player controller, so we show only error about player controller.
    if (!PlayerControllerWeakPtr.IsValid()) FFrame::KismetExecutionMessage(TEXT("Invalid Player Controller when attempting to start a session!"), ELogVerbosity::Warning);
    else FFrame::KismetExecutionMessage(TEXT("Invalid UserID when attempting to start a session!"), ELogVerbosity::Warning);

    // Fail immediately
    OnFailure.Broadcast();
}

General context: doing some shenanigans with EOS - my intention is to try take advantage of unchecked "User Required" checkbox in Client Policy and use EOS only for matchmaking without need to log into Epic or Steam account.

So far without success. I am not sure it is even possible.

And before someone asks why: I plan to create pure coop game (so cheating etc is not really a concern) that will be released on itch.io platform. So I really would like to avoid requiring player to have Epic/Steam/whatever account just to play my game.

mordentral commented 2 years ago

mmm, actually with most subsystems you don't have to do that at all. Makes sense though if you are on EOS and trying to do that. You would be the first person I am aware of to run into this case.

I'll make that warning a bit more descriptive but I will note that you need SOME sort of back end service provider, and EOS itself requires an account if you use them. You can't just disable logging in and have things work for most services. You would need your own master server.

mader-levap commented 2 years ago

I am fine with having account for EOS with all that stuff like ClientID/ClientSecret/other ids. I just want to avoid it for players.

In fact, it does not have to be EOS. Any service is fine, as long as:

Anyway I guess that's it for that issue.