44 lines
1.0 KiB
C++
44 lines
1.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/GameModeBase.h"
|
|
#include "AgrarianGameGameMode.generated.h"
|
|
|
|
class UAgrarianPersistenceSubsystem;
|
|
|
|
/**
|
|
* Simple GameMode for a third person game
|
|
*/
|
|
UCLASS(abstract)
|
|
class AAgrarianGameGameMode : public AGameModeBase
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
/** Constructor */
|
|
AAgrarianGameGameMode();
|
|
|
|
virtual void BeginPlay() override;
|
|
virtual void RestartPlayer(AController* NewPlayer) override;
|
|
virtual void Logout(AController* Exiting) override;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence", meta = (ClampMin = "0"))
|
|
float ServerAutoSaveIntervalSeconds = 300.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
|
|
bool bLoadWorldOnServerStart = true;
|
|
|
|
protected:
|
|
void RegisterPersistentActorClasses(UAgrarianPersistenceSubsystem* Persistence) const;
|
|
void LoadWorldOnServerStart();
|
|
void RunServerAutoSave();
|
|
|
|
FTimerHandle ServerAutoSaveTimerHandle;
|
|
};
|
|
|
|
|
|
|