5#include "CoreMinimal.h"
7#include "OnlineSessionInterface.h"
11#include "OnlineIdentityInterface.h"
12#include "OnlineSessionSettings.h"
13#include "OnlineSessionInterface.h"
14#include "Engine/DataTable.h"
19#if !IS_CONSOLE_PLATFORM
20#include "Schemas/ModioResponse.h"
21#include "ThirdParty/Steamworks/Steamv146/sdk/public/steam/steam_api.h"
24#include "ProjectXGameInstance.generated.h"
110 const FName
None = FName(TEXT(
"None"));
119USTRUCT(Blueprintable)
122 GENERATED_USTRUCT_BODY()
149USTRUCT(BlueprintType)
152 GENERATED_USTRUCT_BODY()
155 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = MatureWords)
159USTRUCT(BlueprintType)
162 GENERATED_USTRUCT_BODY()
165 UPROPERTY(EditAnywhere, BlueprintReadWrite)
167 UPROPERTY(EditAnywhere, BlueprintReadWrite)
238USTRUCT(BlueprintType)
241 GENERATED_USTRUCT_BODY()
243 UPROPERTY(BlueprintReadWrite)
244 FString ServerName = "";
245 UPROPERTY(BlueprintReadWrite)
246 bool bOfficial = false;
247 UPROPERTY(BlueprintReadWrite)
248 FString MapName = "";
249 UPROPERTY(BlueprintReadWrite)
250 int32 PlayersCurrent = -1;
251 UPROPERTY(BlueprintReadWrite)
253 UPROPERTY(BlueprintReadWrite)
254 int32 DifficultyLevel = 254;
255 UPROPERTY(BlueprintReadWrite)
256 int32 PlayerMaximum = -1;
257 UPROPERTY(BlueprintReadWrite)
259 UPROPERTY(BlueprintReadWrite)
261 UPROPERTY(BlueprintReadWrite)
262 int32 VersionNumber = -1;
263 UPROPERTY(BlueprintReadWrite)
264 int32 BranchNumber = -1;
265 UPROPERTY(BlueprintReadWrite)
266 bool bAntiCheatEnabled = true;
267 UPROPERTY(BlueprintReadWrite)
268 bool bHasPassword = false;
269 UPROPERTY(BlueprintReadWrite)
270 TArray<FString> Mods;
271 UPROPERTY(BlueprintReadWrite)
272 bool bHasWhiteList = false;
279 if (ServerInfoA.ServerName != ServerInfoB.ServerName)
281 return bSortDescending ? ServerInfoA.ServerName < ServerInfoB.ServerName : ServerInfoA.ServerName > ServerInfoB.ServerName;
285 if (ServerInfoA.bOfficial != ServerInfoB.bOfficial)
287 return bSortDescending ? ServerInfoA.bOfficial > ServerInfoB.bOfficial : ServerInfoA.bOfficial < ServerInfoB.bOfficial;
291 if (ServerInfoA.GameType != ServerInfoB.GameType)
293 return bSortDescending ? ServerInfoA.GameType < ServerInfoB.GameType : ServerInfoA.GameType > ServerInfoB.GameType;
297 if (ServerInfoA.PlayersCurrent != ServerInfoB.PlayersCurrent)
299 return bSortDescending ? ServerInfoA.PlayersCurrent > ServerInfoB.PlayersCurrent : ServerInfoA.PlayersCurrent < ServerInfoB.PlayersCurrent;
303 if (ServerInfoA.MapName != ServerInfoB.MapName)
305 return bSortDescending ? ServerInfoA.MapName < ServerInfoB.MapName : ServerInfoA.MapName > ServerInfoB.MapName;
309 if (ServerInfoA.Ping != ServerInfoB.Ping)
311 return bSortDescending ? ServerInfoA.Ping < ServerInfoB.Ping : ServerInfoA.Ping > ServerInfoB.Ping;
315 if (ServerInfoA.bAntiCheatEnabled != ServerInfoB.bAntiCheatEnabled)
317 return bSortDescending ? ServerInfoA.bAntiCheatEnabled > ServerInfoB.bAntiCheatEnabled : ServerInfoA.bAntiCheatEnabled < ServerInfoB.bAntiCheatEnabled;
320 if (ServerInfoA.Mods.Num() != ServerInfoB.Mods.Num())
322 return bSortDescending ? ServerInfoA.Mods.Num() < ServerInfoB.Mods.Num() : ServerInfoA.Mods.Num() > ServerInfoB.Mods.Num();
325 if (ServerInfoA.bHasWhiteList != ServerInfoB.bHasWhiteList)
327 return bSortDescending ? ServerInfoA.bHasWhiteList > ServerInfoB.bHasWhiteList : ServerInfoA.bHasWhiteList < ServerInfoB.bHasWhiteList;
330 if (ServerInfoA.DifficultyLevel != ServerInfoB.DifficultyLevel)
332 return bSortDescending ? ServerInfoA.DifficultyLevel > ServerInfoB.DifficultyLevel : ServerInfoA.DifficultyLevel < ServerInfoB.DifficultyLevel;
336 return ServerInfoA > ServerInfoB;
361 if (PlayersCurrent != PlayersCurrent)
392USTRUCT(BlueprintType)
395 GENERATED_USTRUCT_BODY()
399 UPROPERTY(BlueprintReadWrite)
401 UPROPERTY(BlueprintReadWrite)
406 return Score > Other.Score;
410USTRUCT(BlueprintType)
413 GENERATED_USTRUCT_BODY()
415 FNakamaUser(
const FString& NewUserName,
const FString& NewSteamID) {UserName = NewUserName; SteamID = NewSteamID; }
416 UPROPERTY(BlueprintReadWrite)
417 FString UserName = "";
418 UPROPERTY(BlueprintReadWrite)
419 FString SteamID = "";
422USTRUCT(BlueprintType)
427 Users = TMap<FString, FNakamaUser>();
429 GENERATED_USTRUCT_BODY()
430 UPROPERTY(BlueprintReadWrite)
460USTRUCT(BlueprintType)
463 GENERATED_USTRUCT_BODY()
468 ItemUnlockShowcase = Items;
473 UPROPERTY(BlueprintReadWrite)
474 TArray<FString> ItemUnlockShowcase;
475 UPROPERTY(BlueprintReadWrite)
476 int32 CurrencyShowcase = INDEX_NONE;
477 UPROPERTY(BlueprintReadWrite)
478 int32 ExpShowcase = INDEX_NONE;
511 void SetServerPendingRestart();
512 virtual void Shutdown()
override;
513 virtual void Init()
override;
514 virtual void OnStart()
override;
515 virtual void CheckForInstanceRestart();
516 void DownloadModsHeadless();
517#if !IS_CONSOLE_PLATFORM
518 void ModDownloadCompleteHeadless(FModioResponse Response,
bool bSuccess);
520 void InstallModsHeadless();
521 void OnClientTravel(
const FString& PendingURL, ETravelType TravelType,
bool bIsSeamlessTravel);
522 void OnBackBufferReady_RenderThread(SWindow& SlateWindow,
const FTexture2DRHIRef& BackBuffer);
523 void CopyTextureImpl(
const FTexture2DRHIRef& Src, FTexture2DRHIRef& Dst, FRHIGPUFence* GPUFence);
524 void DisableSoftwareCursor();
525 void BeginClientAntiCheatSession();
526 void EndClientAntiCheatSession();
528 void OnAntiCheatMessageToServer(TArrayView<const uint8> Message);
529 void OnAntiCheatClientViolation(
const FString& Reason);
531 UFUNCTION(BlueprintCallable)
533 UFUNCTION(BlueprintCallable, Category=
"Online Subsystem")
534 void FindAllSessions(
bool bLan);
535 UFUNCTION(BlueprintCallable, Category=
"Online Subsystem")
536 void CancelJoinSession();
537 UFUNCTION(BlueprintCallable, Category =
"Online Subsystem")
539 UFUNCTION(BlueprintCallable, Category =
"Online Subsystem")
540 void FindAndJoinBestSession(
EGameType GameType);
541 UFUNCTION(BlueprintCallable, Category =
"Online Subsystem" , meta = (AutoCreateRefTerm =
"Difficultylevels"))
542 void FindAndJoinBestSessionForTypes(
const TArray<EGameType> GameTypes, TArray<EDifficultyLevel> Difficultylevels,
bool bShouldSearchFreshServersOnly =
false);
543 UFUNCTION(BlueprintCallable, Category =
"Online Subsystem")
545 bool FinishJoinSession(ULocalPlayer* LocalPlayer,
const FOnlineSessionSearchResult& SearchResult);
547 UFUNCTION(BlueprintPure, Category =
"Online Subsystem")
548 bool CanUpdateSessionState()
const;
549 UFUNCTION(BlueprintPure, Category =
"Online Subsystem")
550 float GetInstanceUptime()
const {
return UpTime; }
551 UFUNCTION(BlueprintCallable)
552 const TArray<
FServerInfo>& GetServerInfos()
const {
return SavedServerInfos; }
554 UFUNCTION(BlueprintPure, Category = GameInstance)
555 FORCEINLINE FIntVector GetLastOriginShiftDelta()
const {
return LastOriginShiftDelta; }
556 UFUNCTION(BlueprintPure, Category = GameInstance)
558 UFUNCTION(BlueprintPure, Category = GameInstance)
560 UFUNCTION(BlueprintPure, Category = GameInstance)
561 FORCEINLINE UCosmeticsManager* GetCosmeticsManager() {
return CosmeticManager; }
562 UFUNCTION(BlueprintPure, Category = Cosmetics)
563 FORCEINLINE UDataTable* GetCosmeticsTable()
const {
return MasterCosmeticTable; }
564 UFUNCTION(BlueprintPure, Category = Cosmetics)
565 FORCEINLINE UDataTable* GetPerkTable()
const {
return PerksTable;}
566 UFUNCTION(BlueprintPure, Category = Cosmetics)
567 FORCEINLINE UDataTable* GetChallengeTable()
const {
return ChallengeTable; }
568 UFUNCTION(BlueprintPure, Category = Cosmetics)
569 FORCEINLINE
bool IsLoginBonusAvailable()
const {
return bLoginBonusAvailable; }
570 UFUNCTION(BlueprintPure, Category = Cosmetics)
571 FORCEINLINE UDataTable* GetRarityWeightTable()
const {
return RarityWeightTable;}
572 UFUNCTION(BlueprintPure, Category = GameState)
573 const TArray<TSubclassOf<class
AProjectXCharacter>>& GetPlayerClassList()
const {
return PlayerClassList; }
574 UFUNCTION(BlueprintPure, Category = GameState)
575 const TArray<TSubclassOf<class
AProjectXVehicle>>& GetVehicleClassList()
const {
return VehicleClassList; }
576 UFUNCTION(BlueprintPure, Category = GameState)
577 const TArray<FString>& GetAchievementMapNameList()
const {
return AchievementMapNameList; }
578 UFUNCTION(BlueprintPure, Category = GameState)
580 UFUNCTION(BlueprintPure, Category = GameState)
581 void GetWeaponList(TArray<TSubclassOf<class UWeaponInstance>>& WeaponList,
EEquipSlot Slot)
const;
582 UFUNCTION(BlueprintCallable)
583 const FLinearColor& GetRarityColour(
ERarity Rarity)
const {
return RarityColours.Contains(Rarity) ? RarityColours[Rarity] : FLinearColor::Black; }
584 UFUNCTION(BlueprintPure)
585 const FLinearColor& GetAllyColour(
const FName& ColourName = NAME_None)
const;
586 UFUNCTION(BlueprintPure)
587 const FLinearColor& GetEnemyColour(
const FName& ColourName = NAME_None)
const;
588 UFUNCTION(BlueprintPure)
589 const FLinearColor& GetSquadmateColour()
const;
590 UFUNCTION(BlueprintPure)
592 UFUNCTION(BlueprintCallable)
593 bool IsMatchmaking()
const {
return bIsMatchMaking; }
594 UFUNCTION(BlueprintCallable)
595 void SetCaptureBackBuffer(
bool bCaptureBackBuffer) { bCaptureBackBufferAndStream.AtomicSet(bCaptureBackBuffer); }
596 UFUNCTION(BlueprintPure)
597 static void GetCurrentLevelName(FString& LevelName);
598 UFUNCTION(BlueprintPure)
599 static void GetCurrentLevelNameForClients(FString& LevelName);
600 UFUNCTION(BlueprintCallable)
601 void UpdateClientPassword(UPARAM(ref)const FString& NewPassword) { ClientPassword = NewPassword; }
602 UFUNCTION(BlueprintCallable)
603 void LoadNakamaUsers(
const TArray<FString>& NakamaIds);
605 UFUNCTION(BlueprintCallable)
606 void AskForNakamaIdFromSteamID(
const FString& SteamID,FOnNakamaUserIDFound Callback);
607 UFUNCTION(BlueprintCallable)
608 const TArray<FString>& GetFriendsList()
const {
return Friends;}
609 UFUNCTION(BlueprintCallable)
610 void RequestUserInfo(
const FString& PlayerID, FUserRequestCallbackSignature Callback);
611 UFUNCTION(BlueprintCallable)
616 const TArray<TSubclassOf<ULevelInfo>>&
GetMapList()
const {
return MapList; }
617 const void GetMapNameList(TArray<FString>& MapNameList,
bool bShowMode =
false,
bool bShowSize =
false)
const;
619 TSubclassOf<class UOnlineSession> GetOnlineSessionClass()
override;
626 void ToggleLevelLighting(
bool bActiveLighting);
627 void AskForNakamaIdsFromSteamIDs(
const TArray<FString>& SteamIDs, FOnNakamaUserIDsFoundSignature FoundNakamaUsersCallback);
630 virtual
void SetKickReason(const FString& InKickReason);
631 UFUNCTION(BlueprintCallable, Category = GameInstance)
632 virtual
void ConsumeKickReason(FString& OutKickReason);
634 virtual
void OnNakamaConnected();
635 UFUNCTION(BlueprintPure)
637 UFUNCTION(BlueprintPure)
638 bool DoesServerOnlyAllowWhitelistedPlayers()
const {
return WhitelistedPlayers.Num() != 0; }
640 void OverrideAuthoritativeStat(
const FString& StatKey,
int Value);
642 void LevelToTarget(
const FString& StatKey,
int Value);
650 UPROPERTY(BlueprintAssignable)
651 FOnWorldOriginChangedSignature WorldOriginChangedEvent;
652 UPROPERTY(BlueprintAssignable)
653 FOnSessionSearchCompleteSignature SessionSearchCompleteEvent;
654 UPROPERTY(BlueprintAssignable)
655 FOnSessionSearchCompleteSignature OnSessionsListUpdatedEvent;
656 UPROPERTY(BlueprintAssignable)
657 FOnSessionJoinCompleteSignature SessionJoinCompleteEvent;
658 UPROPERTY(BlueprintAssignable)
659 FOnSessionDestroyCompleteSignature SessionDestroyCompleteEvent;
660 UPROPERTY(BlueprintAssignable)
661 FOnSessionEventSignature OnSessionStateUpdatedEvent;
662 UPROPERTY(BlueprintAssignable)
663 FOnSessionMatchmakingSignature OnSessionMatchmakingUpdated;
664 UPROPERTY(BlueprintAssignable)
665 FOnRestartPendingSignature OnServerRestartPending;
666 UPROPERTY(BlueprintAssignable)
667 FOnFounderDLCUnlockSignature OnShowFoundersPrompt;
668 UPROPERTY(BlueprintAssignable)
669 FOnShowcaseItems OnShowcaseUnlockedItems;
670 UPROPERTY(BlueprintAssignable)
671 FOnTwitchIntegrationVerified OnTwitchIntegrationVerified;
672 UPROPERTY(BlueprintAssignable)
673 FOnTwitchIntegrationVerified OnTwitchIntegrationRemoved;
674 UPROPERTY(BlueprintAssignable)
675 FOnMenuStateChanged OnMenuStateChanged;
676 UPROPERTY(BlueprintAssignable)
677 FOnUsersLoadedSignature OnNakamaUsersFoundEvent;
678 UPROPERTY(BlueprintAssignable)
679 FOnNakamaUserIDFoundSignature OnNakamaUserIDFoundEvent;
680 UPROPERTY(BlueprintAssignable)
681 FOnNakamaManagerInitializedSignature OnNakamaManagerInitializedEvent;
682 UPROPERTY(BlueprintAssignable)
683 FOnNakamaManagerInitializedSignature OnDailyLoginEvent;
684 UPROPERTY(BlueprintAssignable, BlueprintCallable)
685 FSettingChanged OnFOVSettingChanged;
686 UPROPERTY(BlueprintAssignable)
687 FOnUserInfoRequested OnUserInfoReceivedEvent;
689 FOnNakamaUserIDsFoundSignature OnNakamaUserIDsFoundEvent;
691 UPROPERTY(EditDefaultsOnly, Category = Configuration)
692 USoundAttenuation* ShooterSoundAttenuation =
nullptr;
693 UPROPERTY(EditDefaultsOnly, Category = Configuration)
694 USoundConcurrency* HitConcurrency =
nullptr;
696 UFUNCTION(BlueprintPure, Category = "Culture")
697 TArray<FText> GetSupportedLanguages() const;
698 UFUNCTION(BlueprintPure, Category = "Culture")
699 FName GetCurrentCulture()
const {
return CurrentLanguage; }
700 UFUNCTION(BlueprintCallable, Category =
"Culture")
701 void ChangeCulture(FName LanguageCode,
bool bPromptRestart = false,
bool bForce = false);
702 void FinishChangeCulture(FName InLanguageOverride,
bool bRestartToMenu = false);
704 UFUNCTION(BlueprintPure)
705 void GetTwitchAccountInfo(FString& Username, FString& Avatar)
const { Username = TwitchUserName; Avatar = TwitchAvatar; }
706 UFUNCTION(BlueprintPure)
707 bool HasValidTwitchAccountLinked()
const {
return bIsTwitchIntegratedOnThisAccount; }
708 UFUNCTION(BlueprintCallable)
709 void LinkTwitchAccount();
710 UFUNCTION(BlueprintCallable)
711 void UnlinkTwitchAccount();
715 void CheckReferAFriend();
717 void CheckLoginBonus();
718 UFUNCTION(BlueprintCallable)
719 void ConsumeLoginBonus(FOnNakamaDailyLoginRewardsFound OnLoginBonusFound);
720 void VerifyTwitchIntegration(
bool bCheckInBackground = true);
721 void OnTwitchIntegrationFailed();
722 void CheckForTwitchRewards(
bool ShowRewardsImmediately = false);
723 void OnTwitchIntegrationSuccess();
727 void GotoState(FName NewState,
bool bInitiateLevelLoad = true,
bool bForce = false);
728 void Open(FString OpenString);
729 void Open(FName LevelName,
bool bAbsolute = true, FString Options = "");
730 void FinishOpen(FString OpenString);
731 void FinishOpen(FName LevelName,
bool bAbsolute, FString Options);
732 void SetPresenceForPlayer(const FString& StatusStr, const FVariantData& PresenceData);
735 UFUNCTION(BlueprintCallable, Category = Permission)
736 void HasOnlinePermissions(
EProjectXPrivileges PrivelegeToCheck, const FPrivilegeSignature& Callback);
737 FPrivilegeSignature OnlinePermissionsCallback;
740 void OnPermissionsChecked(const FUniqueNetId& UserId, EUserPrivileges::Type Privilege, uint32 PrivilegeResults);
741 FName CurrentLanguage = NAME_None;
742 bool bIsTwitchIntegratedOnThisAccount = false;
743 FString TwitchUserName = "";
744 FString TwitchAvatar = "";
748 bool bIsLicensed = false;
749 int PendingControllerIndex = INDEX_NONE;
751 bool bMightBeSilver = false;
754 UPROPERTY(EditDefaultsOnly, Category = GameState)
756 UPROPERTY(EditDefaultsOnly, Category = GameState)
758 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = GameState)
759 TMap<FString, FText> EnumStringMap;
760 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
761 TMap<FName, FLinearColor> AllyColours;
762 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
763 TMap<FName, FLinearColor> EnemyColours;
764 UPROPERTY(EditDefaultsOnly, Category = GameState)
766 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
767 FLinearColor NeutralColor = FLinearColor::Gray;
768 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
769 FLinearColor SquadmateColour = FLinearColor::Green;
770 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
771 TArray<FText> TeamNames;
772 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
773 TArray<FString> AchievementMapNameList;
774 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
776 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
778 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = GameState)
780 UPROPERTY(EditDefaultsOnly, GlobalConfig, Category = AntiCheat)
781 bool bEnableAntiCheatForServer = true;
784 UPROPERTY(EditDefaultsOnly, GlobalConfig, BlueprintReadOnly, Category = "Server Health")
785 float InstanceRestartTime = 0.f;
786 UPROPERTY(GlobalConfig)
787 TArray<int32> ModIds;
788 UPROPERTY(GlobalConfig)
789 TArray<FString> WhitelistedAdmins;
790 UPROPERTY(GlobalConfig)
791 TArray<FString> WhitelistedPlayers;
794 UPROPERTY(EditDefaultsOnly, Category = GameState)
795 TSoftObjectPtr<UDataTable> MatureWordsDatabase;
796 UPROPERTY(EditDefaultsOnly, Category = GameState)
798 static TArray<FString> MatureWords;
799 UPROPERTY(EditDefaultsOnly, Category = "AnnouncerData")
801 UPROPERTY(EditDefaultsOnly, Category = "AnnouncerData")
803 UPROPERTY(EditDefaultsOnly, Category = "AnnouncerData")
804 USoundEffectSourcePresetChain* HelmetRadioEffect =
nullptr;
805 UPROPERTY(EditDefaultsOnly, Category = "Sound")
806 USoundClass* LocalWeaponSoundClass =
nullptr;
807 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
808 class UTextureRenderTarget2D* FrameBufferAsRenderTexture =
nullptr;
809 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
810 UCurveFloat* NavLinkApproachCurve =
nullptr;
813 UPROPERTY(EditDefaultsOnly, Category = Server)
814 int AcceptablePingRange = 50;
816 UPROPERTY(EditDefaultsOnly, Category = Server)
817 int MaximumPingRange = 150;
819 UPROPERTY(EditDefaultsOnly, Category = Server)
820 int MatchmakingMaxPlayerCount = 60;
821 UPROPERTY(EditDefaultsOnly, Category = Session)
822 float SessionEventDelayLength = 5.0f;
823 UPROPERTY(EditDefaultsOnly, Category = Session)
824 float PartyHostSessionJoinDelay = 3.0f;
826 UPROPERTY(EditDefaultsOnly)
828 UPROPERTY(EditDefaultsOnly)
829 TSubclassOf<UAfflictionInstance> DefaultMarkRemainingEnemiesAffliction = NULL;
830 UPROPERTY(BlueprintReadOnly)
831 bool bIsFoundersEdition = true;
832 UFUNCTION(BlueprintPure)
833 bool ShowFoundersPrompt();
835 UFUNCTION(BlueprintNativeEvent)
836 void OnPlatformDependentEngagementCompleted();
838 bool bShowFoundersPrompt = false;
840 FText CancelText = NSLOCTEXT("LEAP", "Cancel", "Cancel");
842 FText OkText = NSLOCTEXT("LEAP", "OK", "Ok");
844 FString GetModIdsAsString()
const
847 for (int32 ModId : ModIds)
849 Output += FString::FromInt(ModId) +
":";
851 Output = Output.LeftChop(1);
852 return MoveTemp(Output);
856 TMap<ERewardType,FRewardShowcase> RewardShowcaseQue = TMap<ERewardType, FRewardShowcase>();
857 uint8 LoadedRewards = 0;
859 void OnNetworkTravelFailure(UWorld* InWorld, ETravelFailure::Type FailureType,
const FString& ErrorString);
860 void OnNetworkFailure(UWorld* InWorld,
class UNetDriver* NetDriver, ENetworkFailure::Type FailureType,
const FString& ErrorString);
862 void FindSessions(
bool blan,
bool bDelayResult,
bool bMatchMaking);
866 void JoinBestSession(const TArray<
FServerInfo>& ServerInfos);
868 void FindAllSessionsResponse(const TArray<
FServerInfo>& ServerInfos);
874 TSharedPtr<class FOnlineSessionSearch> SessionSearch;
875 FOnFindSessionsCompleteDelegate OnFindSessionsCompleteDelegate;
876 FOnReadFriendsListComplete OnReadFriendsListComplete;
877 FDelegateHandle OnFindSessionsCompleteDelegateHandle;
878 FDelegateHandle OnJoinSessionsCompleteDelegateHandle;
879 FDelegateHandle OnSearchSessionsCompleteDelegateHandle;
880 FOnJoinSessionComplete::FDelegate OnJoinSessionCompleteDelegate;
881 FDelegateHandle OnCreatePresenceSessionCompleteDelegateHandle;
882 FOnDestroySessionCompleteDelegate OnDestroySessionCompleteDelegate;
883 FDelegateHandle OnDestroySessionCompleteDelegateHandle;
886 FTickerDelegate TickDelegate;
889 FDelegateHandle TickDelegateHandle;
893 void OnlineSubsystemInit();
894 void BeginAntiCheatSession(const FUniqueNetId& LocalUserId, ELoginStatus::Type Status);
896 bool Tick(
float DeltaSeconds);
897#if !IS_CONSOLE_PLATFORM
898 void ModDownloadsComplete(
struct FModioResponse Response,
bool bSuccess);
901 void OnModsInstalled();
904 void GetFoundersDLC();
906 void OnPostWorldOriginOffset(UWorld* InWorld, FIntVector PreviousOriginLocation, FIntVector NewOriginLocation);
908 void LoadMods(TArray<int32>& ModsToLoad,
bool bRefreshPluginDirectory = false);
909 void OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type JoinCompletionResult);
910 void JoinPartyToSearchResult(const FOnlineSessionSearchResult& SearchResult);
912 void OnDestroySessionComplete(FName Sessionname,
bool bSucessful);
913 virtual
bool JoinSession(ULocalPlayer* LocalPlayer, int32 SessionIndexInSearchResults) override;
914 virtual
bool JoinSession(ULocalPlayer* LocalPlayer, const FOnlineSessionSearchResult& SearchResult) override;
915 bool HostGame(ULocalPlayer* LocalPlayer, const FString& GameType, const FString& InTravelURL);
916 void OnCreatePresenceSessionComplete(FName SessionName,
bool bWasSuccessful);
917 void OnRegisterLocalPlayerComplete(const FUniqueNetId& PlayerId, EOnJoinSessionCompleteResult::Type Result);
918 void FinishSessionCreation(EOnJoinSessionCompleteResult::Type Result);
920 void OnSearchSessionCompleteDelay(
bool bWasSuccessful);
922 void OnSearchSessionsComplete(
bool bWasSuccessful);
924 void OnSessionUserInviteAcceptedClient(const
bool bSuccess, const int32 ControllerId, TSharedPtr<const FUniqueNetId> UserId, const FOnlineSessionSearchResult& InviteSessionData);
925 void OnSessionUserInviteReceivedClient(const FUniqueNetId& UserId, const FUniqueNetId& FromId, const FString& AppID, const FOnlineSessionSearchResult& InviteResult);
926 void HandleSessionFailureServer(const FUniqueNetId& NetId, ESessionFailure::Type FailureType);
927 void HandleSessionFailureClient(const FUniqueNetId& NetId, ESessionFailure::Type FailureType);
928 void OnCreateGameSessionCompleted(FName InSessionName,
bool bWasSuccessful);
930 void OnFriendsChanged();
932 void OnReadFriendListCompleteResponse(int32 LocalUserNum,
bool bWasSuccessful, const FString& ListName, const FString& ErrorStr);
933 void OnNakamaIdsFoundResponse(const TArray<FString>& SteamIds, const TSharedPtr<FJsonObject>& FoundNakamaUsers);
934 void LoadFriendsListFromInterface();
935#if !IS_CONSOLE_PLATFORM
938 bool LoadFrontEndMap();
939 void JoinFoundSession(int32 Id,
bool Success,
const FOnlineSessionSearchResult& Session);
941 FString GetPlayerNickname()
const;
942 static IOnlineIdentityPtr GetOnlineIdentity();
946 TArray<TSubclassOf<ULevelInfo>> MapList;
947 UPROPERTY(GlobalConfig, EditDefaultsOnly, Category = Maps)
948 TArray<TSoftClassPtr<ULevelInfo>> MapListConfig;
949 UPROPERTY(EditDefaultsOnly, Category = Cosmetics)
950 UDataTable* MasterCosmeticTable = NULL;
951 UPROPERTY(EditDefaultsOnly, Category = Cosmetics)
952 UDataTable* PerksTable = NULL;
953 UPROPERTY(EditDefaultsOnly, Category = Cosmetics)
954 UDataTable* ChallengeTable = NULL;
955 UPROPERTY(EditDefaultsOnly, Category = Cosmetics)
956 UDataTable* RarityWeightTable = NULL;
959 FString KickReason = "";
961 FString TravelURL = "";
963 bool bAntiCheatClientSessionActive = false;
965 bool bStarted = false;
972 class UCosmeticsManager* CosmeticManager = NULL;
977 UPROPERTY(BlueprintReadOnly, Category = "SimpleUGC")
978 class UUGCRegistry* UGCRegistry =
nullptr;
980 int32 IgnorePairingChangeForControllerId;
981 EOnlineServerConnectionStatus::Type CurrentConnectionStatus;
982 FString ConsoleServerPort = "";
983 FString ServerSecret = "";
985 TArray<ELoginStatus::Type> LocalPlayerOnlineStatus;
987 FString SessionID = "";
988 FString ClientPassword = "";
989 TArray<FString> Friends;
991 FTimerHandle FindSessionDelayTimer;
992 FTimerHandle JoiningSessionDelayTimer;
993 FTimerHandle InstanceResetCheckTimer;
994 FDelegateHandle WorldOriginDelegateHandle;
996 bool bIsMatchMaking = false;
997 bool bLoadedFriendsListInterface = false;
999 bool bLoginBonusAvailable = false;
1000 FThreadSafeBool bCaptureBackBufferAndStream = true;
1005 bool bSearchFreshServersOnly = false;
1006 bool bServerRestartPending = false;
1007 FIntVector LastOriginShiftDelta = FIntVector::ZeroValue;
1009 TMap<FString, FUserRequestCallbackSignature> UserInfoCallbackRequests;
1010 TMap<FString,FString> UserIDtoNicknameMap = TMap<FString,FString>();
1011 TArray<int32> ServerModsToLoad;
1012 FOnlineSessionSearchResult PostModDownloadSessionToJoin;
1014 UPROPERTY(EditDefaultsOnly, Category = Matchmaking)
1015 UCurveFloat* MatchmakingPingWeightCurve =
nullptr;
1016 UPROPERTY(EditDefaultsOnly, Category = Matchmaking)
1017 UCurveFloat* MatchmakingPlayerWeightCurve =
nullptr;
1018 UPROPERTY(EditDefaultsOnly, Category = Achievement)
1020 bool bIsDownloadingMods = false;
ERarity
Definition: CosmeticAssetBase.h:95
EEquipSlot
Definition: PlayerStructs.h:25
EProjectXPrivileges
Definition: ProjectXGameInstance.h:66
@ CanUseUserGeneratedContent
EProjectXPrivilegeResult
Definition: ProjectXGameInstance.h:81
@ NetworkConnectionUnavailable
EServerPlatform
Definition: ProjectXGameInstance.h:58
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnWorldOriginChangedSignature, class UWorld *, InWorld, FIntVector, PreviousOriginLocation, FIntVector, NewOriginLocation)
EAvatarSize
Definition: ProjectXGameInstance.h:143
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMenuStateChanged, UAdvancedUserWidget *, Widget, bool, bToggle)
DECLARE_DYNAMIC_DELEGATE_TwoParams(FPrivilegeSignature, bool, bAllowed, EProjectXPrivilegeResult, Result)
DECLARE_DELEGATE_TwoParams(FOnNakamaUserIDsFoundSignature, const TArray< FString > &, const TSharedPtr< FJsonObject > &)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSessionSearchCompleteSignature, const TArray< FServerInfo > &, ServerInfos)
ESessionState
Definition: ProjectXGameInstance.h:48
DECLARE_DYNAMIC_DELEGATE_OneParam(FOnNakamaDailyLoginRewardsFound, bool, bLoginBonusAvailable)
EAchievementData
Definition: ProjectXGameInstance.h:191
@ HAZE_FOR_DAYS_ACHIEVEMENT_11
@ DINE_AND_DASH_ACHIEVEMENT_41
@ CENTURION_ACHIEVEMENT_23
@ FLYSWATTER_ACHIEVEMENT_32
@ ACE_OF_BASES_ACHIEVEMENT_17
@ ANNIHILATOR_ACHIEVEMENT_31
@ GLUTTON_FOR_PUNISHMENT_ACHIEVEMENT_8
@ VERSUS_GOLIATH_ACHIEVEMENT_34
@ MASTER_OF_ALL_ACHIEVEMENT_37
@ GRENADIER_ACHIEVEMENT_25
@ CITIZEN_OF_CHANGSHA_ACHIEVEMENT_12
@ AVERAGE_JOES_ACHIEVEMENT_33
@ KING_OF_THE_HILL_ACHIEVEMENT_16
@ LIEUTENANT_ACHIEVEMENT_4
@ VERY_IMPORTANT_ACHIEVEMENT_19
@ BRINGER_OF_WRATH_ACHIEVEMENT_27
@ MORE_LIKE_TECH_STOPS_ACHIEVEMENT_35
@ ARCHAEOLOGIST_ACHIEVEMENT_13
@ PYROMANCER_ACHIEVEMENT_14
@ CANT_STOP_ME_NOW_ACHIEVEMENT_42
@ DESTROYER_ACHIEVEMENT_26
@ VALLEY_GIRL_ACHIEVEMENT_15
@ FLOAT_LIKE_A_BUTTERFLY_ACHIEVEMENT_43
@ NO_I_IN_TEAM_ACHIEVEMENT_20
@ MASTER_OF_NONE_ACHIEVEMENT_36
@ ELIMINATOR_ACHIEVEMENT_30
@ TROPICAN_ACHIEVEMENT_10
@ CRACKIN_SKULLS_ACHIEVEMENT_38
@ ALL_THAT_GLITTERS_ACHIEVEMENT_21
@ CAPTURE_THE_VICTORY_ACHIEVEMENT_18
@ HOT_POTATO_ACHIEVEMENT_24
EOnlineMode
Definition: ProjectXGameInstance.h:40
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnRestartPendingSignature)
EJoinSessionResponse
Definition: ProjectXGameInstance.h:445
@ CouldNotRetrieveAddress
ESortParameter
Definition: ProjectXGameInstance.h:173
ERewardType
Definition: ProjectXGameInstance.h:436
EDifficultyLevel
Definition: ProjectXGameState.h:54
EGameType
Definition: ProjectXGameState.h:40
Definition: ProjectXCharacter.h:128
Definition: ProjectXGameSession.h:36
Definition: ProjectXMapCamera.h:11
Definition: ProjectXVehicle.h:56
Definition: ProjectXGameInstance.h:130
bool bUGCPrivilegesCheckedAndAllowed
Definition: ProjectXGameInstance.h:138
bool bPrivilegesCheckedAndAllowed
Definition: ProjectXGameInstance.h:137
int32 ControllerId
Definition: ProjectXGameInstance.h:134
FPXPendingInvite()
Definition: ProjectXGameInstance.h:132
TSharedPtr< const FUniqueNetId > UserId
Definition: ProjectXGameInstance.h:135
FOnlineSessionSearchResult InviteResult
Definition: ProjectXGameInstance.h:136
Definition: AnnouncerSoundDataAsset.h:42
Definition: GameInstanceLoadingScreen.h:18
Definition: LevelInfo.h:14
Definition: NakamaManager.h:55
Definition: PlayerProgressionManager.h:76
Definition: ProjectXGameInstance.h:507
UAnnouncerSoundDataAsset * GetGeneralAnnouncerData() const
Definition: ProjectXGameInstance.h:648
UPlayerProgressionManager * GetPlayerProgression() const
Definition: ProjectXGameInstance.h:613
const FString & GetClientPassword()
Definition: ProjectXGameInstance.h:604
UAnnouncerSoundDataAsset * GetAnnouncerData() const
Definition: ProjectXGameInstance.h:646
const TMap< EAchievementData, int32 > & GetAchievementMap() const
Definition: ProjectXGameInstance.h:855
const FString & GetSessionID() const
Definition: ProjectXGameInstance.h:621
const TArray< TSubclassOf< ULevelInfo > > & GetMapList() const
Definition: ProjectXGameInstance.h:616
void SetPendingInvite(const FPXPendingInvite &NewPendingInvite)
Definition: ProjectXGameInstance.h:625
static FORCEINLINE T * GetGameInstance()
Definition: ProjectXGameInstance.h:623
bool IsServerRestarting() const
Definition: ProjectXGameInstance.h:643
Definition: RemoteConsole.h:15
Definition: StatsTrackingManager.h:101
Definition: WeaponInstance.h:220
Definition: ProjectXGameInstance.h:109
const FName None
Definition: ProjectXGameInstance.h:110
const FName MainMenu
Definition: ProjectXGameInstance.h:112
const FName Playing
Definition: ProjectXGameInstance.h:113
const FName PlayingSolo
Definition: ProjectXGameInstance.h:114
const FName WelcomeScreen
Definition: ProjectXGameInstance.h:111
Definition: ProjectXGameInstance.h:161
Definition: ProjectXGameInstance.h:151
Definition: ProjectXGameInstance.h:412
FNakamaUser(const FString &NewUserName, const FString &NewSteamID)
Definition: ProjectXGameInstance.h:415
Definition: ProjectXGameInstance.h:121
EProjectXPrivileges Privilege
Definition: ProjectXGameInstance.h:125
FPrivilegeSignature Callback
Definition: ProjectXGameInstance.h:126
Definition: ProjectXGameInstance.h:462
FRewardShowcase(const TArray< FString > &Items, int32 Currency, int32 Experience)
Definition: ProjectXGameInstance.h:466
Definition: ProjectXGameInstance.h:240
FOnlineSessionSearchResult Session
Definition: ProjectXGameInstance.h:389
EGameType GameType
Definition: ProjectXGameInstance.h:252
FString ServerName
Definition: ProjectXGameInstance.h:244
int32 Ping
Definition: ProjectXGameInstance.h:260
bool bHasWhiteList
Definition: ProjectXGameInstance.h:272
bool bOfficial
Definition: ProjectXGameInstance.h:246
FString MapName
Definition: ProjectXGameInstance.h:248
bool bAntiCheatEnabled
Definition: ProjectXGameInstance.h:266
int32 DifficultyLevel
Definition: ProjectXGameInstance.h:254
int32 PlayersCurrent
Definition: ProjectXGameInstance.h:250
Definition: ProjectXGameInstance.h:394
FServerScore(const FServerInfo &InServerInfo, float InScore)
Definition: ProjectXGameInstance.h:397
Definition: ProjectXGameInstance.h:424
FUsers()
Definition: ProjectXGameInstance.h:425