2016-01-07 08:17:16 -05:00
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2015-09-03 20:46:02 -04:00
# include "LinuxCommonStartup.h"
# include "ExceptionHandling.h"
# include "LinuxPlatformCrashContext.h"
# include "ModuleManager.h"
2015-09-07 16:26:02 -04:00
# include "EngineVersion.h"
2015-09-03 20:46:02 -04:00
# include <locale.h>
# include <sys/resource.h>
static FString GSavedCommandLine ;
extern int32 GuardedMain ( const TCHAR * CmdLine ) ;
extern void LaunchStaticShutdownAfterError ( ) ;
Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @ 2879808)
==========================
MAJOR FEATURES + CHANGES
==========================
#lockdown Nick.Penwarden
Change 2879705 on 2016/02/24 by Nick.Darnell
Editor - Tweaking some comments.
#tests n/a
#rb n/a
Change 2879674 on 2016/02/24 by Nick.Darnell
Editor - The editor now supports many new methods of opening new asset editors. You can choose where tabs open with a great deal more options in Editor Preferences > Appearance > Asset Editor Open Location. This will reset the 'always open asset editors in new windows' option, it completely replaces and enchances that option.
#tests Ran the editor, tried each option and they all seem to do what I want.
#rb matt.kuhlenschmidt
Change 2879661 on 2016/02/24 by Jamie.Dale
More general fixes for dialogue waves
- The localization key now uses a hash of the speaker and target voice GUIDs to help keep them short.
- The localization key can now be user customized, and contains a placeholder format specifier for the context hash.
- The "Variations" meta-data is now called "Context".
#rb James.Hopkin
#tests Built for Windows, Linux, and PS4. Tested a loc gather and export had the correct info in it. Tested the new UI worked as expected.
Change 2879436 on 2016/02/24 by Nicholas.Davies
A few bug fixes for blocking PS4 > PC chat
#jira OR-15467 Disable Paragon chat on PS4 for users outside of the game
#RB Antony.Carter
#codereview Sam.Zamani
#TESTS PS4 whispers to and from none Paragon PC users is blocked.
Change 2878929 on 2016/02/23 by Jason.Bestimt
#ORION_DEV - Merge Main to reconcile 0.20 branch creation
#RB:none
#Tests:none
Change 2878600 on 2016/02/23 by Dmitry.Rekman
Linux: added code to identify CPU for FPSCharts (OR-14949).
#rb none
#tests Ran dedicated server on local VM and a few physical boxes.
Change 2878443 on 2016/02/23 by Marcus.Wassmer
Fix game not ticking when PS button is pressed.
#rb andrew.grant
#test golden path ps4
Change 2878361 on 2016/02/23 by Josh.Markiewicz
#UE4 - fixed bad comment
#rb none
#tests none
Change 2878205 on 2016/02/23 by Jason.Bestimt
#ORION_DEV - Merge main (0.19) at CL# 2878162
#Tests:none
#RB:none
Change 2878095 on 2016/02/23 by Josh.Markiewicz
#UE4 - added warnings to json mcp read/write failures
- removed HostAddressOverride parameter (use -uselocalips and -multihome together instead)
#rb none
#tests matchmaking golden path
Change 2878002 on 2016/02/23 by Josh.Markiewicz
#UE4 - made two party framework functions virtual
#rb none
#tests none
Change 2877998 on 2016/02/23 by Josh.Markiewicz
#Ue4 - Party interface can optionally enable/disable creating a chat room alongside the party (defaults to enabled)
#rb rob.cannaday
#tests social/team parties golden path
#codereview rob.cannaday
Change 2877822 on 2016/02/23 by Olaf.Piesche
speculative fix for OR-15710
#rb david.hill
#tests PC game
Change 2877804 on 2016/02/23 by Uriel.Doyon
Fixed ULevel::AddReferencedObjects clearing all references to static texture streaming data
#codereview robert.manuszewski
#rb marcus.wassmer
#tests played several games on PC, also doing rejoin
#jira OR-15658
Change 2877692 on 2016/02/23 by Jamie.Dale
Added commandlet to replace sound wave players in sound cues with dialogue wave players where appropriate
#rb Saul.Abreu
#tests Built for Windows, Linux, and PS4. Tested the commandlet.
Change 2877691 on 2016/02/23 by Jamie.Dale
Added commandlet to extract out the information from our character sheets and put it into the correct dialogue waves
#rb Saul.Abreu
#tests Built for Windows, Linux, and PS4. Tested the commandlet.
Change 2877690 on 2016/02/23 by Jamie.Dale
General dialogue wave fixes
[CL 2881965 by Andrew Grant in Main branch]
2016-02-25 15:13:33 -05:00
# if WITH_ENGINE
// see comment in LaunchLinux.cpp for details why it is done this way
extern void LaunchLinux_FEngineLoop_AppExit ( ) ;
# endif // WITH_ENGINE
2015-09-03 20:46:02 -04:00
/**
* Game - specific crash reporter
*/
void CommonLinuxCrashHandler ( const FGenericCrashContext & GenericContext )
{
Copying //UE4/Orion-Staging to //UE4/Main (originated from //Orion/Dev-General @ 2831630)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2831624 on 2016/01/17 by Marcus.Wassmer
Merge disable of FCachedReadPlatformData on PS4. Reduces memory spikes. 2830986
#rb none
#test none
#codereview Michael.Noland,James.Golding
Change 2831402 on 2016/01/17 by Marcus.Wassmer
HLOD priority and streamout changes.
Give texture pool an extra 200MB which we can afford thanks to James/Michael
#rb Chris.Gagnon
#test run agora, notice nice textures.
#lockdown Andrew.Grant
Change 2831398 on 2016/01/17 by Marcus.Wassmer
Fix 3 logic bugs with Relocate
#rb chris.gagnon
#test run game, look for corruption.
#lockdown Andrew.Grant
Change 2831372 on 2016/01/16 by Marcus.Wassmer
Update param.sfo's and lockdown version in prep for good PS4 playtest build.
#rb none
#test build from last night...
#lockdown Andrew.Grant
Change 2831274 on 2016/01/16 by Graeme.Thornton
Disable platform file cache wrapper on PS4
#codereview James.Golding
#rb none
#tests ran cooked ps4 build, timed loading (no real change), measured memory used for file handles (small)
Change 2831237 on 2016/01/16 by Sammy.James
Fix PS4 compile error
#codereview Andrew.Grant
#rb none
#tests none
Change 2831219 on 2016/01/16 by Matt.Kuhlenschmidt
Fix possible invalid access to shared movie player resource across threads causing startup crash.
#codereview marcus.wassmer
#rb none, #tests initial load
Change 2831218 on 2016/01/16 by Marcus.Wassmer
Fix bad warning case.
#codereview Martin.Mittring
#rb none
#test none
Change 2831201 on 2016/01/16 by Andrew.Grant
Added extra info about referencer to missing asset reference message
#rb none
#tests cooked, ran editor
Change 2831183 on 2016/01/16 by David.Nikdel
#OSS #PS4 #Purchasing #StoreV2
- Force failure if we have no receipts after a "successful" checkout.
- Report consumed entitlements as well as unconsumed but leave ValidationInfo empty so we can tell the difference at the application level
- Convert productIds to skuIds at checkout time
- Added PS4 Implementation of IOnlineStoreV2
- Bugfix: set bSuccessfullyStartedUp=false when InitNPGameSettings() fails
- Adjusted FOnlineStoreOffer to use FText::AsCurrencyBase
#RB: Paul.Moore
#TESTS: login, purchase redemption, store MTX purchasing on PS4 & PC
Change 2831129 on 2016/01/16 by David.Nikdel
#MCP
- Added a ctor to make converting from FOnlineError to FMcpQueryResult easier (for stuff that was already using FMcpQueryResult).
#RB: none
#TESTS: frontend
Change 2830986 on 2016/01/15 by Michael.Noland
PS4: Disabling FCachedReadPlatformFile on PS4 to significantly reduce high watermark memory consumption during blocking loads
#rb marcus.wassmer
#tests Ran Paragon PS4 down a bad path that currently does a blocking map and hero load
#lockdown andrew.grant
Change 2830943 on 2016/01/15 by Max.Chen
Sequencer: Fix bug introduced with preroll. It was also causing a crash in particle track instance.
#tests Master sequence trailer plays without crashing
#rb none
Change 2830912 on 2016/01/15 by Michael.Noland
Rendering: Exposed GRHIDeviceId (only filled in on D3D11 and D3D12 RHI's under the same circumstances as GRHIAdapterName, etc..., 0 otherwise)
#rb mieszko.zielinski
#tests Tested printing the value out
#codereview martin.mittring
Change 2830910 on 2016/01/15 by Michael.Noland
Rendering: Improved GPU driver detection logic to handle more cases
#codereview martin.mittring
#rb mieszko.zielinski
#tests Tested on my machine which was previous reporting Unknown for the values as some entries contained the key in the Settings subfolder
Change 2830776 on 2016/01/15 by Martin.Mittring
from Dev-Rendering
added ensure to track down multiple issues like
OR-11771 CRASH: User Crashed when pressing the Play button
OR-12430 CRASH: OT2 user crashed with FRHIResource::AddRef()
#rb:Gil.Gribb
#code_review:Gil.Gribb,Mark.Satterthwaite,Marcus.Wassmer
2016-01-20 11:32:08 -05:00
// at this point we should already be using malloc crash handler (see PlatformCrashHandler)
const FLinuxCrashContext & Context = static_cast < const FLinuxCrashContext & > ( GenericContext ) ;
printf ( " CommonLinuxCrashHandler: Signal=%d \n " , Context . Signal ) ;
2015-09-03 20:46:02 -04:00
Copying //UE4/Orion-Staging to //UE4/Main (//Orion/Dev-General @ 2855324)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2855265 on 2016/02/03 by Max.Chen
Sequencer: Release track editors when destroying sequencer
#jira UE-26423
Change 2855247 on 2016/02/03 by Max.Chen
PlacementMode: Null factory check in constructor to fix cooking.
#codereview andrew.rodham
#rb andrew.rodham
#jira UE-26412
ChangeChange 2855116 on 2016/02/03 by Michael.Noland
[AUTOMERGE]
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
--------
Integrated using branch //Orion/Main_to_//Orion/Dev-General of change#2855109 by Michael.Noland on 2016/02/03 20:59:51.
Change 2855109 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
Change 2855100 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 using //Orion/Release-Next_to_//Orion/Release-Live
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
ChangeChangeChangeChangeChange 2854825 on 2016/02/03 by Zabir.Hoque
Harden MaterialParameterCollection from ending up with duplicate parameter names of GUIDs.
#Tests: Ran debug editor, create materail param collection with >500 elements. Still only ~18ms. Used param in shader.
#RB: Daniel.Wright
#CodeReview: Daniel.Wright, Gil.Gribb, Rolando.Caloca, Marcus.Wassmer
Change 2854788 on 2016/02/03 by Josh.Markiewicz
#UE4 - JsonObjectConverter changes
- added the ability for a UStruct to emit json as a string if type traits are setup with ExportTextItem / ImportTextItem
- allows the UStruct to convert to json as something other than FJsonValueObject
-- things like FColor, FDateTime but they are already handled differently
- checked for possible change in existing behavior, no classes currently use type traits for this that aren't handled special already
- FUniqueNetIdRepl can now convert to/from json as a string
#rb david.nikdel
#codereview ben.zeigler, sam.zamani, david.nikdel, paul.moore
#tests various online tests connecting to servers, etc
Change 2854751 on 2016/02/03 by Michael.Noland
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
ChangeChange 2854712 on 2016/02/03 by Josh.Markiewicz
#UE4 - added some json compatibility features to FUniqueNetIdRepl struct
- ImportTextItem
- To/FromJson
#rb david.nikdel
#codereview none
#tests various online features, additional unit tests added to class
Change 2854696 on 2016/02/03 by Dmitry.Rekman
Making Memprofiler usable (by MichaelN).
#rb Zak.Middleton (who I got the shelved CL # from)
#codereview Michael.Noland, Zak.Middleton, Bob.Tellez
#tests Used Memprofiler on a number of captures.
ChangeChange 2854536 on 2016/02/03 by John.Pollard
Add event groups as users to replay, so we can quickly find replays with certain events types in them
#rb RyanG
#tests Replays and events
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854526 on 2016/02/03 by John.Pollard
Add support for getting replay id
#rb RyanG
#tests Replays
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854522 on 2016/02/03 by John.Pollard
Support setting string values in perf counters through the perf counters helper class.
#rb none
#tests Client/Server match
[CL 2856676 by Andrew Grant in Main branch]
2016-02-04 23:40:42 -05:00
// better than having mutable fields?
const_cast < FLinuxCrashContext & > ( Context ) . CaptureStackTrace ( ) ;
2015-09-03 20:46:02 -04:00
if ( GLog )
{
GLog - > Flush ( ) ;
}
if ( GWarn )
{
GWarn - > Flush ( ) ;
}
if ( GError )
{
GError - > Flush ( ) ;
GError - > HandleError ( ) ;
}
Copying //UE4/Orion-Staging to //UE4/Main (//Orion/Dev-General @ 2855324)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2855265 on 2016/02/03 by Max.Chen
Sequencer: Release track editors when destroying sequencer
#jira UE-26423
Change 2855247 on 2016/02/03 by Max.Chen
PlacementMode: Null factory check in constructor to fix cooking.
#codereview andrew.rodham
#rb andrew.rodham
#jira UE-26412
ChangeChange 2855116 on 2016/02/03 by Michael.Noland
[AUTOMERGE]
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
--------
Integrated using branch //Orion/Main_to_//Orion/Dev-General of change#2855109 by Michael.Noland on 2016/02/03 20:59:51.
Change 2855109 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 by way of 2855100
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
Change 2855100 on 2016/02/03 by Michael.Noland
PS4: Added a log statement when the gap between SubmitDone calls exceeds 2 seconds and removed a duplicate call to set the LastSubmitDoneTime
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
Merging CL# 2854751 and 2852176 using //Orion/Release-Next_to_//Orion/Release-Live
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
ChangeChangeChangeChangeChange 2854825 on 2016/02/03 by Zabir.Hoque
Harden MaterialParameterCollection from ending up with duplicate parameter names of GUIDs.
#Tests: Ran debug editor, create materail param collection with >500 elements. Still only ~18ms. Used param in shader.
#RB: Daniel.Wright
#CodeReview: Daniel.Wright, Gil.Gribb, Rolando.Caloca, Marcus.Wassmer
Change 2854788 on 2016/02/03 by Josh.Markiewicz
#UE4 - JsonObjectConverter changes
- added the ability for a UStruct to emit json as a string if type traits are setup with ExportTextItem / ImportTextItem
- allows the UStruct to convert to json as something other than FJsonValueObject
-- things like FColor, FDateTime but they are already handled differently
- checked for possible change in existing behavior, no classes currently use type traits for this that aren't handled special already
- FUniqueNetIdRepl can now convert to/from json as a string
#rb david.nikdel
#codereview ben.zeigler, sam.zamani, david.nikdel, paul.moore
#tests various online tests connecting to servers, etc
Change 2854751 on 2016/02/03 by Michael.Noland
PS4: Fixed a bogus log statement when PS4_GNM_SLOW_FRAME_DEBUGGING=1
#rb dave.ratti
#lockdown andrew.grant
#tests Tested on PS4 with PS4_GNM_SLOW_FRAME_DEBUGGING=1
ChangeChange 2854712 on 2016/02/03 by Josh.Markiewicz
#UE4 - added some json compatibility features to FUniqueNetIdRepl struct
- ImportTextItem
- To/FromJson
#rb david.nikdel
#codereview none
#tests various online features, additional unit tests added to class
Change 2854696 on 2016/02/03 by Dmitry.Rekman
Making Memprofiler usable (by MichaelN).
#rb Zak.Middleton (who I got the shelved CL # from)
#codereview Michael.Noland, Zak.Middleton, Bob.Tellez
#tests Used Memprofiler on a number of captures.
ChangeChange 2854536 on 2016/02/03 by John.Pollard
Add event groups as users to replay, so we can quickly find replays with certain events types in them
#rb RyanG
#tests Replays and events
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854526 on 2016/02/03 by John.Pollard
Add support for getting replay id
#rb RyanG
#tests Replays
Merging using OrionDevGeneral->ReleaseCandidate
Change 2854522 on 2016/02/03 by John.Pollard
Support setting string values in perf counters through the perf counters helper class.
#rb none
#tests Client/Server match
[CL 2856676 by Andrew Grant in Main branch]
2016-02-04 23:40:42 -05:00
return Context . GenerateCrashInfoAndLaunchReporter ( ) ;
2015-09-03 20:46:02 -04:00
}
/**
2015-09-07 16:26:02 -04:00
* Sets ( soft ) limit on a specific resource
2015-09-03 20:46:02 -04:00
*
2015-09-07 16:26:02 -04:00
* @ param Resource - one of RLIMIT_ * values
* @ param DesiredLimit - desired value
* @ param bIncreaseOnly - avoid changing the limit if current value is sufficient
2015-09-03 20:46:02 -04:00
*/
2015-09-07 16:26:02 -04:00
bool SetResourceLimit ( int Resource , rlim_t DesiredLimit , bool bIncreaseOnly )
2015-09-03 20:46:02 -04:00
{
rlimit Limit ;
if ( getrlimit ( Resource , & Limit ) ! = 0 )
{
fprintf ( stderr , " getrlimit() failed with error %d (%s) \n " , errno , strerror ( errno ) ) ;
return false ;
}
2015-09-07 16:26:02 -04:00
if ( bIncreaseOnly & & ( Limit . rlim_cur = = RLIM_INFINITY | | Limit . rlim_cur > = DesiredLimit ) )
2015-09-03 20:46:02 -04:00
{
2015-09-07 16:26:02 -04:00
if ( ! UE_BUILD_SHIPPING )
{
printf ( " - Existing per-process limit (soft=%lu, hard=%lu) is enough for us (need only %lu) \n " , Limit . rlim_cur , Limit . rlim_max , DesiredLimit ) ;
}
2015-09-03 20:46:02 -04:00
return true ;
}
Limit . rlim_cur = DesiredLimit ;
if ( setrlimit ( Resource , & Limit ) ! = 0 )
{
fprintf ( stderr , " setrlimit() failed with error %d (%s) \n " , errno , strerror ( errno ) ) ;
if ( errno = = EINVAL )
{
if ( DesiredLimit = = RLIM_INFINITY )
{
fprintf ( stderr , " - Max per-process value allowed is %lu (we wanted infinity). \n " , Limit . rlim_max ) ;
}
else
{
fprintf ( stderr , " - Max per-process value allowed is %lu (we wanted %lu). \n " , Limit . rlim_max , DesiredLimit ) ;
}
}
return false ;
}
return true ;
}
/**
* Expects GSavedCommandLine to be set up . Increases limit on
* - number of open files to be no less than desired ( if specified on command line , otherwise left alone )
* - size of core file , so core gets dumped and we can debug crashed builds ( unless overridden with - nocore )
*
*/
static bool IncreasePerProcessLimits ( )
{
// honor the parameter if given, but don't change limits if not
int32 FileHandlesToReserve = - 1 ;
if ( FParse : : Value ( * GSavedCommandLine , TEXT ( " numopenfiles= " ) , FileHandlesToReserve ) & & FileHandlesToReserve > 0 )
{
2015-09-07 16:26:02 -04:00
if ( ! UE_BUILD_SHIPPING )
{
printf ( " Increasing per-process limit of open file handles to %d \n " , FileHandlesToReserve ) ;
}
if ( ! SetResourceLimit ( RLIMIT_NOFILE , FileHandlesToReserve , true ) )
2015-09-03 20:46:02 -04:00
{
fprintf ( stderr , " Could not adjust number of file handles, consider changing \" nofile \" in /etc/security/limits.conf and relogin. \n error(%d): %s \n " , errno , strerror ( errno ) ) ;
return false ;
}
}
2015-09-07 16:26:02 -04:00
// core dump policy:
// - Shipping and Test disable by default (unless -core is passed)
// - The rest set it to infinity unless -nocore is passed
// (in all scenarios user wish as expressed with -core or -nocore takes priority)
2016-01-22 08:13:18 -05:00
bool bDisableCore = ( UE_BUILD_SHIPPING ! = 0 | | UE_BUILD_TEST ! = 0 ) ;
2015-09-07 16:26:02 -04:00
if ( FParse : : Param ( * GSavedCommandLine , TEXT ( " nocore " ) ) )
{
bDisableCore = true ;
}
if ( FParse : : Param ( * GSavedCommandLine , TEXT ( " core " ) ) )
{
bDisableCore = false ;
}
if ( bDisableCore )
{
printf ( " Disabling core dumps. \n " ) ;
if ( ! SetResourceLimit ( RLIMIT_CORE , 0 , false ) )
{
fprintf ( stderr , " Could not set core file size to 0, error(%d): %s \n " , errno , strerror ( errno ) ) ;
return false ;
}
}
else
2015-09-03 20:46:02 -04:00
{
printf ( " Increasing per-process limit of core file size to infinity. \n " ) ;
2015-09-07 16:26:02 -04:00
if ( ! SetResourceLimit ( RLIMIT_CORE , RLIM_INFINITY , true ) )
2015-09-03 20:46:02 -04:00
{
fprintf ( stderr , " Could not adjust core file size, consider changing \" core \" in /etc/security/limits.conf and relogin. \n error(%d): %s \n " , errno , strerror ( errno ) ) ;
fprintf ( stderr , " Alternatively, pass -nocore if you are unable or unwilling to do that. \n " ) ;
return false ;
}
}
return true ;
}
int CommonLinuxMain ( int argc , char * argv [ ] , int ( * RealMain ) ( const TCHAR * CommandLine ) )
{
FPlatformMisc : : SetGracefulTerminationHandler ( ) ;
2015-09-07 16:26:02 -04:00
if ( UE_BUILD_SHIPPING )
{
// only printed in shipping
Copying //UE4/Dev-Networking to //UE4/Main (Source: //UE4/Dev-Networking @3004032 )
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2939164 on 2016/04/10 by John.Barrett
Updated base UNetConnection netcode to be bit-based, rather than byte-based (to optimize packet size with PacketHandler's and Oodle) - this CL is interdependent with subsequent CL's.
Fixed an issue with FBitReader, when inserting a non-byte-aligned number of bits, where it would fail to zero the unused bits, in the last byte - this led to corrupt reads, in the new termination bit code (subsequent CL).
Added better overflow detection for FBitWriter - plus other additional asserts.
Fixed a potential bug with control channel messages, where non-byte-aligned control channel messages that were queued for later sending, were stored as byte-aligned, causing bad (too large) data to be sent.
Optimized MAX_PACKET_HEADER_BITS to save a bit.
Change 2939169 on 2016/04/10 by John.Barrett
NetcodeUnitTest maintenance.
Added unit test for testing bit reader/writer limits.
Added 'LogHex' debug command, for logging a hex-editor-style dump of selected memory data - without requiring a dependency on NetcodeUnitTest.
Change 2939170 on 2016/04/10 by John.Barrett
Added work-in-progress DoS/DDoS unit test.
Change 2943718 on 2016/04/14 by John.Pollard
Allow override of replay session ID + start using match ID for replays
Change 2944678 on 2016/04/14 by Ryan.Gerleve
Merging using Release-4.11_to_Dev-Networking:
4.11 hotfix change: fix for an assert that can occur when network clients call AActor::SetReplicates. SetReplicates will now only modify RemoteRole if Role is Authority and warn otherwise.
#jira UE-27646
Change 2946909 on 2016/04/18 by John.Pollard
Misc seamless travel cleanup + sanity checks
* Cleanup the naming of variables and logic used to pick which actors will transfer to new world during seamless travel to more explicitly convey intent
* Warn when there is no context for a world when destroying actors, it's likely that this world is the floating world during seamless travel, and if we hit this case, something is likely in a bad state
Change 2948883 on 2016/04/19 by John.Pollard
GitHub request: https://jira.ol.epicgames.net/browse/UE-29385
Change 2952109 on 2016/04/21 by John.Barrett
Fixed false positive with FBitWriter overflow error log, in PackageMap code.
Change 2953639 on 2016/04/22 by John.Barrett
Fixed shadowed local variable - UE-29829
Change 2958267 on 2016/04/27 by John.Pollard
Make vision manager more resilient to bad network data from old replays
Change 2958410 on 2016/04/27 by John.Pollard
Fix incorrect warning when ReceivedBunch fails for replays
Change 2958411 on 2016/04/27 by John.Pollard
Replay backwards compatibility fixes.
* Mark custom properties/RPC's as incompatible if there was an error reading them in the stream, and ignore from there on out.
* Don't close connection when failing to read properties on clients now that we can skip over this info easily.
Change 2960134 on 2016/04/28 by Ryan.Gerleve
Protect against adding null player controllers to the out list of UEngine::GetAllLocalPlayerControllers.
See https://udn.unrealengine.com/questions/289948/uenginegetalllocalplayercontrollers-pushes-a-null.html
Change 2960617 on 2016/04/29 by John.Barrett
Made way for engine version code refactor.
Change 2961050 on 2016/04/29 by John.Pollard
Log when we send hello to server in pending net game
Change 2961468 on 2016/04/29 by John.Pollard
ReplayCompat: Show name of incompatible property when logging + log when we don't read correct number of bits + cleanup
Change 2964357 on 2016/05/03 by John.Barrett
Optimized netcode SerializeInt\WriteIntWrapped, to allow compile-time calculation of the data bit size.
The runtime calculated version of these functions, has been adjusted to not assert on 1-bit sized writes - to fix a false positive in Paragon.
Adjusted some FMath functions, to allow CONSTEXPR for compile-time calculation.
Change 2964361 on 2016/05/03 by John.Barrett
Update unit test to work with new integer serialization code.
Change 2964831 on 2016/05/03 by John.Barrett
Back out net serialization changes for now.
Change 2964832 on 2016/05/03 by John.Barrett
Back out unit test net serialization change.
Change 2964838 on 2016/05/03 by John.Barrett
Fix Paragon false positive netcode assert.
Change 2966257 on 2016/05/04 by John.Pollard
Unify network version logic + move to core
* Move network version logic to core
* Formalized concept of compatible network/replay changelist
* Fixed up UDemoNetDriver to work with new version concepts
* Fixed up Orion/other samples in the same way
* This is first step to officially supporting backwards compatility for replays, and possibly networking in general (would be opt-in if so)
Change 2966657 on 2016/05/04 by John.Pollard
Deprecate GEngineNetVersion, GEngineMinNetVersion and GEngineNegotiationVersion
Change 2968945 on 2016/05/06 by John.Pollard
Print name of object that has NULL level
Change 2970529 on 2016/05/09 by Bart.Bressler
Add an optional "CapturePercentage" command line parameter that has a percentage chance of generating capture files per connection
Change 2971233 on 2016/05/09 by Bart.Bressler
Update Oodle DLLs in Orion
Change 2975585 on 2016/05/12 by Bart.Bressler
- Keep track of STAT_NumNetActors on clients as well as servers
- Change STAT_NumActors to just be the world actor count instead of using FActorIterator (FActorIterator was causing a hitch)
Change 2979207 on 2016/05/16 by Bart.Bressler
Remove FActorIterator loop around world actor count retrieval in UNetDriver::TickFlush
Change 2981198 on 2016/05/17 by John.Pollard
Changes to support FN replays
* Save streaming levels within network stream
* Don't load streaming level if it's already in the list
* Remove need for meta data
Change 2981201 on 2016/05/17 by John.Pollard
Forgot to check in
Change 2982075 on 2016/05/18 by John.Pollard
Cache network checksum so we don't spam log (we call this function more now)
Change 2982092 on 2016/05/18 by John.Pollard
Lower verbosity of log
Change 2986571 on 2016/05/23 by Bart.Bressler
Fix issue where oodle wasn't getting enabled in shipping correctly
Change 2988628 on 2016/05/24 by Bart.Bressler
When processing captures with the Oodle commandlet, only check files that end with "ucap" (there might be gzipped files that have the exact same filenames, for example)
Change 2988838 on 2016/05/24 by Bart.Bressler
- Add script to pull down captures from S3
- Add script to do the whole process from pulling down captures to generating dictionaries
Change 2994575 on 2016/05/31 by John.Pollard
Include networkversion.h in UnrealNetwork.h, this is so that older code will continue to compile that relied on network version code that used to be in this file
Change 2996026 on 2016/06/01 by John.Pollard
Add network version to FArchive
Change 2996043 on 2016/06/01 by John.Pollard
Store network version on NetConnection/Bunch, replays properly initialize these to current replay network versions
Change 2996081 on 2016/06/01 by John.Pollard
Remove unused FInBunch constructor
Change 2996544 on 2016/06/01 by John.Pollard
Make sure network version is correct for external data + set on connection after checkpoint
Change 2996731 on 2016/06/01 by John.Pollard
Set game network version for Orion
Change 2997042 on 2016/06/01 by John.Pollard
Fix issue when game server times out, and replay service turns off live replay flag, and we fail to download last chunk + more log info when replay http chunk downloading fails
Change 2997908 on 2016/06/02 by Ryan.Gerleve
Use the smoothed mesh transform for characters when recording client replays.
Since the root component's transform may only be updated periodically, this greatly improves the quality of character movement.
Change 2998001 on 2016/06/02 by Ryan.Gerleve
Set the NetDriverName in the replay spectator's constructor.
The replay spectator will always be associated with a DemoNetDriver and this fixes cases where GetNetMode could return the wrong value before the net driver name was set (such as during BeginPlay).
Also inverted the logic in IsForPlayback() to make it more intuitive.
Change 2998636 on 2016/06/02 by John.Pollard
If we don't have enough external replay samples, use the best one
Change 2998637 on 2016/06/02 by John.Pollard
Clamp replay time
Change 2998705 on 2016/06/02 by John.Pollard
Replay fixes:
* Fix issue when scrubbing to time 0, and first chunk takes longer than normal to download
* Better streaming logic that works better with new backend delay logic
* Better handling when replay flips from live to not live
* Don't update StreamTimeRangeStart/End unless we got those values in the header response
* Handle when we fail to download a chunk and HighPriorityEndTime is active
Change 2998832 on 2016/06/02 by Ryan.Gerleve
Fix an issue that could cause the replay spectator controller to not get the notification that the spectator class has been received while recording a client replay.
Change 2999054 on 2016/06/02 by Ryan.Gerleve
Added ability to set a maximum desired time budget for replay recording. Once the budget is reached, remaining actors will have to wait until the next frame to try to replicate.
Change 2999057 on 2016/06/02 by Ryan.Gerleve
Fixed an issue that could cause the main game world to use the incorrect vision manager when deathcam was enabled and the replay recording time budget was set very aggressively.
In this case, AOrionVisionManager2::PostInitializeComponents would be called before the spectator player controller was spawned in the playback world, causing it to fail to find the local player and not initializing GKillcamVisionManager correctly.
Change 2999749 on 2016/06/03 by Ryan.Gerleve
RPCs will now be recorded in client replays.
Cleaned up actor role swapping logic for client recording and re-use it for RPCs.
Change 3000051 on 2016/06/03 by Ryan.Gerleve
Fix Paragon server crash.
#jira UE-31618
Change 3001361 on 2016/06/05 by Ryan.Gerleve
Added support for prioritizing actors during replay recording to get better results when a maximum desired recording time is set.
Added virtual function GetReplayPriority to Actor, similar to GetNetPriority, but allows different priorities for live networking and replays.
Moved FCompareFActorPriority to a header so that the DemoNetDriver can use it.
Change 3001365 on 2016/06/05 by Ryan.Gerleve
Paragon now uses a desired recording time limit and enables actor prioritization for recording the deathcam replay.
Change 3002094 on 2016/06/06 by Ryan.Gerleve
Missed file from a main merge fixup.
Change 3002417 on 2016/06/06 by Ryan.Gerleve
Disabling a check to work around UE-31636 for now.
Change 3002547 on 2016/06/06 by John.Barrett
Added improved 'DebugDump' command option to the Oodle trainer commandlet - this takes UE4 .ucap capture files, and batch converts them into Oodle-example-code compatible .bin files.
Use through the new BatchDebugDump.bat file.
Change 3002989 on 2016/06/06 by John.Pollard
Add ability to skip missing/changed properties in FFastArraySerializer
Change 3003072 on 2016/06/06 by John.Pollard
Fix crash related to new replay backwards compatibility changes
#lockdown Nick.Penwarden
[CL 3004618 by John Pollard in Main branch]
2016-06-07 16:19:22 -04:00
printf ( " %s %d %d \n " , StringCast < ANSICHAR > ( * FEngineVersion : : Current ( ) . ToString ( ) ) . Get ( ) , GPackageFileUE4Version , GPackageFileLicenseeUE4Version ) ;
2015-09-07 16:26:02 -04:00
}
2015-09-03 20:46:02 -04:00
int ErrorLevel = 0 ;
2015-09-16 12:07:55 -04:00
if ( setenv ( " LC_NUMERIC " , " en_US " , 1 ) ! = 0 )
{
int ErrNo = errno ;
fprintf ( stderr , " Unable to setenv(LC_NUMERIC): errno=%d (%s) " , ErrNo , strerror ( ErrNo ) ) ;
}
2015-09-03 20:46:02 -04:00
setlocale ( LC_CTYPE , " " ) ;
2015-09-16 12:07:55 -04:00
2015-09-03 20:46:02 -04:00
for ( int32 Option = 1 ; Option < argc ; Option + + )
{
GSavedCommandLine + = TEXT ( " " ) ;
// we need to quote stuff that has spaces in it because something somewhere is removing quotation marks before they arrive here
FString Temp = UTF8_TO_TCHAR ( argv [ Option ] ) ;
if ( Temp . Contains ( TEXT ( " " ) ) )
{
if ( Temp . StartsWith ( TEXT ( " - " ) ) )
{
Temp = Temp . Replace ( TEXT ( " = " ) , TEXT ( " = \" " ) ) ;
}
else
{
Temp = TEXT ( " \" " ) + Temp ;
}
Temp + = TEXT ( " \" " ) ;
}
GSavedCommandLine + = Temp ; // note: technically it depends on locale
}
2015-09-07 16:26:02 -04:00
if ( ! UE_BUILD_SHIPPING )
2015-09-03 20:46:02 -04:00
{
2015-09-07 16:26:02 -04:00
GAlwaysReportCrash = true ; // set by default and reverse the behavior
if ( FParse : : Param ( * GSavedCommandLine , TEXT ( " nocrashreports " ) ) | | FParse : : Param ( * GSavedCommandLine , TEXT ( " no-crashreports " ) ) )
{
GAlwaysReportCrash = false ;
}
2015-09-03 20:46:02 -04:00
}
if ( ! IncreasePerProcessLimits ( ) )
{
fprintf ( stderr , " Could not set desired per-process limits, consider changing system limits. \n " ) ;
ErrorLevel = 1 ;
}
else
{
# if UE_BUILD_DEBUG
if ( true & & ! GAlwaysReportCrash )
# else
if ( FPlatformMisc : : IsDebuggerPresent ( ) & & ! GAlwaysReportCrash )
# endif
{
// Don't use exception handling when a debugger is attached to exactly trap the crash. This does NOT check
// whether we are the first instance or not!
ErrorLevel = RealMain ( * GSavedCommandLine ) ;
}
else
{
FPlatformMisc : : SetCrashHandler ( CommonLinuxCrashHandler ) ;
GIsGuarded = 1 ;
// Run the guarded code.
ErrorLevel = RealMain ( * GSavedCommandLine ) ;
GIsGuarded = 0 ;
}
}
Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @ 2879808)
==========================
MAJOR FEATURES + CHANGES
==========================
#lockdown Nick.Penwarden
Change 2879705 on 2016/02/24 by Nick.Darnell
Editor - Tweaking some comments.
#tests n/a
#rb n/a
Change 2879674 on 2016/02/24 by Nick.Darnell
Editor - The editor now supports many new methods of opening new asset editors. You can choose where tabs open with a great deal more options in Editor Preferences > Appearance > Asset Editor Open Location. This will reset the 'always open asset editors in new windows' option, it completely replaces and enchances that option.
#tests Ran the editor, tried each option and they all seem to do what I want.
#rb matt.kuhlenschmidt
Change 2879661 on 2016/02/24 by Jamie.Dale
More general fixes for dialogue waves
- The localization key now uses a hash of the speaker and target voice GUIDs to help keep them short.
- The localization key can now be user customized, and contains a placeholder format specifier for the context hash.
- The "Variations" meta-data is now called "Context".
#rb James.Hopkin
#tests Built for Windows, Linux, and PS4. Tested a loc gather and export had the correct info in it. Tested the new UI worked as expected.
Change 2879436 on 2016/02/24 by Nicholas.Davies
A few bug fixes for blocking PS4 > PC chat
#jira OR-15467 Disable Paragon chat on PS4 for users outside of the game
#RB Antony.Carter
#codereview Sam.Zamani
#TESTS PS4 whispers to and from none Paragon PC users is blocked.
Change 2878929 on 2016/02/23 by Jason.Bestimt
#ORION_DEV - Merge Main to reconcile 0.20 branch creation
#RB:none
#Tests:none
Change 2878600 on 2016/02/23 by Dmitry.Rekman
Linux: added code to identify CPU for FPSCharts (OR-14949).
#rb none
#tests Ran dedicated server on local VM and a few physical boxes.
Change 2878443 on 2016/02/23 by Marcus.Wassmer
Fix game not ticking when PS button is pressed.
#rb andrew.grant
#test golden path ps4
Change 2878361 on 2016/02/23 by Josh.Markiewicz
#UE4 - fixed bad comment
#rb none
#tests none
Change 2878205 on 2016/02/23 by Jason.Bestimt
#ORION_DEV - Merge main (0.19) at CL# 2878162
#Tests:none
#RB:none
Change 2878095 on 2016/02/23 by Josh.Markiewicz
#UE4 - added warnings to json mcp read/write failures
- removed HostAddressOverride parameter (use -uselocalips and -multihome together instead)
#rb none
#tests matchmaking golden path
Change 2878002 on 2016/02/23 by Josh.Markiewicz
#UE4 - made two party framework functions virtual
#rb none
#tests none
Change 2877998 on 2016/02/23 by Josh.Markiewicz
#Ue4 - Party interface can optionally enable/disable creating a chat room alongside the party (defaults to enabled)
#rb rob.cannaday
#tests social/team parties golden path
#codereview rob.cannaday
Change 2877822 on 2016/02/23 by Olaf.Piesche
speculative fix for OR-15710
#rb david.hill
#tests PC game
Change 2877804 on 2016/02/23 by Uriel.Doyon
Fixed ULevel::AddReferencedObjects clearing all references to static texture streaming data
#codereview robert.manuszewski
#rb marcus.wassmer
#tests played several games on PC, also doing rejoin
#jira OR-15658
Change 2877692 on 2016/02/23 by Jamie.Dale
Added commandlet to replace sound wave players in sound cues with dialogue wave players where appropriate
#rb Saul.Abreu
#tests Built for Windows, Linux, and PS4. Tested the commandlet.
Change 2877691 on 2016/02/23 by Jamie.Dale
Added commandlet to extract out the information from our character sheets and put it into the correct dialogue waves
#rb Saul.Abreu
#tests Built for Windows, Linux, and PS4. Tested the commandlet.
Change 2877690 on 2016/02/23 by Jamie.Dale
General dialogue wave fixes
[CL 2881965 by Andrew Grant in Main branch]
2016-02-25 15:13:33 -05:00
// Final shut down.
# if WITH_ENGINE
LaunchLinux_FEngineLoop_AppExit ( ) ;
# endif // WITH_ENGINE
2016-01-28 16:03:26 -05:00
// check if a specific return code has been set
uint8 OverriddenErrorLevel = 0 ;
if ( FPlatformMisc : : HasOverriddenReturnCode ( & OverriddenErrorLevel ) )
{
ErrorLevel = OverriddenErrorLevel ;
}
2015-09-03 20:46:02 -04:00
if ( ErrorLevel )
{
printf ( " Exiting abnormally (error code: %d) \n " , ErrorLevel ) ;
}
return ErrorLevel ;
}
class FLinuxCommonStartupModule : public IModuleInterface
{
/** IModuleInterface implementation */
virtual void StartupModule ( ) override { } ;
virtual void ShutdownModule ( ) override { } ;
} ;
IMPLEMENT_MODULE ( FLinuxCommonStartupModule , LinuxCommonStartup ) ;