project-d-p / Client

0 stars 0 forks source link

Match Button Does not Work after Session Destroyed #26

Closed dkglee closed 1 month ago

dkglee commented 2 months ago

문제

Parkjoungwan commented 2 months ago

로비 레벨로 돌아가는 과정이 어떻게 되죠?

dkglee commented 2 months ago

로비 레벨로 돌아가는 과정이 어떻게 되죠?

Host가 아예 종료를 하면 세션이 파괴되는 것을 감지하는 함수를 만들고 LobbyLevel?closed 레벨을 호출해서 넘어가게 했는데 그 이후에는 매치 버튼을 눌러도 세션이 생성이 안되네요ㅠ

void UGI_Zoomies::OnHostDisconnected()
{
    if (ADPPlayerController* PC = Cast<ADPPlayerController>(GetWorld()->GetFirstPlayerController()))
    {
        UE_LOG(LogTemp, Warning, TEXT("Destroying PlayerController"));
        PC->ReleaseMemory();
        PC->Destroy();
    }
    UGameplayStatics::OpenLevel(GetWorld(), FName("lobbyLevel?closed"));
}

void UGI_Zoomies::HandleNetworkFailure(UWorld* World, UNetDriver* NetDriver, ENetworkFailure::Type Arg,
                                       const FString& String)
{
    if (Arg == ENetworkFailure::ConnectionLost || Arg == ENetworkFailure::ConnectionTimeout)
    {
        UE_LOG(LogTemp, Warning, TEXT("Network failure In HandleNetworkFailure: %s"), *String);
        OnHostDisconnected();
    }
}
Parkjoungwan commented 2 months ago

https://github.com/project-d-p/Client/commit/484902c3ae2891336579ea37e426811643f4d581

해당 커밋에서 해결됐습니다. 세션 호스트가 중간에 연결종료 됐을 때, 세션 클라이언트들의 Session 정보를 리셋시키도록 변경했습니다.

이슈는 병합된 후에 닫도록하겠습니다.