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

Method PostLogin

Source/Blaster/GameMode/TeamsGameMode.cpp:15–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15void ATeamsGameMode::PostLogin(APlayerController* NewPlayer)
16{
17 Super::PostLogin(NewPlayer);
18
19 ABlasterGameState* BGameState = Cast<ABlasterGameState>(UGameplayStatics::GetGameState(this));
20 if (BGameState)
21 {
22 ABlasterPlayerState* BPState = NewPlayer->GetPlayerState<ABlasterPlayerState>();
23 if (BPState && BPState->GetTeam() == ETeam::ET_NoTeam)
24 {
25 if (BGameState->BlueTeam.Num() >= BGameState->RedTeam.Num())
26 {
27 BGameState->RedTeam.AddUnique(BPState);
28 BPState->SetTeam(ETeam::ET_RedTeam);
29 }
30 else
31 {
32 BGameState->BlueTeam.AddUnique(BPState);
33 BPState->SetTeam(ETeam::ET_BlueTeam);
34 }
35 }
36 }
37}
38
39void ATeamsGameMode::Logout(AController* Exiting)
40{

Callers

nothing calls this directly

Calls 2

SetTeamMethod · 0.80
GetTeamMethod · 0.45

Tested by

no test coverage detected