本文整理汇总了C++中UE_LOG函数的典型用法代码示例。如果您正苦于以下问题:C++ UE_LOG函数的具体用法?C++ UE_LOG怎么用?C++ UE_LOG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UE_LOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetOwnerClass
void USimpleConstructionScript::FixupRootNodeParentReferences()
{
// Get the BlueprintGeneratedClass that owns the SCS
UClass* BPGeneratedClass = GetOwnerClass();
if(BPGeneratedClass == NULL)
{
UE_LOG(LogBlueprint, Warning, TEXT("USimpleConstructionScript::FixupRootNodeParentReferences() - owner class is NULL; skipping."));
// cannot do the rest of fixup without a BPGC
return;
}
for (int32 NodeIndex=0; NodeIndex < RootNodes.Num(); ++NodeIndex)
{
// If this root node is parented to a native/inherited component template
USCS_Node* RootNode = RootNodes[NodeIndex];
if(RootNode->ParentComponentOrVariableName != NAME_None)
{
bool bWasFound = false;
// If the node is parented to a native component
if(RootNode->bIsParentComponentNative)
{
// Get the Blueprint class default object
AActor* CDO = Cast<AActor>(BPGeneratedClass->GetDefaultObject(false));
if(CDO != NULL)
{
// Look for the parent component in the CDO's components array
TInlineComponentArray<UActorComponent*> Components;
CDO->GetComponents(Components);
for (auto CompIter = Components.CreateConstIterator(); CompIter && !bWasFound; ++CompIter)
{
UActorComponent* ComponentTemplate = *CompIter;
bWasFound = ComponentTemplate->GetFName() == RootNode->ParentComponentOrVariableName;
}
}
else
{
// SCS and BGClass depends on each other (while their construction).
// Class is not ready, so one have to break the dependency circle.
continue;
}
}
// Otherwise the node is parented to an inherited SCS node from a parent Blueprint
else
{
// Get the Blueprint hierarchy
TArray<const UBlueprintGeneratedClass*> ParentBPClassStack;
const bool bErrorFree = UBlueprintGeneratedClass::GetGeneratedClassesHierarchy(BPGeneratedClass, ParentBPClassStack);
// Find the parent Blueprint in the hierarchy
for(int32 StackIndex = ParentBPClassStack.Num() - 1; StackIndex > 0; --StackIndex)
{
auto ParentClass = ParentBPClassStack[StackIndex];
if( ParentClass != NULL
&& ParentClass->SimpleConstructionScript != NULL
&& ParentClass->GetFName() == RootNode->ParentComponentOwnerClassName)
{
// Attempt to locate a match by searching all the nodes that belong to the parent Blueprint's SCS
TArray<USCS_Node*> ParentNodes = ParentClass->SimpleConstructionScript->GetAllNodes();
for (int32 ParentNodeIndex=0; ParentNodeIndex < ParentNodes.Num() && !bWasFound; ++ParentNodeIndex)
{
USCS_Node* ParentNode = ParentNodes[ParentNodeIndex];
bWasFound = ParentNode != NULL && ParentNode->VariableName == RootNode->ParentComponentOrVariableName;
}
// We found a match; no need to continue searching the hierarchy
break;
}
}
}
// Clear parent info if we couldn't find the parent component instance
if(!bWasFound)
{
UE_LOG(LogBlueprint, Warning, TEXT("USimpleConstructionScript::FixupRootNodeParentReferences() - Couldn't find %s parent component '%s' for '%s' in BlueprintGeneratedClass '%s' (it may have been removed)"), RootNode->bIsParentComponentNative ? TEXT("native") : TEXT("inherited"), *RootNode->ParentComponentOrVariableName.ToString(), *RootNode->GetVariableName().ToString(), *BPGeneratedClass->GetName());
RootNode->bIsParentComponentNative = false;
RootNode->ParentComponentOrVariableName = NAME_None;
RootNode->ParentComponentOwnerClassName = NAME_None;
}
}
}
// call this after we do the above ParentComponentOrVariableName fixup,
// because this operates differently for root nodes that have their
// ParentComponentOrVariableName field cleared
//
// repairs invalid scene hierarchies (like when this Blueprint has been
// reparented and there is no longer an inherited scene root... meaning one
// of the scene component nodes here needs to be promoted)
FixupSceneNodeHierarchy();
}
示例2: UE_LOG
bool UWorld::ComponentOverlapTest(class UPrimitiveComponent* PrimComp, const FVector& Pos, const FRotator& Rot, const struct FComponentQueryParams& Params) const
{
if(GetPhysicsScene() == NULL)
{
return false;
}
if(PrimComp == NULL)
{
UE_LOG(LogCollision, Log, TEXT("ComponentOverlapMulti : No PrimComp"));
return false;
}
// if target is skeletalmeshcomponent and do not support singlebody physics, we don't support this yet
// talk to @JG, SP, LH
if ( !PrimComp->ShouldTrackOverlaps() )
{
UE_LOG(LogCollision, Log, TEXT("ComponentOverlapMulti : (%s) Does not support skeletalmesh with Physics Asset and destructibles."), *PrimComp->GetPathName());
return false;
}
#if WITH_PHYSX
ECollisionChannel TraceChannel = PrimComp->GetCollisionObjectType();
PxRigidActor* PRigidActor = PrimComp->BodyInstance.GetPxRigidActor();
if(PRigidActor == NULL)
{
UE_LOG(LogCollision, Log, TEXT("ComponentOverlapMulti : (%s) No physics data"), *PrimComp->GetPathName());
return false;
}
// calculate the test global pose of the actor
PxTransform PTestGlobalPose = U2PTransform(FTransform(Rot, Pos));
// Get all the shapes from the actor
TArray<PxShape*, TInlineAllocator<8>> PShapes;
PShapes.AddZeroed(PRigidActor->getNbShapes());
int32 NumShapes = PRigidActor->getShapes(PShapes.GetData(), PShapes.Num());
// Iterate over each shape
for(int32 ShapeIdx=0; ShapeIdx<PShapes.Num(); ShapeIdx++)
{
PxShape* PShape = PShapes[ShapeIdx];
check(PShape);
// Calc shape global pose
PxTransform PLocalPose = PShape->getLocalPose();
PxTransform PShapeGlobalPose = PTestGlobalPose.transform(PLocalPose);
GET_GEOMETRY_FROM_SHAPE(PGeom, PShape);
if(PGeom != NULL)
{
if( GeomOverlapTest(this, *PGeom, PShapeGlobalPose, TraceChannel, Params, FCollisionResponseParams(PrimComp->GetCollisionResponseToChannels())))
{
// in this test, it only matters true or false.
// if we found first true, we don't care next test anymore.
return true;
}
}
}
#endif //WITH_PHYSX
return false;
}
示例3: UE_LOG
void ALobbyBeaconState::DumpState() const
{
UE_LOG(LogBeacon, Display, TEXT("Players:"));
Players.DumpState();
}
示例4: CreateOutputArchive
FArchive* CreateOutputArchive()
{
FArchive* OutputFilePtr = nullptr;
if (CommunicationMode == ThroughFile)
{
const double StartTime = FPlatformTime::Seconds();
bool bResult = false;
// It seems XGE does not support deleting files.
// Don't delete the input file if we are running under Incredibuild.
// Instead, we signal completion by creating a zero byte "Success" file after the output file has been fully written.
if (!GShaderCompileUseXGE)
{
do
{
// Remove the input file so that it won't get processed more than once
bResult = IFileManager::Get().Delete(*InputFilePath);
}
while (!bResult && (FPlatformTime::Seconds() - StartTime < 2));
if (!bResult)
{
UE_LOG(LogShaders, Fatal,TEXT("Couldn't delete input file %s, is it readonly?"), *InputFilePath);
}
}
#if PLATFORM_MAC || PLATFORM_LINUX
// To make sure that the process waiting for results won't read unfinished output file,
// we use a temp file name during compilation.
do
{
FGuid Guid;
FPlatformMisc::CreateGuid(Guid);
TempFilePath = WorkingDirectory + Guid.ToString();
} while (IFileManager::Get().FileSize(*TempFilePath) != INDEX_NONE);
// Create the output file.
OutputFilePtr = IFileManager::Get().CreateFileWriter(*TempFilePath,FILEWRITE_EvenIfReadOnly | FILEWRITE_NoFail);
#else
const double StartTime2 = FPlatformTime::Seconds();
do
{
// Create the output file.
OutputFilePtr = IFileManager::Get().CreateFileWriter(*OutputFilePath,FILEWRITE_EvenIfReadOnly);
}
while (!OutputFilePtr && (FPlatformTime::Seconds() - StartTime2 < 2));
if (!OutputFilePtr)
{
UE_LOG(LogShaders, Fatal,TEXT("Couldn't save output file %s"), *OutputFilePath);
}
#endif
}
else
{
#if PLATFORM_SUPPORTS_NAMED_PIPES
check(IsUsingNamedPipes());
// Output Transfer Buffer...
TransferBufferOut.Empty(0);
OutputFilePtr = new FMemoryWriter(TransferBufferOut);
#endif
}
return OutputFilePtr;
}
示例5: FString
bool FLinuxPlatformProcess::ExecProcess( const TCHAR* URL, const TCHAR* Params, int32* OutReturnCode, FString* OutStdOut, FString* OutStdErr )
{
TArray<FString> ArgsArray;
FString(Params).ParseIntoArray(&ArgsArray, TEXT(" "), true);
char *args[ArgsArray.Num()];
for(int i = 0; i < ArgsArray.Num(); i++)
{
args[i] = TCHAR_TO_ANSI(*ArgsArray[i]);
}
pid_t pid;
int status;
int fd_stdout[2], fd_stderr[2];
if (pipe(fd_stdout) == -1)
{
int ErrNo = errno;
UE_LOG(LogHAL, Fatal, TEXT("Creating fd_stdout pipe failed with errno = %d (%s)"), ErrNo,
StringCast< TCHAR >(strerror(ErrNo)).Get());
return false;
}
if (pipe(fd_stderr) == -1)
{
int ErrNo = errno;
UE_LOG(LogHAL, Fatal, TEXT("Creating fd_stderr pipe failed with errno = %d (%s)"), ErrNo,
StringCast< TCHAR >(strerror(ErrNo)).Get());
return false;
}
pid = fork();
if(pid < 0)
{
int ErrNo = errno;
UE_LOG(LogHAL, Fatal, TEXT("fork() failed with errno = %d (%s)"), ErrNo,
StringCast< TCHAR >(strerror(ErrNo)).Get());
return false;
}
if(pid == 0)
{
close(fd_stdout[0]);
close(fd_stderr[0]);
dup2(fd_stdout[1], 1);
dup2(fd_stderr[1], 2);
close(fd_stdout[1]);
close(fd_stderr[1]);
// TODO Not sure if we need to look up URL in PATH
exit(execv(TCHAR_TO_ANSI(URL), args));
}
else
{
// TODO This might deadlock, should use select. Rewrite me. Also doesn't handle all errors correctly.
close(fd_stdout[1]);
close(fd_stderr[1]);
do
{
pid_t wpid = waitpid(pid, &status, 0);
if (wpid == -1)
{
int ErrNo = errno;
UE_LOG(LogHAL, Fatal, TEXT("waitpid() failed with errno = %d (%s)"), ErrNo,
StringCast< TCHAR >(strerror(ErrNo)).Get());
return false;
}
if (WIFEXITED(status))
{
*OutReturnCode = WEXITSTATUS(status);
}
else if (WIFSIGNALED(status))
{
*OutReturnCode = WTERMSIG(status);
}
} while (!WIFEXITED(status) && !WIFSIGNALED(status));
while(1)
{
char buf[100];
int size = read(fd_stdout[0], buf, 100);
if(size)
{
if(OutStdErr)
{
*OutStdErr += FString(buf);
}
}
else
{
break;
}
}
while(1)
{
char buf[100];
int size = read(fd_stderr[0], buf, 100);
if(size)
//.........这里部分代码省略.........
示例6: DECLARE_SCOPE_CYCLE_COUNTER
void UGameEngine::Init(IEngineLoop* InEngineLoop)
{
DECLARE_SCOPE_CYCLE_COUNTER(TEXT("UGameEngine Init"), STAT_GameEngineStartup, STATGROUP_LoadTime);
// Call base.
UEngine::Init(InEngineLoop);
#if USE_NETWORK_PROFILER
FString NetworkProfilerTag;
if( FParse::Value(FCommandLine::Get(), TEXT("NETWORKPROFILER="), NetworkProfilerTag ) )
{
GNetworkProfiler.EnableTracking(true);
}
#endif
// Load and apply user game settings
GetGameUserSettings()->LoadSettings();
GetGameUserSettings()->ApplySettings();
// Creates the initial world context. For GameEngine, this should be the only WorldContext that ever gets created.
FWorldContext &InitialWorldContext = CreateNewWorldContext(EWorldType::Game);
// Initialize the viewport client.
UGameViewportClient* ViewportClient = NULL;
if(GIsClient)
{
ViewportClient = ConstructObject<UGameViewportClient>(GameViewportClientClass,this);
ViewportClient->SetReferenceToWorldContext(InitialWorldContext);
GameViewport = ViewportClient;
InitialWorldContext.GameViewport = ViewportClient;
}
bCheckForMovieCapture = true;
// Attach the viewport client to a new viewport.
if(ViewportClient)
{
// This must be created before any gameplay code adds widgets
bool bWindowAlreadyExists = GameViewportWindow.IsValid();
if (!bWindowAlreadyExists)
{
GameViewportWindow = CreateGameWindow();
}
CreateGameViewport( ViewportClient );
if( !bWindowAlreadyExists )
{
SwitchGameWindowToUseGameViewport();
}
FString Error;
if(!ViewportClient->Init(Error))
{
UE_LOG(LogEngine, Fatal,TEXT("%s"),*Error);
}
}
// Create default URL.
// @note: if we change how we determine the valid start up map update LaunchEngineLoop's GetStartupMap()
FURL DefaultURL;
DefaultURL.LoadURLConfig( TEXT("DefaultPlayer"), GGameIni );
// Enter initial world.
EBrowseReturnVal::Type BrowseRet = EBrowseReturnVal::Failure;
FString Error;
TCHAR Parm[4096]=TEXT("");
const TCHAR* Tmp = FCommandLine::Get();
#if UE_BUILD_SHIPPING
// In shipping don't allow an override
Tmp = TEXT("");
#endif // UE_BUILD_SHIPPING
const UGameMapsSettings* GameMapsSettings = GetDefault<UGameMapsSettings>();
const FString& DefaultMap = GameMapsSettings->GetGameDefaultMap();
if (!FParse::Token(Tmp, Parm, ARRAY_COUNT(Parm), 0) || Parm[0] == '-')
{
FCString::Strcpy(Parm, *(DefaultMap + GameMapsSettings->LocalMapOptions));
}
FURL URL( &DefaultURL, Parm, TRAVEL_Partial );
if( URL.Valid )
{
BrowseRet = Browse(InitialWorldContext, URL, Error );
}
// If waiting for a network connection, go into the starting level.
if (BrowseRet != EBrowseReturnVal::Success && FCString::Stricmp(Parm, *DefaultMap) != 0)
{
const FText Message = FText::Format( NSLOCTEXT("Engine", "MapNotFound", "The map specified on the commandline '{0}' could not be found. Would you like to load the default map instead?"), FText::FromString( URL.Map ) );
// the map specified on the command-line couldn't be loaded. ask the user if we should load the default map instead
if ( FCString::Stricmp(*URL.Map, *DefaultMap) != 0 &&
FMessageDialog::Open( EAppMsgType::OkCancel, Message ) != EAppReturnType::Ok)
{
// user canceled (maybe a typo while attempting to run a commandlet)
FPlatformMisc::RequestExit( false );
return;
}
else
{
//.........这里部分代码省略.........
示例7: RunCommand
bool FPerforceConnection::GetWorkspaceList(const FPerforceConnectionInfo& InConnectionInfo, FOnIsCancelled InOnIsCanceled, TArray<FString>& OutWorkspaceList, TArray<FText>& OutErrorMessages)
{
if(bEstablishedConnection)
{
TArray<FString> Params;
bool bAllowWildHosts = !GIsBuildMachine;
Params.Add(TEXT("-u"));
Params.Add(InConnectionInfo.UserName);
FP4RecordSet Records;
bool bConnectionDropped = false;
bool bCommandOK = RunCommand(TEXT("clients"), Params, Records, OutErrorMessages, InOnIsCanceled, bConnectionDropped);
if (bCommandOK)
{
FString ApplicationPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*FPaths::GameDir()).ToLower();
FString LocalHostName = InConnectionInfo.HostOverride;
if(LocalHostName.Len() == 0)
{
// No host override, check environment variable
TCHAR P4HostEnv[256];
FPlatformMisc::GetEnvironmentVariable(TEXT("P4HOST"), P4HostEnv, ARRAY_COUNT(P4HostEnv));
LocalHostName = P4HostEnv;
}
if (LocalHostName.Len() == 0)
{
// no host name, use local machine name
LocalHostName = FString(FPlatformProcess::ComputerName()).ToLower();
}
else
{
LocalHostName = LocalHostName.ToLower();
}
for (int32 Index = 0; Index < Records.Num(); ++Index)
{
const FP4Record& ClientRecord = Records[Index];
FString ClientName = ClientRecord("client");
FString HostName = ClientRecord("Host");
FString ClientRootPath = ClientRecord("Root").ToLower();
//this clientspec has to be meant for this machine ( "" hostnames mean any host can use ths clientspec in p4 land)
bool bHostNameMatches = (LocalHostName == HostName.ToLower());
bool bHostNameWild = (HostName.Len() == 0);
if( bHostNameMatches || (bHostNameWild && bAllowWildHosts) )
{
// A workspace root could be "null" which allows the user to map depot locations to different drives.
// Allow these workspaces since we already allow workspaces mapped to drive letters.
const bool bIsNullClientRootPath = (ClientRootPath == TEXT("null"));
//make sure all slashes point the same way
ClientRootPath = ClientRootPath.Replace(TEXT("\\"), TEXT("/"));
ApplicationPath = ApplicationPath.Replace(TEXT("\\"), TEXT("/"));
if (!ClientRootPath.EndsWith(TEXT("/")))
{
ClientRootPath += TEXT("/");
}
// Only allow paths that are ACTUALLY legit for this application
if (bIsNullClientRootPath || ApplicationPath.Contains(ClientRootPath) )
{
OutWorkspaceList.Add(ClientName);
}
else
{
UE_LOG(LogSourceControl, Error, TEXT(" %s client specs rejected due to root directory mismatch (%s)"), *ClientName, *ClientRootPath);
}
//Other useful fields: Description, Owner, Host
}
else
{
UE_LOG(LogSourceControl, Error, TEXT(" %s client specs rejected due to host name mismatch (%s)"), *ClientName, *HostName);
}
}
}
return bCommandOK;
}
return false;
}
示例8: UTF8String
bool FPerforceConnection::RunCommand(const FString& InCommand, const TArray<FString>& InParameters, FP4RecordSet& OutRecordSet, TArray<FText>& OutErrorMessage, FOnIsCancelled InIsCancelled, bool& OutConnectionDropped, const bool bInStandardDebugOutput, const bool bInAllowRetry)
{
#if USE_P4_API
if (!bEstablishedConnection)
{
return false;
}
FString FullCommand = InCommand;
// Prepare arguments
int32 ArgC = InParameters.Num();
UTF8CHAR** ArgV = new UTF8CHAR*[ArgC];
for (int32 Index = 0; Index < ArgC; Index++)
{
if(bIsUnicode)
{
FTCHARToUTF8 UTF8String(*InParameters[Index]);
ArgV[Index] = new UTF8CHAR[UTF8String.Length() + 1];
FMemory::Memcpy(ArgV[Index], UTF8String.Get(), UTF8String.Length() + 1);
}
else
{
ArgV[Index] = new UTF8CHAR[InParameters[Index].Len() + 1];
FMemory::Memcpy(ArgV[Index], TCHAR_TO_ANSI(*InParameters[Index]), InParameters[Index].Len() + 1);
}
if (bInStandardDebugOutput)
{
FullCommand += TEXT(" ");
FullCommand += InParameters[Index];
}
}
if (bInStandardDebugOutput)
{
UE_LOG( LogSourceControl, Log, TEXT("Attempting 'p4 %s'"), *FullCommand );
}
double SCCStartTime = FPlatformTime::Seconds();
P4Client.SetArgv(ArgC, (char**)ArgV);
FP4KeepAlive KeepAlive(InIsCancelled);
P4Client.SetBreak(&KeepAlive);
OutRecordSet.Reset();
FP4ClientUser User(OutRecordSet, bIsUnicode, OutErrorMessage);
P4Client.Run(FROM_TCHAR(*InCommand, bIsUnicode), &User);
if ( P4Client.Dropped() )
{
OutConnectionDropped = true;
}
P4Client.SetBreak(NULL);
// Free arguments
for (int32 Index = 0; Index < ArgC; Index++)
{
delete [] ArgV[Index];
}
delete [] ArgV;
if (bInStandardDebugOutput)
{
UE_LOG( LogSourceControl, VeryVerbose, TEXT("P4 execution time: %0.4f seconds. Command: %s"), FPlatformTime::Seconds() - SCCStartTime, *FullCommand );
}
#endif
return OutRecordSet.Num() > 0;
}
示例9: UE_LOG
void AOnlineBeaconHost::NotifyControlMessage(UNetConnection* Connection, uint8 MessageType, class FInBunch& Bunch)
{
if(NetDriver->ServerConnection == nullptr)
{
bool bCloseConnection = false;
// We are the server.
#if !(UE_BUILD_SHIPPING && WITH_EDITOR)
UE_LOG(LogBeacon, Verbose, TEXT("%s[%s] Host received: %s"), *GetName(), Connection ? *Connection->GetName() : TEXT("Invalid"), FNetControlMessageInfo::GetName(MessageType));
#endif
switch (MessageType)
{
case NMT_Hello:
{
UE_LOG(LogBeacon, Log, TEXT("Beacon Hello"));
uint8 IsLittleEndian;
uint32 RemoteNetworkVersion = 0;
uint32 LocalNetworkVersion = FNetworkVersion::GetLocalNetworkVersion();
FNetControlMessage<NMT_Hello>::Receive(Bunch, IsLittleEndian, RemoteNetworkVersion);
if (!FNetworkVersion::IsNetworkCompatible(LocalNetworkVersion, RemoteNetworkVersion))
{
UE_LOG(LogBeacon, Log, TEXT("Client not network compatible %s"), *Connection->GetName());
FNetControlMessage<NMT_Upgrade>::Send(Connection, LocalNetworkVersion);
bCloseConnection = true;
}
else
{
Connection->Challenge = FString::Printf(TEXT("%08X"), FPlatformTime::Cycles());
FNetControlMessage<NMT_BeaconWelcome>::Send(Connection);
Connection->FlushNet();
}
break;
}
case NMT_Netspeed:
{
int32 Rate;
FNetControlMessage<NMT_Netspeed>::Receive(Bunch, Rate);
Connection->CurrentNetSpeed = FMath::Clamp(Rate, 1800, NetDriver->MaxClientRate);
UE_LOG(LogBeacon, Log, TEXT("Client netspeed is %i"), Connection->CurrentNetSpeed);
break;
}
case NMT_BeaconJoin:
{
FString ErrorMsg;
FString BeaconType;
FUniqueNetIdRepl UniqueId;
FNetControlMessage<NMT_BeaconJoin>::Receive(Bunch, BeaconType, UniqueId);
UE_LOG(LogBeacon, Log, TEXT("Beacon Join %s %s"), *BeaconType, *UniqueId.ToDebugString());
if (Connection->ClientWorldPackageName == NAME_None)
{
AOnlineBeaconClient* ClientActor = GetClientActor(Connection);
if (ClientActor == nullptr)
{
UWorld* World = GetWorld();
Connection->ClientWorldPackageName = World->GetOutermost()->GetFName();
AOnlineBeaconClient* NewClientActor = nullptr;
FOnBeaconSpawned* OnBeaconSpawnedDelegate = OnBeaconSpawnedMapping.Find(BeaconType);
if (OnBeaconSpawnedDelegate && OnBeaconSpawnedDelegate->IsBound())
{
NewClientActor = OnBeaconSpawnedDelegate->Execute(Connection);
}
if (NewClientActor && BeaconType == NewClientActor->GetBeaconType())
{
NewClientActor->SetConnectionState(EBeaconConnectionState::Pending);
FNetworkGUID NetGUID = Connection->Driver->GuidCache->AssignNewNetGUID_Server(NewClientActor);
NewClientActor->SetNetConnection(Connection);
Connection->PlayerId = UniqueId;
Connection->OwningActor = NewClientActor;
NewClientActor->Role = ROLE_Authority;
NewClientActor->SetReplicates(false);
check(NetDriverName == NetDriver->NetDriverName);
NewClientActor->SetNetDriverName(NetDriverName);
ClientActors.Add(NewClientActor);
FNetControlMessage<NMT_BeaconAssignGUID>::Send(Connection, NetGUID);
}
else
{
ErrorMsg = NSLOCTEXT("NetworkErrors", "BeaconSpawnFailureError", "Join failure, Couldn't spawn beacon.").ToString();
}
}
else
{
ErrorMsg = NSLOCTEXT("NetworkErrors", "BeaconSpawnExistingActorError", "Join failure, existing beacon actor.").ToString();
}
}
else
{
ErrorMsg = NSLOCTEXT("NetworkErrors", "BeaconSpawnClientWorldPackageNameError", "Join failure, existing ClientWorldPackageName.").ToString();
}
if (!ErrorMsg.IsEmpty())
{
UE_LOG(LogBeacon, Log, TEXT("%s: %s"), *Connection->GetName(), *ErrorMsg);
//.........这里部分代码省略.........
示例10: UE_LOG
void ATankPlayerController::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("PlayerController BeginPlay()"));
}
示例11: UE_LOG
UMyCharDataComp::~UMyCharDataComp()
{
UE_LOG(CompLogger, Warning, TEXT("--- UMyCharDataComp::~UMyCharDataComp"));
}
示例12: UE_LOG
void FConsoleEventLogger::Log( EEventLog::Type Event, const FString& AdditionalContent, TSharedPtr<SWidget> Widget )
{
UE_LOG(LogSlate, Log, TEXT("%s"), *PrettyPrint(Event, AdditionalContent, Widget));
}
示例13: UE_LOG
void AOnlineBeaconClient::OnFailure()
{
UE_LOG(LogBeacon, Verbose, TEXT("Client beacon (%s) connection failure, handling connection timeout."), *GetName());
HostConnectionFailure.ExecuteIfBound();
Super::OnFailure();
}
示例14: UE_LOG
void FPerforceConnection::EstablishConnection(const FPerforceConnectionInfo& InConnectionInfo)
{
#if USE_P4_API
// Verify Input. ServerName and UserName are required
if ( InConnectionInfo.Port.IsEmpty() || InConnectionInfo.UserName.IsEmpty() )
{
return;
}
//Connection assumed successful
bEstablishedConnection = true;
UE_LOG(LogSourceControl, Verbose, TEXT("Attempting P4 connection: %s/%s"), *InConnectionInfo.Port, *InConnectionInfo.UserName);
P4Client.SetProtocol("tag", "");
P4Client.SetProtocol("enableStreams", "");
//Set configuration based params
P4Client.SetPort(TCHAR_TO_ANSI(*InConnectionInfo.Port));
Error P4Error;
if(InConnectionInfo.Password.Len() > 0)
{
UE_LOG(LogSourceControl, Verbose, TEXT(" ... applying password" ));
P4Client.DefinePassword(TCHAR_TO_ANSI(*InConnectionInfo.Password), &P4Error);
if(P4Error.Test())
{
StrBuf ErrorMessage;
P4Error.Fmt(&ErrorMessage);
UE_LOG(LogSourceControl, Error, TEXT("P4ERROR: Could not set password."));
UE_LOG(LogSourceControl, Error, TEXT("%s"), ANSI_TO_TCHAR(ErrorMessage.Text()));
}
}
if(InConnectionInfo.HostOverride.Len() > 0)
{
UE_LOG(LogSourceControl, Verbose, TEXT(" ... overriding host" ));
P4Client.SetHost(TCHAR_TO_ANSI(*InConnectionInfo.HostOverride));
}
UE_LOG(LogSourceControl, Verbose, TEXT(" ... connecting" ));
//execute the connection to perforce using the above settings
P4Client.Init(&P4Error);
//ensure the connection is valid
UE_LOG(LogSourceControl, Verbose, TEXT(" ... validating connection" ));
if (P4Error.Test())
{
bEstablishedConnection = false;
StrBuf ErrorMessage;
P4Error.Fmt(&ErrorMessage);
UE_LOG(LogSourceControl, Error, TEXT("P4ERROR: Invalid connection to server."));
UE_LOG(LogSourceControl, Error, TEXT("%s"), ANSI_TO_TCHAR(ErrorMessage.Text()));
}
else
{
TArray<FString> Params;
TArray<FText> ErrorMessages;
FP4RecordSet Records;
bool bConnectionDropped = false;
const bool bStandardDebugOutput = false;
const bool bAllowRetry = true;
UE_LOG(LogSourceControl, Verbose, TEXT(" ... checking unicode status" ));
if (RunCommand(TEXT("info"), Params, Records, ErrorMessages, FOnIsCancelled(), bConnectionDropped, bStandardDebugOutput, bAllowRetry))
{
// Get character encoding
bIsUnicode = Records[0].Find(TEXT("unicode")) != NULL;
if(bIsUnicode)
{
P4Client.SetTrans(CharSetApi::UTF_8);
UE_LOG(LogSourceControl, Verbose, TEXT(" server is unicode" ));
}
// Now we know our unicode status we can gather the client root
P4Client.SetUser(FROM_TCHAR(*InConnectionInfo.UserName, bIsUnicode));
if(InConnectionInfo.Password.Len() > 0)
{
Login(InConnectionInfo);
}
if (InConnectionInfo.Ticket.Len())
{
P4Client.SetPassword(FROM_TCHAR(*InConnectionInfo.Ticket, bIsUnicode));
}
if (InConnectionInfo.Workspace.Len())
{
P4Client.SetClient(FROM_TCHAR(*InConnectionInfo.Workspace, bIsUnicode));
}
P4Client.SetCwd(FROM_TCHAR(*FPaths::RootDir(), bIsUnicode));
// Gather the client root
UE_LOG(LogSourceControl, Verbose, TEXT(" ... getting info" ));
bConnectionDropped = false;
if (RunCommand(TEXT("info"), Params, Records, ErrorMessages, FOnIsCancelled(), bConnectionDropped, bStandardDebugOutput, bAllowRetry))
//.........这里部分代码省略.........
示例15: FProcHandle
FProcHandle FLinuxPlatformProcess::CreateProc(const TCHAR* URL, const TCHAR* Parms, bool bLaunchDetached, bool bLaunchHidden, bool bLaunchReallyHidden, uint32* OutProcessID, int32 PriorityModifier, const TCHAR* OptionalWorkingDirectory, void* PipeWrite)
{
// @TODO bLaunchHidden bLaunchReallyHidden are not handled
// We need an absolute path to executable
FString ProcessPath = URL;
if (*URL != '/')
{
ProcessPath = FPaths::ConvertRelativePathToFull(ProcessPath);
}
if (!FPaths::FileExists(ProcessPath))
{
return FProcHandle();
}
FString Commandline = ProcessPath;
Commandline += TEXT(" ");
Commandline += Parms;
UE_LOG(LogHAL, Verbose, TEXT("FLinuxPlatformProcess::CreateProc: '%s'"), *Commandline);
TArray<FString> ArgvArray;
int Argc = Commandline.ParseIntoArray(&ArgvArray, TEXT(" "), true);
char* Argv[PlatformProcessLimits::MaxArgvParameters + 1] = { NULL }; // last argument is NULL, hence +1
struct CleanupArgvOnExit
{
int Argc;
char** Argv; // relying on it being long enough to hold Argc elements
CleanupArgvOnExit( int InArgc, char *InArgv[] )
: Argc(InArgc)
, Argv(InArgv)
{}
~CleanupArgvOnExit()
{
for (int Idx = 0; Idx < Argc; ++Idx)
{
FMemory::Free(Argv[Idx]);
}
}
} CleanupGuard(Argc, Argv);
// make sure we do not lose arguments with spaces in them due to Commandline.ParseIntoArray breaking them apart above
// @todo this code might need to be optimized somehow and integrated with main argument parser below it
TArray<FString> NewArgvArray;
if (Argc > 0)
{
if (Argc > PlatformProcessLimits::MaxArgvParameters)
{
UE_LOG(LogHAL, Warning, TEXT("FLinuxPlatformProcess::CreateProc: too many (%d) commandline arguments passed, will only pass %d"),
Argc, PlatformProcessLimits::MaxArgvParameters);
Argc = PlatformProcessLimits::MaxArgvParameters;
}
FString MultiPartArg;
for (int32 Index = 0; Index < Argc; Index++)
{
if (MultiPartArg.IsEmpty())
{
if ((ArgvArray[Index].StartsWith(TEXT("\"")) && !ArgvArray[Index].EndsWith(TEXT("\""))) // check for a starting quote but no ending quote, excludes quoted single arguments
|| (ArgvArray[Index].Contains(TEXT("=\"")) && !ArgvArray[Index].EndsWith(TEXT("\""))) // check for quote after =, but no ending quote, this gets arguments of the type -blah="string string string"
|| ArgvArray[Index].EndsWith(TEXT("=\""))) // check for ending quote after =, this gets arguments of the type -blah=" string string string "
{
MultiPartArg = ArgvArray[Index];
}
else
{
if (ArgvArray[Index].Contains(TEXT("=\"")))
{
FString SingleArg = ArgvArray[Index];
SingleArg = SingleArg.Replace(TEXT("=\""), TEXT("="));
NewArgvArray.Add(SingleArg.TrimQuotes(NULL));
}
else
{
NewArgvArray.Add(ArgvArray[Index].TrimQuotes(NULL));
}
}
}
else
{
MultiPartArg += TEXT(" ");
MultiPartArg += ArgvArray[Index];
if (ArgvArray[Index].EndsWith(TEXT("\"")))
{
if (MultiPartArg.StartsWith(TEXT("\"")))
{
NewArgvArray.Add(MultiPartArg.TrimQuotes(NULL));
}
else
{
NewArgvArray.Add(MultiPartArg);
}
MultiPartArg.Empty();
}
}
}
}
// update Argc with the new argument count
//.........这里部分代码省略.........