#pragma once #include "CoreMinimal.h" #include "GameFramework/GameStateBase.h" #include "SaltyGameState.generated.h" // Replicated session facts. Step 2 carries the session id the server minted so every client's telemetry file // belongs to the same session (Docs/Spec/Networking.md, Telemetry over the wire). UCLASS() class SALTY_API ASaltyGameState : public AGameStateBase { GENERATED_BODY() public: virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; // Server only. Writes the id and starts the server's own telemetry session. void SetSessionId(const FGuid& InSessionId); FGuid GetSessionId() const { return SessionId; } protected: UFUNCTION() void OnRep_SessionId(); private: UPROPERTY(ReplicatedUsing = OnRep_SessionId) FGuid SessionId; void AdoptSessionId(); };