Ark Server API (ASA) - Wiki
|
#include <GenericPlatformMisc.h>
Public Member Functions | |
UE_DEPRECATED (4.18, "FPlatformMisc::ClipboardCopy() has been superseded by FPlatformApplicationMisc::ClipboardCopy()") static void ClipboardCopy(const TCHAR *Str) | |
UE_DEPRECATED (4.18, "FPlatformMisc::ClipboardPaste() has been superseded by FPlatformApplicationMisc::ClipboardPaste()") static void ClipboardPaste(class FString &Dest) | |
UE_DEPRECATED (4.18, "FPaths::SetOverrideGameDir() has been superseded by FPaths::SetOverrideProjectDir().") static FORCEINLINE void SetOverrideGameDir(const FString &InOverrideDir) | |
Static Protected Member Functions | |
static void | GetConfiguredCoreLimits (int32 PlatformNumPhysicalCores, int32 PlatformNumLogicalCores, bool &bOutFullyInitialized, int32 &OutPhysicalCoreLimit, int32 &OutLogicalCoreLimit, bool &bOutSetPhysicalCountToLogicalCount) |
Generic implementation for most platforms
Definition at line 535 of file GenericPlatformMisc.h.
add an additional root directory
Checks if platform wants to allow an audio thread on current device (note: does not imply it will, only if okay given other criteria met)
Definition at line 1115 of file GenericPlatformMisc.h.
Definition at line 808 of file GenericPlatformMisc.h.
Checks if platform wants to allow the thread heartbeat hang detection
Profiler enter background events. These are for timing backgrounding. Some platforms have a timeout for this
Definition at line 888 of file GenericPlatformMisc.h.
|
static |
|
static |
Platform specific function for adding a named event that can be viewed in external tool
|
inlinestatic |
Indicates the start of a frame for named events
Definition at line 893 of file GenericPlatformMisc.h.
Profiler color stack - this overrides the color for named events with undefined colors (e.g stat namedevents)
Definition at line 882 of file GenericPlatformMisc.h.
Function to store the current working directory for use with LaunchDir()
|
static |
Ensure that there enough space in the persistent download dir. Returns true if there is sufficient space. If there is insufficient space and bAttemptToUseUI is true, the function will return false and the user may be prompted to clear space
|
inlinestatic |
Definition at line 1803 of file GenericPlatformMisc.h.
Return the CloudDir. CloudDir can be per-user.
Handles Game Explorer, Firewall and FirstInstall commands, typically from the installer
Definition at line 1057 of file GenericPlatformMisc.h.
Create a new globally unique identifier.
|
inlinestatic |
Definition at line 877 of file GenericPlatformMisc.h.
|
inlinestatic |
Platform specific function for adding a named custom stat that can be viewed in external tool
Definition at line 876 of file GenericPlatformMisc.h.
|
inlinestatic |
Break into the debugger, if IsDebuggerPresent returns true, otherwise do nothing
Definition at line 675 of file GenericPlatformMisc.h.
|
static |
Deletes the given section and its contained values in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user
InStoreId | The name used to identify the store you want to use (eg, MyGame) |
InSectionName | The section to delete. |
|
static |
Deletes value for the given section and key in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user
InStoreId | The name used to identify the store you want to use (eg, MyGame) |
InSectionName | The section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo) |
InKeyName | The name of the key to set the value for |
Definition at line 1504 of file GenericPlatformMisc.h.
Definition at line 1876 of file GenericPlatformMisc.h.
Definition at line 1880 of file GenericPlatformMisc.h.
Platform specific function for closing a named event that can be viewed in external tool
Definition at line 883 of file GenericPlatformMisc.h.
|
inlinestatic |
Platform-specific Exec function
InWorld | World context |
Cmd | The command to execute |
Out | The output device to utilize |
Definition at line 1330 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1814 of file GenericPlatformMisc.h.
|
static |
Definition at line 1513 of file GenericPlatformMisc.h.
Return the GamePersistentDownloadDir. On some platforms, returns the writable directory for downloaded data that persists across play sessions. This dir is always per-game.
Return the temporary directory
get additional directories which can be considered as root directories
|
static |
|
static |
|
static |
Returns the allowed orientation of the device. This is NOT the same as GetDeviceOrientation, which only returns Portrait, LandscapeLeft, PortraitUpsideDown or LandscapeRight. The allowed orientation limits what orientation your device can have. So if you set the allowed orientation to LandscapeLeft, GetDeviceOrientation will only ever return LandscapeLeft. But if you set the allowed orientation to LandscapeSensor, you are actually restricting the allowed orientations to LandscapeLeft OR LandscapeRight (depending on the sensor), so GetDeviceOrientation might return LandscapeLeft OR LandscapeRight.
|
inlinestatic |
Gets the current battery level.
Definition at line 1432 of file GenericPlatformMisc.h.
|
inlinestatic |
Gets Blocking Input/Output stats covering the lifetime of the process
OutStats | Outputs the IO stats |
Flags | The type of IO stats to retrieve |
Definition at line 771 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1438 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1807 of file GenericPlatformMisc.h.
|
staticprotected |
Parse CoreLimit from CommandLine or from the SetCoreLimit value. The real number of physical cores and logical cores must be provided so that CommandLine arguments can be translated.
bOutFullyInitialized | True if commandline was available. If false, values are set to defaults. |
OutPhysicalCoreLimit | The maximum number of physical cores to report in NumberOfCores. Non-negative. 0 indicates unlimited. |
OutLogicalCoreLimit | The maximum number of logical cores to report in NumberOfCoresIncludingHyperthreads. Non-negative. 0 indicates unlimited. |
bOutSetPhysicalCountToLogicalCount | Whether NumberOfCores should be overridden to return NumberOfCoresIncludingHyperthreads. |
|
inlinestatic |
Gets Context Switch stats covering the lifetime of the process
OutStats | Outputs the Context Switch stats |
Flags | The type of Context Switch stats to retrieve |
Definition at line 783 of file GenericPlatformMisc.h.
|
static |
Gets the current mode of convertible laptops, i.e. Laptop or Tablet.
Uses cpuid instruction to get the CPU brand string
Returns the CPU chipset if known
On x86(-64) platforms, uses cpuid instruction to get the CPU signature
Bits 0-3 Stepping ID Bits 4-7 Model Bits 8-11 Family Bits 12-13 Processor type (Intel) / Reserved (AMD) Bits 14-15 Reserved Bits 16-19 Extended model Bits 20-27 Extended family Bits 28-31 Reserved
Uses cpuid instruction to get the vendor string
|
inlinestatic |
Gets the current crash handling type.
Definition at line 565 of file GenericPlatformMisc.h.
|
static |
Gets the default profile name. Used if there is no device profile specified
Get the default language (for localization) used by this platform.
Get the default locale (for internationalization) used by this platform.
Returns a unique string for device identification. Differs from the deprecated GetUniqueDeviceId in that there is no default implementation (which used unreliable Mac address determiniation). This code is expected to use platform-specific methods to identify the device.
WARNING: Use of this method in your app may imply technical certification requirments for your platform! For instance, consoles often require cert waivers to be in place before calling APIs that can track a device, so be very careful that you are following your platform's protocols for accessing device IDs. See the platform- specific implementations of this method for details on what APIs are used.
If you do not have permission to call this on one or more of your platforms, set GET_DEVICE_ID_UNAVAILABLE=1 in your build step to ensure that any calls that may be made to this API will simply return an empty string.
|
static |
Returns the current orientation of the device: will be either Portrait, LandscapeLeft, PortraitUpsideDown or LandscapeRight.
Returns the current device temperature level. Level is a relative value that is platform dependent. Lower is cooler, higher is warmer. Level of -1 means Unimplemented.
Returns the device volume if the device is capable of returning that information. -1 : Unknown 0 : Muted 100 : Full Volume
|
static |
Retrieves information about the total number of bytes and number of free bytes for the specified disk path.
Get a string description of the mode the engine was running in.
Retrieve a environment variable from the system
VariableName | The name of the variable (ie "Path") |
Get the Epic account ID for the user who last used the Launcher.
Note: This function is for Epic internal use only. Do not use.
|
static |
Retrieve the Mac address of the current adapter as a hashed string (privacy). This generally relies on GetMacAddress() being implemented for the platform, if possible.
|
inlinestatic |
Definition at line 845 of file GenericPlatformMisc.h.
Returns the currency code associated with the device's locale
Returns the currency symbol associated with the device's locale
Returns a unique string associated with the login account of the current machine. Implemented using persistent storage like the registry on window (using HKCU), so is susceptible to anything that could reset or revert that storage if the ID is created, which is generally during install or first run of the app.
Note: This is NOT a user or machine fingerprint, as multiple logins on the same machine will not share the same ID, and it is not based on the hardware of the user. It is completely random and non-identifiable.
Retrieve the Mac address of the current adapter. This is generally platform-dependent code that other platforms must implement.
Retrieve the Mac address of the current adapter as a string. This generally relies on GetMacAddress() being implemented for the platform, if possible.
Get (or create) the unique ID used to identify this computer. This is sort of a misnomer, as there will actually be one per user account on the operating system. This is NOT based on a machine fingerprint.
|
inlinestatic |
Returns the maximum length of a path
Definition at line 592 of file GenericPlatformMisc.h.
retrieves the current maximum refresh rate supported by the platform
Definition at line 1834 of file GenericPlatformMisc.h.
retrieves the maximum refresh rate supported by the platform
Definition at line 1842 of file GenericPlatformMisc.h.
Returns the platform's maximum allowed value for rhi.SyncInterval
Definition at line 1850 of file GenericPlatformMisc.h.
|
static |
Returns the current status for the network connection
|
inlinestatic |
Returns whether WiFi connection is currently active
Definition at line 1559 of file GenericPlatformMisc.h.
|
inlinestatic |
Returns any platform-specific key-value data that needs to be sent to the network file server
Definition at line 1822 of file GenericPlatformMisc.h.
Determines the shader format for the platform
|
static |
Gets a globally unique ID the represents a particular operating system install.
Gets a string representing the numeric OS version (as opposed to a translated OS version that GetOSVersions returns). The returned string should try to be brief and avoid newlines and symbols, but there's technically no restriction on the string it can return. If the implementation does not support this, it should return an empty string.
|
static |
Gets the OS Version and OS Subversion.
|
inlinestatic |
Gets Page Fault stats covering the lifetime of the process
OutStats | Outputs the page fault stats |
Flags | The type of page fault stats to retrieve |
Definition at line 759 of file GenericPlatformMisc.h.
return the delimiter between paths in the PATH environment variable.
|
static |
Returns the platform specific chunk based install interface
|
static |
Returns the platform specific compression interface
Return the name of the platform features module. Can be nullptr if there are no extra features for this platform
Definition at line 1162 of file GenericPlatformMisc.h.
|
static |
Returns the platform specific interface for communication with processes running on the host pc.
|
inlinestatic |
Returns any platform specific warning messages we want printed on screen
Definition at line 1896 of file GenericPlatformMisc.h.
|
inlinestatic |
Return the platform specific async IO system, or nullptr if the standard one should be used.
Definition at line 1156 of file GenericPlatformMisc.h.
|
static |
Returns an array of the user's preferred languages in order of preference
|
static |
Returns non-zero if a performance-sensitive diagnostic, like a memory sanitizer, is detected for this process
|
static |
|
static |
Generates the SHA256 signature of the given data.
Data | Pointer to the beginning of the data to hash |
Bytesize | Size of the data to has, in bytes. |
OutSignature | Output Structure to hold the computed signature. |
|
static |
Get the value for the given section and key from the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user
InStoreId | The name used to identify the store you want to use (eg, MyGame) |
InSectionName | The section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo) |
InKeyName | The name of the key to get the value for |
OutValue | The value found |
|
static |
Returns the last system error code in string form. NOTE: Only one return value is valid at a time!
OutBuffer | the buffer to be filled with the error message |
BufferLength | the size of the buffer in character count |
Error | the error code to convert to string form |
Get the timezone identifier for this platform, or an empty string if the default timezone calculation will work.
Returns a unique string for advertising identification
|
static |
Returns whether the platform wants to use a touch screen for virtual joysticks.
Definition at line 1483 of file GenericPlatformMisc.h.
|
static |
Return an ordered list of target platforms this runtime can support (ie Android_DXT, Android would mean that it prefers Android_DXT, but can use Android as well)
Definition at line 1524 of file GenericPlatformMisc.h.
Returns whether WiFi connection is currently active
Definition at line 1541 of file GenericPlatformMisc.h.
Determines if a warning handler has been set
Definition at line 840 of file GenericPlatformMisc.h.
Returns whether the given platform feature is currently available (for instance, Metal is only available in IOS8 and with A7 devices)
Definition at line 1576 of file GenericPlatformMisc.h.
Return true if the PersistentDownloadDir is available. On some platforms, a writable directory might not be available by default. Using this function allows handling that case early.
Definition at line 1200 of file GenericPlatformMisc.h.
Whether the platform has a separate debug channel to stdout (eg. OutputDebugString on Windows). Used to suppress messages being output twice if both go to the same place.
Returns whether the platform has variable hardware (configurable/upgradeable system).
Definition at line 1567 of file GenericPlatformMisc.h.
Definition at line 1793 of file GenericPlatformMisc.h.
|
inlinestatic |
Platform specific function for initializing storage of tagged memory buffers
Definition at line 900 of file GenericPlatformMisc.h.
|
inlinestatic |
Detects whether we're running in a 64-bit operating system.
Definition at line 1067 of file GenericPlatformMisc.h.
For platforms that support cache storage functionality, setting a directory for it when it's not available can result in errors. This method's purpose is to be overridden in such platforms, with logic that checks if said cache is available. In all other platforms without this constraint, it should return true by default.
Definition at line 798 of file GenericPlatformMisc.h.
|
inlinestatic |
Return true if a debugger is present
Definition at line 661 of file GenericPlatformMisc.h.
Allows disabling ensure()s without rebuilding the binary, by either a commandline switch or a hotfix.
Definition at line 1364 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1441 of file GenericPlatformMisc.h.
Whether LocalPrint can be called from any thread without overlapping
Definition at line 988 of file GenericPlatformMisc.h.
Whether LowLevelOutputDebugString[f] can receive structured output as lines of JSON.
Definition at line 1276 of file GenericPlatformMisc.h.
Returns whether or not the device has been registered to receive remote notifications.
Check to see if the platform is being viewed remotely. In such a mode we should aim to minimize screen refresh to get the best performance on the remote viewer
Definition at line 655 of file GenericPlatformMisc.h.
Return if the game is running on cloud server
Definition at line 1871 of file GenericPlatformMisc.h.
Returns whether the platform is running on battery power or not.
Checks structure of the path against platform formatting requirements
return true if path is formatted validly
Definition at line 1077 of file GenericPlatformMisc.h.
Get the directory the application was launched from (useful for commandline utilities)
|
static |
Loads a text file relative to the package root on platforms that distribute apps in package formats. For other platforms, the path is relative to the root directory.
Prints string to the default output
Sends a message to a remote tool, and debugger consoles
|
static |
|
static |
Enforces strict memory load/store ordering across the memory barrier call.
|
static |
Show a message box if possible, otherwise print a message and return the default
MsgType | What sort of options are provided |
Text | Specific message |
Caption | String indicating the title of the message box |
Platform-specific normalization of path E.g. on Linux/Unix platforms, replaces ~ with user home directory, so ~/.config becomes /home/joe/.config (or /Users/Joe/.config)
Definition at line 1086 of file GenericPlatformMisc.h.
|
inlinestatic |
Platform-specific normalization of path E.g. on Linux/Unix platforms, replaces ~ with user home directory, so ~/.config becomes /home/joe/.config (or /Users/Joe/.config)
Definition at line 1094 of file GenericPlatformMisc.h.
return the number of logical CPU cores
Return the number of worker threads we should spawn to service IO, NOT based on number of cores
Return the number of worker threads we should spawn, based on number of cores
|
inlinestatic |
Has the OS execute a command and path pair (such as launch a browser)
ComandType | OS hint as to the type of command |
Command | the command to execute |
CommandLine | the commands to pass to the executable |
Definition at line 1268 of file GenericPlatformMisc.h.
|
static |
|
inlinestatic |
Called to dismiss splash screen
Definition at line 546 of file GenericPlatformMisc.h.
Definition at line 541 of file GenericPlatformMisc.h.
Called during appInit() after cmd line setup
Called during AppExit(). Log, Config still exist at this point, but not much else does.
Definition at line 551 of file GenericPlatformMisc.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 1400 of file GenericPlatformMisc.h.
|
inlinestatic |
|
inlinestatic |
For mobile devices, this will crank up a haptic engine for the specified type to be played later with TriggerMobileHaptics If this is called again before Release, it will switch to this type
Definition at line 1718 of file GenericPlatformMisc.h.
Definition at line 1381 of file GenericPlatformMisc.h.
Pumps app messages only if there are essential keep-alive messages pending. This function called from time-sensitive parts of the code and should take minimal time if there are no essential messages waiting
Definition at line 1789 of file GenericPlatformMisc.h.
Definition at line 1782 of file GenericPlatformMisc.h.
Definition at line 1778 of file GenericPlatformMisc.h.
Requests permission to send remote notifications to the user's device.
For mobile devices, this will shutdown the haptics, allowing system to put it to reset as needed
Definition at line 1733 of file GenericPlatformMisc.h.
|
static |
Requests application exit.
Force | If true, perform immediate exit (dangerous because config code isn't flushed, etc). If false, request clean main-loop exit from the platform specific code. |
Requests application exit with a specified return code. Name is different from RequestExit() so overloads of just one of functions are possible.
Force | If true, perform immediate exit (dangerous because config code isn't flushed, etc). If false, request clean main-loop exit from the platform specific code. |
ReturnCode | This value will be returned from the program (on the platforms where it's possible). Limited to 0-255 to conform with POSIX. |
Requests application to restart appending the passed in CmdLine to the restart
|
static |
Change the allowed orientation of the device.
|
inlinestatic |
Definition at line 1437 of file GenericPlatformMisc.h.
|
inlinestatic |
Installs handler for the unexpected (due to error) termination of the program, including, but not limited to, crashes.
Definition at line 560 of file GenericPlatformMisc.h.
|
inlinestatic |
Sets the type of crash handling done by the engine. Returns the new crash handling type. If disabling crash handling make sure an alternative is active since threads that crash will just disappear.
Definition at line 571 of file GenericPlatformMisc.h.
|
static |
Change the orientation of the device.
|
static |
Sets an environment variable to the local process's environment
VariableName | The name of the variable (ie "Path") |
Value | The string to set the variable to. |
Set/restore the Console Interrupt (Control-C, Control-Break, Close) handler.
Definition at line 554 of file GenericPlatformMisc.h.
Definition at line 850 of file GenericPlatformMisc.h.
|
inlinestatic |
Set a handler to be called when there is a memory warning from the OS
Handler | The handler to call |
Definition at line 833 of file GenericPlatformMisc.h.
|
static |
Updates the current status for the network connection
Allows a game/program/etc to control the game directory in a special place (for instance, monolithic programs that don't have .uprojects)
|
inlinestatic |
Definition at line 1345 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1350 of file GenericPlatformMisc.h.
|
static |
Set the value for the given section and key in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user
InStoreId | The name used to identify the store you want to use (eg, MyGame) |
InSectionName | The section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo) |
InKeyName | The name of the key to set the value for |
InValue | The value to set |
|
static |
Set the value for the given section and key in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user
InStoreId | The name used to identify the store you want to use (eg, MyGame) |
InSectionName | The section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo) |
InKeyValues | The mapping of key->value pairs to set |
Definition at line 1887 of file GenericPlatformMisc.h.
Definition at line 1532 of file GenericPlatformMisc.h.
|
inlinestatic |
Perform a mobile-style sharing of a URL. Will use native UI to display sharing target
Definition at line 1740 of file GenericPlatformMisc.h.
|
inlinestatic |
Allows platform at runtime to disable unsupported plugins
PluginName | Name of enabled plugin to consider |
Definition at line 1709 of file GenericPlatformMisc.h.
Definition at line 1498 of file GenericPlatformMisc.h.
|
inlinestatic |
Platform specific function for freeing storage of tagged memory buffers
Definition at line 907 of file GenericPlatformMisc.h.
|
static |
Stats logging for named event
|
static |
Submits a crash report to a central server (release builds only)
|
inlinestatic |
Definition at line 1826 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1439 of file GenericPlatformMisc.h.
Definition at line 1744 of file GenericPlatformMisc.h.
Definition at line 1493 of file GenericPlatformMisc.h.
Platform can generate a full-memory crashdump during crash handling.
Definition at line 818 of file GenericPlatformMisc.h.
Definition at line 803 of file GenericPlatformMisc.h.
Definition at line 788 of file GenericPlatformMisc.h.
Definition at line 1339 of file GenericPlatformMisc.h.
Definition at line 1488 of file GenericPlatformMisc.h.
|
inlinestatic |
Platform specific function for tagging a memory buffer with a label. Helps see memory access in profilers
Definition at line 914 of file GenericPlatformMisc.h.
Frees any memory retained by FGenericPlatformMisc.
Ticks values that can be hotfixable in the config.
For mobile devices, this will kick the haptic type that was set in PrepareMobileHaptics. It can be called multiple times with only a single call to Prepare
Definition at line 1726 of file GenericPlatformMisc.h.
|
inline |
FGenericPlatformMisc::UE_DEPRECATED | ( | 4. | 18, |
"FPlatformMisc::ClipboardCopy() has been superseded by FPlatformApplicationMisc::ClipboardCopy()" | ) const |
Copies text to the operating system clipboard.
FGenericPlatformMisc::UE_DEPRECATED | ( | 4. | 18, |
"FPlatformMisc::ClipboardPaste() has been superseded by FPlatformApplicationMisc::ClipboardPaste()" | ) & |
Pastes in text from the operating system clipboard.
Requests unregistering from receiving remote notifications on the user's device.
Updates hotfixable ensure settings from config and commandline (config takes priority).
Definition at line 1373 of file GenericPlatformMisc.h.
|
inlinestatic |
Definition at line 1798 of file GenericPlatformMisc.h.
Checks if platform wants to use a rendering thread on current device
|
staticprotected |
Definition at line 1908 of file GenericPlatformMisc.h.
|
staticprotected |
Whether the user should be prompted to allow for a remote debugger to be attached on an ensure
Definition at line 1905 of file GenericPlatformMisc.h.
|
staticprotected |
Whether the user should be prompted to allow for a remote debugger to be attached
Definition at line 1903 of file GenericPlatformMisc.h.
|
staticprotected |
Definition at line 1910 of file GenericPlatformMisc.h.