Skip to content

Build failing on Windows 11 Unreal Engine 5.7.1 (Source Build) #73

Description

@draicor

Hey there, new follower here, amazing plugin!

I tried to compile the plugin from source, and it wouldn't work, I was getting this error:

Plugins\EOSIntegrationKit\Source\OnlineSubsystemEIK\Subsystem\EIK_Subsystem.cpp(1115): error C4702: unreachable code
2> while compiling UEIK_Subsystem::OnJoinSessionCompleted

So I edited the function definition and the error went away, and it works for Unreal Engine 5.7.1 now.
Here is the fixed version, maybe you could test it and if it works, then add it to the project.

void UEIK_Subsystem::OnJoinSessionCompleted(FName SessionName, EOnJoinSessionCompleteResult::Type Result)
{
    bool bSuccess = false;
    
    if(Result == EOnJoinSessionCompleteResult::Success)
    {
        if(APlayerController* PlayerControllerRef = UGameplayStatics::GetPlayerController(GetWorld(), 0))
        {
            if(const IOnlineSubsystem* SubsystemRef = IOnlineSubsystem::Get())
            {
                if(const IOnlineSessionPtr SessionPtrRef = SubsystemRef->GetSessionInterface())
                {
                    FString JoinAddress;
                    SessionPtrRef->GetResolvedConnectString(SessionName, JoinAddress);
                    
                    if(Local_bIsDedicatedServerSession)
                    {
                        TArray<FString> IpPortArray;
                        JoinAddress.ParseIntoArray(IpPortArray, TEXT(":"), true);
                        
                        if(IpPortArray.Num() > 0)
                        {
                            const FString IpAddress = IpPortArray[0];
                            if(LocalPortInfo.IsEmpty())
                            {
                                LocalPortInfo = "7777";
                            }
                            const FString NewCustomIP = IpAddress + ":" + LocalPortInfo;
                            JoinAddress = NewCustomIP;
                        }
                    }
                    
                    if(!JoinAddress.IsEmpty())
                    {
                        PlayerControllerRef->ClientTravel(JoinAddress, ETravelType::TRAVEL_Absolute);
                        bSuccess = true;
                    }
                }
            }
        }
    }
    else
    {
        UE_LOG(LogTemp, Error, TEXT("Join Session Error with Reason of %d"), Result);
    }
    
    JoinSession_CallbackBP.ExecuteIfBound(bSuccess);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions