2019-12-26 14:45:42 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "SocketSubsystemIOS.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 "SocketSubsystemModule.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 "Modules/ModuleManager.h"
|
2018-07-20 11:36:48 -04:00
|
|
|
#include "SocketsBSDIOS.h"
|
|
|
|
|
#include "IPAddressBSDIOS.h"
|
2019-01-30 18:48:01 -05:00
|
|
|
#include <net/if.h>
|
|
|
|
|
#include <ifaddrs.h>
|
2018-07-20 11:36:48 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
FSocketSubsystemIOS* FSocketSubsystemIOS::SocketSingleton = NULL;
|
|
|
|
|
|
2019-01-30 18:48:01 -05:00
|
|
|
class FSocketBSD* FSocketSubsystemIOS::InternalBSDSocketFactory(SOCKET Socket, ESocketType SocketType, const FString& SocketDescription, const FName& SocketProtocol)
|
2017-09-25 14:08:25 -04:00
|
|
|
{
|
|
|
|
|
UE_LOG(LogIOS, Log, TEXT(" FSocketSubsystemIOS::InternalBSDSocketFactory"));
|
2018-10-24 17:19:33 -04:00
|
|
|
return new FSocketBSDIOS(Socket, SocketType, SocketDescription, SocketProtocol, this);
|
2017-09-25 14:08:25 -04:00
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
FName CreateSocketSubsystem( FSocketSubsystemModule& SocketSubsystemModule )
|
|
|
|
|
{
|
|
|
|
|
FName SubsystemName(TEXT("IOS"));
|
|
|
|
|
// Create and register our singleton factor with the main online subsystem for easy access
|
|
|
|
|
FSocketSubsystemIOS* SocketSubsystem = FSocketSubsystemIOS::Create();
|
|
|
|
|
FString Error;
|
|
|
|
|
if (SocketSubsystem->Init(Error))
|
|
|
|
|
{
|
|
|
|
|
SocketSubsystemModule.RegisterSocketSubsystem(SubsystemName, SocketSubsystem);
|
|
|
|
|
return SubsystemName;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FSocketSubsystemIOS::Destroy();
|
|
|
|
|
return NAME_None;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DestroySocketSubsystem( FSocketSubsystemModule& SocketSubsystemModule )
|
|
|
|
|
{
|
|
|
|
|
SocketSubsystemModule.UnregisterSocketSubsystem(FName(TEXT("IOS")));
|
|
|
|
|
FSocketSubsystemIOS::Destroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FSocketSubsystemIOS* FSocketSubsystemIOS::Create()
|
|
|
|
|
{
|
|
|
|
|
if (SocketSingleton == NULL)
|
|
|
|
|
{
|
|
|
|
|
SocketSingleton = new FSocketSubsystemIOS();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SocketSingleton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FSocketSubsystemIOS::Destroy()
|
|
|
|
|
{
|
|
|
|
|
if (SocketSingleton != NULL)
|
|
|
|
|
{
|
|
|
|
|
SocketSingleton->Shutdown();
|
|
|
|
|
delete SocketSingleton;
|
|
|
|
|
SocketSingleton = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FSocketSubsystemIOS::Init(FString& Error)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FSocketSubsystemIOS::Shutdown(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool FSocketSubsystemIOS::HasNetworkDevice()
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 18:48:01 -05:00
|
|
|
FSocket* FSocketSubsystemIOS::CreateSocket(const FName& SocketType, const FString& SocketDescription, const FName& ProtocolType)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2018-09-10 20:35:09 -04:00
|
|
|
FSocketBSD* NewSocket = (FSocketBSD*)FSocketSubsystemBSD::CreateSocket(SocketType, SocketDescription, ProtocolType);
|
2014-03-14 14:13:41 -04:00
|
|
|
if (NewSocket)
|
|
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
NewSocket->SetIPv6Only(false);
|
Copying //UE4/Dev-Platform to //UE4/Dev-Main (Source: //UE4/Dev-Platform @ 3233741)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
[NOTE: Switch changes have been removed from this list, and will be in a comment in //UE4/Main/Engine/Build/Switch/SwitchChanges.txt]
Change 3207431 on 2016/11/22 by Keith.Judge
Make VectorSign on XB1 match (incorrect) SSE implementation rather than the reference FPU implementation. Too many things seem to rely on this to change the default behaviour now.
#jira UE-36921
#jira UE-38560
Change 3208206 on 2016/11/22 by Josh.Adams
- Changed plugins upgrading a content-only project to code-based, even if the modules inside aren't compiled for the current platform. There are issues with runtime not knowing the plugin isn't needed. The proper way is to non-whitelist the platform in the project, not in the modules, if you don't want it to upgrade the project. See the comments in this change for more info.
#jira UE-38929
Change 3209137 on 2016/11/23 by Alicia.Cano
Add a check to iOS tool chain for exception flag
#jira UE-36528
#ios
Change 3209296 on 2016/11/23 by Ben.Marsh
Always send build failure notifications in Dev-Platform to Will.Fissler@epicgames.com and Owen.Stupka@epicgames.com
Change 3211316 on 2016/11/28 by Joe.Barnes
Fix some typos
Change 3211318 on 2016/11/28 by Joe.Barnes
Fix wrong function name in header file. Didn't match actual function name in RenderingThread.cpp
Change 3213227 on 2016/11/29 by Dmitry.Rekman
Add -fPIC to libwebsockets on Linux.
Change 3213463 on 2016/11/29 by Nick.Shin
helper build scripts for CentOS 7 Linux (via Docker)
LINUX: pull source and compile: zlib openssl libcurl & libwebsockets
using [ glibc 2.17 ] & [ gcc 4.8.5 ]
Docker creates an image (that is essentially a CentOS box) and runs the build script within that environment (called a container). think of this as a VM -- but waaaaaaay better -- nothing is virtualized -- it's all on the metal.
#jira UEPLAT-1246 - Update libWebsockets
#jira UEPLAT-1221 - update websocket library
#jira UEPLAT-1203 - Add Linux library for libwebsockets
#jira UEPLAT-1204 - Rebuild libwebsockets with SSL
Change 3213939 on 2016/11/29 by Michael.Trepka
Ignore parent widget's geometry scale when showing a popup menu in a separate window
#jira UE-38706
Change 3215583 on 2016/11/30 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
Change 3216345 on 2016/11/30 by Josh.Adams
Better fix for poison proxy fix
Change 3217106 on 2016/12/01 by Michael.Trepka
Fixed a crash caused by an attempt to use FPlayWorldCommands::GlobalPlayWorldActions before it's initialized when showing suppressable warning dialogs in UEditorEngine::UpdateAutoLoadProject()
#jira UE-38816
Change 3217223 on 2016/12/01 by Josh.Adams
- Fixed some TEXT macro warnings that crept in from IWYU changes
Change 3217253 on 2016/12/01 by Dmitry.Rekman
Linux: fix GL crash (UE-17649).
- Making sure all streams are set up. Fix by Cengiz.
Change 3217473 on 2016/12/01 by Daniel.Lamb
Fixed a case when we load a map it might not have it's sublevels loaded because it's not treated like a map.
#test cook run QAGame
Change 3217588 on 2016/12/01 by Peter.Sauerbrei
Pull in IPv6 fix
Change 3217654 on 2016/12/01 by Michael.Trepka
Changed the Mac-specific high DPI code to use system backingScaleFactor only if NSHighResolutionCapable in Info.plist is set to true. This solves the problem with macOS Sierra giving us actual backingScaleFactor values even in low DPI modes.
Change 3217873 on 2016/12/01 by Josh.Adams
- Added some logging to a tvOS assert, since debugging it right away is tricky
Change 3218097 on 2016/12/01 by Josh.Adams
- Fixed up the Switch MediaFramework, making editor better, etc
- ALso changed PS4 and Xbox plugins to be enabled by default by having two entries in the plugin module for the Factory modules (an editor only entry, and a platform specific runtime entry... this will make it so that UE4Game.exe won't ahve it compiled in, even with it enabled by default)
Change 3218133 on 2016/12/01 by Dmitry.Rekman
Linux: report server hangs by crashing the hung thread (UE-39164).
Change 3218512 on 2016/12/01 by Josh.Adams
- Made the MfMedia plugin to be distributable in public builds, since it's for Windows and Xbox
Change 3219804 on 2016/12/02 by Dmitry.Rekman
Linux: fix project settings crash (UE-38800).
- Also submitted as a pull request #2945.
Change 3220027 on 2016/12/02 by Nick.Shin
plow all physx libs into build
NOTE: most browsers will not function
- chrome and firefox nightly only works
checking this in as per email
#jira UE-38323 VehicleTemplate Vehicle does not move in HTML5
Change 3221620 on 2016/12/05 by Joe.Barnes
UE-37275 - Temporary workaround for log lines losing carriage returns. Add's a \n when outputting lines if there isn't one at the end.
Change 3221689 on 2016/12/05 by Dmitry.Rekman
Attempt to change/rename.
Change 3221700 on 2016/12/05 by Dmitry.Rekman
Another attempt to change renamed file (from Linux).
Change 3221731 on 2016/12/05 by Michael.Trepka
Added missing initialization for FAvfVideoSampler::MetalTextureCache
#jira UE-38689
Change 3221792 on 2016/12/05 by Michael.Trepka
Fixed a crash in FMetalDynamicRHI::RHIAsyncReallocateTexture2D for PVRTC2 textures
Change 3222675 on 2016/12/05 by Josh.Adams
- Removed some resolution setting junk that was recently added to PlatformerGame - settings resolution on AppleTV is bad, it doesn't need to change resolution on non-desktop platforms
#jira UE-39188
Change 3223546 on 2016/12/06 by Brent.Pease
+ Properly set and use the realtime compression for ios.
+ Reduce unused memory on ios from the precached first buffer
+ Fix a resource tracking issue that was causing a double free on the sound buffer
Change 3223785 on 2016/12/06 by Brent.Pease
+ Add support for iPhone7 (implemented by peter.sauerbrei, merged in from WEX)
#jira ue-38701
Change 3224314 on 2016/12/06 by Chris.Babcock
Send OnTargetPlatformChangedSupportedFormats when format changed in Android project settings in editor
#jira UE-38361
#ue4
#android
Change 3225367 on 2016/12/07 by Josh.Adams
- Added FKey::Virtual_Accept and Virtual_Back, which will map to FaceButton Right/Down appropriately based on platform (Switch swaps them)
- Made changes to ShooterGame and VehicleGame for Virtual_Accept and Back
- Added some icons for ShooterGame, and changed some text blocks to SRichTextBlock to insert the icons
Change 3225426 on 2016/12/07 by Chris.Babcock
Add missing Android UPL file for binary builds
#jira UE-39420
#ue4
#android
Change 3225471 on 2016/12/07 by Dmitry.Rekman
Update all platforms to C++14.
Change 3225525 on 2016/12/07 by Nick.Shin
Cook-On-The-Fly for HTML5
- re-enabled: ENetworkFileServerProtocol::NFSP_Http
- cleaned up port numbers used with cook-on-the-fly situations
- fixed null_ptr in NetworkFileServerHttp.cpp
- fix CORS issue with HTML5LaunchHelper (not really needed -- but doesn't hurt to have it in the test server)
- finally, the core of the jira issue:
o fix serialization bug: do not append zero sized data
o fix de-serialization bug: removed double insertion of packet "Marker and Size" header
#jira UE-38281 Quicklaunch UFE HTML5 fails to get COTF Header Size
Change 3225690 on 2016/12/07 by Dmitry.Rekman
Linux: improvements in touch support.
- Multiple fingers.
- Filtering out "moved" events from the same location.
- Consistent logging.
(Edigrating 3225194 from Wombat to Dev-Platform)
Change 3225868 on 2016/12/07 by Josh.Stoddard
Gracefully handle delete without matching new on iOS & Mac
#jira UE-39395
Change 3226159 on 2016/12/07 by Omar.Rodriguez
UEPLAT-1423 WEX: Improved virtual keyboard for Android
* Renamed old virtual keyboard functions by adding "Dialog" suffix to the name
* Added new virtual keyboard functions that use InputMethodManager to show/hide keyboard
* Hide the virtual keyboard, if shown, onPause
* Slate edit box decides which functions to call for showing/hiding keyboard
- eventually will be based on command line parameter like in IOS
#jira UEPLAT-1423
Change 3226167 on 2016/12/07 by Dmitry.Rekman
Allow running as root on ARM.
(Edigrating 3204974 to Dev-Platform)
Change 3226168 on 2016/12/07 by Dmitry.Rekman
Print current CVar value when denying an override.
(Based on CL 3205476).
Change 3226169 on 2016/12/07 by Dmitry.Rekman
Allow enabling sound (if disabled by default).
(Based on CL 3205505)
Change 3226171 on 2016/12/07 by Dmitry.Rekman
Allow running from symlinks.
(Edigrating 3205518 to Dev-Platform).
Change 3226174 on 2016/12/07 by Dmitry.Rekman
Linux: do not init SDL audio (we do not use it anyway).
(Based on CL 3205505).
Change 3226327 on 2016/12/07 by Nick.Shin
fix CIS warning
#jira UE-38281 Quicklaunch UFE HTML5 fails to get COTF Header Size
Change 3226506 on 2016/12/08 by Dmitry.Rekman
Fix one more case-sensitive misspelling (UE-39030).
- Submitted as part of PR #2976.
Change 3226542 on 2016/12/08 by Dmitry.Rekman
Linux: fix weirdness with tesselation in GL4 (UE-32865).
- Workaround by CengizT. Proper fix tracked as UE-39489.
Change 3226570 on 2016/12/08 by Dmitry.Rekman
Fix for ar failing due to too long command line (UE-39009).
- Based on PR #2973.
Change 3226575 on 2016/12/08 by Dmitry.Rekman
Add build-essential to dependencies (UE-39053).
- PR #2981 contributed by cpyarger.
Change 3227129 on 2016/12/08 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
Fixed up a deferred GL error as well
Fixed some copyrights of files not in main
Change 3227260 on 2016/12/08 by Omar.Rodriguez
UE-39140 Projects with iCloud are failing provisioning check when code signing.
* Set default value of bEnableCloudKitSupport to False
* Set value of get-task-allow to true only on non-distribution builds
* Only write out the entitlements file if changes have been made
#jira UE-39140
Change 3229312 on 2016/12/09 by Dmitry.Rekman
Fix missing responses (UE-39572).
- Proper implementation of UE-39009.
Change 3230849 on 2016/12/12 by Dmitry.Rekman
Linux: fixed Android packaging (UE-39635).
- Misspelled case; fixed by JohnHenry Carawon.
#jira UE-39635
Change 3231591 on 2016/12/12 by Peter.Sauerbrei
fix for splash screen not being turned off by default
#jira UE-39591
Change 3231880 on 2016/12/12 by Josh.Adams
- Fixing StaticAnalysis warnings, but -enablecodeanalysis stopped working for some reason, and the /Zm thing has hit me really hard, so this is a hopeful checkin for static analysis issues
#jira UE-39680
Change 3232816 on 2016/12/13 by Dmitry.Rekman
Linux: fix for CEF (UE-39682)
- Fix by Cengiz.Terzibas.
Change 3232873 on 2016/12/13 by Josh.Adams
Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform)
Change 3232933 on 2016/12/13 by Josh.Adams
- Missed the files that were needed to fix up after merge from main, but didn';t come from main
Change 3233066 on 2016/12/13 by Ben.Marsh
UBT: Ignore exception if PATH variable contains invalid characters when looking for XGE.
Change 3233512 on 2016/12/13 by Ben.Marsh
Fix static analysis warnings.
[CL 3233813 by Josh Adams in Main branch]
2016-12-13 19:47:16 -05:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
// disable the SIGPIPE exception
|
|
|
|
|
int bAllow = 1;
|
|
|
|
|
setsockopt(NewSocket->GetNativeSocket(), SOL_SOCKET, SO_NOSIGPIPE, &bAllow, sizeof(bAllow));
|
|
|
|
|
}
|
|
|
|
|
return NewSocket;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
/** Priority values for iOS adapters. */
|
|
|
|
|
enum class EAdapterPriorityValues : uint8
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
None = 0,
|
|
|
|
|
IPv6Wifi = 1,
|
|
|
|
|
IPv4Wifi = 2,
|
|
|
|
|
IPv6Cell = 3,
|
|
|
|
|
IPv4Cell = 4,
|
|
|
|
|
};
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
/** Helper struct to sort our adapters based off of interface information */
|
|
|
|
|
struct FSortedPriorityAddresses
|
|
|
|
|
{
|
|
|
|
|
FSortedPriorityAddresses(FSocketSubsystemIOS* SocketSub) :
|
|
|
|
|
Priority(EAdapterPriorityValues::None)
|
|
|
|
|
{
|
|
|
|
|
Address = StaticCastSharedRef<FInternetAddrBSDIOS>(SocketSub->CreateInternetAddr());
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
TSharedPtr<FInternetAddrBSDIOS> Address;
|
|
|
|
|
EAdapterPriorityValues Priority;
|
|
|
|
|
FString InterfaceName;
|
|
|
|
|
|
|
|
|
|
bool operator<(const FSortedPriorityAddresses& Other) const
|
|
|
|
|
{
|
|
|
|
|
// Lower values are better than higher values
|
|
|
|
|
return Priority < Other.Priority;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FString ToString() const
|
|
|
|
|
{
|
|
|
|
|
FString AdapterPriorityValue;
|
|
|
|
|
switch (Priority)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case EAdapterPriorityValues::None:
|
|
|
|
|
AdapterPriorityValue = TEXT("Invalid/Any");
|
|
|
|
|
break;
|
|
|
|
|
case EAdapterPriorityValues::IPv6Wifi:
|
|
|
|
|
AdapterPriorityValue = TEXT("IPv6 Wifi");
|
|
|
|
|
break;
|
|
|
|
|
case EAdapterPriorityValues::IPv6Cell:
|
|
|
|
|
AdapterPriorityValue = TEXT("IPv6 Cell");
|
|
|
|
|
break;
|
|
|
|
|
case EAdapterPriorityValues::IPv4Wifi:
|
|
|
|
|
AdapterPriorityValue = TEXT("IPv4 Wifi");
|
|
|
|
|
break;
|
|
|
|
|
case EAdapterPriorityValues::IPv4Cell:
|
|
|
|
|
AdapterPriorityValue = TEXT("IPv4 Cell");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FString::Printf(TEXT("%s [Interface: %s] %s (%d)"), *Address->ToString(true), *InterfaceName, *AdapterPriorityValue, (int32)Priority);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bool FSocketSubsystemIOS::GetLocalAdapterAddresses(TArray<TSharedPtr<FInternetAddr>>& OutAddresses)
|
|
|
|
|
{
|
|
|
|
|
// Since getifaddrs does not return the addresses in a sorted priority list, we need to do that ourselves.
|
|
|
|
|
// This does lead to us processing a lot of information, however we get a massive benefit in making sure the adapters we use are the best
|
|
|
|
|
TArray<FSortedPriorityAddresses> SortedAddresses;
|
|
|
|
|
|
|
|
|
|
// Grow the array to a largish size. We don't know how many interfaces we could have, and there's no way to tell ahead of time.
|
|
|
|
|
SortedAddresses.Reserve(12);
|
|
|
|
|
|
|
|
|
|
// Get all of the addresses this device has
|
|
|
|
|
ifaddrs* Interfaces = nullptr;
|
2018-06-07 22:39:07 -04:00
|
|
|
if (getifaddrs(&Interfaces) == 0)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
// Loop through linked list of interfaces
|
2020-01-31 18:46:22 -05:00
|
|
|
for (ifaddrs* Travel = Interfaces; Travel != nullptr; Travel = Travel->ifa_next)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
// Skip over anything that does not have valid data, is the loopback interface, or is currently not in use
|
|
|
|
|
if (Travel->ifa_addr == nullptr || (Travel->ifa_flags & (IFF_LOOPBACK)) != 0 || (Travel->ifa_flags & (IFF_RUNNING | IFF_UP)) == 0)
|
2018-07-19 18:32:21 -04:00
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
// Also drop any interface that's not a wifi or mobile adapter
|
|
|
|
|
bool bIsWifi = strncmp(Travel->ifa_name, "en", 2) == 0;
|
|
|
|
|
bool bIsMobile = strncmp(Travel->ifa_name, "pdp_ip", 6) == 0;
|
|
|
|
|
if (!bIsWifi && !bIsMobile)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
continue;
|
2018-06-07 22:39:07 -04:00
|
|
|
}
|
2020-01-31 18:46:22 -05:00
|
|
|
|
|
|
|
|
// Otherwise, this is an address we can consider.
|
|
|
|
|
FSortedPriorityAddresses NewAddress(this);
|
|
|
|
|
sockaddr_storage* AddrData = reinterpret_cast<sockaddr_storage*>(Travel->ifa_addr);
|
|
|
|
|
|
|
|
|
|
// Set in the address data.
|
|
|
|
|
NewAddress.Address->SetIp(*AddrData);
|
|
|
|
|
// Make sure to set the scope id as it will not be in the AddrData by default.
|
|
|
|
|
NewAddress.Address->SetScopeId(ntohl(if_nametoindex(Travel->ifa_name)));
|
|
|
|
|
|
|
|
|
|
// Ignore anything that is not a valid address that we can use.
|
|
|
|
|
if (NewAddress.Address->IsValid())
|
2018-06-07 22:39:07 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
// Assign priority as needed. IPv6 is always better than IPv4, and WIFI is better than Cellular
|
|
|
|
|
if (Travel->ifa_addr->sa_family == AF_INET6)
|
2018-06-07 22:39:07 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
NewAddress.Priority = (bIsWifi) ?
|
|
|
|
|
EAdapterPriorityValues::IPv6Wifi : EAdapterPriorityValues::IPv6Cell;
|
2018-06-07 22:39:07 -04:00
|
|
|
}
|
2020-01-31 18:46:22 -05:00
|
|
|
else if (Travel->ifa_addr->sa_family == AF_INET)
|
2018-06-07 22:39:07 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
NewAddress.Priority = (bIsWifi) ?
|
|
|
|
|
EAdapterPriorityValues::IPv4Wifi : EAdapterPriorityValues::IPv4Cell;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2020-01-31 18:46:22 -05:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NewAddress.InterfaceName = ANSI_TO_TCHAR(Travel->ifa_name);
|
|
|
|
|
UE_LOG(LogIOS, Verbose, TEXT("Added address %s with interface %s"), *NewAddress.ToString(), *NewAddress.InterfaceName);
|
|
|
|
|
SortedAddresses.Add(NewAddress);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
2019-01-30 18:48:01 -05:00
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
// Free interface memory
|
2014-03-14 14:13:41 -04:00
|
|
|
freeifaddrs(Interfaces);
|
|
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
// Sort the addresses based on priority now that all of them are added
|
|
|
|
|
SortedAddresses.Sort();
|
|
|
|
|
|
|
|
|
|
// With the now sorted list, add them to our output addresses.
|
|
|
|
|
for (const auto& AddressInterface : SortedAddresses)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
UE_LOG(LogIOS, Verbose, TEXT("Ordered Address: %s"), *AddressInterface.ToString());
|
|
|
|
|
OutAddresses.Add(AddressInterface.Address);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2020-01-31 18:46:22 -05:00
|
|
|
|
2020-05-02 03:14:27 -04:00
|
|
|
return OutAddresses.Num() > 0;
|
2020-01-31 18:46:22 -05:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TArray<TSharedRef<FInternetAddr>> FSocketSubsystemIOS::GetLocalBindAddresses()
|
|
|
|
|
{
|
|
|
|
|
TArray<TSharedRef<FInternetAddr>> BindingAddresses = FSocketSubsystemBSD::GetLocalBindAddresses();
|
|
|
|
|
|
|
|
|
|
uint32 AdapterScopeId = 0;
|
|
|
|
|
TSharedRef<FInternetAddr> MultihomeAddr = CreateInternetAddr();
|
|
|
|
|
if (!GetMultihomeAddress(MultihomeAddr))
|
|
|
|
|
{
|
|
|
|
|
TArray<TSharedPtr<FInternetAddr>> AdapterAddresses;
|
|
|
|
|
if (GetLocalAdapterAddresses(AdapterAddresses))
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
AdapterScopeId = StaticCastSharedPtr<FInternetAddrBSDIOS>(AdapterAddresses[0])->GetScopeId();
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-01-31 18:46:22 -05:00
|
|
|
UE_LOG(LogIOS, Warning, TEXT("Unable to grab the local adapters on this device in order to write scope id on binding addreesses!"));
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
2020-01-31 18:46:22 -05:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AdapterScopeId = StaticCastSharedRef<FInternetAddrBSDIOS>(MultihomeAddr)->GetScopeId();
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2020-01-31 18:46:22 -05:00
|
|
|
UE_LOG(LogIOS, Verbose, TEXT("Using scope id %u for binding addresses"), AdapterScopeId);
|
|
|
|
|
|
|
|
|
|
// For iOS, we pull the best scope id that we know of and use that to bind with.
|
|
|
|
|
for (auto& BindAddress : BindingAddresses)
|
|
|
|
|
{
|
|
|
|
|
StaticCastSharedRef<FInternetAddrBSDIOS>(BindAddress)->SetScopeId(AdapterScopeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return BindingAddresses;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2017-09-25 14:08:25 -04:00
|
|
|
|
2019-01-30 18:48:01 -05:00
|
|
|
TSharedRef<FInternetAddr> FSocketSubsystemIOS::CreateInternetAddr()
|
2018-07-20 18:58:13 -04:00
|
|
|
{
|
2019-01-30 18:48:01 -05:00
|
|
|
return MakeShareable(new FInternetAddrBSDIOS(this));
|
2017-09-25 14:08:25 -04:00
|
|
|
}
|
2020-01-11 00:51:33 -05:00
|
|
|
|
|
|
|
|
TSharedRef<FInternetAddr> FSocketSubsystemIOS::CreateInternetAddr(const FName RequiredProtocol)
|
|
|
|
|
{
|
|
|
|
|
return MakeShareable(new FInternetAddrBSDIOS(this, RequiredProtocol));
|
|
|
|
|
}
|