Files
UnrealEngineUWP/Engine/Source/Developer/PakFileUtilities/Private/KeyGenerator.cpp

533 lines
14 KiB
C++
Raw Normal View History

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "KeyGenerator.h"
#include "IPlatformFilePak.h"
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 3847469) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3805828 by Gil.Gribb UE4 - Fixed a bug in the lock free stalling task queue and adjusted a comment. The code is not current used, so this is not actually change the way the code works. Change 3806784 by Ben.Marsh UAT: Remove code to compile UBT when using UE4Build. It should already be compiled as a dependency of UAT. Change 3807549 by Graeme.Thornton Add a cook timer around VerifyCanCookPackage. A licensee reports this taking a lot of time so it'll be good to account for it. Change 3807727 by Graeme.Thornton Unhide the text asset format experimental editor option Change 3807746 by Josh.Engebretson Remove WER from iOS platform Change 3807928 by Robert.Manuszewski When async loading, GC Clusters will be created after packages have been processed to avoid situations where some of the objects that are being added to a cluster haven't been fully loaded yet Change 3808221 by Steve.Robb GitHub #4307 - Made GetModulePtr() thread safe by not using GetModule() ^ I'm not convinced by how much thread-safer this is really, but it's tidier anyway. Change 3809233 by Graeme.Thornton TBA: Misc changes to text asset commandlet - Rename mode to "loadsave" - Add -outputFormat option which can be assigned "text" or "binary" - When saving binary, use a differentiated filename so that source assets aren't overwritten Change 3809518 by Ben.Marsh Remove the outdated UnrealSync automation script. Change 3809643 by Steve.Robb GitHub #4277 : fix bug; FMath::FormatIntToHumanReadable 3rd comma and negative value #jira UE-53037 Change 3809862 by Steve.Robb GitHub #3342 : [FRotator.h] Fix to DecompressAxisFromByte to be more efficient and reflect its intent accurately #jira UE-42593 Change 3811190 by Graeme.Thornton Add support for writing specific log channels to their own files Change 3811197 by Graeme.Thornton Minor updates to output formatting and timing for the text asset commandlet Change 3811257 by Robert.Manuszewski Cluster creation will now be time-sliced Change 3811565 by Steve.Robb Define out non-monolithic module functions. Change 3812561 by Steve.Robb GitHub #3886 : Enable Brace-Initialization for Declaring Variables Incorrect semi-colon search removed after discussion with author. Test added. #jira UE-48242 Change 3812864 by Steve.Robb Removal of some unproven code which was supposed to fix hot reloading BP class functions in plugins. See: https://udn.unrealengine.com/questions/376978/aitask-blueprint-nodes-disappear-when-their-module.html #jira UE-53089 Change 3820358 by Ben.Marsh PR #4358: Incredibuild use ShowAgent by default (Contributed by projectgheist) Change 3822594 by Ben.Marsh UAT: Improvements to log file handling. - Always create log files in the final location, rather than writing to a temp directory and copying in later. - Now supports -Verbose and -VeryVerbose for increasing log verbosity, rather than -Verbose=XXX. - Keep a backlog of log output before the log system is initialized, and flush it to the log file once it is. - Allow buildmachines to specify the uebp_FinalLogFolder environment variable, which is used to form paths for display. When build machines copy log files elsewhere after UAT finishes (eg. a network share), this allows error messages to display the right location. Change 3823695 by Ben.Marsh UGS: Fix issue where precompiled binaries would not be shown as available for a change until scrolling the last submitted code change into the buffer (other symptoms, like de-focussing the main window would cause it to go back to an unavailable state, since the changes buffer was shrunk). Now always queries changes up to the last change for which zipped binaries are available. Change 3823845 by Ben.Marsh UBT: Exclude C# projects for unsupported platforms when generating project files. Change 3824180 by Ben.Marsh UGS: Add an option to show changes by build machines, and move the "only show reviewed" option in there too (Options > Show Changes). #jira Change 3825777 by Steve.Robb Fix to return value of StringToBytes. Change 3825810 by Ben.Marsh UBT: Reduce length of include paths for MSVC toolchain. Change 3825822 by Robert.Manuszewski Optimized PIE lazy pointer fixup. Should be up to 8x faster now. Change 3826734 by Ben.Marsh Remove code to disable TextureFormatAndroid on Linux. It seems to be an editor dependency. Change 3827730 by Steve.Robb Try to avoid decltype(auto) if it's not supported. See: https://udn.unrealengine.com/questions/395644/build-417-with-c11-on-linux-ttuple-errors.html Change 3827745 by Steve.Robb Initializer list support for TMap. Change 3827770 by Steve.Robb GitHub #4399 : Added a CONSTEXPR qualifiers to FVariant::GetType() #jira UE-53813 Change 3829189 by Ben.Marsh UBT: Now always writes a minimal log file. By default, just contains the regular console output and any reasons why actions are outdated and needed to be executed. UAT directs child UBT instances to output logs into its own log folder, so that build machines can save them off. Change 3830444 by Steve.Robb BuildVersion and ModuleManifest moved to Core, and parsing of these files reimplemented to avoid a JSON library. This should be revisited when Core has its own JSON library. Change 3830718 by Ben.Marsh Fix incorrect group name being returned by FStatNameAndInfo::GetGroupName() for stat groups. The editor populates the viewport stats list by calling this for every registered stat and stat group (via FLevelViewportCommands::HandleNewStatGroup). The menu entry attempts to show the stat name with STAT_XXX stripped from the start as the menu item label, with the free-form text description as a tooltip. For stat groups, the it would previously just return the stat group name as "Groups" (due to the raw naming convention of "//Groups//STATGROUP_Foo//..."). Since this didn't match the expected naming convention in FLevelViewportCommands::HandleNewStat (ie. STAT_XXX or STATGROUP_XXX), it would fail to add it. When the first actual stat belonging to that group is added, it would add a menu entry for the group based on that, but the stat description no longer makes sense as a tooltip for the group. As a result, all the editor tooltips were junk. #jira UE-53845 Change 3831064 by Ben.Marsh Fix log file contention when spawning UBT recursively. Change 3832654 by Ben.Marsh UGS: Fix error panel not being selected when opened, and weird alignment/color issues on it. Change 3832680 by Ben.Marsh UGS: Fix failing to detect workspace if synced to a different stream. Seems to be a regression caused by recent P4D upgrade. Change 3832695 by Ben.Marsh UGS: Invert the options in the 'Show Changes' submenu for simplicity. Change 3833528 by Ben.Marsh UAT: Script to rewrite source files with public include paths relative to the 'Public' folder. Usage is: RebasePublicIncludePaths -UpdateDir=<Dir> [-Project=<Dir>] [-Write]. Change 3833543 by Ben.Marsh UBT: Allow targets to opt-out of having public include paths added for every dependent module. This reduces the command line length when building a target, which has recently become a problem with larger games (due to Microsoft's compiler embedding the command line into each object file, with a maximum length of 64kb). All engine modules are compiled with this enabled; games may opt into it by setting bLegacyPublicIncludePaths = false; from their .target.cs, as may individual modules. Change 3834354 by Robert.Manuszewski Archetype pointer will now be cached to avoid locking the object tables when acquiring its info. It should also be faster this way regardless of any locks. #jira UE-52035 Change 3834400 by Robert.Manuszewski Fixing crash on exit caused by cached archetypes not being cleaned up before static exit cleanup. #jira UE-52035 Change 3834947 by Steve.Robb USE_FORMAT_STRING_TYPE_CHECKING removed from FMsg::Logf and FMsg::Logf_Internal. Change 3835004 by Ben.Marsh Fix code that relies on dubious behavior of requiring referenced "include path only" modules having their _API macros set to be empty, even if the module is actually implemented in a separate DLL. Change 3835340 by Ben.Marsh Fix errors making installed build from directories with spaces in the name. Change 3835972 by Ben.Marsh UBT: Improved diagnostic message for targets which don't need a version file. Change 3836019 by Ben.Marsh UBT: Fix warnings caused by defining linkage macros for third party libraries. Change 3836269 by Ben.Marsh Fix message box larger than the screen height being created when a large number of modules are incompatible on startup. Change 3836543 by Ben.Marsh Enable SoundMod plugin on Linux, since it's already supported through the editor. Change 3836546 by Ben.Marsh PR #4412: fix type mismatch (Contributed by nakapon) Change 3836805 by Ben.Marsh Fix commandlet to compile marketplace plugins. Change 3836829 by Ben.Marsh UBT: Fix ability to precompile plugins from installed engine builds. Change 3837036 by Ben.Marsh UBT: Write the previous and new contents of intermediate files to the log if they change. Makes it easier to debug unexpected rebuilds. Change 3837037 by Ben.Marsh UBT: Fix engine modules having inconsistent definitions depending on whether modules are only referenced for their include paths vs being linked into a binary (due to different _API macro). Change 3837040 by Ben.Marsh UBT: Remove code that initializes members in ModuleRules and TargetRules objects before the constructor is run. This is no longer necessary, now that the backwards-compatible default constructors have been removed. Change 3837247 by Ben.Marsh UBT: Remove UELinkerFixups module, now that plugins and precompiled modules do not require hacks to force initialization (since they're linked in as object files). Encryption and signing keys are now set via macros expanded from the IMPLEMENT_PRIMARY_GAME_MODULE macro, via project-specific macros added in the TargetRules constructor. Change 3837262 by Ben.Marsh UBT: Set whether a module is an engine module or not via a default value for the rules assembly. All non-program engine and enterprise modules are created with this flag set to true; program targets and modules are now created from a different assembly that sets it to false. This removes hacks from UEBuildModule needed to adjust behavior for different module types based on the directory containing the module. Also add a bUseBackwardsCompatibleDefaults flag to the TargetRules class, also initialized to a default value from a setting passed to the RulesAssembly constructor. This controls whether modules created for the target should be configured to allow breaking changes to default settings, and is set to false for all engine targets, and true for all project targets. Change 3837343 by Ben.Marsh UBT: Remove the OverrideExecutableFileExtension target property. Change the only current use for this (the MayaLiveLinkPlugin target) to use a post build step to copy the file instead. Change 3837356 by Ben.Marsh Fix invalid character encodings. Change 3837727 by Graeme.Thornton UnrealPak: KeyGenerator: Only generate prime table when required, not all the time Change 3837823 by Ben.Marsh UBT: Output warnings and errors when compiling module rules assembly in a way that allows them to be double-clicked in the Visual Studio output window. Change 3837831 by Graeme.Thornton UBT: When parsing crypto settings, always load legacy data first, then allow the new system to override it. Provides the same key backwards compatibility that the editor settings class gives Change 3837857 by Robert.Manuszewski PR #4404: Make FGCArrayPool singleton global instead of per-CU (Contributed by mhutch) Change 3837943 by Robert.Manuszewski PR #4405: Fix FGarbageCollectionTracer (Contributed by mhutch) Change 3838451 by Ben.Marsh UBT: Fix exceptions thrown on a background thread while caching C++ includes not being caught and logged correctly. Now captures exceptions and re-throws on the main thread. #jira UE-53996 Change 3839519 by Ben.Marsh UBT: Simplify configuring bPrecompile and bUsePrecompile settings for modules. Each rules assembly can now be configured as installed, which defaults the module rules it creates to use precompiled data. Change 3843790 by Graeme.Thornton UnrealPak: Log the size of all encrypted data Change 3844258 by Ben.Marsh Fix plugin compile failure when created via new plugin wizard. Passing -plugin on the command line is unnecessary, and is now reserved for packaging external plugins for the marketplace. Also extend the length of time that the error toast stays visible, and don't delete the plugin on failure. #jira UE-54157 Change 3845796 by Ben.Marsh Workaround for slow performance of String.EndsWith() on Mono. Change 3845823 by Ben.Marsh Fix case sensitive matching of platform names in -TargetPlatform=X argument to BuildCookRun. #jira UE-54123 Change 3845901 by Arciel.Rekman Linux: fix crash due to lambda lifetime issues (UE-54040). - The lambda goes out of scope in FBufferVisualizationMenuCommands::CreateVisualizationCommands, crashing the editor if compiled with a recent clang (5.0+). (Edigrating 3819174 to Dev-Core) Change 3846439 by Ben.Marsh Revert CL 3822742 to always call Process.WaitForExit(). The Android target platform module in the editor spawns ADB.EXE, which inherits the editor's stdout/stderr handles and forks itself. Process.WaitForExit() waits for EOF on those pipes, which never occurs because the forked process never terminates. Proper fix is probably to have the engine explicitly duplicate stdout/stderr handles for new pipes to output process, but too risky before copying up to Main. Change 3816608 by Ben.Marsh UBT: Use DirectoryReference objects for all include paths. Change 3816954 by Ben.Marsh UBT: Remove bIncludeDependentLibrariesInLibrary option. This is not widely supported by platform toolchains, and is not used anywhere. Change 3816986 by Ben.Marsh UBT: Remove UEBuildBinaryConfig; UEBuildBinary objects are now just created directly. Change 3816991 by Ben.Marsh UBT: Deprecate PlatformSpecificDynamicallyLoadedModules. We no longer have any special behavior for these modules. Change 3823090 by Ben.Marsh UAT: Improve logging for child UAT instances. - Calling RunUAT now requires an identifier for prefixing into the parent log, which is also used to determine the name of the log folder. - Stdout is no longer written to its own output file, since it's written to the parent stdout, the parent log file, and the child log file anyway. - Log folders for child UAT instances are left intact, rather than being copied to the parent folder. The derived names for the copied names were confusing and hard to read. - Output from UAT is no longer returned as a string. It should not be parsed anyway (but may be huge!). ProcessResult now supports running without capturing output. Change 3826082 by Ben.Marsh UBT: Add a check to make sure that all modules that are precompiled are correctly marked to enable it, even if they are part of the build target. Change 3827025 by Ben.Marsh UBT: Move the compile output directory into a property on the module, and explicitly pass it to the toolchain when compiling. Change 3829927 by James.Hopkin Made HTTP interface const correct Change 3833533 by Ben.Marsh Rewrite engine source files to base include paths relative to the "Public" directory. This allows reducing the number of public include paths that have to be added for engine modules. Change 3835826 by Ben.Marsh UBT: Precompiled targets now generate a separate manifest for each precompiled module, rather than adding object files to a library. This fixes issues where object files from static libraries would not be linked into a target if a symbol in them was not referenced. Change 3835969 by Ben.Marsh UBT: Fix cases where text is being written directly to the console rather than via logging functions. Change 3837777 by Steve.Robb Format string type checking added to FOutputDevice::Logf. Fixes for those. Change 3838569 by Steve.Robb Algo moved up a folder. [CL 3847482 by Ben Marsh in Main branch]
2018-01-20 11:19:29 -05:00
#include "Misc/SecureHash.h"
#include "Math/BigInt.h"
#include "Async/TaskGraphInterfaces.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "HAL/Runnable.h"
#include "HAL/RunnableThread.h"
#include "Math/RandomStream.h"
#include "Misc/FileHelper.h"
#include "Misc/CommandLine.h"
#include "Primes.inl"
// Global constants
namespace
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
const TEncryptionInt Two(2);
const TEncryptionInt IterationStep(1000);
TArray<TEncryptionInt> PrimeLookupTable;
}
/**
* A thread that finds factors in the given range
*/
class FPrimeCheckRunnable : public FRunnable
{
/** Flag indicating if a factor has been found. Shared across multiple threads. */
FThreadSafeCounter& FoundFactor;
/** Candidate for a prime number */
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt PotentialPrime;
/** Start of a range to check for factors */
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt InitialValue;
/** End of a range to check for factors */
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MaxValue;
/** This thread */
FRunnableThread* Thread;
public:
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
FPrimeCheckRunnable(FThreadSafeCounter& InFoundFactor, TEncryptionInt Candidate, TEncryptionInt InInitialValue, TEncryptionInt InMaxValue)
: FoundFactor(InFoundFactor)
, PotentialPrime(Candidate)
, InitialValue(InInitialValue)
, MaxValue(InMaxValue)
{
// Must be odd number
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 2972815) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2821607 on 2016/01/08 by Mieszko.Zielinski Added a way to limit amount of information logged by vlog by discarding logs from classes from outside of class whitelist #UE4 This feature was followed by refactoring of functions taking FVisualLogEntry pointers to use references instead. Change 2828384 on 2016/01/14 by Mieszko.Zielinski Back out of visual log refactor done as part of CL#2821607 #UE4 Change 2965743 on 2016/05/04 by Tom.Looman Added check to PostActorConstruction to avoid BeginPlay call on pendingkill actor. UE-27528 #rb MarcA Change 2965744 on 2016/05/04 by Marc.Audy VS2015 Shadow Variable fixes Change 2965813 on 2016/05/04 by Tom.Looman Moved UninitializeComponents outside (bActorInitialized) to always uninit components when actors gets destroyed early. UE-27529 #rb MarcA Change 2966564 on 2016/05/04 by Marc.Audy VS2015 shadow variable fixes Change 2967244 on 2016/05/05 by Jon.Nabozny Remove UPROPERTY from members that don't require serialization and aren't user editable. #JIRA UE-30155 Change 2967377 on 2016/05/05 by Lukasz.Furman fixed processing of AIMessages when new message appears during notify loop #ue4 Change 2967437 on 2016/05/05 by Marc.Audy Add a static One to TBigInt Remove numerous local statics and TEncryptionInt specific version in KeyGenerator.cpp Part of fixing shadow variables for VS2015 Change 2967465 on 2016/05/05 by Marc.Audy Fix VS2015 shadow variables fixes Change 2967552 on 2016/05/05 by Marc.Audy Fix compile error in DocumentationCode Change 2967556 on 2016/05/05 by Marc.Audy Enable shadow variable warnings in 2015 Change 2967836 on 2016/05/05 by Marc.Audy Another DocumentationCode project fix Change 2967941 on 2016/05/05 by Marc.Audy Make bShowHUD not config Expose HUD properties to blueprints Cleanup stale entries in BaseGame.ini Deprecate unnecessary colors in AHUD in favor of using FColor statics #jira UE-30045 Change 2969008 on 2016/05/06 by Marc.Audy VS2015 Shadow Variable fixes found by CIS Change 2969315 on 2016/05/06 by John.Abercrombie Duplicating CL 2969279 from //Fortnite/Main/ Behavior tree auxilary nodes, parallel tasks, active tasks, and aborting tasks shouldn't be ticked while the behavior tree is paused -------- Integrated using branch //Fortnite/Main/_to_//UE4/Dev-Framework of change#2969279 by John.Abercrombie on 2016/05/06 14:21:40. Change 2969611 on 2016/05/06 by Marc.Audy Default bShowHUD to true Change 2971041 on 2016/05/09 by Marc.Audy Add Get/Set Actor/Component TickInterval functions and expose to blueprints Change 2971072 on 2016/05/09 by Marc.Audy Fix VS2015 shadow variables warnings Change 2971629 on 2016/05/09 by Marc.Audy PR#1981 (contributed by EverNewJoy) CheatManager is blueprintable (though very basic exposure at this time) and can be set from PlayerController DebugCameraController is now visible and can be subclassed and specified via CheatManager blueprint #jira UE-25901 Change 2971632 on 2016/05/09 by Marc.Audy Missed file from CL# 2971629 [CL 2972828 by Marc Audy in Main branch]
2016-05-10 16:00:39 -04:00
check(!(Candidate & TEncryptionInt::One).IsZero());
Thread = FRunnableThread::Create(this, TEXT("FPrimeCheckRunnable"));
}
virtual ~FPrimeCheckRunnable()
{
delete Thread;
Thread = NULL;
}
FRunnableThread* GetThread()
{
return Thread;
}
// Start FRunnable interface
virtual bool Init() override { return true; }
virtual uint32 Run() override
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Remainder;
int32 FactorCheckTimer = 0;
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
for (TEncryptionInt Factor = InitialValue; InitialValue <= MaxValue; Factor += Two)
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Dividend(PotentialPrime);
Dividend.DivideWithRemainder(Factor, Remainder);
if (Remainder.IsZero())
{
FoundFactor.Increment();
break;
}
// Don't check the FoundFactor too often
FactorCheckTimer++;
if (FactorCheckTimer >= 100)
{
FactorCheckTimer = 0;
if (FoundFactor.GetValue() != 0)
{
// Another thread found a factor
break;
}
}
}
return 0;
}
// End FRunnable interface
};
/**
* Checks if the value is a prime number.
*/
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
bool IsPrime(const TEncryptionInt& InValue, bool bUseTasks)
{
// 2 is but we don't care about small numbers here.
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 2972815) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2821607 on 2016/01/08 by Mieszko.Zielinski Added a way to limit amount of information logged by vlog by discarding logs from classes from outside of class whitelist #UE4 This feature was followed by refactoring of functions taking FVisualLogEntry pointers to use references instead. Change 2828384 on 2016/01/14 by Mieszko.Zielinski Back out of visual log refactor done as part of CL#2821607 #UE4 Change 2965743 on 2016/05/04 by Tom.Looman Added check to PostActorConstruction to avoid BeginPlay call on pendingkill actor. UE-27528 #rb MarcA Change 2965744 on 2016/05/04 by Marc.Audy VS2015 Shadow Variable fixes Change 2965813 on 2016/05/04 by Tom.Looman Moved UninitializeComponents outside (bActorInitialized) to always uninit components when actors gets destroyed early. UE-27529 #rb MarcA Change 2966564 on 2016/05/04 by Marc.Audy VS2015 shadow variable fixes Change 2967244 on 2016/05/05 by Jon.Nabozny Remove UPROPERTY from members that don't require serialization and aren't user editable. #JIRA UE-30155 Change 2967377 on 2016/05/05 by Lukasz.Furman fixed processing of AIMessages when new message appears during notify loop #ue4 Change 2967437 on 2016/05/05 by Marc.Audy Add a static One to TBigInt Remove numerous local statics and TEncryptionInt specific version in KeyGenerator.cpp Part of fixing shadow variables for VS2015 Change 2967465 on 2016/05/05 by Marc.Audy Fix VS2015 shadow variables fixes Change 2967552 on 2016/05/05 by Marc.Audy Fix compile error in DocumentationCode Change 2967556 on 2016/05/05 by Marc.Audy Enable shadow variable warnings in 2015 Change 2967836 on 2016/05/05 by Marc.Audy Another DocumentationCode project fix Change 2967941 on 2016/05/05 by Marc.Audy Make bShowHUD not config Expose HUD properties to blueprints Cleanup stale entries in BaseGame.ini Deprecate unnecessary colors in AHUD in favor of using FColor statics #jira UE-30045 Change 2969008 on 2016/05/06 by Marc.Audy VS2015 Shadow Variable fixes found by CIS Change 2969315 on 2016/05/06 by John.Abercrombie Duplicating CL 2969279 from //Fortnite/Main/ Behavior tree auxilary nodes, parallel tasks, active tasks, and aborting tasks shouldn't be ticked while the behavior tree is paused -------- Integrated using branch //Fortnite/Main/_to_//UE4/Dev-Framework of change#2969279 by John.Abercrombie on 2016/05/06 14:21:40. Change 2969611 on 2016/05/06 by Marc.Audy Default bShowHUD to true Change 2971041 on 2016/05/09 by Marc.Audy Add Get/Set Actor/Component TickInterval functions and expose to blueprints Change 2971072 on 2016/05/09 by Marc.Audy Fix VS2015 shadow variables warnings Change 2971629 on 2016/05/09 by Marc.Audy PR#1981 (contributed by EverNewJoy) CheatManager is blueprintable (though very basic exposure at this time) and can be set from PlayerController DebugCameraController is now visible and can be subclassed and specified via CheatManager blueprint #jira UE-25901 Change 2971632 on 2016/05/09 by Marc.Audy Missed file from CL# 2971629 [CL 2972828 by Marc Audy in Main branch]
2016-05-10 16:00:39 -04:00
if ((InValue & TEncryptionInt::One) == 0)
{
return false;
}
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Remainder;
// Check against known prime factors
int32 Index;
for (Index = 0; Index < PrimeLookupTable.Num() && PrimeLookupTable[Index] < InValue; ++Index)
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Dividend(InValue);
Dividend.DivideWithRemainder(PrimeLookupTable[Index], Remainder);
if (Remainder.IsZero())
{
return false;
}
}
// This means the number is smaller than one of the primes in the prime table and it has no factors
if (Index < PrimeLookupTable.Num())
{
return true;
}
// Brute force, check all odd numbers > MaxKnownPrime < sqrt(Number)
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MaxFactorValue(InValue);
MaxFactorValue.Sqrt();
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Factor(PrimeLookupTable[PrimeLookupTable.Num() - 1] + Two);
if (bUseTasks)
{
// Mutithreaded path. Split the range we look for factors over multiple threads. If one thread finds a factor
// we stop and reject this number.
// The worst case is when we actually have a prime number.
UE_LOG(LogPakFile, Display, TEXT("Detected potentially prime number %s. This may take a while..."), *InValue.ToString());
const int32 TaskCount = FPlatformMisc::NumberOfCoresIncludingHyperthreads();
TArray<FPrimeCheckRunnable*> Tasks;
Tasks.Reserve(TaskCount);
FThreadSafeCounter FoundFactors(0);
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Range(MaxFactorValue - Factor);
Range /= TaskCount;
// Spawn threads
for (int32 TaskIndex = 0; TaskIndex < TaskCount; ++TaskIndex)
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MaxValue(Factor + Range);
Tasks.Add(new FPrimeCheckRunnable(FoundFactors, InValue, Factor, MaxValue));
Factor = MaxValue;
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 2972815) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2821607 on 2016/01/08 by Mieszko.Zielinski Added a way to limit amount of information logged by vlog by discarding logs from classes from outside of class whitelist #UE4 This feature was followed by refactoring of functions taking FVisualLogEntry pointers to use references instead. Change 2828384 on 2016/01/14 by Mieszko.Zielinski Back out of visual log refactor done as part of CL#2821607 #UE4 Change 2965743 on 2016/05/04 by Tom.Looman Added check to PostActorConstruction to avoid BeginPlay call on pendingkill actor. UE-27528 #rb MarcA Change 2965744 on 2016/05/04 by Marc.Audy VS2015 Shadow Variable fixes Change 2965813 on 2016/05/04 by Tom.Looman Moved UninitializeComponents outside (bActorInitialized) to always uninit components when actors gets destroyed early. UE-27529 #rb MarcA Change 2966564 on 2016/05/04 by Marc.Audy VS2015 shadow variable fixes Change 2967244 on 2016/05/05 by Jon.Nabozny Remove UPROPERTY from members that don't require serialization and aren't user editable. #JIRA UE-30155 Change 2967377 on 2016/05/05 by Lukasz.Furman fixed processing of AIMessages when new message appears during notify loop #ue4 Change 2967437 on 2016/05/05 by Marc.Audy Add a static One to TBigInt Remove numerous local statics and TEncryptionInt specific version in KeyGenerator.cpp Part of fixing shadow variables for VS2015 Change 2967465 on 2016/05/05 by Marc.Audy Fix VS2015 shadow variables fixes Change 2967552 on 2016/05/05 by Marc.Audy Fix compile error in DocumentationCode Change 2967556 on 2016/05/05 by Marc.Audy Enable shadow variable warnings in 2015 Change 2967836 on 2016/05/05 by Marc.Audy Another DocumentationCode project fix Change 2967941 on 2016/05/05 by Marc.Audy Make bShowHUD not config Expose HUD properties to blueprints Cleanup stale entries in BaseGame.ini Deprecate unnecessary colors in AHUD in favor of using FColor statics #jira UE-30045 Change 2969008 on 2016/05/06 by Marc.Audy VS2015 Shadow Variable fixes found by CIS Change 2969315 on 2016/05/06 by John.Abercrombie Duplicating CL 2969279 from //Fortnite/Main/ Behavior tree auxilary nodes, parallel tasks, active tasks, and aborting tasks shouldn't be ticked while the behavior tree is paused -------- Integrated using branch //Fortnite/Main/_to_//UE4/Dev-Framework of change#2969279 by John.Abercrombie on 2016/05/06 14:21:40. Change 2969611 on 2016/05/06 by Marc.Audy Default bShowHUD to true Change 2971041 on 2016/05/09 by Marc.Audy Add Get/Set Actor/Component TickInterval functions and expose to blueprints Change 2971072 on 2016/05/09 by Marc.Audy Fix VS2015 shadow variables warnings Change 2971629 on 2016/05/09 by Marc.Audy PR#1981 (contributed by EverNewJoy) CheatManager is blueprintable (though very basic exposure at this time) and can be set from PlayerController DebugCameraController is now visible and can be subclassed and specified via CheatManager blueprint #jira UE-25901 Change 2971632 on 2016/05/09 by Marc.Audy Missed file from CL# 2971629 [CL 2972828 by Marc Audy in Main branch]
2016-05-10 16:00:39 -04:00
if ((Factor & TEncryptionInt::One) == 0)
{
++Factor;
}
}
// Wait for all threads to complete
for (int32 TaskIndex = 0; TaskIndex < Tasks.Num(); ++TaskIndex)
{
Tasks[TaskIndex]->GetThread()->WaitForCompletion();
delete Tasks[TaskIndex];
}
if (FoundFactors.GetValue() > 0)
{
UE_LOG(LogPakFile, Display, TEXT("%s is not prime."), *InValue.ToString());
return false;
}
else
{
UE_LOG(LogPakFile, Display, TEXT("%s is prime!"), *InValue.ToString());
}
}
else
{
// Single threaded path (used for generating prime table)
while (Factor < MaxFactorValue)
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Dividend(InValue);
Dividend.DivideWithRemainder(Factor, Remainder);
if (Remainder.IsZero())
{
return false;
}
Factor += Two;
}
}
return true;
}
/**
* Generate two random prime numbers
*/
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
void GeneratePrimeNumbers(TEncryptionInt& P, TEncryptionInt& Q)
{
// Generate a random odd number
FRandomStream Rand((int32)(FDateTime::Now().GetTicks() % (int64)MAX_int32));
uint32 RandBits[256/32] =
{
0xffffffff,
(uint32)Rand.RandRange(0, MAX_int32 - 1),
(uint32)Rand.RandRange(0, MAX_int32 - 1),
0, //(uint32)Rand.RandRange(0, MAX_int32 - 1) | 0xa0ff0000,
0, 0, 0, 0
};
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt InitialValue(RandBits);
// We need two primes
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TArray<TEncryptionInt> DiscoveredPrimes;
int64 IterationCounter = 0;
double TimeAccumulator = 0.0;
const double StartTime = FPlatformTime::Seconds();
do
{
if (IterationCounter == 10)
{
IterationCounter = 0;
TimeAccumulator = 0.0;
}
IterationCounter++;
const double IterationStartTime = FPlatformTime::Seconds();
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MinValue(InitialValue - IterationStep);
while (InitialValue >= MinValue && DiscoveredPrimes.Num() < 2)
{
if (IsPrime(InitialValue, true))
{
DiscoveredPrimes.Add(InitialValue);
}
InitialValue -= Two;
}
}
while (DiscoveredPrimes.Num() < 2);
UE_LOG(LogPakFile, Display, TEXT("Generated prime numbers in %.2lfs."), FPlatformTime::Seconds() - StartTime);
P = DiscoveredPrimes[0];
Q = DiscoveredPrimes[1];
UE_LOG(LogPakFile, Display, TEXT("P=%s"), *P.ToString());
UE_LOG(LogPakFile, Display, TEXT("Q=%s"), *Q.ToString());
}
/**
* Lookup table generation - fill it with precompile primes
*/
void FillPrimeLookupTableWithPrecompiledNumbers()
{
const int32 PrimeTableLength = ARRAY_COUNT(PrimeTable);
PrimeLookupTable.Reserve(PrimeTableLength * PrimeTableLength);
for (int32 Index = 0; Index < PrimeTableLength; ++Index)
{
PrimeLookupTable.Add(PrimeTable[Index]);
}
}
void GeneratePrimeNumberTable(int64 MaxValue, const TCHAR* Filename)
{
FillPrimeLookupTableWithPrecompiledNumbers();
UE_LOG(LogPakFile, Display, TEXT("Generating prime number table <= %lld: %s."), MaxValue, Filename);
FString PrimeTableString(TEXT("// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.\nTEncryptionInt PrimeTable[] = \n{\n\t2, "));
int64 PrimeCount = 1;
const double StartTime = FPlatformTime::Seconds();
for (int64 SmallNumber = 3; SmallNumber <= MaxValue; SmallNumber += 2)
{
if (IsPrime(SmallNumber, false))
{
PrimeTableString += FString::Printf(TEXT("%lld, "), SmallNumber);
PrimeCount++;
if ((PrimeCount % 10) == 0)
{
PrimeTableString += TEXT("\n\t");
}
}
}
PrimeTableString += TEXT("\n};\n");
UE_LOG(LogPakFile, Display, TEXT("Generated %lld primes in %.4lfs."), PrimeCount, FPlatformTime::Seconds() - StartTime);
FFileHelper::SaveStringToFile(PrimeTableString, Filename);
}
/**
* Multithreaded prime number generation (for the prime table)
* Finds prime numbers in the given range.
*/
class FPrimeFinderRunnable : public FRunnable
{
/** Range start */
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MinValue;
/** Range end */
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MaxValue;
/** This thread */
FRunnableThread* Thread;
/** All primes found in the given range */
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TArray<TEncryptionInt> FoundPrimes;
public:
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
FPrimeFinderRunnable(TEncryptionInt InMinValue, TEncryptionInt InMaxValue)
: MinValue(InMinValue)
, MaxValue(InMaxValue)
{
// Must be an odd number
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 2972815) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2821607 on 2016/01/08 by Mieszko.Zielinski Added a way to limit amount of information logged by vlog by discarding logs from classes from outside of class whitelist #UE4 This feature was followed by refactoring of functions taking FVisualLogEntry pointers to use references instead. Change 2828384 on 2016/01/14 by Mieszko.Zielinski Back out of visual log refactor done as part of CL#2821607 #UE4 Change 2965743 on 2016/05/04 by Tom.Looman Added check to PostActorConstruction to avoid BeginPlay call on pendingkill actor. UE-27528 #rb MarcA Change 2965744 on 2016/05/04 by Marc.Audy VS2015 Shadow Variable fixes Change 2965813 on 2016/05/04 by Tom.Looman Moved UninitializeComponents outside (bActorInitialized) to always uninit components when actors gets destroyed early. UE-27529 #rb MarcA Change 2966564 on 2016/05/04 by Marc.Audy VS2015 shadow variable fixes Change 2967244 on 2016/05/05 by Jon.Nabozny Remove UPROPERTY from members that don't require serialization and aren't user editable. #JIRA UE-30155 Change 2967377 on 2016/05/05 by Lukasz.Furman fixed processing of AIMessages when new message appears during notify loop #ue4 Change 2967437 on 2016/05/05 by Marc.Audy Add a static One to TBigInt Remove numerous local statics and TEncryptionInt specific version in KeyGenerator.cpp Part of fixing shadow variables for VS2015 Change 2967465 on 2016/05/05 by Marc.Audy Fix VS2015 shadow variables fixes Change 2967552 on 2016/05/05 by Marc.Audy Fix compile error in DocumentationCode Change 2967556 on 2016/05/05 by Marc.Audy Enable shadow variable warnings in 2015 Change 2967836 on 2016/05/05 by Marc.Audy Another DocumentationCode project fix Change 2967941 on 2016/05/05 by Marc.Audy Make bShowHUD not config Expose HUD properties to blueprints Cleanup stale entries in BaseGame.ini Deprecate unnecessary colors in AHUD in favor of using FColor statics #jira UE-30045 Change 2969008 on 2016/05/06 by Marc.Audy VS2015 Shadow Variable fixes found by CIS Change 2969315 on 2016/05/06 by John.Abercrombie Duplicating CL 2969279 from //Fortnite/Main/ Behavior tree auxilary nodes, parallel tasks, active tasks, and aborting tasks shouldn't be ticked while the behavior tree is paused -------- Integrated using branch //Fortnite/Main/_to_//UE4/Dev-Framework of change#2969279 by John.Abercrombie on 2016/05/06 14:21:40. Change 2969611 on 2016/05/06 by Marc.Audy Default bShowHUD to true Change 2971041 on 2016/05/09 by Marc.Audy Add Get/Set Actor/Component TickInterval functions and expose to blueprints Change 2971072 on 2016/05/09 by Marc.Audy Fix VS2015 shadow variables warnings Change 2971629 on 2016/05/09 by Marc.Audy PR#1981 (contributed by EverNewJoy) CheatManager is blueprintable (though very basic exposure at this time) and can be set from PlayerController DebugCameraController is now visible and can be subclassed and specified via CheatManager blueprint #jira UE-25901 Change 2971632 on 2016/05/09 by Marc.Audy Missed file from CL# 2971629 [CL 2972828 by Marc Audy in Main branch]
2016-05-10 16:00:39 -04:00
check(!(MinValue & TEncryptionInt::One).IsZero());
Thread = FRunnableThread::Create(this, TEXT("FPrimeFinderRunnable"));
}
virtual ~FPrimeFinderRunnable()
{
delete Thread;
Thread = NULL;
}
FRunnableThread* GetThread()
{
return Thread;
}
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
const TArray<TEncryptionInt>& GetFoundPrimes() const
{
return FoundPrimes;
}
// Start FRunnable interface
virtual bool Init() override { return true; }
virtual uint32 Run() override
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Remainder;
int32 FactorCheckTimer = 0;
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
for (TEncryptionInt Candidate = MinValue; Candidate <= MaxValue; Candidate += Two)
{
if (IsPrime(Candidate, false))
{
FoundPrimes.Add(Candidate);
}
}
return 0;
}
// End FRunnable interface
};
/**
* Generates a lookup table in runtime.
* This is a superset of precompiled prime table and primes generated on startup.
* The reason for this is that the precompiled table can't be too big because it affects
* the compile times and we don't usually use UnrealPak for prime number generation anyway.
*/
void GeneratePrimeNumberLookupTable()
{
const int32 PrimeTableLength = ARRAY_COUNT(PrimeTable);
UE_LOG(LogPakFile, Display, TEXT("Generating prime number lookup table (max size: %d)."), PrimeTableLength * PrimeTableLength);
const double StartTime = FPlatformTime::Seconds();
FillPrimeLookupTableWithPrecompiledNumbers();
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MinPrimeValue(PrimeLookupTable[PrimeLookupTable.Num() - 1] + Two);
TEncryptionInt MaxPrimeValue(MinPrimeValue);
MaxPrimeValue *= 100;
const int32 TaskCount = FPlatformMisc::NumberOfCoresIncludingHyperthreads();
TArray<FPrimeFinderRunnable*> Tasks;
Tasks.Reserve(TaskCount);
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt Range(MaxPrimeValue - MinPrimeValue);
Range /= TaskCount;
for (int32 TaskIndex = 0; TaskIndex < TaskCount; ++TaskIndex)
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt MaxValue(MinPrimeValue + Range);
Tasks.Add(new FPrimeFinderRunnable(MinPrimeValue, MaxValue));
MinPrimeValue = MaxValue;
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 2972815) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2821607 on 2016/01/08 by Mieszko.Zielinski Added a way to limit amount of information logged by vlog by discarding logs from classes from outside of class whitelist #UE4 This feature was followed by refactoring of functions taking FVisualLogEntry pointers to use references instead. Change 2828384 on 2016/01/14 by Mieszko.Zielinski Back out of visual log refactor done as part of CL#2821607 #UE4 Change 2965743 on 2016/05/04 by Tom.Looman Added check to PostActorConstruction to avoid BeginPlay call on pendingkill actor. UE-27528 #rb MarcA Change 2965744 on 2016/05/04 by Marc.Audy VS2015 Shadow Variable fixes Change 2965813 on 2016/05/04 by Tom.Looman Moved UninitializeComponents outside (bActorInitialized) to always uninit components when actors gets destroyed early. UE-27529 #rb MarcA Change 2966564 on 2016/05/04 by Marc.Audy VS2015 shadow variable fixes Change 2967244 on 2016/05/05 by Jon.Nabozny Remove UPROPERTY from members that don't require serialization and aren't user editable. #JIRA UE-30155 Change 2967377 on 2016/05/05 by Lukasz.Furman fixed processing of AIMessages when new message appears during notify loop #ue4 Change 2967437 on 2016/05/05 by Marc.Audy Add a static One to TBigInt Remove numerous local statics and TEncryptionInt specific version in KeyGenerator.cpp Part of fixing shadow variables for VS2015 Change 2967465 on 2016/05/05 by Marc.Audy Fix VS2015 shadow variables fixes Change 2967552 on 2016/05/05 by Marc.Audy Fix compile error in DocumentationCode Change 2967556 on 2016/05/05 by Marc.Audy Enable shadow variable warnings in 2015 Change 2967836 on 2016/05/05 by Marc.Audy Another DocumentationCode project fix Change 2967941 on 2016/05/05 by Marc.Audy Make bShowHUD not config Expose HUD properties to blueprints Cleanup stale entries in BaseGame.ini Deprecate unnecessary colors in AHUD in favor of using FColor statics #jira UE-30045 Change 2969008 on 2016/05/06 by Marc.Audy VS2015 Shadow Variable fixes found by CIS Change 2969315 on 2016/05/06 by John.Abercrombie Duplicating CL 2969279 from //Fortnite/Main/ Behavior tree auxilary nodes, parallel tasks, active tasks, and aborting tasks shouldn't be ticked while the behavior tree is paused -------- Integrated using branch //Fortnite/Main/_to_//UE4/Dev-Framework of change#2969279 by John.Abercrombie on 2016/05/06 14:21:40. Change 2969611 on 2016/05/06 by Marc.Audy Default bShowHUD to true Change 2971041 on 2016/05/09 by Marc.Audy Add Get/Set Actor/Component TickInterval functions and expose to blueprints Change 2971072 on 2016/05/09 by Marc.Audy Fix VS2015 shadow variables warnings Change 2971629 on 2016/05/09 by Marc.Audy PR#1981 (contributed by EverNewJoy) CheatManager is blueprintable (though very basic exposure at this time) and can be set from PlayerController DebugCameraController is now visible and can be subclassed and specified via CheatManager blueprint #jira UE-25901 Change 2971632 on 2016/05/09 by Marc.Audy Missed file from CL# 2971629 [CL 2972828 by Marc Audy in Main branch]
2016-05-10 16:00:39 -04:00
if ((MinPrimeValue & TEncryptionInt::One) == 0)
{
++MinPrimeValue;
}
}
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TArray<TEncryptionInt> NewPrimes;
for (int32 TaskIndex = 0; TaskIndex < Tasks.Num(); ++TaskIndex)
{
Tasks[TaskIndex]->GetThread()->WaitForCompletion();
NewPrimes.Append(Tasks[TaskIndex]->GetFoundPrimes());
delete Tasks[TaskIndex];
}
PrimeLookupTable.Append(NewPrimes);
UE_LOG(LogPakFile, Display, TEXT("Generated %d primes in %.4lfs."), PrimeLookupTable.Num(), FPlatformTime::Seconds() - StartTime);
}
bool GenerateKeys(const TCHAR* KeyFilename)
{
UE_LOG(LogPakFile, Display, TEXT("Generating keys %s."), KeyFilename);
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
TEncryptionInt P;
TEncryptionInt Q;
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
FString CmdLineP;
FString CmdLineQ;
FParse::Value(FCommandLine::Get(), TEXT("P="), CmdLineP);
FParse::Value(FCommandLine::Get(), TEXT("Q="), CmdLineQ);
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
P.Parse(CmdLineP);
Q.Parse(CmdLineQ);
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 3847469) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3805828 by Gil.Gribb UE4 - Fixed a bug in the lock free stalling task queue and adjusted a comment. The code is not current used, so this is not actually change the way the code works. Change 3806784 by Ben.Marsh UAT: Remove code to compile UBT when using UE4Build. It should already be compiled as a dependency of UAT. Change 3807549 by Graeme.Thornton Add a cook timer around VerifyCanCookPackage. A licensee reports this taking a lot of time so it'll be good to account for it. Change 3807727 by Graeme.Thornton Unhide the text asset format experimental editor option Change 3807746 by Josh.Engebretson Remove WER from iOS platform Change 3807928 by Robert.Manuszewski When async loading, GC Clusters will be created after packages have been processed to avoid situations where some of the objects that are being added to a cluster haven't been fully loaded yet Change 3808221 by Steve.Robb GitHub #4307 - Made GetModulePtr() thread safe by not using GetModule() ^ I'm not convinced by how much thread-safer this is really, but it's tidier anyway. Change 3809233 by Graeme.Thornton TBA: Misc changes to text asset commandlet - Rename mode to "loadsave" - Add -outputFormat option which can be assigned "text" or "binary" - When saving binary, use a differentiated filename so that source assets aren't overwritten Change 3809518 by Ben.Marsh Remove the outdated UnrealSync automation script. Change 3809643 by Steve.Robb GitHub #4277 : fix bug; FMath::FormatIntToHumanReadable 3rd comma and negative value #jira UE-53037 Change 3809862 by Steve.Robb GitHub #3342 : [FRotator.h] Fix to DecompressAxisFromByte to be more efficient and reflect its intent accurately #jira UE-42593 Change 3811190 by Graeme.Thornton Add support for writing specific log channels to their own files Change 3811197 by Graeme.Thornton Minor updates to output formatting and timing for the text asset commandlet Change 3811257 by Robert.Manuszewski Cluster creation will now be time-sliced Change 3811565 by Steve.Robb Define out non-monolithic module functions. Change 3812561 by Steve.Robb GitHub #3886 : Enable Brace-Initialization for Declaring Variables Incorrect semi-colon search removed after discussion with author. Test added. #jira UE-48242 Change 3812864 by Steve.Robb Removal of some unproven code which was supposed to fix hot reloading BP class functions in plugins. See: https://udn.unrealengine.com/questions/376978/aitask-blueprint-nodes-disappear-when-their-module.html #jira UE-53089 Change 3820358 by Ben.Marsh PR #4358: Incredibuild use ShowAgent by default (Contributed by projectgheist) Change 3822594 by Ben.Marsh UAT: Improvements to log file handling. - Always create log files in the final location, rather than writing to a temp directory and copying in later. - Now supports -Verbose and -VeryVerbose for increasing log verbosity, rather than -Verbose=XXX. - Keep a backlog of log output before the log system is initialized, and flush it to the log file once it is. - Allow buildmachines to specify the uebp_FinalLogFolder environment variable, which is used to form paths for display. When build machines copy log files elsewhere after UAT finishes (eg. a network share), this allows error messages to display the right location. Change 3823695 by Ben.Marsh UGS: Fix issue where precompiled binaries would not be shown as available for a change until scrolling the last submitted code change into the buffer (other symptoms, like de-focussing the main window would cause it to go back to an unavailable state, since the changes buffer was shrunk). Now always queries changes up to the last change for which zipped binaries are available. Change 3823845 by Ben.Marsh UBT: Exclude C# projects for unsupported platforms when generating project files. Change 3824180 by Ben.Marsh UGS: Add an option to show changes by build machines, and move the "only show reviewed" option in there too (Options > Show Changes). #jira Change 3825777 by Steve.Robb Fix to return value of StringToBytes. Change 3825810 by Ben.Marsh UBT: Reduce length of include paths for MSVC toolchain. Change 3825822 by Robert.Manuszewski Optimized PIE lazy pointer fixup. Should be up to 8x faster now. Change 3826734 by Ben.Marsh Remove code to disable TextureFormatAndroid on Linux. It seems to be an editor dependency. Change 3827730 by Steve.Robb Try to avoid decltype(auto) if it's not supported. See: https://udn.unrealengine.com/questions/395644/build-417-with-c11-on-linux-ttuple-errors.html Change 3827745 by Steve.Robb Initializer list support for TMap. Change 3827770 by Steve.Robb GitHub #4399 : Added a CONSTEXPR qualifiers to FVariant::GetType() #jira UE-53813 Change 3829189 by Ben.Marsh UBT: Now always writes a minimal log file. By default, just contains the regular console output and any reasons why actions are outdated and needed to be executed. UAT directs child UBT instances to output logs into its own log folder, so that build machines can save them off. Change 3830444 by Steve.Robb BuildVersion and ModuleManifest moved to Core, and parsing of these files reimplemented to avoid a JSON library. This should be revisited when Core has its own JSON library. Change 3830718 by Ben.Marsh Fix incorrect group name being returned by FStatNameAndInfo::GetGroupName() for stat groups. The editor populates the viewport stats list by calling this for every registered stat and stat group (via FLevelViewportCommands::HandleNewStatGroup). The menu entry attempts to show the stat name with STAT_XXX stripped from the start as the menu item label, with the free-form text description as a tooltip. For stat groups, the it would previously just return the stat group name as "Groups" (due to the raw naming convention of "//Groups//STATGROUP_Foo//..."). Since this didn't match the expected naming convention in FLevelViewportCommands::HandleNewStat (ie. STAT_XXX or STATGROUP_XXX), it would fail to add it. When the first actual stat belonging to that group is added, it would add a menu entry for the group based on that, but the stat description no longer makes sense as a tooltip for the group. As a result, all the editor tooltips were junk. #jira UE-53845 Change 3831064 by Ben.Marsh Fix log file contention when spawning UBT recursively. Change 3832654 by Ben.Marsh UGS: Fix error panel not being selected when opened, and weird alignment/color issues on it. Change 3832680 by Ben.Marsh UGS: Fix failing to detect workspace if synced to a different stream. Seems to be a regression caused by recent P4D upgrade. Change 3832695 by Ben.Marsh UGS: Invert the options in the 'Show Changes' submenu for simplicity. Change 3833528 by Ben.Marsh UAT: Script to rewrite source files with public include paths relative to the 'Public' folder. Usage is: RebasePublicIncludePaths -UpdateDir=<Dir> [-Project=<Dir>] [-Write]. Change 3833543 by Ben.Marsh UBT: Allow targets to opt-out of having public include paths added for every dependent module. This reduces the command line length when building a target, which has recently become a problem with larger games (due to Microsoft's compiler embedding the command line into each object file, with a maximum length of 64kb). All engine modules are compiled with this enabled; games may opt into it by setting bLegacyPublicIncludePaths = false; from their .target.cs, as may individual modules. Change 3834354 by Robert.Manuszewski Archetype pointer will now be cached to avoid locking the object tables when acquiring its info. It should also be faster this way regardless of any locks. #jira UE-52035 Change 3834400 by Robert.Manuszewski Fixing crash on exit caused by cached archetypes not being cleaned up before static exit cleanup. #jira UE-52035 Change 3834947 by Steve.Robb USE_FORMAT_STRING_TYPE_CHECKING removed from FMsg::Logf and FMsg::Logf_Internal. Change 3835004 by Ben.Marsh Fix code that relies on dubious behavior of requiring referenced "include path only" modules having their _API macros set to be empty, even if the module is actually implemented in a separate DLL. Change 3835340 by Ben.Marsh Fix errors making installed build from directories with spaces in the name. Change 3835972 by Ben.Marsh UBT: Improved diagnostic message for targets which don't need a version file. Change 3836019 by Ben.Marsh UBT: Fix warnings caused by defining linkage macros for third party libraries. Change 3836269 by Ben.Marsh Fix message box larger than the screen height being created when a large number of modules are incompatible on startup. Change 3836543 by Ben.Marsh Enable SoundMod plugin on Linux, since it's already supported through the editor. Change 3836546 by Ben.Marsh PR #4412: fix type mismatch (Contributed by nakapon) Change 3836805 by Ben.Marsh Fix commandlet to compile marketplace plugins. Change 3836829 by Ben.Marsh UBT: Fix ability to precompile plugins from installed engine builds. Change 3837036 by Ben.Marsh UBT: Write the previous and new contents of intermediate files to the log if they change. Makes it easier to debug unexpected rebuilds. Change 3837037 by Ben.Marsh UBT: Fix engine modules having inconsistent definitions depending on whether modules are only referenced for their include paths vs being linked into a binary (due to different _API macro). Change 3837040 by Ben.Marsh UBT: Remove code that initializes members in ModuleRules and TargetRules objects before the constructor is run. This is no longer necessary, now that the backwards-compatible default constructors have been removed. Change 3837247 by Ben.Marsh UBT: Remove UELinkerFixups module, now that plugins and precompiled modules do not require hacks to force initialization (since they're linked in as object files). Encryption and signing keys are now set via macros expanded from the IMPLEMENT_PRIMARY_GAME_MODULE macro, via project-specific macros added in the TargetRules constructor. Change 3837262 by Ben.Marsh UBT: Set whether a module is an engine module or not via a default value for the rules assembly. All non-program engine and enterprise modules are created with this flag set to true; program targets and modules are now created from a different assembly that sets it to false. This removes hacks from UEBuildModule needed to adjust behavior for different module types based on the directory containing the module. Also add a bUseBackwardsCompatibleDefaults flag to the TargetRules class, also initialized to a default value from a setting passed to the RulesAssembly constructor. This controls whether modules created for the target should be configured to allow breaking changes to default settings, and is set to false for all engine targets, and true for all project targets. Change 3837343 by Ben.Marsh UBT: Remove the OverrideExecutableFileExtension target property. Change the only current use for this (the MayaLiveLinkPlugin target) to use a post build step to copy the file instead. Change 3837356 by Ben.Marsh Fix invalid character encodings. Change 3837727 by Graeme.Thornton UnrealPak: KeyGenerator: Only generate prime table when required, not all the time Change 3837823 by Ben.Marsh UBT: Output warnings and errors when compiling module rules assembly in a way that allows them to be double-clicked in the Visual Studio output window. Change 3837831 by Graeme.Thornton UBT: When parsing crypto settings, always load legacy data first, then allow the new system to override it. Provides the same key backwards compatibility that the editor settings class gives Change 3837857 by Robert.Manuszewski PR #4404: Make FGCArrayPool singleton global instead of per-CU (Contributed by mhutch) Change 3837943 by Robert.Manuszewski PR #4405: Fix FGarbageCollectionTracer (Contributed by mhutch) Change 3838451 by Ben.Marsh UBT: Fix exceptions thrown on a background thread while caching C++ includes not being caught and logged correctly. Now captures exceptions and re-throws on the main thread. #jira UE-53996 Change 3839519 by Ben.Marsh UBT: Simplify configuring bPrecompile and bUsePrecompile settings for modules. Each rules assembly can now be configured as installed, which defaults the module rules it creates to use precompiled data. Change 3843790 by Graeme.Thornton UnrealPak: Log the size of all encrypted data Change 3844258 by Ben.Marsh Fix plugin compile failure when created via new plugin wizard. Passing -plugin on the command line is unnecessary, and is now reserved for packaging external plugins for the marketplace. Also extend the length of time that the error toast stays visible, and don't delete the plugin on failure. #jira UE-54157 Change 3845796 by Ben.Marsh Workaround for slow performance of String.EndsWith() on Mono. Change 3845823 by Ben.Marsh Fix case sensitive matching of platform names in -TargetPlatform=X argument to BuildCookRun. #jira UE-54123 Change 3845901 by Arciel.Rekman Linux: fix crash due to lambda lifetime issues (UE-54040). - The lambda goes out of scope in FBufferVisualizationMenuCommands::CreateVisualizationCommands, crashing the editor if compiled with a recent clang (5.0+). (Edigrating 3819174 to Dev-Core) Change 3846439 by Ben.Marsh Revert CL 3822742 to always call Process.WaitForExit(). The Android target platform module in the editor spawns ADB.EXE, which inherits the editor's stdout/stderr handles and forks itself. Process.WaitForExit() waits for EOF on those pipes, which never occurs because the forked process never terminates. Proper fix is probably to have the engine explicitly duplicate stdout/stderr handles for new pipes to output process, but too risky before copying up to Main. Change 3816608 by Ben.Marsh UBT: Use DirectoryReference objects for all include paths. Change 3816954 by Ben.Marsh UBT: Remove bIncludeDependentLibrariesInLibrary option. This is not widely supported by platform toolchains, and is not used anywhere. Change 3816986 by Ben.Marsh UBT: Remove UEBuildBinaryConfig; UEBuildBinary objects are now just created directly. Change 3816991 by Ben.Marsh UBT: Deprecate PlatformSpecificDynamicallyLoadedModules. We no longer have any special behavior for these modules. Change 3823090 by Ben.Marsh UAT: Improve logging for child UAT instances. - Calling RunUAT now requires an identifier for prefixing into the parent log, which is also used to determine the name of the log folder. - Stdout is no longer written to its own output file, since it's written to the parent stdout, the parent log file, and the child log file anyway. - Log folders for child UAT instances are left intact, rather than being copied to the parent folder. The derived names for the copied names were confusing and hard to read. - Output from UAT is no longer returned as a string. It should not be parsed anyway (but may be huge!). ProcessResult now supports running without capturing output. Change 3826082 by Ben.Marsh UBT: Add a check to make sure that all modules that are precompiled are correctly marked to enable it, even if they are part of the build target. Change 3827025 by Ben.Marsh UBT: Move the compile output directory into a property on the module, and explicitly pass it to the toolchain when compiling. Change 3829927 by James.Hopkin Made HTTP interface const correct Change 3833533 by Ben.Marsh Rewrite engine source files to base include paths relative to the "Public" directory. This allows reducing the number of public include paths that have to be added for engine modules. Change 3835826 by Ben.Marsh UBT: Precompiled targets now generate a separate manifest for each precompiled module, rather than adding object files to a library. This fixes issues where object files from static libraries would not be linked into a target if a symbol in them was not referenced. Change 3835969 by Ben.Marsh UBT: Fix cases where text is being written directly to the console rather than via logging functions. Change 3837777 by Steve.Robb Format string type checking added to FOutputDevice::Logf. Fixes for those. Change 3838569 by Steve.Robb Algo moved up a folder. [CL 3847482 by Ben Marsh in Main branch]
2018-01-20 11:19:29 -05:00
const bool bNoVerifyPrimes = FParse::Param(FCommandLine::Get(), TEXT("NoVerifyPrimes"));
// Check if we have valid primes in the command line.
// @todo: IsPrime check should probably go when we start to use big primes
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
bool bGeneratePrimes = !(P > Two && Q > Two);
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 3847469) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3805828 by Gil.Gribb UE4 - Fixed a bug in the lock free stalling task queue and adjusted a comment. The code is not current used, so this is not actually change the way the code works. Change 3806784 by Ben.Marsh UAT: Remove code to compile UBT when using UE4Build. It should already be compiled as a dependency of UAT. Change 3807549 by Graeme.Thornton Add a cook timer around VerifyCanCookPackage. A licensee reports this taking a lot of time so it'll be good to account for it. Change 3807727 by Graeme.Thornton Unhide the text asset format experimental editor option Change 3807746 by Josh.Engebretson Remove WER from iOS platform Change 3807928 by Robert.Manuszewski When async loading, GC Clusters will be created after packages have been processed to avoid situations where some of the objects that are being added to a cluster haven't been fully loaded yet Change 3808221 by Steve.Robb GitHub #4307 - Made GetModulePtr() thread safe by not using GetModule() ^ I'm not convinced by how much thread-safer this is really, but it's tidier anyway. Change 3809233 by Graeme.Thornton TBA: Misc changes to text asset commandlet - Rename mode to "loadsave" - Add -outputFormat option which can be assigned "text" or "binary" - When saving binary, use a differentiated filename so that source assets aren't overwritten Change 3809518 by Ben.Marsh Remove the outdated UnrealSync automation script. Change 3809643 by Steve.Robb GitHub #4277 : fix bug; FMath::FormatIntToHumanReadable 3rd comma and negative value #jira UE-53037 Change 3809862 by Steve.Robb GitHub #3342 : [FRotator.h] Fix to DecompressAxisFromByte to be more efficient and reflect its intent accurately #jira UE-42593 Change 3811190 by Graeme.Thornton Add support for writing specific log channels to their own files Change 3811197 by Graeme.Thornton Minor updates to output formatting and timing for the text asset commandlet Change 3811257 by Robert.Manuszewski Cluster creation will now be time-sliced Change 3811565 by Steve.Robb Define out non-monolithic module functions. Change 3812561 by Steve.Robb GitHub #3886 : Enable Brace-Initialization for Declaring Variables Incorrect semi-colon search removed after discussion with author. Test added. #jira UE-48242 Change 3812864 by Steve.Robb Removal of some unproven code which was supposed to fix hot reloading BP class functions in plugins. See: https://udn.unrealengine.com/questions/376978/aitask-blueprint-nodes-disappear-when-their-module.html #jira UE-53089 Change 3820358 by Ben.Marsh PR #4358: Incredibuild use ShowAgent by default (Contributed by projectgheist) Change 3822594 by Ben.Marsh UAT: Improvements to log file handling. - Always create log files in the final location, rather than writing to a temp directory and copying in later. - Now supports -Verbose and -VeryVerbose for increasing log verbosity, rather than -Verbose=XXX. - Keep a backlog of log output before the log system is initialized, and flush it to the log file once it is. - Allow buildmachines to specify the uebp_FinalLogFolder environment variable, which is used to form paths for display. When build machines copy log files elsewhere after UAT finishes (eg. a network share), this allows error messages to display the right location. Change 3823695 by Ben.Marsh UGS: Fix issue where precompiled binaries would not be shown as available for a change until scrolling the last submitted code change into the buffer (other symptoms, like de-focussing the main window would cause it to go back to an unavailable state, since the changes buffer was shrunk). Now always queries changes up to the last change for which zipped binaries are available. Change 3823845 by Ben.Marsh UBT: Exclude C# projects for unsupported platforms when generating project files. Change 3824180 by Ben.Marsh UGS: Add an option to show changes by build machines, and move the "only show reviewed" option in there too (Options > Show Changes). #jira Change 3825777 by Steve.Robb Fix to return value of StringToBytes. Change 3825810 by Ben.Marsh UBT: Reduce length of include paths for MSVC toolchain. Change 3825822 by Robert.Manuszewski Optimized PIE lazy pointer fixup. Should be up to 8x faster now. Change 3826734 by Ben.Marsh Remove code to disable TextureFormatAndroid on Linux. It seems to be an editor dependency. Change 3827730 by Steve.Robb Try to avoid decltype(auto) if it's not supported. See: https://udn.unrealengine.com/questions/395644/build-417-with-c11-on-linux-ttuple-errors.html Change 3827745 by Steve.Robb Initializer list support for TMap. Change 3827770 by Steve.Robb GitHub #4399 : Added a CONSTEXPR qualifiers to FVariant::GetType() #jira UE-53813 Change 3829189 by Ben.Marsh UBT: Now always writes a minimal log file. By default, just contains the regular console output and any reasons why actions are outdated and needed to be executed. UAT directs child UBT instances to output logs into its own log folder, so that build machines can save them off. Change 3830444 by Steve.Robb BuildVersion and ModuleManifest moved to Core, and parsing of these files reimplemented to avoid a JSON library. This should be revisited when Core has its own JSON library. Change 3830718 by Ben.Marsh Fix incorrect group name being returned by FStatNameAndInfo::GetGroupName() for stat groups. The editor populates the viewport stats list by calling this for every registered stat and stat group (via FLevelViewportCommands::HandleNewStatGroup). The menu entry attempts to show the stat name with STAT_XXX stripped from the start as the menu item label, with the free-form text description as a tooltip. For stat groups, the it would previously just return the stat group name as "Groups" (due to the raw naming convention of "//Groups//STATGROUP_Foo//..."). Since this didn't match the expected naming convention in FLevelViewportCommands::HandleNewStat (ie. STAT_XXX or STATGROUP_XXX), it would fail to add it. When the first actual stat belonging to that group is added, it would add a menu entry for the group based on that, but the stat description no longer makes sense as a tooltip for the group. As a result, all the editor tooltips were junk. #jira UE-53845 Change 3831064 by Ben.Marsh Fix log file contention when spawning UBT recursively. Change 3832654 by Ben.Marsh UGS: Fix error panel not being selected when opened, and weird alignment/color issues on it. Change 3832680 by Ben.Marsh UGS: Fix failing to detect workspace if synced to a different stream. Seems to be a regression caused by recent P4D upgrade. Change 3832695 by Ben.Marsh UGS: Invert the options in the 'Show Changes' submenu for simplicity. Change 3833528 by Ben.Marsh UAT: Script to rewrite source files with public include paths relative to the 'Public' folder. Usage is: RebasePublicIncludePaths -UpdateDir=<Dir> [-Project=<Dir>] [-Write]. Change 3833543 by Ben.Marsh UBT: Allow targets to opt-out of having public include paths added for every dependent module. This reduces the command line length when building a target, which has recently become a problem with larger games (due to Microsoft's compiler embedding the command line into each object file, with a maximum length of 64kb). All engine modules are compiled with this enabled; games may opt into it by setting bLegacyPublicIncludePaths = false; from their .target.cs, as may individual modules. Change 3834354 by Robert.Manuszewski Archetype pointer will now be cached to avoid locking the object tables when acquiring its info. It should also be faster this way regardless of any locks. #jira UE-52035 Change 3834400 by Robert.Manuszewski Fixing crash on exit caused by cached archetypes not being cleaned up before static exit cleanup. #jira UE-52035 Change 3834947 by Steve.Robb USE_FORMAT_STRING_TYPE_CHECKING removed from FMsg::Logf and FMsg::Logf_Internal. Change 3835004 by Ben.Marsh Fix code that relies on dubious behavior of requiring referenced "include path only" modules having their _API macros set to be empty, even if the module is actually implemented in a separate DLL. Change 3835340 by Ben.Marsh Fix errors making installed build from directories with spaces in the name. Change 3835972 by Ben.Marsh UBT: Improved diagnostic message for targets which don't need a version file. Change 3836019 by Ben.Marsh UBT: Fix warnings caused by defining linkage macros for third party libraries. Change 3836269 by Ben.Marsh Fix message box larger than the screen height being created when a large number of modules are incompatible on startup. Change 3836543 by Ben.Marsh Enable SoundMod plugin on Linux, since it's already supported through the editor. Change 3836546 by Ben.Marsh PR #4412: fix type mismatch (Contributed by nakapon) Change 3836805 by Ben.Marsh Fix commandlet to compile marketplace plugins. Change 3836829 by Ben.Marsh UBT: Fix ability to precompile plugins from installed engine builds. Change 3837036 by Ben.Marsh UBT: Write the previous and new contents of intermediate files to the log if they change. Makes it easier to debug unexpected rebuilds. Change 3837037 by Ben.Marsh UBT: Fix engine modules having inconsistent definitions depending on whether modules are only referenced for their include paths vs being linked into a binary (due to different _API macro). Change 3837040 by Ben.Marsh UBT: Remove code that initializes members in ModuleRules and TargetRules objects before the constructor is run. This is no longer necessary, now that the backwards-compatible default constructors have been removed. Change 3837247 by Ben.Marsh UBT: Remove UELinkerFixups module, now that plugins and precompiled modules do not require hacks to force initialization (since they're linked in as object files). Encryption and signing keys are now set via macros expanded from the IMPLEMENT_PRIMARY_GAME_MODULE macro, via project-specific macros added in the TargetRules constructor. Change 3837262 by Ben.Marsh UBT: Set whether a module is an engine module or not via a default value for the rules assembly. All non-program engine and enterprise modules are created with this flag set to true; program targets and modules are now created from a different assembly that sets it to false. This removes hacks from UEBuildModule needed to adjust behavior for different module types based on the directory containing the module. Also add a bUseBackwardsCompatibleDefaults flag to the TargetRules class, also initialized to a default value from a setting passed to the RulesAssembly constructor. This controls whether modules created for the target should be configured to allow breaking changes to default settings, and is set to false for all engine targets, and true for all project targets. Change 3837343 by Ben.Marsh UBT: Remove the OverrideExecutableFileExtension target property. Change the only current use for this (the MayaLiveLinkPlugin target) to use a post build step to copy the file instead. Change 3837356 by Ben.Marsh Fix invalid character encodings. Change 3837727 by Graeme.Thornton UnrealPak: KeyGenerator: Only generate prime table when required, not all the time Change 3837823 by Ben.Marsh UBT: Output warnings and errors when compiling module rules assembly in a way that allows them to be double-clicked in the Visual Studio output window. Change 3837831 by Graeme.Thornton UBT: When parsing crypto settings, always load legacy data first, then allow the new system to override it. Provides the same key backwards compatibility that the editor settings class gives Change 3837857 by Robert.Manuszewski PR #4404: Make FGCArrayPool singleton global instead of per-CU (Contributed by mhutch) Change 3837943 by Robert.Manuszewski PR #4405: Fix FGarbageCollectionTracer (Contributed by mhutch) Change 3838451 by Ben.Marsh UBT: Fix exceptions thrown on a background thread while caching C++ includes not being caught and logged correctly. Now captures exceptions and re-throws on the main thread. #jira UE-53996 Change 3839519 by Ben.Marsh UBT: Simplify configuring bPrecompile and bUsePrecompile settings for modules. Each rules assembly can now be configured as installed, which defaults the module rules it creates to use precompiled data. Change 3843790 by Graeme.Thornton UnrealPak: Log the size of all encrypted data Change 3844258 by Ben.Marsh Fix plugin compile failure when created via new plugin wizard. Passing -plugin on the command line is unnecessary, and is now reserved for packaging external plugins for the marketplace. Also extend the length of time that the error toast stays visible, and don't delete the plugin on failure. #jira UE-54157 Change 3845796 by Ben.Marsh Workaround for slow performance of String.EndsWith() on Mono. Change 3845823 by Ben.Marsh Fix case sensitive matching of platform names in -TargetPlatform=X argument to BuildCookRun. #jira UE-54123 Change 3845901 by Arciel.Rekman Linux: fix crash due to lambda lifetime issues (UE-54040). - The lambda goes out of scope in FBufferVisualizationMenuCommands::CreateVisualizationCommands, crashing the editor if compiled with a recent clang (5.0+). (Edigrating 3819174 to Dev-Core) Change 3846439 by Ben.Marsh Revert CL 3822742 to always call Process.WaitForExit(). The Android target platform module in the editor spawns ADB.EXE, which inherits the editor's stdout/stderr handles and forks itself. Process.WaitForExit() waits for EOF on those pipes, which never occurs because the forked process never terminates. Proper fix is probably to have the engine explicitly duplicate stdout/stderr handles for new pipes to output process, but too risky before copying up to Main. Change 3816608 by Ben.Marsh UBT: Use DirectoryReference objects for all include paths. Change 3816954 by Ben.Marsh UBT: Remove bIncludeDependentLibrariesInLibrary option. This is not widely supported by platform toolchains, and is not used anywhere. Change 3816986 by Ben.Marsh UBT: Remove UEBuildBinaryConfig; UEBuildBinary objects are now just created directly. Change 3816991 by Ben.Marsh UBT: Deprecate PlatformSpecificDynamicallyLoadedModules. We no longer have any special behavior for these modules. Change 3823090 by Ben.Marsh UAT: Improve logging for child UAT instances. - Calling RunUAT now requires an identifier for prefixing into the parent log, which is also used to determine the name of the log folder. - Stdout is no longer written to its own output file, since it's written to the parent stdout, the parent log file, and the child log file anyway. - Log folders for child UAT instances are left intact, rather than being copied to the parent folder. The derived names for the copied names were confusing and hard to read. - Output from UAT is no longer returned as a string. It should not be parsed anyway (but may be huge!). ProcessResult now supports running without capturing output. Change 3826082 by Ben.Marsh UBT: Add a check to make sure that all modules that are precompiled are correctly marked to enable it, even if they are part of the build target. Change 3827025 by Ben.Marsh UBT: Move the compile output directory into a property on the module, and explicitly pass it to the toolchain when compiling. Change 3829927 by James.Hopkin Made HTTP interface const correct Change 3833533 by Ben.Marsh Rewrite engine source files to base include paths relative to the "Public" directory. This allows reducing the number of public include paths that have to be added for engine modules. Change 3835826 by Ben.Marsh UBT: Precompiled targets now generate a separate manifest for each precompiled module, rather than adding object files to a library. This fixes issues where object files from static libraries would not be linked into a target if a symbol in them was not referenced. Change 3835969 by Ben.Marsh UBT: Fix cases where text is being written directly to the console rather than via logging functions. Change 3837777 by Steve.Robb Format string type checking added to FOutputDevice::Logf. Fixes for those. Change 3838569 by Steve.Robb Algo moved up a folder. [CL 3847482 by Ben Marsh in Main branch]
2018-01-20 11:19:29 -05:00
if (bGeneratePrimes || !bNoVerifyPrimes)
{
GeneratePrimeNumberLookupTable();
}
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
if (!bGeneratePrimes && !bNoVerifyPrimes)
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
if (!IsPrime(P, false))
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
UE_LOG(LogPakFile, Warning, TEXT("P=%s is not prime!"), *CmdLineP);
bGeneratePrimes = true;
}
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
if (!IsPrime(Q, false))
{
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
UE_LOG(LogPakFile, Warning, TEXT("Q=%s is not prime!"), *CmdLineQ);
bGeneratePrimes = true;
}
}
if (bGeneratePrimes)
{
// Generate random prime numbers
UE_LOG(LogPakFile, Display, TEXT("Generating prime numbers..."));
GeneratePrimeNumbers(P, Q);
}
else
{
// Use predefined primes
UE_LOG(LogPakFile, Display, TEXT("Using predefined values to generate keys."));
}
// Generate key pair
UE_LOG(LogPakFile, Display, TEXT("Generating key pair..."));
FKeyPair Keys;
FEncryption::GenerateKeyPair(P, Q, Keys.PublicKey, Keys.PrivateKey);
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
if (TestKeys(Keys))
{
return SaveKeysToFile(Keys, KeyFilename);
}
else
{
return false;
}
}
bool SaveKeysToFile(const FKeyPair& Keys, const TCHAR* KeyFilename)
{
UE_LOG(LogPakFile, Display, TEXT("Saving key pair in %s"), KeyFilename);
FString KeyFileContents = FString::Printf(TEXT("%s\n%s\n%s"), *Keys.PrivateKey.Exponent.ToString(), *Keys.PrivateKey.Modulus.ToString(), *Keys.PublicKey.Exponent.ToString());
return FFileHelper::SaveStringToFile(KeyFileContents, KeyFilename);
}
bool ReadKeysFromFile(const TCHAR* KeyFilename, FKeyPair& OutKeys)
{
bool bResult = false;
UE_LOG(LogPakFile, Display, TEXT("Loading key pair from %s"), KeyFilename);
FString KeyFileContents;
if (FFileHelper::LoadFileToString(KeyFileContents, KeyFilename))
{
TArray<FString> KeyValues;
KeyFileContents.ParseIntoArrayWS(KeyValues);
if (KeyValues.Num() != 3)
{
UE_LOG(LogPakFile, Error, TEXT("Expecting 3 values in %s, got %d."), KeyFilename, KeyValues.Num());
}
else
{
OutKeys.PrivateKey.Exponent.Parse(KeyValues[0]);
OutKeys.PrivateKey.Modulus.Parse(KeyValues[1]);
OutKeys.PublicKey.Exponent.Parse(KeyValues[2]);
OutKeys.PublicKey.Modulus = OutKeys.PrivateKey.Modulus;
bResult = true;
}
}
else
{
UE_LOG(LogPakFile, Error, TEXT("Failed to load key pair from %s"), KeyFilename);
}
return bResult;
}
Copying //UE4/Dev-Core to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2877442 on 2016/02/23 by Graeme.Thornton@GThornton_DevCore Allow 'dumpnonframe' stat command to also take an optional group name which will filter the output Change 2879289 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Removed "-" in switch string for load time tracker. Makes -NoLoadTrackClear cmd line param actually work Change 2879323 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore PC builds now log engine initialization time with the load time tracker Change 2879418 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Optimization for FSignedArchiveReader - Compute incoming data hash in parallel on another thread while we serialize and decrypt the signature on the chunk cache worker thread Change 2879419 on 2016/02/24 by Graeme.Thornton@GThornton_DevCore Extra stats for PakFile group - Time reading from pak handles - Number of open pak handles Change 2881199 on 2016/02/25 by Graeme.Thornton@GThornton_DevCore Use 32 bit CRCs to hash chunk contents rather than SHA1. Much faster to compute than SHA1, and the decrypting 4 bytes rather than 20 is also a lot faster Change 2885687 on 2016/02/29 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Close disregard for GC pool when disabling it to leave it in a good state. Change 2887358 on 2016/03/01 by Steve.Robb@Dev-Core FlushCurrentThreadCache calls forwarded on from FMalloc wrappers. Change 2887398 on 2016/03/01 by Steve.Robb@Dev-Core Stats for MallocBinned2. Change 2887682 on 2016/03/01 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added code to catch game hangs. If game thread is stalled for more than 5 seconds we will catch that, report its callstack and crash. Change 2889573 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Renamed the new StackWalkAndDump to ThreadStackWalkAndDump to avoid name collisions and build errors. Change 2889687 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Send thread heartbeats during potentially slow tasks. Change 2889963 on 2016/03/02 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Added the ability to query the name of a thread given its TLS id. Change 2890439 on 2016/03/02 by Steve.Robb@Dev-Core MallocBinned redirection header, to allow easy switching between MallocBinned and MallocBinned2. Switch back to MallocBinned by default. Change 2891799 on 2016/03/03 by Steve.Robb@Dev-Core Shrunken GMallocBinned2MemSizeToIndex array. Improvement of some shared templated alignment-related functions. Change 2891812 on 2016/03/03 by Graeme.Thornton@GThornton_DevCore Refactoring of pak signing to be more compatible with patching - Store signatures in a block at the end of the pak file - Optimize decryption of signatures by serializing them all when the pak is opened, and decrypting on the chunk cache worker thread between read requests. Change 2891813 on 2016/03/03 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream2 Don't compile UnrealPak with ICU Change 2892386 on 2016/03/03 by Steve.Robb@Dev-Core GitHub #2070 - Fix incorrect FMallocDebug::Malloc alignment checking Change 2894189 on 2016/03/04 by Steve.Robb@Dev-Core Memswap fixes for sizes of 3, 5, 6 and 7, and early out on 0. Change 2894427 on 2016/03/04 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Don't display message boxes in unattended mode when D3D device is removed. Change 2896912 on 2016/03/07 by Graeme.Thornton@GThornton_DevCore Disable reading of anything outside the pak file when in shipping builds Change 2897053 on 2016/03/07 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 A few improvements to thread heartbeat thread: - Don't check for heartbeat in debug builds - Don't spawn the thread heartbeat thread for programs - Ignore stalls when exiting Change 2898752 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Fixing race conditions when using malloc verify Change 2899075 on 2016/03/08 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 UnrealPak will now accept hex values for p and q. Added the command line param to trust p and q. Change 2899091 on 2016/03/08 by Steve.Robb@Dev-Core Fix for TQueue::Peek const-correctness. Change 2902775 on 2016/03/10 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 Adding code to test signature keys. Change 2905040 on 2016/03/11 by Robert.Manuszewski@Robert.Manuszewski_NCL_Stream1 TBigInt Multiply is now 30x faster Change 2905218 on 2016/03/11 by Steve.Robb@Dev-Core New FCString::Strspn and FCString::Strcspn functions. [CL 2921423 by Robert Manuszewski in Main branch]
2016-03-24 13:53:55 -04:00
bool TestKeys(FKeyPair& Pair)
{
UE_LOG(LogPakFile, Display, TEXT("Testing signature keys."));
// Just some random values
static TEncryptionInt TestData[] =
{
11,
253,
128,
234,
56,
89,
34,
179,
29,
1024,
(int64)(MAX_int32),
(int64)(MAX_uint32) - 1
};
for (int32 TestIndex = 0; TestIndex < ARRAY_COUNT(TestData); ++TestIndex)
{
TEncryptionInt EncryptedData = FEncryption::ModularPow(TestData[TestIndex], Pair.PrivateKey.Exponent, Pair.PrivateKey.Modulus);
TEncryptionInt DecryptedData = FEncryption::ModularPow(EncryptedData, Pair.PublicKey.Exponent, Pair.PublicKey.Modulus);
if (TestData[TestIndex] != DecryptedData)
{
UE_LOG(LogPakFile, Error, TEXT("Keys do not properly encrypt/decrypt data (failed test with %lld)"), TestData[TestIndex].ToInt());
return false;
}
}
UE_LOG(LogPakFile, Display, TEXT("Signature keys check completed successfuly."));
return true;
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 3847469) #lockdown Nick.Penwarden #rb none ============================ MAJOR FEATURES & CHANGES ============================ Change 3805828 by Gil.Gribb UE4 - Fixed a bug in the lock free stalling task queue and adjusted a comment. The code is not current used, so this is not actually change the way the code works. Change 3806784 by Ben.Marsh UAT: Remove code to compile UBT when using UE4Build. It should already be compiled as a dependency of UAT. Change 3807549 by Graeme.Thornton Add a cook timer around VerifyCanCookPackage. A licensee reports this taking a lot of time so it'll be good to account for it. Change 3807727 by Graeme.Thornton Unhide the text asset format experimental editor option Change 3807746 by Josh.Engebretson Remove WER from iOS platform Change 3807928 by Robert.Manuszewski When async loading, GC Clusters will be created after packages have been processed to avoid situations where some of the objects that are being added to a cluster haven't been fully loaded yet Change 3808221 by Steve.Robb GitHub #4307 - Made GetModulePtr() thread safe by not using GetModule() ^ I'm not convinced by how much thread-safer this is really, but it's tidier anyway. Change 3809233 by Graeme.Thornton TBA: Misc changes to text asset commandlet - Rename mode to "loadsave" - Add -outputFormat option which can be assigned "text" or "binary" - When saving binary, use a differentiated filename so that source assets aren't overwritten Change 3809518 by Ben.Marsh Remove the outdated UnrealSync automation script. Change 3809643 by Steve.Robb GitHub #4277 : fix bug; FMath::FormatIntToHumanReadable 3rd comma and negative value #jira UE-53037 Change 3809862 by Steve.Robb GitHub #3342 : [FRotator.h] Fix to DecompressAxisFromByte to be more efficient and reflect its intent accurately #jira UE-42593 Change 3811190 by Graeme.Thornton Add support for writing specific log channels to their own files Change 3811197 by Graeme.Thornton Minor updates to output formatting and timing for the text asset commandlet Change 3811257 by Robert.Manuszewski Cluster creation will now be time-sliced Change 3811565 by Steve.Robb Define out non-monolithic module functions. Change 3812561 by Steve.Robb GitHub #3886 : Enable Brace-Initialization for Declaring Variables Incorrect semi-colon search removed after discussion with author. Test added. #jira UE-48242 Change 3812864 by Steve.Robb Removal of some unproven code which was supposed to fix hot reloading BP class functions in plugins. See: https://udn.unrealengine.com/questions/376978/aitask-blueprint-nodes-disappear-when-their-module.html #jira UE-53089 Change 3820358 by Ben.Marsh PR #4358: Incredibuild use ShowAgent by default (Contributed by projectgheist) Change 3822594 by Ben.Marsh UAT: Improvements to log file handling. - Always create log files in the final location, rather than writing to a temp directory and copying in later. - Now supports -Verbose and -VeryVerbose for increasing log verbosity, rather than -Verbose=XXX. - Keep a backlog of log output before the log system is initialized, and flush it to the log file once it is. - Allow buildmachines to specify the uebp_FinalLogFolder environment variable, which is used to form paths for display. When build machines copy log files elsewhere after UAT finishes (eg. a network share), this allows error messages to display the right location. Change 3823695 by Ben.Marsh UGS: Fix issue where precompiled binaries would not be shown as available for a change until scrolling the last submitted code change into the buffer (other symptoms, like de-focussing the main window would cause it to go back to an unavailable state, since the changes buffer was shrunk). Now always queries changes up to the last change for which zipped binaries are available. Change 3823845 by Ben.Marsh UBT: Exclude C# projects for unsupported platforms when generating project files. Change 3824180 by Ben.Marsh UGS: Add an option to show changes by build machines, and move the "only show reviewed" option in there too (Options > Show Changes). #jira Change 3825777 by Steve.Robb Fix to return value of StringToBytes. Change 3825810 by Ben.Marsh UBT: Reduce length of include paths for MSVC toolchain. Change 3825822 by Robert.Manuszewski Optimized PIE lazy pointer fixup. Should be up to 8x faster now. Change 3826734 by Ben.Marsh Remove code to disable TextureFormatAndroid on Linux. It seems to be an editor dependency. Change 3827730 by Steve.Robb Try to avoid decltype(auto) if it's not supported. See: https://udn.unrealengine.com/questions/395644/build-417-with-c11-on-linux-ttuple-errors.html Change 3827745 by Steve.Robb Initializer list support for TMap. Change 3827770 by Steve.Robb GitHub #4399 : Added a CONSTEXPR qualifiers to FVariant::GetType() #jira UE-53813 Change 3829189 by Ben.Marsh UBT: Now always writes a minimal log file. By default, just contains the regular console output and any reasons why actions are outdated and needed to be executed. UAT directs child UBT instances to output logs into its own log folder, so that build machines can save them off. Change 3830444 by Steve.Robb BuildVersion and ModuleManifest moved to Core, and parsing of these files reimplemented to avoid a JSON library. This should be revisited when Core has its own JSON library. Change 3830718 by Ben.Marsh Fix incorrect group name being returned by FStatNameAndInfo::GetGroupName() for stat groups. The editor populates the viewport stats list by calling this for every registered stat and stat group (via FLevelViewportCommands::HandleNewStatGroup). The menu entry attempts to show the stat name with STAT_XXX stripped from the start as the menu item label, with the free-form text description as a tooltip. For stat groups, the it would previously just return the stat group name as "Groups" (due to the raw naming convention of "//Groups//STATGROUP_Foo//..."). Since this didn't match the expected naming convention in FLevelViewportCommands::HandleNewStat (ie. STAT_XXX or STATGROUP_XXX), it would fail to add it. When the first actual stat belonging to that group is added, it would add a menu entry for the group based on that, but the stat description no longer makes sense as a tooltip for the group. As a result, all the editor tooltips were junk. #jira UE-53845 Change 3831064 by Ben.Marsh Fix log file contention when spawning UBT recursively. Change 3832654 by Ben.Marsh UGS: Fix error panel not being selected when opened, and weird alignment/color issues on it. Change 3832680 by Ben.Marsh UGS: Fix failing to detect workspace if synced to a different stream. Seems to be a regression caused by recent P4D upgrade. Change 3832695 by Ben.Marsh UGS: Invert the options in the 'Show Changes' submenu for simplicity. Change 3833528 by Ben.Marsh UAT: Script to rewrite source files with public include paths relative to the 'Public' folder. Usage is: RebasePublicIncludePaths -UpdateDir=<Dir> [-Project=<Dir>] [-Write]. Change 3833543 by Ben.Marsh UBT: Allow targets to opt-out of having public include paths added for every dependent module. This reduces the command line length when building a target, which has recently become a problem with larger games (due to Microsoft's compiler embedding the command line into each object file, with a maximum length of 64kb). All engine modules are compiled with this enabled; games may opt into it by setting bLegacyPublicIncludePaths = false; from their .target.cs, as may individual modules. Change 3834354 by Robert.Manuszewski Archetype pointer will now be cached to avoid locking the object tables when acquiring its info. It should also be faster this way regardless of any locks. #jira UE-52035 Change 3834400 by Robert.Manuszewski Fixing crash on exit caused by cached archetypes not being cleaned up before static exit cleanup. #jira UE-52035 Change 3834947 by Steve.Robb USE_FORMAT_STRING_TYPE_CHECKING removed from FMsg::Logf and FMsg::Logf_Internal. Change 3835004 by Ben.Marsh Fix code that relies on dubious behavior of requiring referenced "include path only" modules having their _API macros set to be empty, even if the module is actually implemented in a separate DLL. Change 3835340 by Ben.Marsh Fix errors making installed build from directories with spaces in the name. Change 3835972 by Ben.Marsh UBT: Improved diagnostic message for targets which don't need a version file. Change 3836019 by Ben.Marsh UBT: Fix warnings caused by defining linkage macros for third party libraries. Change 3836269 by Ben.Marsh Fix message box larger than the screen height being created when a large number of modules are incompatible on startup. Change 3836543 by Ben.Marsh Enable SoundMod plugin on Linux, since it's already supported through the editor. Change 3836546 by Ben.Marsh PR #4412: fix type mismatch (Contributed by nakapon) Change 3836805 by Ben.Marsh Fix commandlet to compile marketplace plugins. Change 3836829 by Ben.Marsh UBT: Fix ability to precompile plugins from installed engine builds. Change 3837036 by Ben.Marsh UBT: Write the previous and new contents of intermediate files to the log if they change. Makes it easier to debug unexpected rebuilds. Change 3837037 by Ben.Marsh UBT: Fix engine modules having inconsistent definitions depending on whether modules are only referenced for their include paths vs being linked into a binary (due to different _API macro). Change 3837040 by Ben.Marsh UBT: Remove code that initializes members in ModuleRules and TargetRules objects before the constructor is run. This is no longer necessary, now that the backwards-compatible default constructors have been removed. Change 3837247 by Ben.Marsh UBT: Remove UELinkerFixups module, now that plugins and precompiled modules do not require hacks to force initialization (since they're linked in as object files). Encryption and signing keys are now set via macros expanded from the IMPLEMENT_PRIMARY_GAME_MODULE macro, via project-specific macros added in the TargetRules constructor. Change 3837262 by Ben.Marsh UBT: Set whether a module is an engine module or not via a default value for the rules assembly. All non-program engine and enterprise modules are created with this flag set to true; program targets and modules are now created from a different assembly that sets it to false. This removes hacks from UEBuildModule needed to adjust behavior for different module types based on the directory containing the module. Also add a bUseBackwardsCompatibleDefaults flag to the TargetRules class, also initialized to a default value from a setting passed to the RulesAssembly constructor. This controls whether modules created for the target should be configured to allow breaking changes to default settings, and is set to false for all engine targets, and true for all project targets. Change 3837343 by Ben.Marsh UBT: Remove the OverrideExecutableFileExtension target property. Change the only current use for this (the MayaLiveLinkPlugin target) to use a post build step to copy the file instead. Change 3837356 by Ben.Marsh Fix invalid character encodings. Change 3837727 by Graeme.Thornton UnrealPak: KeyGenerator: Only generate prime table when required, not all the time Change 3837823 by Ben.Marsh UBT: Output warnings and errors when compiling module rules assembly in a way that allows them to be double-clicked in the Visual Studio output window. Change 3837831 by Graeme.Thornton UBT: When parsing crypto settings, always load legacy data first, then allow the new system to override it. Provides the same key backwards compatibility that the editor settings class gives Change 3837857 by Robert.Manuszewski PR #4404: Make FGCArrayPool singleton global instead of per-CU (Contributed by mhutch) Change 3837943 by Robert.Manuszewski PR #4405: Fix FGarbageCollectionTracer (Contributed by mhutch) Change 3838451 by Ben.Marsh UBT: Fix exceptions thrown on a background thread while caching C++ includes not being caught and logged correctly. Now captures exceptions and re-throws on the main thread. #jira UE-53996 Change 3839519 by Ben.Marsh UBT: Simplify configuring bPrecompile and bUsePrecompile settings for modules. Each rules assembly can now be configured as installed, which defaults the module rules it creates to use precompiled data. Change 3843790 by Graeme.Thornton UnrealPak: Log the size of all encrypted data Change 3844258 by Ben.Marsh Fix plugin compile failure when created via new plugin wizard. Passing -plugin on the command line is unnecessary, and is now reserved for packaging external plugins for the marketplace. Also extend the length of time that the error toast stays visible, and don't delete the plugin on failure. #jira UE-54157 Change 3845796 by Ben.Marsh Workaround for slow performance of String.EndsWith() on Mono. Change 3845823 by Ben.Marsh Fix case sensitive matching of platform names in -TargetPlatform=X argument to BuildCookRun. #jira UE-54123 Change 3845901 by Arciel.Rekman Linux: fix crash due to lambda lifetime issues (UE-54040). - The lambda goes out of scope in FBufferVisualizationMenuCommands::CreateVisualizationCommands, crashing the editor if compiled with a recent clang (5.0+). (Edigrating 3819174 to Dev-Core) Change 3846439 by Ben.Marsh Revert CL 3822742 to always call Process.WaitForExit(). The Android target platform module in the editor spawns ADB.EXE, which inherits the editor's stdout/stderr handles and forks itself. Process.WaitForExit() waits for EOF on those pipes, which never occurs because the forked process never terminates. Proper fix is probably to have the engine explicitly duplicate stdout/stderr handles for new pipes to output process, but too risky before copying up to Main. Change 3816608 by Ben.Marsh UBT: Use DirectoryReference objects for all include paths. Change 3816954 by Ben.Marsh UBT: Remove bIncludeDependentLibrariesInLibrary option. This is not widely supported by platform toolchains, and is not used anywhere. Change 3816986 by Ben.Marsh UBT: Remove UEBuildBinaryConfig; UEBuildBinary objects are now just created directly. Change 3816991 by Ben.Marsh UBT: Deprecate PlatformSpecificDynamicallyLoadedModules. We no longer have any special behavior for these modules. Change 3823090 by Ben.Marsh UAT: Improve logging for child UAT instances. - Calling RunUAT now requires an identifier for prefixing into the parent log, which is also used to determine the name of the log folder. - Stdout is no longer written to its own output file, since it's written to the parent stdout, the parent log file, and the child log file anyway. - Log folders for child UAT instances are left intact, rather than being copied to the parent folder. The derived names for the copied names were confusing and hard to read. - Output from UAT is no longer returned as a string. It should not be parsed anyway (but may be huge!). ProcessResult now supports running without capturing output. Change 3826082 by Ben.Marsh UBT: Add a check to make sure that all modules that are precompiled are correctly marked to enable it, even if they are part of the build target. Change 3827025 by Ben.Marsh UBT: Move the compile output directory into a property on the module, and explicitly pass it to the toolchain when compiling. Change 3829927 by James.Hopkin Made HTTP interface const correct Change 3833533 by Ben.Marsh Rewrite engine source files to base include paths relative to the "Public" directory. This allows reducing the number of public include paths that have to be added for engine modules. Change 3835826 by Ben.Marsh UBT: Precompiled targets now generate a separate manifest for each precompiled module, rather than adding object files to a library. This fixes issues where object files from static libraries would not be linked into a target if a symbol in them was not referenced. Change 3835969 by Ben.Marsh UBT: Fix cases where text is being written directly to the console rather than via logging functions. Change 3837777 by Steve.Robb Format string type checking added to FOutputDevice::Logf. Fixes for those. Change 3838569 by Steve.Robb Algo moved up a folder. [CL 3847482 by Ben Marsh in Main branch]
2018-01-20 11:19:29 -05:00
}