// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action. #include "OLSLog.h" FString GetClientServerContextString(UObject* contextObject) { ENetRole role = ROLE_None; if (AActor* actor = Cast(contextObject)) { role = actor->GetLocalRole(); } else if (UActorComponent* component = Cast(contextObject)) { role = component->GetOwnerRole(); } if (role != ROLE_None) { return (role == ROLE_Authority) ? TEXT("Server") : TEXT("Client"); } else { #if WITH_EDITOR if (GIsEditor) { extern ENGINE_API FString GPlayInEditorContextString; return GPlayInEditorContextString; } #endif } return TEXT("[]"); }