MCPcopy Create free account
hub / github.com/DruidMech/MultiplayerCourseBlasterGame / PostLogin

Method PostLogin

Source/Blaster/GameMode/LobbyGameMode.cpp:8–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "MultiplayerSessionsSubsystem.h"
7
8void 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected