Commit Graph

117 Commits

Author SHA1 Message Date
justin marcus
be714597d2 Fix assumption that built-in game feature plugins would not be reloaded at runtime. This fixes auto test errors that were causes by the dedicated server failing to reload plugins after resetting. Any unloading is now canceled if still in flight when reloading happens.
[REVIEW] [at]Daniel.Lamb [at]Bob.Tellez
#preflight 62a223a2c85a3dbe320d3a9e

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20626085 via CL 20626104 via CL 20626111 via CL 20626123
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20627094 by justin marcus in ue5-main branch]
2022-06-13 10:43:12 -04:00
justin marcus
57e17a8100 Fix gamefeature subsystem observer array being modified while iterated for the purposes of dispatching callbacks.
#preflight 6298ca35b72f596b0fcb6652

#ROBOMERGE-OWNER: justin.marcus
#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20470761 via CL 20470765 via CL 20470979 via CL 20470984
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20472725 by justin marcus in ue5-main branch]
2022-06-02 14:02:07 -04:00
justin marcus
824d55a021 Cleanup asset manager when unloading game feature plugins.
- Remove game feature data from asset manager when unregistering.
- When an asset is removed from the asset registry, also remove it from the asset manager.
-review-20397299
#p4v-preflight-copy 20385644

#ROBOMERGE-OWNER: justin.marcus
#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20441121 via CL 20441132 via CL 20441313 via CL 20441314
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20449474 by justin marcus in ue5-main branch]
2022-06-01 04:23:27 -04:00
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
This change consists of multiple changes:

Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used  in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values

AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes

Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names

#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32

#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
justin marcus
6a747585c2 GFP state transition canceling support:
- Explicit GFP state transition canceling
- Implicit GFP state transition canceling (happens if setting a destination incompatible with the current destination)
- Fix possibility of GFP state machine being garbage collected while still in update loop (seen in UEFN)
- Fix state machine not correctly checking compatibility between current destination and new destination if destination is changed while running.

[REVIEW] [at]Bob.Tellez, [at]Graeme.Thornton, [at]Daniel.Lamb, [at]Dave.Belanger
#preflight 628e951bc511f67c9fe4e6c9

#ROBOMERGE-OWNER: justin.marcus
#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20372089 via CL 20372734 via CL 20373086 via CL 20373102
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20374094 by justin marcus in ue5-main branch]
2022-05-25 20:27:50 -04:00
robert manuszewski
f8a812a32f Converting hardcoded short class/enum names to pathnames ahead of ANY_PACKAGE removal
#rb trivial
#jira UE-99463
#preflight 6288fd998828ea88c8aef3d0

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20314896 via CL 20314897 via CL 20314903 via CL 20314904
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20315214 by robert manuszewski in ue5-main branch]
2022-05-22 10:30:02 -04:00
ben zeigler
f165616ec8 Change an error message key to be more accurate
#rb justin.marcus
#preflight trivial
#jira UE-150969

[CL 20286157 by ben zeigler in ue5-main branch]
2022-05-19 15:48:24 -04:00
ben zeigler
a6f9ee784b Lower severity of a check when unmounting a plugin to instead ensure and set an error state. You can set it back to Registered after this to fix the plugin that failed to unmount
#jira UE-150969
#rb justin.marcus
#preflight 628690741074a756b346e561

[CL 20285932 by ben zeigler in ue5-main branch]
2022-05-19 15:41:56 -04:00
justin marcus
55409d9ea8 Refactor to prep for GFP canceling and to make GFP state machine transition requests more robust.
Solved Problems:
It was impossible to know if it was ok to change destination states if the state machine was currently running.
If the state machine was running, setting a new destination would stomp any existing callbacks without calling them.
If was impossible to know if the current tranistion needed be canceld because there was no way to tell if the new destination state was complatible with the intent of the current state transition.

Changes:
- Instead of passing a single destination state pass a range acceptable destination states to the machine.  This communicates the intent of the caller.
- If the machine is running, then the intersection of any new range and the existing range will satisfy both requests.
- If there is no intersection, the request can't be satisified and is refused (I'll change this to an actual implementation of canceling in a future change list)
- The state machine tracks multiple completion callbacks, callbacks are no longer stomped and are always called back.
- Stopped deferring a lot of callbacks to next tick since there were still a lot of cases where callbacks could happen immediatlely and it was giving a false sense of the way GFPs worked.  Content Beacon V2 should be fine with syncronous callbacks and CBV1 is no longer used. I couldn't find other cases that requried deffered callbacks.
- Clear bInUpdateStateMachine before the state machine calls back so that callbacks can force new state machine updates. This was a common cause of adding deffered callbacks in some cases.
- Since machines can now track multiple callbacks, FGameFeaturePluginState_WaitingForDependencies no longer needs special case state transition callbacks
- Moved a few things into the UE::GameFeatures namespace.

[FYI] Bob.Tellez, Graeme.Thornton, Daniel.Lamb, Dave.Belanger

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20245903 via CL 20245946 via CL 20245992 via CL 20246016
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20250951 by justin marcus in ue5-main branch]
2022-05-17 17:08:39 -04:00
justin marcus
5d491c90d9 Change GameFeaturePlugin.VerifyUnload to ECVF_Default
#preflight
#p4v-cherrypick 20129160

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20138825 via CL 20140524 via CL 20142267 via CL 20142760
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20145544 by justin marcus in ue5-main branch]
2022-05-11 14:18:35 -04:00
dave belanger
83e7b79be9 Remove GameFeaturePluginURL field from uplugin dependency and use UGameFeaturesSubsystem::GetPluginURLByName instead
#rb Bob.Tellez
#preflight 62756913dd374c4235cda9fa

#ROBOMERGE-OWNER: dave.belanger
#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 20081670 via CL 20084451 via CL 20084882 via CL 20085303
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20108222 by dave belanger in ue5-main branch]
2022-05-09 15:02:21 -04:00
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
justin marcus
f253f883e1 Dump reference chains if an asset leak is detected on GFP unload.
#preflight 627164245e6ce673f449a301

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 20030080 via CL 20032549 via CL 20032564 via CL 20032576
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20035148 by justin marcus in ue5-main branch]
2022-05-03 19:50:06 -04:00
dave belanger
a4e4d231a3 Fix another crash in GFP system when the termination callback would trigger a GC and destroy the GF state machine (similar issue/fix as 19985514)
#rb Justin.Marcus
#preflight 626ca0349b5919403acd5f54

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19996329 via CL 19997483 via CL 19997528 via CL 19997535
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19998491 by dave belanger in ue5-main branch]
2022-04-30 15:41:04 -04:00
dave belanger
a1bd9682f7 Fix crash in GFP system when the termination callback would trigger a GC and destroy the GF state machine
#rb Justin.Marcus
#preflight skip

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19985514 via CL 19986757 via CL 19986772 via CL 19986781
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19988002 by dave belanger in ue5-main branch]
2022-04-29 19:08:26 -04:00
dave belanger
9f1e7850e9 Proper unloading of gfp assets in editor (need to deal with assets opened in editors and standalone packages)
#rb Justin.Marcus
#preflight 6261a2006971732e13204626

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19857156 via CL 19859849 via CL 19864831 via CL 19865256
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19871233 by dave belanger in ue5-main branch]
2022-04-22 16:01:38 -04:00
dave belanger
4eebcf3fb0 Deprecate UGameFeaturesSubsystem::GetPluginURLForBuiltInPluginByName
#rb Justin.Marcus,Bob.Tellez
#preflight 62605de4dd47b4ad21805deb

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19837144 via CL 19839023 via CL 19857485 via CL 19857765
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19869198 by dave belanger in ue5-main branch]
2022-04-22 14:51:38 -04:00
dave belanger
51c42b7efd Add UGameFeaturesSubsystem::GetPluginURLProtocol
#rb Justin.Marcus
#preflight 62603ab891376845ade59855

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19833663 via CL 19836632 via CL 19851213 via CL 19851473
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19853451 by dave belanger in ue5-main branch]
2022-04-21 14:48:37 -04:00
justin marcus
0d3a391ab0 Game Feature Plugins get removed from plugin manager in FGameFeaturePluginState_Unmounting if they had to be added to the plugin manager list by FGameFeaturePluginState_Mounting.
[REVIEW] [at]Bob.Tellez [at]Michael.Noland
#preflight 625f0ce93e0f6f80adbd76bb

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 19818572 via CL 19821467 via CL 19822259 via CL 19822532
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19827859 by justin marcus in ue5-main branch]
2022-04-20 08:20:37 -04:00
Dave Belanger
6028ad7160 Manual integration of 19807702 to UE5 GameFeatureSystem: Add to GameFeaturePluginNameToPathMap on StatusKnown state and remove on Terminal state
#rb Justin.Marcus,Bob.Tellez
#jira UE-149554
#preflight 625ef31ad412434587fd250c

[CL 19812363 by Dave Belanger in ue5-main branch]
2022-04-19 13:37:11 -04:00
justin marcus
e7b3bab39f Add a comment about how asset registry state gets cleaned up
#preflight

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 19789817 via CL 19791856 via CL 19791872 via CL 19791883
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19809568 by justin marcus in ue5-main branch]
2022-04-19 11:33:52 -04:00
justin marcus
cf21079351 CVar GameFeaturePlugin.VerifyUnload can be used to verify that all assets in a GFP plugin have been unloaded after a call to UnloadGameFeaturePlugin().
[REVIEW] [at]Bob.Tellez [at]Michael.Noland [at]Graeme.Thornton
#preflight https://horde.devtools.epicgames.com/job/625d6f3f6813aa38e3cb0ed7

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 19786314 via CL 19789751 via CL 19789789 via CL 19789819
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19809435 by justin marcus in ue5-main branch]
2022-04-19 11:27:28 -04:00
justin marcus
31c4878b63 Unload primary game feature assets in FGameFeaturePluginState_Unloading
[REVIEW] [at]Bob.Tellez [at]Michael.Noland [at]Dave.Belanger
#preflight https://horde.devtools.epicgames.com/job/62598e9b850de408fbb3e590

#ROBOMERGE-AUTHOR: justin.marcus
#ROBOMERGE-SOURCE: CL 19774032 via CL 19776179 via CL 19776543 via CL 19776605
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19803100 by justin marcus in ue5-main branch]
2022-04-19 00:02:45 -04:00
dave belanger
ef8a6bb3b4 Quick fix for ensure caused by 19749517
Ensure: OnPlaylistDataLoadCompleted failed to find plugin URL
I'd rather not make this change so I'll investigate why it happens with this particular plugin
#rb none
#preflight skip

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19750556 via CL 19751354 via CL 19751360 via CL 19751362
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19801897 by dave belanger in ue5-main branch]
2022-04-18 23:26:49 -04:00
dave belanger
053c67c2fb GameFeaturesSubsystem: Include non-builtin plugins to GameFeaturePluginNameToPathMap
Soft-deprecate GetPluginURLForBuiltInPluginByName and replace it by GetPluginURLForRegisteredPluginByName
Will do the actual deprecation in a separate CL
#rb Bob.Tellez
#preflight 62570f9977269238e170d131

#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 19749517 via CL 19750894 via CL 19750906 via CL 19750911
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19801892 by dave belanger in ue5-main branch]
2022-04-18 23:26:43 -04:00