Network total reforge. Team-List and Race-Data handled

This commit is contained in:
2025-06-29 19:04:36 +02:00
parent 3a45d4c3b7
commit 81bf37639b
92 changed files with 3736 additions and 4202 deletions

View File

@ -0,0 +1,32 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxArchSelectServerResponse.generated.h"
USTRUCT(BlueprintType)
struct FDTFluxArchSelectResponseItem
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "arch-select";
UPROPERTY()
int ContestId;
UPROPERTY()
int StageId;
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxArchSelectResponse
{
GENERATED_BODY()
UPROPERTY()
FString Type = "arch-select";
UPROPERTY()
TArray<FDTFluxArchSelectResponseItem> Datas;
};

View File

@ -0,0 +1,93 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
// #include "DTFluxRaceDataServerResponse.generated.h"
#include "DTFluxRaceDataServerResponse.generated.h"
/**
* Struct that represent split Json data response from the server
* Used to deserialize Split response data
*/
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxSplitResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "split-response-data";
UPROPERTY()
int Id;
UPROPERTY()
FString Name;
};
/**
* Struct representing Stage data response from the server
* Used to deserialize Stage response data
*/
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxStageResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "stage-response-data";
UPROPERTY()
int Id;
UPROPERTY()
FString Name;
UPROPERTY()
FString StartTime;
UPROPERTY()
FString EndTime;
UPROPERTY()
FString CutOff;
};
/**
* Struct representing Contest data response from the server
* Used to deserialize Contest Response
*/
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxContestResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "contest";
UPROPERTY()
int Id;
UPROPERTY()
FString Name;
UPROPERTY()
FDateTime Date;
UPROPERTY()
TArray<FDTFluxStageResponse> Stages;
UPROPERTY()
TArray<FDTFluxSplitResponse> Splits;
};
/**
* Struct representing the race data globally
* Used to exchange data between the system and the API
*/
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxRaceDataResponse
{
GENERATED_BODY()
public:
UPROPERTY()
// ReSharper disable once StringLiteralTypo
FString Type = "race-datas";
UPROPERTY()
TArray<FDTFluxContestResponse> Datas;
};

View File

@ -0,0 +1,62 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Types/Struct/DTFluxRankingStructs.h"
#include "UObject/Object.h"
#include "DTFluxRankingServerResponse.generated.h"
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxContestRankingResponseItem : public FDTFluxContestRanking
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "team-contest-ranking";
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxContestRankingResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "contest-ranking";
UPROPERTY()
int ContestID;
UPROPERTY()
TArray<FDTFluxContestRankingResponseItem> Datas;
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxStageRankingResponseItem : public FDTFluxStageRanking
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "team-stage-ranking";
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxStageRankingResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "stage-ranking";
UPROPERTY()
int ContestID;
UPROPERTY()
int StageID;
UPROPERTY()
int SplitID = -1;
UPROPERTY()
// ReSharper disable once IdentifierTypo
TArray<FDTFluxStageRankingResponseItem> Datas;
};

View File

@ -0,0 +1,133 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxRequestStructs.generated.h"
/**
* Struct representing a base json object request to the server
* Used to request data to the server
*/
USTRUCT()
struct FDTFluxRequestBase
{
GENERATED_BODY()
public:
UPROPERTY()
FString Path = "";
};
/**
* Struct representing a RaceData json object request to the server
* RaceData represents all data concerning the Race and its different Contests, Stages and Splits.
*/
USTRUCT()
struct FDTFluxRaceDataRequest: public FDTFluxRequestBase
{
GENERATED_BODY()
public:
FDTFluxRaceDataRequest(){
Path = "race-datas";
}
};
/**
* Struct representing a TeamList json object request to the server
* TeamList is the list of participants of the events
*/
USTRUCT()
struct FDTFluxTeamListRequest: public FDTFluxRequestBase
{
GENERATED_BODY()
public:
FDTFluxTeamListRequest(){
Path = "team-list";
}
};
/**
* Struct representing a Ranking json request object for a specific to the server
*/
USTRUCT()
struct FDTFluxContestRankingRequest: public FDTFluxRequestBase
{
GENERATED_BODY()
public:
FDTFluxContestRankingRequest()
{
Path = "contest-ranking";
ContestID = -1;
}
FDTFluxContestRankingRequest(int InContestID)
{
Path = "contest-ranking";
ContestID = InContestID;
}
UPROPERTY()
int ContestID;
};
/**
* Struct representing a Ranking json request object for a specific Stage to the server
*/
USTRUCT()
struct FDTFluxStageRankingRequest: public FDTFluxRequestBase
{
GENERATED_BODY()
public:
FDTFluxStageRankingRequest()
{
Path = "stage-ranking";
ContestID = -1;
StageID = -1;
SplitID = -1;
}
FDTFluxStageRankingRequest(int InContestID, int InStageId)
{
Path = "stage-ranking";
ContestID = InContestID;
StageID = InStageId;
SplitID = -1;
}
UPROPERTY()
int ContestID;
UPROPERTY()
int StageID;
UPROPERTY()
int SplitID;
};
/**
* Struct representing a Ranking json request object for a specific Split to the server
*/
USTRUCT()
struct FDTFluxSplitRankingRequest: public FDTFluxStageRankingRequest
{
GENERATED_BODY()
public:
FDTFluxSplitRankingRequest()
{
Path = "stage-ranking";
ContestID = -1;
StageID = -1;
SplitID = -1;
}
FDTFluxSplitRankingRequest(int InContestID, int InStageId, int InSplitId)
{
Path = "stage-ranking";
ContestID = InContestID;
StageID = InStageId;
SplitID = InSplitId;
}
};

View File

@ -0,0 +1,54 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxServerResponseStruct.generated.h"
/**
* Struct representing a mixed root json server response
*/
USTRUCT()
struct DTFLUXNETWORK_API FDTFluxServerResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "";
UPROPERTY()
int Code = -1;
UPROPERTY()
FString Message = "";
UPROPERTY()
FString Trigger = "";
UPROPERTY()
int ContestID = -1;
UPROPERTY()
int StageID = -1;
UPROPERTY()
int SplitID = -1;
UPROPERTY()
FDateTime ReceivedAt;
UPROPERTY()
FString RawMessage;
UPROPERTY()
FName RequestId = FName("");
UPROPERTY()
FText FailureReason;
};

View File

@ -0,0 +1,45 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "DTFluxSplitSensorServerResponse.generated.h"
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxSplitSensorItemResponse
{
GENERATED_BODY()
public:
UPROPERTY()
int Bib;
UPROPERTY()
FString Type = "split-sensor-item";
UPROPERTY()
int ContestID;
UPROPERTY()
int StageID;
UPROPERTY()
int SplitID;
UPROPERTY()
FString Time = "-";
UPROPERTY()
FString Gap = "-";
UPROPERTY()
int Rank;
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxSplitSensorResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "split-sensor";
UPROPERTY()
// ReSharper disable once IdentifierTypo
TArray<FDTFluxSplitSensorItemResponse> Datas;
};

View File

@ -0,0 +1,66 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Types/Struct/DTFluxTeamListStruct.h"
#include "UObject/Object.h"
#include "DTFluxTeamListServerResponse.generated.h"
/**
* @struct FDTFluxTeamUpdateResponse
* Struct representing the Participant List Update Response from the server
* Used to exchange an update of a list of participant to the server
*/
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxTeamUpdateResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "team-update";
UPROPERTY()
int Bib = -1;
UPROPERTY()
FString Status;
};
/**
* @struct FDTFluxTeamListResponse
* Struct representing the Participant List Response from the server
* Used to exchange data between the system and the API
*/
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxTeamListResponse : public FDTFluxTeamListDefinition
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "team-list";
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxStatusTeamUpdateResponse
{
GENERATED_BODY()
public:
UPROPERTY()
FString Type = "status-team-update";
UPROPERTY()
int Bib;
UPROPERTY()
int Status;
};
USTRUCT(BlueprintType)
struct DTFLUXNETWORK_API FDTFluxStatusUpdateResponse
{
GENERATED_BODY()
UPROPERTY()
FString Type = "status-update";
UPROPERTY()
// ReSharper disable once IdentifierTypo
FDTFluxStatusTeamUpdateResponse Datas;
};