Exemplo n.º 1
0
void ACharacter::PossessedBy(AController* NewController)
{
	Super::PossessedBy(NewController);

	// If we are controlled remotely, set animation timing to be driven by client's network updates. So timing and events remain in sync.
	if (Mesh && (GetRemoteRole() == ROLE_AutonomousProxy && GetNetConnection() != nullptr))
	{
		Mesh->bAutonomousTickPose = true;
	}
}
Exemplo n.º 2
0
void AEmitter::PostInitializeComponents()
{
	Super::PostInitializeComponents();

	// Let them die quickly on a dedicated server
	if (IsNetMode(NM_DedicatedServer) && (GetRemoteRole() == ROLE_None || bNetTemporary))
	{
		SetLifeSpan(0.2f);
	}

	// Set Notification Delegate
	if (ParticleSystemComponent)
	{
		ParticleSystemComponent->OnSystemFinished.AddUniqueDynamic(this, &AEmitter::OnParticleSystemFinished);
		bCurrentlyActive = ParticleSystemComponent->bAutoActivate;
	}

	if (ParticleSystemComponent && bPostUpdateTickGroup)
	{
		ParticleSystemComponent->SetTickGroup(TG_PostUpdateWork);
	}
}
Exemplo n.º 3
0
bool AController::IsLocalController() const
{
	const ENetMode NetMode = GetNetMode();

	if (NetMode == NM_Standalone)
	{
		// Not networked.
		return true;
	}
	
	if (NetMode == NM_Client && Role == ROLE_AutonomousProxy)
	{
		// Networked client in control.
		return true;
	}

	if (GetRemoteRole() != ROLE_AutonomousProxy && Role == ROLE_Authority)
	{
		// Local authority in control.
		return true;
	}

	return false;
}