Source/RnD/Network/LobbyPlayerController.cpp
//called from the game mode when the player is kicked by the host to make the player destroy his session and leave game

called from the game mode when the player is kicked by the host to make the player destroy his session and leave game
called from the game mode when the player is kicked by the host to make the player destroy his session and leave game
void ALobbyPlayerController::Client_GotKicked_Implementation()
{
	UNWGameInstance* NetworkedGameInstance = Cast<UNWGameInstance>(GetWorld()->GetGameInstance());
	if (NetworkedGameInstance)
	{
		NetworkedGameInstance->ShowErrorMessage(FText::FromString("You got kicked from the server"));
		NetworkedGameInstance->DestroySessionAndLeaveGame();
	}
}
void ALobbyPlayerController :: Client_GotKicked_Implementation ( ) { UNWGameInstance * NetworkedGameInstance = Cast < UNWGameInstance > ( GetWorld ( ) -> GetGameInstance ( ) ) ; if ( NetworkedGameInstance ) { NetworkedGameInstance -> ShowErrorMessage ( FText :: FromString ( " " ) ) ; NetworkedGameInstance -> DestroySessionAndLeaveGame ( ) ; } }
called from the game mode when the player is kicked by the host to make the player destroy his session and leave game
called from the game mode when the player is kicked by the host to make the player destroy his session and leave game
//get the game Instance to make the player destroy his session and leave game
 //show the player that he got kicked in message in UMG
 //make the player call the game Instance to destroy his session
