This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Source/AgrarianGame/AgrarianGameGameMode.h
T

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;
};