Download

Modifying Engine Source Files

I’m finding that my game works fine when I run a listen server but when I build a dedicated server I’m running into some odd issues where players are not spawning after PlayerController::ServerRestartPlayer is called.

In my attempt to debug this I’ve added some log statements to PlayerController:



void APlayerController::ServerRestartPlayer_Implementation()
{
	UE_LOG(LogPlayerController, Verbose, TEXT("SERVER RESTART PLAYER"));
	if ( GetNetMode() == NM_Client )
	{
		UE_LOG(LogPlayerController, Verbose, TEXT("( GetNetMode() == NM_Client )"));
		return;
	}

	if ( IsInState(NAME_Inactive) || (IsInState(NAME_Spectating) && bPlayerIsWaiting) )
	{
		UE_LOG(LogPlayerController, Verbose, TEXT("( IsInState(NAME_Inactive) || (IsInState(NAME_Spectating) && bPlayerIsWaiting) )"));
		AGameMode* const GameMode = GetWorld()->GetAuthGameMode();
		if ( !GetWorld()->GetAuthGameMode()->PlayerCanRestart(this) )
		{
			UE_LOG(LogPlayerController, Verbose, TEXT("( !GetWorld()->GetAuthGameMode()->PlayerCanRestart(this) )"));
			return;
		}

		// If we're still attached to a Pawn, leave it
		if ( GetPawn() != NULL )
		{
			UE_LOG(LogPlayerController, Verbose, TEXT("( GetPawn() != NULL )"));
			UnPossess();
		}

		GameMode->RestartPlayer( this );
	}
	else if ( GetPawn() != NULL )
	{
		UE_LOG(LogPlayerController, Verbose, TEXT("( GetPawn() != NULL )"));

		ClientRetryClientRestart(GetPawn());
	}
}


However, after rebuilding the Engine’s server/client/editor and building my game’s server/client/editor (pointing at this new engine) and packaging a new client I’m not finding any of the new log statements to be printing in the console. Just the “SERVER RESTART PLAYER” prints which leads me to believe none of my statements were included in the builds.

My question is, if I make a change to the engine’s core files like PlayerController.cpp, what steps do I have to take to ensure that they will be included in project’s that build off of it?