| 6 | #include "MultiplayerSessionsSubsystem.h" |
| 7 | |
| 8 | void ALobbyGameMode::PostLogin(APlayerController* NewPlayer) |
| 9 | { |
| 10 | Super::PostLogin(NewPlayer); |
| 11 | |
| 12 | int32 NumberOfPlayers = GameState.Get()->PlayerArray.Num(); |
| 13 | |
| 14 | UGameInstance* GameInstance = GetGameInstance(); |
| 15 | if (GameInstance) |
| 16 | { |
| 17 | UMultiplayerSessionsSubsystem* Subsystem = GameInstance->GetSubsystem<UMultiplayerSessionsSubsystem>(); |
| 18 | check(Subsystem); |
| 19 | |
| 20 | if (NumberOfPlayers == Subsystem->DesiredNumPublicConnections) |
| 21 | { |
| 22 | UWorld* World = GetWorld(); |
| 23 | if (World) |
| 24 | { |
| 25 | bUseSeamlessTravel = true; |
| 26 | |
| 27 | FString MatchType = Subsystem->DesiredMatchType; |
| 28 | if (MatchType == "FreeForAll") |
| 29 | { |
| 30 | World->ServerTravel(FString("/Game/Maps/BlasterMap?listen")); |
| 31 | } |
| 32 | else if (MatchType == "Teams") |
| 33 | { |
| 34 | World->ServerTravel(FString("/Game/Maps/Teams?listen")); |
| 35 | } |
| 36 | else if (MatchType == "CaptureTheFlag") |
| 37 | { |
| 38 | World->ServerTravel(FString("/Game/Maps/CaptureTheFlag?listen")); |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected