UnrealVoxta 0.1.1
 
Loading...
Searching...
No Matches
VoxtaVersionData.h
Go to the documentation of this file.
1// Copyright(c) 2025 grrimgrriefer & DZnnah, see LICENSE for details.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "VoxtaDefines.h"
7#include "VoxtaVersionData.generated.h"
8
15USTRUCT(BlueprintType)
16struct VOXTADATA_API FVoxtaVersionData
17{
18 GENERATED_BODY()
19
20#pragma region public API
21public:
28 FStringView GetCompatibleServerVersion() const { return m_compatibleServerVersion; }
29
36 FStringView GetCompatibleAPIVersion() const { return m_compatibleAPIVersion; }
37
44 FStringView GetServerVersion() const { return m_serverVersion; }
45
52 FStringView GetApiVersion() const { return m_apiVersion; }
53
60 bool IsMatchingServerVersion() const { return m_serverVersion == m_compatibleServerVersion; }
61
68 bool IsMatchingAPIVersion() const { return m_apiVersion == m_compatibleAPIVersion; }
69
70 explicit FVoxtaVersionData(FString voxtaServerVersion, FString voxtaAPIVersion) :
71 m_serverVersion(voxtaServerVersion),
72 m_apiVersion(voxtaAPIVersion)
73 {}
74
76 FVoxtaVersionData() = default;
77#pragma endregion
78
79private:
80 UPROPERTY(BlueprintReadOnly, Category = "Voxta", meta = (AllowPrivateAccess = "true", DisplayName = "Supported VoxtaServer version"))
81 FString m_compatibleServerVersion = TARGETED_SERVER_VERSION;
82
83 UPROPERTY(BlueprintReadOnly, Category = "Voxta", meta = (AllowPrivateAccess = "true", DisplayName = "Supported VoxtaServer API version"))
84 FString m_compatibleAPIVersion = TARGETED_API_VERSION;
85
86 UPROPERTY(BlueprintReadOnly, Category = "Voxta", meta = (AllowPrivateAccess = "true", DisplayName = "Current VoxtaServer version"))
87 FString m_serverVersion = TEXT("not connected");
88
89 UPROPERTY(BlueprintReadOnly, Category = "Voxta", meta = (AllowPrivateAccess = "true", DisplayName = "Current VoxtaServer API version"))
90 FString m_apiVersion = TEXT("not connected");
91};
#define TARGETED_API_VERSION
Definition VoxtaDefines.h:20
#define TARGETED_SERVER_VERSION
Definition VoxtaDefines.h:19
FStringView GetApiVersion() const
Get the actual API version reported by the connected server.
Definition VoxtaVersionData.h:52
bool IsMatchingServerVersion() const
Check if the connected server's version matches the expected version.
Definition VoxtaVersionData.h:60
bool IsMatchingAPIVersion() const
Check if the connected server's API version matches the expected version.
Definition VoxtaVersionData.h:68
FVoxtaVersionData()=default
Default constructor.
FStringView GetCompatibleAPIVersion() const
Get the compatible API version that this client expects.
Definition VoxtaVersionData.h:36
FStringView GetServerVersion() const
Get the actual server version reported by the connected server.
Definition VoxtaVersionData.h:44
FStringView GetCompatibleServerVersion() const
Get the compatible server version that this client expects.
Definition VoxtaVersionData.h:28
FVoxtaVersionData(FString voxtaServerVersion, FString voxtaAPIVersion)
Definition VoxtaVersionData.h:70