So basicly I have a function that sends all clients and the server an block update and or creation:
In the .H:
UFUNCTION(Reliable, NetMulticast) // Sends block update to clients
void UpdateBlockToClients(const FString& Position, int32 ID);
void UpdateBlockToClients_Implementation(const FString& Position, int32 ID);
In the CPP:
void APlayerCharacter::UpdateBlockToClients_Implementation(const FString& Position, int32 ID)
{
if (PP_BlockID.Contains(Position))
{
PP_BlockID[Position] = ID;
}
else
{
PP_BlockID.Add(Position, ID);
}
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Position: %s, ID: %d"), *Position, ID));
}
Howerer when an block update is sent the debug message in the last line is only visible twice (including server) REGARDLESS of the actual amount of clients.
For example with 2 Clients and a dedicated server the funcion is called only on the dedicated server and 1 client.
Thanks in advance!