You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3175510 on 2016/10/26 by Josh.Adams - New Wolf SDK support (11). - Added new input plugin now that extra NDA is lifted Change 3176629 on 2016/10/27 by Josh.Adams Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform) Change 3177232 on 2016/10/27 by Josh.Adams - Minor comment change Change 3177348 on 2016/10/27 by Dmitry.Rekman Linux: default to GL4. Change 3177523 on 2016/10/27 by Dmitry.Rekman Linux: update libc++ to 3.9 and add AArch64. Change 3178208 on 2016/10/28 by Daniel.Lamb Enable multithreaded lightmap encoding. Change 3178273 on 2016/10/28 by Luke.Thatcher [PLATFORM] [PS4] [!] Fix crash in PS4 packaging step. - Parallel-for accessing the same log files, causing IOException. Change 3178573 on 2016/10/28 by Dmitry.Rekman Linux: fix for projects not having proper version associations (UE-5954). - Fixed by CengizT. Change3180487on 2016/10/31 by Josh.Adams Moved new file to peoper spot Change 3180508 on 2016/10/31 by Josh.Adams - Fixed crash on audio free for Wolf Change 3181821 on 2016/11/01 by Josh.Adams - Fixed ShooterGame cooking after sync from main Change 3182469 on 2016/11/01 by Josh.Adams - test/shipping build wolf fixes Change 3183078 on 2016/11/02 by Josh.Adams - Added AllDesktop back in for Windows (File | Package) Change 3183229 on 2016/11/02 by Josh.Adams - Fixed wrong path in JunkManifest.txt Change 3184245 on 2016/11/02 by Dmitry.Rekman Linux: add AArch64 (ARM64) libs. Change 3184326 on 2016/11/02 by Dmitry.Rekman Linux: add more files for AArch64. Change 3184353 on 2016/11/02 by Dmitry.Rekman Linux: Add missed AArch64 libpng. Change 3184871 on 2016/11/03 by Luke.Thatcher [PLATFORM] [PS4] [!] Fix broken DownloadImage blueprint node on PS4. - Node should return a UTexture2DDynamic, otherwise the RHI assumes the data has been pre-formatted for the GPU, and we get pitch/layout issues. #jira UE-36365 Change 3185407 on 2016/11/03 by Dmitry.Rekman Linux: fix PhysX on AArch64. (Edigrating 3184484 from Wombat to Dev-Platform). Change 3187488 on 2016/11/04 by Josh.Adams Copying //Tasks/UE4/Private-Platform-Switch to Dev-Platform-Minimal (//UE4/Dev-Platform-Minimal) Change 3187740 on 2016/11/04 by Josh.Adams - Re-copying the Switch files, now with proper case in the directory names Change 3188304 on 2016/11/07 by Dan.Mahashin - Removed deprecated functions in NVN window creation Change3188865on 2016/11/07 by Luke.Thatcher [PLATFORM] [PS4] [~] Move PS4 console input handler into engine classes from OrionGame. - Enables console input from Sony's "Console Output" tool for all games, in debug/development builds. #jira UE-37672 Change 3189517 on 2016/11/07 by Jeff.Campeau Fix incorrect local platform identification in device manager. #jira UE-38312 Change 3189897 on 2016/11/08 by Luke.Thatcher [PLATFORM] [!] Fix width/height mismatch in DownloadImage blueprint node. Change 3190042 on 2016/11/08 by Josh.Adams - Fixed default and Shooter App Ids for Switch Change 3190181 on 2016/11/08 by Joe.Barnes [UE-37275] Split reflection capture error message into two UE_LOG()s. Line length causes truncation and line wrap on some platforms. Change 3190185 on 2016/11/08 by Joe.Barnes Fix another instance of UE_LOG() where the string was being truncated on Switch platform. Change 3190272 on 2016/11/08 by Daniel.Lamb Add file hashes to depependency tracking info. Moved partial gc controlling code outside of the cooker. Store cooked file hashes in cooked asset registry. Cooked asset registry is now part of the cooker instead of chunking manifest. #test cook paragon Change 3190332 on 2016/11/08 by Omar.Rodriguez Fixing issues with iOS remote notifications * Update UPlatformGameInstance::FPlatformRegisteredForRemoteNotificationsDelegate signature so the parameter is const& which will work with BlueprintAssignable * Fix misspelling when doing respondsToSelector check * Update generated Xcode project to use the generated entitlements file * Add remote-notification as a background mode * Update the generated entitlements file contents to include APS environment for push notifications * Added bEnableRemoteNotificationsSupport ini parameter to control whether iOS push notifications code is compiled Change 3190391 on 2016/11/08 by Brent.Pease UE-31739 - Crash when Deploying to iPad Air with BC4 Texture Compression Setting (Josh's suggestion worked out of the box) Change 3190786 on 2016/11/08 by Bart.Hawthorne Fix some missing PLATFORM_WOLF changes to PLATFORM_SWITCH in ShooterGame Change 3190902 on 2016/11/08 by Alicia.Cano Allow RTTI and exceptions to be enabled for Android #jira UE-37845 #android Change 3190973 on 2016/11/08 by Chris.Babcock Add ability to set element value field with new text parameter for UPL #jira UE-37390 #PR #2869 #ue4 #upl Change 3191411 on 2016/11/09 by Josh.Stoddard Warn when user tries to use a shared pak reader on the wrong thread #jira UE-38049 Change 3191635 on 2016/11/09 by Josh.Stoddard More useful message during cook when AT9 assets fail to encode using SCE's tool #jira UE-38053 Change 3191663 on 2016/11/09 by Peter.Sauerbrei fix for ios build from PC Change 3191701 on 2016/11/09 by Brent.Pease implement iOS device logs on windows Change 3191794 on 2016/11/09 by Daniel.Lamb Fixed up compile error missing header file. #test Compile editor #jira UE-38414 Change 3191807 on 2016/11/09 by Josh.Adams - Fixed one chage that was missed in the WolfPlat->Switch rename Change 3191867 on 2016/11/09 by Josh.Adams - Enabled Switch for ShooterGame project Change 3191958 on 2016/11/09 by Jeff.Campeau Add warning for anyone still using XP Change 3192185 on 2016/11/09 by Josh.Adams - Updated to SDK 0.11.12 - Added TrackLotCheckItem API to track guidelines with limits (nothing using it yet) Change 3192241 on 2016/11/09 by Josh.Adams Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform) Change 3192324 on 2016/11/09 by Josh.Adams - Worked around an issue with RunOnTarget stripping quotes around paths with spaces #jira UE-38388 Change 3192387 on 2016/11/09 by Josh.Adams - Updating editor icon for Switch #jira UE-38295 Change 3192476 on 2016/11/09 by Dmitry.Rekman Linux: put correct OpenAL lib per architecture. (Edigrating CL 3185947 from Wombat to Dev-Platform) Change 3192527 on 2016/11/09 by Josh.Adams - Fixed a shadow variable warning #jira UE-38408 Change 3192606 on 2016/11/09 by Jeff.Campeau XP option removed #jira UEPLAT-1542 Change 3192644 on 2016/11/09 by Josh.Adams - Fixed a CIS error (not sure why I don't get it, but hey) Change 3192659 on 2016/11/09 by Josh.Adams - Fixed a crash in DeploymentServer Change 3192672 on 2016/11/09 by Jeff.Campeau Fix WinXP message spamming Change 3193252 on 2016/11/10 by Josh.Adams - Remove assertion in SwitchTextureFormat when the SDK can't be found (if you are sharing DLLs) Change 3193756 on 2016/11/10 by Dmitry.Rekman Linux: add support for touch events. (Edigrating CL 3188159 from Wombat to Dev-Platform). Change 3194297 on 2016/11/10 by Jeff.Campeau HarfBuzz implementation for Xbox One #jira UE-28590 Change 3194299 on 2016/11/10 by Jeff.Campeau Pump Xbox One messaging during slow startup tasks #jira UEPLAT-1276 Change 3194300 on 2016/11/10 by Jeff.Campeau Use response files when building for Xbox One #jira UEPLAT-1296 Change 3194313 on 2016/11/11 by Jeff.Campeau Stop uploading symbols on the first error Show a more detailed error message if symbol uploading fails Add a command line option to disable upload of symbols #1852 #jira UE-24425 Change 3194327 on 2016/11/11 by Jeff.Campeau Deduplicate Xbox One build.cs setup for several modules #jira UE-37540 Change 3194402 on 2016/11/11 by Dmitry.Rekman Linux: do not apply mouse workaround unnecessarily. - Only matters when there is more than one window. (Edigrating 3194399 from Wombat to Dev-Platform). Change 3194434 on 2016/11/11 by Dan.Mahashin - Ported fix CL 3193690: Add workaround to file I/O error about ResultInvalidCurrentMemory when reloading levels - remove uncached attribute during memory pool finalization Change 3194569 on 2016/11/11 by Daniel.Lamb Fixed issue with CreateLinker failing to return LinkerLoad but creating a UPackage which can't be cleaned up. Change 3194570 on 2016/11/11 by Daniel.Lamb Fix for DiffSerializeArchive not using the correct archive when saving packages. #test Cook paragon Change 3194571 on 2016/11/11 by Daniel.Lamb Make sure dependent packages are valid before using them. Added FastBuildCookRun bat file for paragon testing. #test Cook Paragon Change 3194575 on 2016/11/11 by Daniel.Lamb Reworked a warning for the cooker. Change 3194698 on 2016/11/11 by Daniel.Lamb Skip skin verify only runs on build machines now. Saves paragon cook time. Change 3194699 on 2016/11/11 by Daniel.Lamb Changed the wording of skip editor content setting so it's more clear. #test none Change 3194702 on 2016/11/11 by Daniel.Lamb Potential fix for default materials not being in chunk zero. #test run ps4 cooked build paragon Change3194711on 2016/11/11 by Alicia.Cano Allow RTTI and exceptions to be enabled for Android Allow RTTI to be enabled for IOS, Mac #jira UE-37845, UE-20314 #android #ios #mac Change 3194956 on 2016/11/11 by Josh.Adams - Removed the crash with unknown socket error code, left in the warning Change 3195028 on 2016/11/11 by Dmitry.Rekman Linux: repair launch on. (Edigrating 3194384 from //UE4/Private-Wombat/... to //UE4/Dev-Platform/...) Change 3195041 on 2016/11/11 by Dmitry.Rekman Linux: support selecting architectures per project. (Edigrating 3192783 from Wombat to Dev-Platform). Change 3195058 on 2016/11/11 by Dmitry.Rekman Linux: fix code to determine number of cores. - ARM topology seems not to be in line with the assumptions made by x86-centric code. (Merging 3184632 from Wombat to Dev-Platform). Change 3195082 on 2016/11/11 by Josh.Adams - Fixed name of packaged Switch builds to have the config in it (Shipping, etc) #jira UE-38394 Change 3195151 on 2016/11/11 by Bart.Hawthorne - Add game server settings to project settings to connect to the actual game server, instead of the debug login - Use the system software dialog box to show error codes for login failures Change 3195153 on 2016/11/11 by Josh.Adams - Fixed copy and paste logs errors Change 3195156 on 2016/11/11 by Josh.Adams - Fixed some default values, especially for save games (uses their default of 4MB size) - Added some LotCheck write tracking Change 3195285 on 2016/11/11 by Jeff.Campeau Fix HarfBuzz warning on Xbox One Change 3195477 on 2016/11/11 by Josh.Adams - Fixed up some IsGameOnly calls #jira UE-37575 Change 3195490 on 2016/11/11 by Dmitry.Rekman UAT: fix CIS (removed old variables). Change 3195724 on 2016/11/11 by Josh.Adams - Final fix for name of .nsp (content only projects in Shipping config, etc) #jira UE-38394 Change 3195755 on 2016/11/11 by Josh.Adams - Made translucent Switch icons Change 3195771 on 2016/11/11 by Josh.Adams - Fixed some Switch "space in path" issues #jira UE-38393 Change 3195801 on 2016/11/11 by Josh.Adams - Handle making sure the save is completed before we shutdown #jira UE-38215 Change 3196593 on 2016/11/14 by Michael.Trepka Implemented Info string in AvfMedia for display in Media Player Editor #jira UE-35386 Change 3196782 on 2016/11/14 by Josh.Adams - Added a comment for a workaround Change 3196784 on 2016/11/14 by Michael.Trepka Alembic importer for Mac #jira UE-37708 Change 3196901 on 2016/11/14 by Alicia.Cano ADB over wifi fails to deploy on Launch on. #jira UE-37957 #android Change 3197055 on 2016/11/14 by Josh.Adams - Fixed BinnedAllocator crash that happened with PoisonProxy and large allocations with large alignment Change 3197059 on 2016/11/14 by Josh.Adams - Removed some stat code with no STATS Change 3197066 on 2016/11/14 by Josh.Adams - Fixed the generic growableallocator to not free metadata before it's used for stats, and cleaned up a couple minor things Change 3197176 on 2016/11/14 by Josh.Adams - Added some helper scripts to switch in and out of debug mode on Switch Change 3197183 on 2016/11/14 by Bart.Hawthorne Error dialog fixes based on peer review feedback from JoshA Change 3197339 on 2016/11/14 by Josh.Adams Allow -htcs on the commandline now to override disabling Htcs in packaged builds Change 3197401 on 2016/11/14 by Josh.Adams - Fixed the Switch package installation script to remove the path of the package, since it causes problems with spaces, and also it makes the script less portable! #jira UE-38556 Change 3197691 on 2016/11/14 by Dmitry.Rekman Linux: save added devices. (Edigrating 3196529 from Wombat to Dev-Platform). Change 3197854 on 2016/11/15 by Dan.Mahashin - MemoryProfiler2: fixed Switch parser file path in the csproj Change 3197960 on 2016/11/15 by Dan.Mahashin - NVN RHITransitionResources() directly uses a barrier instead of relying on CopyToResolveTarget() side effect (UE-33834) Change 3198488 on 2016/11/15 by Bart.Hawthorne Submit missing NoRedist/DefaultEngine.ini file Change 3198970 on 2016/11/15 by Michael.Trepka Don't try to use installed Mono 4.6 on Mac as it's known to have issues on macOS 10.12 (for example building the editor with UBT often fails with Mono running out of file desriptors) Change 3199050 on 2016/11/15 by Daniel.Lamb Some more output to help track down iterative cooking scenarios #test Cook paragon Change 3199097 on 2016/11/15 by Josh.Adams - Fixed up Switch packaging to re-generate the meta data in case it changed since compile time (esp with content only projects - Fixed default Program Id in code - Fixed a problem with Run with a space in the path #jira UE-38608 Change 3199181 on 2016/11/15 by Dmitry.Rekman Fix CIS (compiling LinuxTargetDevice without engine). Change 3199253 on 2016/11/15 by Dmitry.Rekman Hopeful fix for a static analysis warning. Change 3199325 on 2016/11/15 by Joe.Barnes Start a new CommandBuffer immediately upon ending one. Prevents fetching when there's no CommandBuffer. Needed for Loading Screen movie playback. Change 3199814 on 2016/11/15 by Dmitry.Rekman Linux: remove forced -windowed when launching. (Merging CL 3199789 from Wombat to Dev-Platform) Change 3200580 on 2016/11/16 by Josh.Adams Updasted DeploymentServer Change 3200595 on 2016/11/16 by Joe.Barnes Removed inadvertent SleepThread() when starting movie playback. Change 3200604 on 2016/11/16 by Josh.Adams - Added NN_MIDDLEWARE macros to tag ths apps as using UE4 middleware Change 3200632 on 2016/11/16 by Brent.Pease Update PlatformShowcase with latest tests Change 3200704 on 2016/11/16 by Dmitry.Rekman Linux: fix native compilation. Change 3200711 on 2016/11/16 by Brent.Pease - Support ios audio streaming from disk - Flushed out ADPCMAudioInfo to be more flexible with buffer management in addition to support streaming from disk. This should make more code platform independent. + Other platforms should work fine but will need to be updated to use the new buffer flexability (and hence simplify their own code and buffer management) - IOS audio implementation simplified to use new ADPCMAudioInfo functionality - Fixed adpcm seamless looping NOTE: While everything works with my testing (admittedly simple tests) a little more code cleanup needs to happen... Change 3201015 on 2016/11/16 by Josh.Adams Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform) Change 3201023 on 2016/11/16 by Josh.Stoddard Fix splash screen assignment for iPad #jira UE-38623 Change 3201215 on 2016/11/16 by Brent.Pease Hopefully final fix for build breakage Change 3201259 on 2016/11/16 by Josh.Adams - Removed the clock rate settings from the Project Settings, and the cvars - it was just confusing - Further improved the metadata recreation during packaging (can get rid of the temp meta/desc files now I believe) - Reduced audio pool alignment to not waste massive memory from it Change3202332on 2016/11/17 by Daniel.Lamb Changed build scripts to support iterative cooking #test Ran new build scripts Change 3202371 on 2016/11/17 by Michael.Trepka Changed FAppleHttpResponse::GetContentLength to return expected content size instead of payload size so it's consistent with other implementations #jira UE-38392 Change 3202421 on 2016/11/17 by Michael.Trepka Decrease the number of max open files for a thread on Apple platforms from 256 to 192 to leave more file descriptors to Cocoa #jira UE-18343 Change 3202462 on 2016/11/17 by Michael.Trepka Fixed HTTP If-None-Match response code on Mac and iOS Fixed by iktomi, https://answers.unrealengine.com/questions/492514/http-if-none-match-logic-isnt-working-on-mac-due-t.html #jira UE-36317 Change 3202620 on 2016/11/17 by Daniel.Lamb Fixed issue with some objects being garbage collected which shouldn't be because the collection handler didn't get registered. Commandlets now do not always have GIsRequestingExit true. Made crash handler check for commandlets running and exit appropriately. #test Rebuild lighting QAGame Change 3202955 on 2016/11/17 by Daniel.Lamb Add support for clearing all the cached cooked platform data for a platform when requested. #test cook QA game #jira UE-38361 Change 3202983 on 2016/11/17 by Daniel.Lamb Added support to rebuild lightmaps commandlet for building lightmaps in seperate files. #test rebuild lighting Custom QAGame maps. #jira OR-31907 Change 3203128 on 2016/11/17 by Josh.Adams - Fixed split screen user selection in ShooterGame (brought over some changes from NickD for it as well) Change 3203537 on 2016/11/18 by Dmitry.Rekman Fix ProjectWorldToScreen node for letterboxed viewports. (Merging CL 3201546 from Wombat to Dev-Platform). Change 3203540 on 2016/11/18 by Dmitry.Rekman Linux: be more verbose when setting vblank sync. (Merging CL 3199633 from Private-Wombat to Dev-Platform). Change 3203599 on 2016/11/18 by Dmitry.Rekman Speedup bForceCompilationAtStartup=True when nothing changed (UE-37067). - PR #2849: Contributed by slonopotamus. Change 3203610 on 2016/11/18 by Dmitry.Rekman Add CEF support for Linux (UE-6743). Change 3203615 on 2016/11/18 by Dmitry.Rekman Linux: fix bootstrap script so it is independent of working dir (UE-37016). - PR #2842 contributed by slonopotamus Change 3203645 on 2016/11/18 by Dmitry.Rekman Linux: fix UnrealCEFSubProcess. Change 3203658 on 2016/11/18 by Dmitry.Rekman Remove hard-coded paths to mono binary (UE-35228). - Another way to implement pull request #2741. Change 3203770 on 2016/11/18 by Josh.Adams - Brought over some changes from Dev-Core to not crash in AsyncLoading with debug code Change 3204244 on 2016/11/18 by Dmitry.Rekman Unsuppress mistakenly suppressed warnings and fix one more (UE-38788). Change 3204277 on 2016/11/18 by Brent.Pease + Fix seamless looping bug found on Dan's QAGame test + Fix static analyzer warning (which was a real bug with uncompressed streaming) + Code review feedback from Aaron + Small addition from channel sync ios bug fix Change 3204576 on 2016/11/18 by Omar.Rodriguez Expose the bEnableRemoteNotificationsSupport ini setting in the iOS project settings. Change 3204629 on 2016/11/18 by Chris.Babcock Fix case of VulkanSwapChain.h #include #jira UE-38843 #ue4 #vulkan Change 3204708 on 2016/11/18 by Josh.Adams - Set SwitchMoviePlayer to include the libs from the proper directory Change 3204730 on 2016/11/18 by Josh.Adams - Changed a check to a checkf to narrow down why FMaterialUniformExpressionType::GetTypeMap().FindRef(TypeName) is returning nullptr on tvOS Change 3204865 on 2016/11/18 by Brent.Pease + Turn off ios console logs on Windows to help sort through ios packaging and launch-on issues - This is NOT a fix but it should make it easier to track down the problem with it off. Change 3204883 on 2016/11/18 by Dmitry.Rekman Linux: fix native LaunchOn (UE-38616). Change 3204914 on 2016/11/18 by Brent.Pease + Turn off the device check to prevent it from conflicting with remote packaging/launch-on Change 3204940 on 2016/11/18 by Josh.Adams Backing out changes to the profiler for Switch. Shouldn't have checked it in today during smoke Change 3204952 on 2016/11/18 by Dmitry.Rekman Linux: fix bootstrap script (UE-38851). - Caused by UE-37016. Change 3205630 on 2016/11/21 by Brent.Pease + Fix audio sound queuing bug by ensuring audio buffers are not reused by different sound source objects. + Cleaned up the locking mechanism around stopping sound sources to make its intent and function are clear + Cleaned up memory tracking and freeing. #jira ue-38846 Change 3205787 on 2016/11/21 by Josh.Adams Merging //UE4/Dev-Main to Dev-Platform (//UE4/Dev-Platform) [CL 3206922 by Josh Adams in Main branch]
1094 lines
34 KiB
C#
1094 lines
34 KiB
C#
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading;
|
|
using System.Reflection;
|
|
using System.Linq;
|
|
using System.Net.NetworkInformation;
|
|
using System.Collections;
|
|
using AutomationTool;
|
|
using UnrealBuildTool;
|
|
|
|
/// <summary>
|
|
/// Helper command to run a game.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Uses the following command line params:
|
|
/// -cooked
|
|
/// -cookonthefly
|
|
/// -dedicatedserver
|
|
/// -win32
|
|
/// -noclient
|
|
/// -logwindow
|
|
/// </remarks>
|
|
public partial class Project : CommandUtils
|
|
{
|
|
#region Fields
|
|
|
|
/// <summary>
|
|
/// Thread used to read client log file.
|
|
/// </summary>
|
|
private static Thread ClientLogReaderThread = null;
|
|
|
|
/// <summary>
|
|
/// Process for the server, can be set by the cook command when a cook on the fly server is used
|
|
/// </summary>
|
|
public static IProcessResult ServerProcess;
|
|
|
|
#endregion
|
|
|
|
#region Run Command
|
|
|
|
// debug commands for the engine to crash
|
|
public static string[] CrashCommands =
|
|
{
|
|
"crash",
|
|
"CHECK",
|
|
"GPF",
|
|
"ASSERT",
|
|
"ENSURE",
|
|
"RENDERCRASH",
|
|
"RENDERCHECK",
|
|
"RENDERGPF",
|
|
"THREADCRASH",
|
|
"THREADCHECK",
|
|
"THREADGPF",
|
|
};
|
|
|
|
/// <summary>
|
|
/// For not-installed runs, returns a temp log folder to make sure it doesn't fall into sandbox paths
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private static string GetLogFolderOutsideOfSandbox()
|
|
{
|
|
return GlobalCommandLine.Installed ?
|
|
CmdEnv.LogFolder :
|
|
CombinePaths(Path.GetTempPath(), CommandUtils.EscapePath(CmdEnv.LocalRoot), "Logs");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Fot not-installed runs, copies all logs from the temp log folder back to the UAT log folder.
|
|
/// </summary>
|
|
private static void CopyLogsBackToLogFolder()
|
|
{
|
|
if (!GlobalCommandLine.Installed)
|
|
{
|
|
var LogFolderOutsideOfSandbox = GetLogFolderOutsideOfSandbox();
|
|
var TempLogFiles = FindFiles_NoExceptions("*", false, LogFolderOutsideOfSandbox);
|
|
foreach (var LogFilename in TempLogFiles)
|
|
{
|
|
var DestFilename = CombinePaths(CmdEnv.LogFolder, Path.GetFileName(LogFilename));
|
|
CopyFile_NoExceptions(LogFilename, DestFilename);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void Run(ProjectParams Params)
|
|
{
|
|
Params.ValidateAndLog();
|
|
if (!Params.Run)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Log("********** RUN COMMAND STARTED **********");
|
|
|
|
var LogFolderOutsideOfSandbox = GetLogFolderOutsideOfSandbox();
|
|
if (!GlobalCommandLine.Installed && ServerProcess == null)
|
|
{
|
|
// In the installed runs, this is the same folder as CmdEnv.LogFolder so delete only in not-installed
|
|
DeleteDirectory(LogFolderOutsideOfSandbox);
|
|
CreateDirectory(LogFolderOutsideOfSandbox);
|
|
}
|
|
var ServerLogFile = CombinePaths(LogFolderOutsideOfSandbox, "Server.log");
|
|
var ClientLogFile = CombinePaths(LogFolderOutsideOfSandbox, Params.EditorTest ? "Editor.log" : "Client.log");
|
|
|
|
try
|
|
{
|
|
RunInternal(Params, ServerLogFile, ClientLogFile);
|
|
}
|
|
catch
|
|
{
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
CopyLogsBackToLogFolder();
|
|
}
|
|
|
|
Log("********** RUN COMMAND COMPLETED **********");
|
|
}
|
|
|
|
private static void RunInternal(ProjectParams Params, string ServerLogFile, string ClientLogFile)
|
|
{
|
|
// Setup server process if required.
|
|
if (Params.DedicatedServer && !Params.SkipServer)
|
|
{
|
|
if (Params.ServerTargetPlatforms.Count > 0)
|
|
{
|
|
TargetPlatformDescriptor ServerPlatformDesc = Params.ServerTargetPlatforms[0];
|
|
ServerProcess = RunDedicatedServer(Params, ServerLogFile, Params.RunCommandline);
|
|
// With dedicated server, the client connects to local host to load a map.
|
|
if (ServerPlatformDesc.Type == UnrealTargetPlatform.Linux)
|
|
{
|
|
Params.MapToRun = Params.ServerDeviceAddress;
|
|
}
|
|
else
|
|
{
|
|
Params.MapToRun = "127.0.0.1";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
throw new AutomationException("Failed to run, server target platform not specified");
|
|
}
|
|
}
|
|
else if (Params.FileServer && !Params.SkipServer)
|
|
{
|
|
ServerProcess = RunFileServer(Params, ServerLogFile, Params.RunCommandline);
|
|
}
|
|
|
|
if (ServerProcess != null)
|
|
{
|
|
Log("Waiting a few seconds for the server to start...");
|
|
Thread.Sleep(5000);
|
|
}
|
|
|
|
if (!Params.NoClient)
|
|
{
|
|
Log("Starting Client....");
|
|
|
|
var SC = CreateDeploymentContext(Params, false);
|
|
|
|
ERunOptions ClientRunFlags;
|
|
string ClientApp;
|
|
string ClientCmdLine;
|
|
SetupClientParams(SC, Params, ClientLogFile, out ClientRunFlags, out ClientApp, out ClientCmdLine);
|
|
|
|
// Run the client.
|
|
if (ServerProcess != null)
|
|
{
|
|
RunClientWithServer(SC, ServerLogFile, ServerProcess, ClientApp, ClientCmdLine, ClientRunFlags, ClientLogFile, Params);
|
|
}
|
|
else
|
|
{
|
|
RunStandaloneClient(SC, ClientLogFile, ClientRunFlags, ClientApp, ClientCmdLine, Params);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Client
|
|
|
|
private static void RunStandaloneClient(List<DeploymentContext> DeployContextList, string ClientLogFile, ERunOptions ClientRunFlags, string ClientApp, string ClientCmdLine, ProjectParams Params)
|
|
{
|
|
if (Params.Unattended)
|
|
{
|
|
string LookFor = "Bringing up level for play took";
|
|
bool bCommandlet = false;
|
|
|
|
if (Params.RunAutomationTest != "")
|
|
{
|
|
LookFor = "Automation Test Succeeded";
|
|
}
|
|
else if (Params.RunAutomationTests)
|
|
{
|
|
LookFor = "Automation Test Queue Empty";
|
|
}
|
|
else if (Params.EditorTest)
|
|
{
|
|
LookFor = "Asset discovery search completed in";
|
|
}
|
|
// If running a commandlet, just detect a normal exit
|
|
else if (ClientCmdLine.IndexOf("-run=", StringComparison.InvariantCultureIgnoreCase) >= 0)
|
|
{
|
|
LookFor = "Game engine shut down";
|
|
bCommandlet = true;
|
|
}
|
|
|
|
{
|
|
|
|
string AllClientOutput = "";
|
|
int LastAutoFailIndex = -1;
|
|
IProcessResult ClientProcess = null;
|
|
FileStream ClientProcessLog = null;
|
|
StreamReader ClientLogReader = null;
|
|
Log("Starting Client for unattended test....");
|
|
ClientProcess = Run(ClientApp, ClientCmdLine + " -FORCELOGFLUSH -testexit=\"" + LookFor + "\"", null, ClientRunFlags | ERunOptions.NoWaitForExit);
|
|
while (!FileExists(ClientLogFile) && !ClientProcess.HasExited)
|
|
{
|
|
Log("Waiting for client logging process to start...{0}", ClientLogFile);
|
|
Thread.Sleep(2000);
|
|
}
|
|
if (FileExists(ClientLogFile))
|
|
{
|
|
Thread.Sleep(2000);
|
|
Log("Client logging process started...{0}", ClientLogFile);
|
|
ClientProcessLog = File.Open(ClientLogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
|
ClientLogReader = new StreamReader(ClientProcessLog);
|
|
}
|
|
if (ClientLogReader == null)
|
|
{
|
|
throw new AutomationException("Client exited without creating a log file.");
|
|
}
|
|
bool bKeepReading = true;
|
|
bool WelcomedCorrectly = false;
|
|
bool bClientExited = false;
|
|
DateTime ExitTime = DateTime.UtcNow;
|
|
|
|
while (bKeepReading)
|
|
{
|
|
if (!bClientExited && ClientProcess.HasExited)
|
|
{
|
|
ExitTime = DateTime.UtcNow;
|
|
bClientExited = true;
|
|
}
|
|
string ClientOutput = ClientLogReader.ReadToEnd();
|
|
if (!String.IsNullOrEmpty(ClientOutput))
|
|
{
|
|
if (bClientExited)
|
|
{
|
|
ExitTime = DateTime.UtcNow; // as long as it is spewing, we reset the timer
|
|
}
|
|
AllClientOutput += ClientOutput;
|
|
Console.Write(ClientOutput);
|
|
|
|
if (AllClientOutput.LastIndexOf(LookFor) > AllClientOutput.IndexOf(LookFor))
|
|
{
|
|
WelcomedCorrectly = true;
|
|
Log("Test complete...");
|
|
bKeepReading = false;
|
|
}
|
|
else if (Params.RunAutomationTests)
|
|
{
|
|
int FailIndex = AllClientOutput.LastIndexOf("Automation Test Failed");
|
|
int ParenIndex = AllClientOutput.LastIndexOf(")");
|
|
if (FailIndex >= 0 && ParenIndex > FailIndex && FailIndex > LastAutoFailIndex)
|
|
{
|
|
string Tail = AllClientOutput.Substring(FailIndex);
|
|
int CloseParenIndex = Tail.IndexOf(")");
|
|
int OpenParenIndex = Tail.IndexOf("(");
|
|
string Test = "";
|
|
if (OpenParenIndex >= 0 && CloseParenIndex > OpenParenIndex)
|
|
{
|
|
Test = Tail.Substring(OpenParenIndex + 1, CloseParenIndex - OpenParenIndex - 1);
|
|
LogError("Automated test failed ({0}).", Test);
|
|
LastAutoFailIndex = FailIndex;
|
|
}
|
|
}
|
|
}
|
|
// Detect commandlet failure
|
|
else if (bCommandlet)
|
|
{
|
|
const string ResultLog = "Commandlet->Main return this error code: ";
|
|
|
|
int ResultStart = AllClientOutput.LastIndexOf(ResultLog);
|
|
int ResultValIdx = ResultStart + ResultLog.Length;
|
|
|
|
if (ResultStart >= 0 && ResultValIdx < AllClientOutput.Length &&
|
|
AllClientOutput.Substring(ResultValIdx, 1) == "1")
|
|
{
|
|
// Parse the full commandlet warning/error summary
|
|
string FullSummary = "";
|
|
int SummaryStart = AllClientOutput.LastIndexOf("Warning/Error Summary");
|
|
|
|
if (SummaryStart >= 0 && SummaryStart < ResultStart)
|
|
{
|
|
FullSummary = AllClientOutput.Substring(SummaryStart, ResultStart - SummaryStart);
|
|
}
|
|
|
|
|
|
if (FullSummary.Length > 0)
|
|
{
|
|
LogError("Commandlet failed, summary:" + Environment.NewLine +
|
|
FullSummary);
|
|
}
|
|
else
|
|
{
|
|
LogError("Commandlet failed.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (bClientExited && (DateTime.UtcNow - ExitTime).TotalSeconds > 30)
|
|
{
|
|
Log("Client exited and has been quiet for 30 seconds...exiting");
|
|
bKeepReading = false;
|
|
}
|
|
}
|
|
if (ClientProcess != null && !ClientProcess.HasExited)
|
|
{
|
|
Log("Client is supposed to exit, lets wait a while for it to exit naturally...");
|
|
for (int i = 0; i < 120 && !ClientProcess.HasExited; i++)
|
|
{
|
|
Thread.Sleep(1000);
|
|
}
|
|
}
|
|
if (ClientProcess != null && !ClientProcess.HasExited)
|
|
{
|
|
Log("Stopping client...");
|
|
ClientProcess.StopProcess();
|
|
Thread.Sleep(10000);
|
|
}
|
|
while (ClientLogReader != null && !ClientLogReader.EndOfStream)
|
|
{
|
|
string ClientOutput = ClientLogReader.ReadToEnd();
|
|
if (!String.IsNullOrEmpty(ClientOutput))
|
|
{
|
|
Console.Write(ClientOutput);
|
|
}
|
|
}
|
|
|
|
if (!WelcomedCorrectly)
|
|
{
|
|
throw new AutomationException("Client exited before we asked it to.");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
var SC = DeployContextList[0];
|
|
IProcessResult ClientProcess = SC.StageTargetPlatform.RunClient(ClientRunFlags, ClientApp, ClientCmdLine, Params);
|
|
if (ClientProcess != null)
|
|
{
|
|
// If the client runs without StdOut redirect we're going to read the log output directly from log file on
|
|
// a separate thread.
|
|
if ((ClientRunFlags & ERunOptions.NoStdOutRedirect) == ERunOptions.NoStdOutRedirect)
|
|
{
|
|
ClientLogReaderThread = new System.Threading.Thread(ClientLogReaderProc);
|
|
ClientLogReaderThread.Start(new object[] { ClientLogFile, ClientProcess });
|
|
}
|
|
|
|
do
|
|
{
|
|
Thread.Sleep(100);
|
|
}
|
|
while (ClientProcess.HasExited == false);
|
|
|
|
SC.StageTargetPlatform.PostRunClient(ClientProcess, Params);
|
|
|
|
// any non-zero exit code should propagate an exception. The Virtual function above may have
|
|
// already thrown a more specific exception or given a more specific ErrorCode, but this catches the rest.
|
|
if (ClientProcess.ExitCode != 0)
|
|
{
|
|
throw new AutomationException("Client exited with error code: " + ClientProcess.ExitCode);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void RunClientWithServer(List<DeploymentContext> DeployContextList, string ServerLogFile, IProcessResult ServerProcess, string ClientApp, string ClientCmdLine, ERunOptions ClientRunFlags, string ClientLogFile, ProjectParams Params)
|
|
{
|
|
IProcessResult ClientProcess = null;
|
|
var OtherClients = new List<IProcessResult>();
|
|
|
|
bool WelcomedCorrectly = false;
|
|
int NumClients = Params.NumClients;
|
|
string AllClientOutput = "";
|
|
int LastAutoFailIndex = -1;
|
|
|
|
if (Params.Unattended)
|
|
{
|
|
string LookFor = "Bringing up level for play took";
|
|
if (Params.DedicatedServer)
|
|
{
|
|
LookFor = "Welcomed by server";
|
|
}
|
|
else if (Params.RunAutomationTest != "")
|
|
{
|
|
LookFor = "Automation Test Succeeded";
|
|
}
|
|
else if (Params.RunAutomationTests)
|
|
{
|
|
LookFor = "Automation Test Queue Empty";
|
|
}
|
|
{
|
|
while (!FileExists(ServerLogFile) && !ServerProcess.HasExited)
|
|
{
|
|
Log("Waiting for logging process to start...");
|
|
Thread.Sleep(2000);
|
|
}
|
|
Thread.Sleep(1000);
|
|
|
|
string AllServerOutput = "";
|
|
using (FileStream ProcessLog = File.Open(ServerLogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
|
{
|
|
StreamReader LogReader = new StreamReader(ProcessLog);
|
|
bool bKeepReading = true;
|
|
|
|
FileStream ClientProcessLog = null;
|
|
StreamReader ClientLogReader = null;
|
|
|
|
// Read until the process has exited.
|
|
while (!ServerProcess.HasExited && bKeepReading)
|
|
{
|
|
while (!LogReader.EndOfStream && bKeepReading && ClientProcess == null)
|
|
{
|
|
string Output = LogReader.ReadToEnd();
|
|
if (!String.IsNullOrEmpty(Output))
|
|
{
|
|
AllServerOutput += Output;
|
|
if (ClientProcess == null &&
|
|
(AllServerOutput.Contains("Game Engine Initialized") || AllServerOutput.Contains("Unreal Network File Server is ready")))
|
|
{
|
|
Log("Starting Client for unattended test....");
|
|
ClientProcess = Run(ClientApp, ClientCmdLine + " -FORCELOGFLUSH -testexit=\"" + LookFor + "\"", null, ClientRunFlags | ERunOptions.NoWaitForExit);
|
|
//@todo no testing is done on these
|
|
if (NumClients > 1 && NumClients < 9)
|
|
{
|
|
for (int i = 1; i < NumClients; i++)
|
|
{
|
|
Log("Starting Extra Client....");
|
|
OtherClients.Add(Run(ClientApp, ClientCmdLine, null, ClientRunFlags | ERunOptions.NoWaitForExit));
|
|
}
|
|
}
|
|
while (!FileExists(ClientLogFile) && !ClientProcess.HasExited)
|
|
{
|
|
Log("Waiting for client logging process to start...{0}", ClientLogFile);
|
|
Thread.Sleep(2000);
|
|
}
|
|
if (!ClientProcess.HasExited)
|
|
{
|
|
Thread.Sleep(2000);
|
|
Log("Client logging process started...{0}", ClientLogFile);
|
|
ClientProcessLog = File.Open(ClientLogFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
|
ClientLogReader = new StreamReader(ClientProcessLog);
|
|
}
|
|
}
|
|
else if (ClientProcess == null && !ServerProcess.HasExited)
|
|
{
|
|
Log("Waiting for server to start....");
|
|
Thread.Sleep(2000);
|
|
}
|
|
if (ClientProcess != null && ClientProcess.HasExited)
|
|
{
|
|
ServerProcess.StopProcess();
|
|
throw new AutomationException("Client exited before we asked it to.");
|
|
}
|
|
}
|
|
}
|
|
if (ClientLogReader != null)
|
|
{
|
|
if (ClientProcess.HasExited)
|
|
{
|
|
ServerProcess.StopProcess();
|
|
throw new AutomationException("Client exited or closed the log before we asked it to.");
|
|
}
|
|
while (!ClientProcess.HasExited && !ServerProcess.HasExited && bKeepReading)
|
|
{
|
|
while (!ClientLogReader.EndOfStream && bKeepReading && !ServerProcess.HasExited && !ClientProcess.HasExited)
|
|
{
|
|
string ClientOutput = ClientLogReader.ReadToEnd();
|
|
if (!String.IsNullOrEmpty(ClientOutput))
|
|
{
|
|
AllClientOutput += ClientOutput;
|
|
Console.Write(ClientOutput);
|
|
|
|
if (AllClientOutput.LastIndexOf(LookFor) > AllClientOutput.IndexOf(LookFor))
|
|
{
|
|
if (Params.FakeClient)
|
|
{
|
|
Log("Welcomed by server or client loaded, lets wait ten minutes...");
|
|
Thread.Sleep(60000 * 10);
|
|
}
|
|
else
|
|
{
|
|
Log("Welcomed by server or client loaded, lets wait 30 seconds...");
|
|
Thread.Sleep(30000);
|
|
}
|
|
WelcomedCorrectly = true;
|
|
bKeepReading = false;
|
|
}
|
|
else if (Params.RunAutomationTests)
|
|
{
|
|
int FailIndex = AllClientOutput.LastIndexOf("Automation Test Failed");
|
|
int ParenIndex = AllClientOutput.LastIndexOf(")");
|
|
if (FailIndex >= 0 && ParenIndex > FailIndex && FailIndex > LastAutoFailIndex)
|
|
{
|
|
string Tail = AllClientOutput.Substring(FailIndex);
|
|
int CloseParenIndex = Tail.IndexOf(")");
|
|
int OpenParenIndex = Tail.IndexOf("(");
|
|
string Test = "";
|
|
if (OpenParenIndex >= 0 && CloseParenIndex > OpenParenIndex)
|
|
{
|
|
Test = Tail.Substring(OpenParenIndex + 1, CloseParenIndex - OpenParenIndex - 1);
|
|
LogError("Automated test failed ({0}).", Test);
|
|
LastAutoFailIndex = FailIndex;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
LogFileReaderProcess(ServerLogFile, ServerProcess, (string Output) =>
|
|
{
|
|
bool bKeepReading = true;
|
|
if (ClientProcess == null && !String.IsNullOrEmpty(Output))
|
|
{
|
|
AllClientOutput += Output;
|
|
if (ClientProcess == null && (AllClientOutput.Contains("Game Engine Initialized") || AllClientOutput.Contains("Unreal Network File Server is ready")))
|
|
{
|
|
Log("Starting Client....");
|
|
var SC = DeployContextList[0];
|
|
ClientProcess = SC.StageTargetPlatform.RunClient(ClientRunFlags | ERunOptions.NoWaitForExit, ClientApp, ClientCmdLine, Params);
|
|
// ClientProcess = Run(ClientApp, ClientCmdLine, null, ClientRunFlags | ERunOptions.NoWaitForExit);
|
|
if (NumClients > 1 && NumClients < 9)
|
|
{
|
|
for (int i = 1; i < NumClients; i++)
|
|
{
|
|
Log("Starting Extra Client....");
|
|
IProcessResult NewClient = SC.StageTargetPlatform.RunClient(ClientRunFlags | ERunOptions.NoWaitForExit, ClientApp, ClientCmdLine, Params);
|
|
OtherClients.Add(NewClient);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (ClientProcess == null && !ServerProcess.HasExited)
|
|
{
|
|
Log("Waiting for server to start....");
|
|
Thread.Sleep(2000);
|
|
}
|
|
|
|
if (String.IsNullOrEmpty(Output) == false)
|
|
{
|
|
Console.Write(Output);
|
|
}
|
|
|
|
if (ClientProcess != null && ClientProcess.HasExited)
|
|
{
|
|
|
|
Log("Client exited, stopping server....");
|
|
if (!GlobalCommandLine.NoKill)
|
|
{
|
|
ServerProcess.StopProcess();
|
|
}
|
|
bKeepReading = false;
|
|
}
|
|
|
|
return bKeepReading; // Keep reading
|
|
});
|
|
}
|
|
Log("Server exited....");
|
|
if (ClientProcess != null && !ClientProcess.HasExited)
|
|
{
|
|
ClientProcess.StopProcess();
|
|
}
|
|
foreach (var OtherClient in OtherClients)
|
|
{
|
|
if (OtherClient != null && !OtherClient.HasExited)
|
|
{
|
|
OtherClient.StopProcess();
|
|
}
|
|
}
|
|
if (Params.Unattended)
|
|
{
|
|
if (!WelcomedCorrectly)
|
|
{
|
|
throw new AutomationException("Server or client exited before we asked it to.");
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void SetupClientParams(List<DeploymentContext> DeployContextList, ProjectParams Params, string ClientLogFile, out ERunOptions ClientRunFlags, out string ClientApp, out string ClientCmdLine)
|
|
{
|
|
if (Params.ClientTargetPlatforms.Count == 0)
|
|
{
|
|
throw new AutomationException("No ClientTargetPlatform set for SetupClientParams.");
|
|
}
|
|
|
|
// var DeployContextList = CreateDeploymentContext(Params, false);
|
|
|
|
if (DeployContextList.Count == 0)
|
|
{
|
|
throw new AutomationException("No DeployContextList for SetupClientParams.");
|
|
}
|
|
|
|
var SC = DeployContextList[0];
|
|
|
|
// Get client app name and command line.
|
|
ClientRunFlags = ERunOptions.AllowSpew | ERunOptions.AppMustExist;
|
|
ClientApp = "";
|
|
ClientCmdLine = "";
|
|
string TempCmdLine = "";
|
|
var PlatformName = Params.ClientTargetPlatforms[0].ToString();
|
|
if (Params.Cook || Params.CookOnTheFly)
|
|
{
|
|
List<string> Exes = SC.StageTargetPlatform.GetExecutableNames(SC, true);
|
|
ClientApp = Exes[0];
|
|
if (SC.StageTargetPlatform.PlatformType != UnrealTargetPlatform.IOS)
|
|
{
|
|
TempCmdLine += SC.ProjectArgForCommandLines + " ";
|
|
}
|
|
TempCmdLine += Params.MapToRun + " ";
|
|
|
|
if (Params.CookOnTheFly || Params.FileServer)
|
|
{
|
|
TempCmdLine += "-filehostip=";
|
|
bool FirstParam = true;
|
|
if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac)
|
|
{
|
|
NetworkInterface[] Interfaces = NetworkInterface.GetAllNetworkInterfaces();
|
|
foreach (NetworkInterface adapter in Interfaces)
|
|
{
|
|
if (adapter.NetworkInterfaceType != NetworkInterfaceType.Loopback)
|
|
{
|
|
IPInterfaceProperties IP = adapter.GetIPProperties();
|
|
for (int Index = 0; Index < IP.UnicastAddresses.Count; ++Index)
|
|
{
|
|
if (IP.UnicastAddresses[Index].IsDnsEligible && IP.UnicastAddresses[Index].Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
|
{
|
|
if (!IsNullOrEmpty(Params.Port))
|
|
{
|
|
foreach (var Port in Params.Port)
|
|
{
|
|
if (!FirstParam)
|
|
{
|
|
TempCmdLine += "+";
|
|
}
|
|
FirstParam = false;
|
|
string[] PortProtocol = Port.Split(new char[] { ':' });
|
|
if (PortProtocol.Length > 1)
|
|
{
|
|
TempCmdLine += String.Format("{0}://{1}:{2}", PortProtocol[0], IP.UnicastAddresses[Index].Address.ToString(), PortProtocol[1]);
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += IP.UnicastAddresses[Index].Address.ToString();
|
|
TempCmdLine += ":";
|
|
TempCmdLine += Params.Port;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (!FirstParam)
|
|
{
|
|
TempCmdLine += "+";
|
|
}
|
|
FirstParam = false;
|
|
|
|
// use default port
|
|
TempCmdLine += IP.UnicastAddresses[Index].Address.ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
NetworkInterface[] Interfaces = NetworkInterface.GetAllNetworkInterfaces();
|
|
foreach (NetworkInterface adapter in Interfaces)
|
|
{
|
|
if (adapter.OperationalStatus == OperationalStatus.Up)
|
|
{
|
|
IPInterfaceProperties IP = adapter.GetIPProperties();
|
|
for (int Index = 0; Index < IP.UnicastAddresses.Count; ++Index)
|
|
{
|
|
if (IP.UnicastAddresses[Index].IsDnsEligible)
|
|
{
|
|
if (!IsNullOrEmpty(Params.Port))
|
|
{
|
|
foreach (var Port in Params.Port)
|
|
{
|
|
if (!FirstParam)
|
|
{
|
|
TempCmdLine += "+";
|
|
}
|
|
FirstParam = false;
|
|
string[] PortProtocol = Port.Split(new char[] { ':' });
|
|
if (PortProtocol.Length > 1)
|
|
{
|
|
TempCmdLine += String.Format("{0}://{1}:{2}", PortProtocol[0], IP.UnicastAddresses[Index].Address.ToString(), PortProtocol[1]);
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += IP.UnicastAddresses[Index].Address.ToString();
|
|
TempCmdLine += ":";
|
|
TempCmdLine += Params.Port;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (!FirstParam)
|
|
{
|
|
TempCmdLine += "+";
|
|
}
|
|
FirstParam = false;
|
|
|
|
// use default port
|
|
TempCmdLine += IP.UnicastAddresses[Index].Address.ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
const string LocalHost = "127.0.0.1";
|
|
|
|
if (!IsNullOrEmpty(Params.Port))
|
|
{
|
|
foreach (var Port in Params.Port)
|
|
{
|
|
if (!FirstParam)
|
|
{
|
|
TempCmdLine += "+";
|
|
}
|
|
FirstParam = false;
|
|
string[] PortProtocol = Port.Split(new char[] { ':' });
|
|
if (PortProtocol.Length > 1)
|
|
{
|
|
TempCmdLine += String.Format("{0}://{1}:{2}", PortProtocol[0], LocalHost, PortProtocol[1]);
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += LocalHost;
|
|
TempCmdLine += ":";
|
|
TempCmdLine += Params.Port;
|
|
}
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (!FirstParam)
|
|
{
|
|
TempCmdLine += "+";
|
|
}
|
|
FirstParam = false;
|
|
|
|
// use default port
|
|
TempCmdLine += LocalHost;
|
|
}
|
|
TempCmdLine += " ";
|
|
|
|
if (Params.CookOnTheFlyStreaming)
|
|
{
|
|
TempCmdLine += "-streaming ";
|
|
}
|
|
else if (SC.StageTargetPlatform.PlatformType != UnrealTargetPlatform.IOS)
|
|
{
|
|
// per josh, allowcaching is deprecated/doesn't make sense for iOS.
|
|
TempCmdLine += "-allowcaching ";
|
|
}
|
|
}
|
|
else if (Params.UsePak(SC.StageTargetPlatform))
|
|
{
|
|
if (Params.SignedPak)
|
|
{
|
|
TempCmdLine += "-signedpak ";
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += "-pak ";
|
|
}
|
|
}
|
|
else if (!Params.Stage)
|
|
{
|
|
var SandboxPath = CombinePaths(SC.RuntimeProjectRootDir, "Saved", "Cooked", SC.CookPlatform);
|
|
if (!SC.StageTargetPlatform.LaunchViaUFE)
|
|
{
|
|
TempCmdLine += "-sandbox=" + CommandUtils.MakePathSafeToUseWithCommandLine(SandboxPath) + " ";
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += "-sandbox=\'" + SandboxPath + "\' ";
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ClientApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries", PlatformName, "UE4Editor.exe");
|
|
TempCmdLine += SC.ProjectArgForCommandLines + " ";
|
|
if (!Params.EditorTest)
|
|
{
|
|
TempCmdLine += "-game " + Params.MapToRun + " ";
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += Params.MapToRun + " ";
|
|
}
|
|
}
|
|
if (Params.LogWindow)
|
|
{
|
|
// Without NoStdOutRedirect '-log' doesn't log anything to the window
|
|
ClientRunFlags |= ERunOptions.NoStdOutRedirect;
|
|
TempCmdLine += "-log ";
|
|
}
|
|
else
|
|
{
|
|
TempCmdLine += "-stdout ";
|
|
}
|
|
if (Params.Unattended)
|
|
{
|
|
TempCmdLine += "-unattended ";
|
|
}
|
|
if (IsBuildMachine || Params.Unattended)
|
|
{
|
|
TempCmdLine += "-buildmachine ";
|
|
}
|
|
if (Params.CrashIndex > 0)
|
|
{
|
|
int RealIndex = Params.CrashIndex - 1;
|
|
if (RealIndex < 0 || RealIndex >= CrashCommands.Count())
|
|
{
|
|
throw new AutomationException("CrashIndex {0} is out of range...max={1}", Params.CrashIndex, CrashCommands.Count());
|
|
}
|
|
TempCmdLine += String.Format("-execcmds=\"debug {0}\" ", CrashCommands[RealIndex]);
|
|
}
|
|
else if (Params.RunAutomationTest != "")
|
|
{
|
|
TempCmdLine += "-execcmds=\"automation list;runtests " + Params.RunAutomationTest + "\" ";
|
|
}
|
|
else if (Params.RunAutomationTests)
|
|
{
|
|
TempCmdLine += "-execcmds=\"automation list;runall\" ";
|
|
}
|
|
if (SC.StageTargetPlatform.UseAbsLog)
|
|
{
|
|
TempCmdLine += "-abslog=" + CommandUtils.MakePathSafeToUseWithCommandLine(ClientLogFile) + " ";
|
|
}
|
|
if (SC.StageTargetPlatform.PlatformType != UnrealTargetPlatform.IOS && SC.StageTargetPlatform.PlatformType != UnrealTargetPlatform.Linux)
|
|
{
|
|
TempCmdLine += "-Messaging -nomcp -Windowed ";
|
|
}
|
|
else
|
|
{
|
|
// skip arguments which don't make sense for iOS
|
|
TempCmdLine += "-Messaging -nomcp ";
|
|
}
|
|
if (Params.NullRHI && SC.StageTargetPlatform.PlatformType != UnrealTargetPlatform.Mac) // all macs have GPUs, and currently the mac dies with nullrhi
|
|
{
|
|
TempCmdLine += "-nullrhi ";
|
|
}
|
|
if (Params.Deploy && !Params.CookOnTheFly && (SC.StageTargetPlatform.PlatformType == UnrealTargetPlatform.PS4))
|
|
{
|
|
TempCmdLine += "-deployedbuild ";
|
|
}
|
|
|
|
TempCmdLine += "-CrashForUAT ";
|
|
TempCmdLine += Params.RunCommandline;
|
|
|
|
// todo: move this into the platform
|
|
if (SC.StageTargetPlatform.LaunchViaUFE)
|
|
{
|
|
ClientCmdLine = "-run=Launch ";
|
|
ClientCmdLine += "-Device=" + Params.Devices[0];
|
|
for (int DeviceIndex = 1; DeviceIndex < Params.Devices.Count; DeviceIndex++)
|
|
{
|
|
ClientCmdLine += "+" + Params.Devices[DeviceIndex];
|
|
}
|
|
ClientCmdLine += " ";
|
|
ClientCmdLine += "-Exe=\"" + ClientApp + "\" ";
|
|
ClientCmdLine += "-Targetplatform=" + Params.ClientTargetPlatforms[0].ToString() + " ";
|
|
ClientCmdLine += "-Params=\"" + TempCmdLine + "\"";
|
|
ClientApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/Win64/UnrealFrontend.exe");
|
|
|
|
Log("Launching via UFE:");
|
|
Log("\tClientCmdLine: " + ClientCmdLine + "");
|
|
}
|
|
else
|
|
{
|
|
ClientCmdLine = TempCmdLine;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Client Thread
|
|
|
|
private static void ClientLogReaderProc(object ArgsContainer)
|
|
{
|
|
var Args = ArgsContainer as object[];
|
|
var ClientLogFile = (string)Args[0];
|
|
var ClientProcess = (IProcessResult)Args[1];
|
|
LogFileReaderProcess(ClientLogFile, ClientProcess, (string Output) =>
|
|
{
|
|
if (String.IsNullOrEmpty(Output) == false)
|
|
{
|
|
Log(Output);
|
|
}
|
|
return true;
|
|
});
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Servers
|
|
|
|
private static IProcessResult RunDedicatedServer(ProjectParams Params, string ServerLogFile, string AdditionalCommandLine)
|
|
{
|
|
ProjectParams ServerParams = new ProjectParams(Params);
|
|
ServerParams.Devices = new ParamList<string>(Params.ServerDevice);
|
|
|
|
if (ServerParams.ServerTargetPlatforms.Count == 0)
|
|
{
|
|
throw new AutomationException("No ServerTargetPlatform set for RunDedicatedServer.");
|
|
}
|
|
|
|
var DeployContextList = CreateDeploymentContext(ServerParams, true);
|
|
|
|
if (DeployContextList.Count == 0)
|
|
{
|
|
throw new AutomationException("No DeployContextList for RunDedicatedServer.");
|
|
}
|
|
|
|
var SC = DeployContextList[0];
|
|
|
|
var ServerApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/Win64/UE4Editor.exe");
|
|
if (ServerParams.Cook)
|
|
{
|
|
List<string> Exes = SC.StageTargetPlatform.GetExecutableNames(SC);
|
|
ServerApp = Exes[0];
|
|
}
|
|
var Args = ServerParams.Cook ? "" : (SC.ProjectArgForCommandLines + " ");
|
|
Console.WriteLine(Params.ServerDeviceAddress);
|
|
TargetPlatformDescriptor ServerPlatformDesc = ServerParams.ServerTargetPlatforms[0];
|
|
if (ServerParams.Cook && ServerPlatformDesc.Type == UnrealTargetPlatform.Linux && !String.IsNullOrEmpty(ServerParams.ServerDeviceAddress))
|
|
{
|
|
ServerApp = @"C:\Windows\system32\cmd.exe";
|
|
|
|
string plinkPath = CombinePaths(Environment.GetEnvironmentVariable("LINUX_ROOT"), "bin/PLINK.exe ");
|
|
string exePath = CombinePaths(SC.ShortProjectName, "Binaries", ServerPlatformDesc.Type.ToString(), SC.ShortProjectName + "Server");
|
|
if (ServerParams.ServerConfigsToBuild[0] != UnrealTargetConfiguration.Development)
|
|
{
|
|
exePath += "-" + ServerPlatformDesc.Type.ToString() + "-" + ServerParams.ServerConfigsToBuild[0].ToString();
|
|
}
|
|
exePath = CombinePaths("LinuxServer", exePath.ToLower()).Replace("\\", "/");
|
|
Args = String.Format("/k {0} -batch -ssh -t -i {1} {2}@{3} {4} {5} {6} -server -Messaging", plinkPath, ServerParams.DevicePassword, ServerParams.DeviceUsername, ServerParams.ServerDeviceAddress, exePath, Args, ServerParams.MapToRun);
|
|
}
|
|
else
|
|
{
|
|
var Map = ServerParams.MapToRun;
|
|
if (!String.IsNullOrEmpty(ServerParams.AdditionalServerMapParams))
|
|
{
|
|
Map += ServerParams.AdditionalServerMapParams;
|
|
}
|
|
if (Params.FakeClient)
|
|
{
|
|
Map += "?fake";
|
|
}
|
|
|
|
Args += String.Format("{0} -server -abslog={1} -unattended -FORCELOGFLUSH -log -Messaging", Map, CommandUtils.MakePathSafeToUseWithCommandLine(ServerLogFile));
|
|
|
|
// Do not blindly add -nomcp, only do so if the client is using it
|
|
if (Params.RunCommandline.Contains("-nomcp"))
|
|
{
|
|
Args += " -nomcp";
|
|
}
|
|
|
|
if (Params.ServerCommandline.Length > 0)
|
|
{
|
|
Args += " " + Params.ServerCommandline;
|
|
}
|
|
}
|
|
|
|
if (ServerParams.UsePak(SC.StageTargetPlatform))
|
|
{
|
|
if (ServerParams.SignedPak)
|
|
{
|
|
Args += " -signedpak";
|
|
}
|
|
else
|
|
{
|
|
Args += " -pak";
|
|
}
|
|
}
|
|
if (IsBuildMachine || Params.Unattended)
|
|
{
|
|
Args += " -buildmachine";
|
|
}
|
|
Args += " -CrashForUAT";
|
|
Args += " " + AdditionalCommandLine;
|
|
|
|
|
|
if (ServerParams.Cook && ServerPlatformDesc.Type == UnrealTargetPlatform.Linux && !String.IsNullOrEmpty(ServerParams.ServerDeviceAddress))
|
|
{
|
|
Args += String.Format(" 2>&1 > {0}", ServerLogFile);
|
|
}
|
|
|
|
PushDir(Path.GetDirectoryName(ServerApp));
|
|
var Result = Run(ServerApp, Args, null, ERunOptions.AllowSpew | ERunOptions.NoWaitForExit | ERunOptions.AppMustExist | ERunOptions.NoStdOutRedirect);
|
|
PopDir();
|
|
|
|
return Result;
|
|
}
|
|
|
|
private static IProcessResult RunCookOnTheFlyServer(FileReference ProjectName, string ServerLogFile, string TargetPlatform, string AdditionalCommandLine)
|
|
{
|
|
var ServerApp = HostPlatform.Current.GetUE4ExePath("UE4Editor.exe");
|
|
var Args = String.Format("{0} -run=cook -cookonthefly -unattended -CrashForUAT -FORCELOGFLUSH -log",
|
|
CommandUtils.MakePathSafeToUseWithCommandLine(ProjectName.FullName));
|
|
if (!String.IsNullOrEmpty(ServerLogFile))
|
|
{
|
|
Args += " -abslog=" + CommandUtils.MakePathSafeToUseWithCommandLine(ServerLogFile);
|
|
}
|
|
if (IsBuildMachine)
|
|
{
|
|
Args += " -buildmachine";
|
|
}
|
|
Args += " " + AdditionalCommandLine;
|
|
|
|
// Run the server (Without NoStdOutRedirect -log doesn't log anything to the window)
|
|
PushDir(Path.GetDirectoryName(ServerApp));
|
|
var Result = Run(ServerApp, Args, null, ERunOptions.AllowSpew | ERunOptions.NoWaitForExit | ERunOptions.AppMustExist | ERunOptions.NoStdOutRedirect);
|
|
PopDir();
|
|
return Result;
|
|
}
|
|
|
|
private static IProcessResult RunFileServer(ProjectParams Params, string ServerLogFile, string AdditionalCommandLine)
|
|
{
|
|
#if false
|
|
// this section of code would provide UFS with a more accurate file mapping
|
|
var SC = new StagingContext(Params, false);
|
|
CreateStagingManifest(SC);
|
|
MaybeConvertToLowerCase(Params, SC);
|
|
var UnrealFileServerResponseFile = new List<string>();
|
|
|
|
foreach (var Pair in SC.UFSStagingFiles)
|
|
{
|
|
string Src = Pair.Key;
|
|
string Dest = Pair.Value;
|
|
|
|
Dest = CombinePaths(PathSeparator.Slash, SC.UnrealFileServerInternalRoot, Dest);
|
|
|
|
UnrealFileServerResponseFile.Add("\"" + Src + "\" \"" + Dest + "\"");
|
|
}
|
|
|
|
|
|
string UnrealFileServerResponseFileName = CombinePaths(CmdEnv.LogFolder, "UnrealFileServerList.txt");
|
|
File.WriteAllLines(UnrealFileServerResponseFileName, UnrealFileServerResponseFile);
|
|
#endif
|
|
var UnrealFileServerExe = HostPlatform.Current.GetUE4ExePath("UnrealFileServer.exe");
|
|
|
|
Log("Running UnrealFileServer *******");
|
|
var Args = String.Format("{0} -abslog={1} -unattended -CrashForUAT -FORCELOGFLUSH -log {2}",
|
|
CommandUtils.MakePathSafeToUseWithCommandLine(Params.RawProjectPath.FullName),
|
|
CommandUtils.MakePathSafeToUseWithCommandLine(ServerLogFile),
|
|
AdditionalCommandLine);
|
|
if (IsBuildMachine)
|
|
{
|
|
Args += " -buildmachine";
|
|
}
|
|
PushDir(Path.GetDirectoryName(UnrealFileServerExe));
|
|
var Result = Run(UnrealFileServerExe, Args, null, ERunOptions.AllowSpew | ERunOptions.NoWaitForExit | ERunOptions.AppMustExist | ERunOptions.NoStdOutRedirect);
|
|
PopDir();
|
|
return Result;
|
|
}
|
|
|
|
#endregion
|
|
}
|