5#include "CoreMinimal.h"
8#include "GameFramework/GameModeBase.h"
9#include "MainMenuGameMode.generated.h"
28 int32 NumberOfVisits = 0;
29 bool bFavourited =
false;
49 virtual void PostLogin(APlayerController * NewPlayer)
override;
54 void RequestServerHistoryInfo(std::string cursor =
"");
55 void RequestServerHistoryInfoResponse(std::vector<NAKAMA_NAMESPACE::NStorageObject> ServerInfo);
60 void OnNakamaManagerInitialized();
62 virtual TSubclassOf<AGameSession> GetGameSessionClass() const override;
65 void OnStoreTimerExpired();
66 UFUNCTION(BlueprintPure, meta = (WorldContext = "WorldContextObject"), Category = PlayerState)
67 static
void GetPlayerID(const UObject* WorldContextObject, APlayerState* PlayerState, FString& ID);
70 UFUNCTION(BlueprintPure, Category = ServerInfo)
71 FORCEINLINE
bool IsFavouriteServer(const FString&
ServerName)
const {
return ServerHistory.Servers.Contains(
ServerName) ? ServerHistory.Servers[
ServerName].bFavourited :
false; }
72 UFUNCTION(BlueprintPure, Category = ServerInfo)
73 FORCEINLINE
bool IsInHistory(const FString&
ServerName)
const {
return ServerHistory.Servers.Contains(
ServerName) ? ServerHistory.Servers[
ServerName].NumberOfVisits > 0 :
false; }
75 UFUNCTION(BlueprintPure, Category = PlayerInfo)
76 FORCEINLINE TSubclassOf<
UWeaponInstance> GetWeaponClassByName(const FString& WeaponID)
const {
return WeaponClasses.Contains(WeaponID) ? WeaponClasses[WeaponID] : NULL; }
77 UFUNCTION(BlueprintCallable, Category = PlayerInfo)
78 TSubclassOf<AProjectXCharacter> GetCharacterClassByWeaponName(
const FString& WeaponID)
const;
79 UFUNCTION(BlueprintCallable, Category = MainMenuGameMod)
81 UFUNCTION(BlueprintCallable, Category = MainMenuGameMode)
82 TSoftObjectPtr<USkeletalMesh> GetMesh(
const FString& ID,
EStatClassifier Type);
83 UFUNCTION(BlueprintCallable)
84 void PurchaseItemRequest(int32 ItemID);
85 UFUNCTION(BlueprintCallable, Category =
Server)
86 void ToggleFavouriteServer(
const FString& ServerID,
bool bFavourited);
87 UFUNCTION(BlueprintCallable, Category =
Server)
88 void IncrementServerVisits(
const FString& ServerID);
90 void OnNakamaConnected();
91 void SaveServerHistoryInfo();
93 UPROPERTY(BlueprintAssignable, Category = MainMenuGameMode)
94 FOnStatsLoadedSignature OnDataLoaded;
95 UPROPERTY(BlueprintAssignable, Category = MainMenuGameMode)
96 FMeshUpdatedSignature OnMeshUpdated;
97 UPROPERTY(BlueprintAssignable, Category = MainMenuGameMode)
98 FPurchaseRequestSignature OnPurchaseRequest;
99 UPROPERTY(BlueprintAssignable, Category = MainMenuGameMode)
100 FPurchaseResponseSignature OnPurchaseResponse;
101 UPROPERTY(BlueprintAssignable, Category = MainMenuGameMode)
102 FServerInfoSignature OnServerInfoLoaded;
105 FString LocalPlayerID;
108 FTimerHandle DailyTimer;
109 FTimerHandle FeatureTimer;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FPurchaseResponseSignature, AActor *, Item, bool, bSuccess)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FMeshUpdatedSignature, TSoftObjectPtr< USkeletalMesh >, Mesh)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStatsLoadedSignature)
EStatClassifier
Definition: PlayerStats.h:75
Definition: MainMenuGameMode.h:45
TMap< FString, TSubclassOf< UWeaponInstance > > WeaponClasses
Definition: MainMenuGameMode.h:51
TMap< FString, TSubclassOf< AProjectXCharacter > > PlayerClasses
Definition: MainMenuGameMode.h:52
Definition: ProjectXCharacter.h:128
Definition: WeaponInstance.h:220
Definition: MainMenuGameMode.h:36
Definition: MainMenuGameMode.h:24