Compare commits

4 Commits

Author SHA1 Message Date
7ce81040e9 and the function 2025-07-11 00:54:34 +02:00
77c9d42f22 Expose To Blueprint 2025-07-11 00:53:35 +02:00
f7f70446d8 Fix Event Pursuit 2025-07-11 00:47:51 +02:00
8e42f9565e Fix Uncallable event 2025-07-11 00:37:22 +02:00
5 changed files with 24 additions and 17 deletions

View File

@ -366,3 +366,12 @@ void UDTFluxCoreSubsystem::LaunchPursuitSequenceFor(const TArray<int> ContestIds
} }
} }
} }
FOnPursuitSequenceReady& UDTFluxCoreSubsystem::InitPursuit(const TArray<FDTFluxContest> Contests)
{
if (PursuitManager)
{
PursuitManager->LaunchPursuitSequenceFor(Contests);
}
return PursuitManager->OnPursuitSequenceReady;
}

View File

@ -18,7 +18,7 @@ class UDTFluxPursuitManager;
/** /**
* *
*/ */
UCLASS() UCLASS(Blueprintable, BlueprintType)
class DTFLUXCORESUBSYSTEM_API UDTFluxCoreSubsystem : public UEngineSubsystem class DTFLUXCORESUBSYSTEM_API UDTFluxCoreSubsystem : public UEngineSubsystem
{ {
GENERATED_BODY() GENERATED_BODY()

View File

@ -102,7 +102,7 @@ public:
UPROPERTY() UPROPERTY()
int CurrentIndex = -1; int CurrentIndex = -1;
UPROPERTY(BlueprintCallable, Category="DTFlux|Pursuit") UPROPERTY(BlueprintAssignable, Category="DTFlux|Pursuit")
FOnPursuitSequenceReady OnPursuitSequenceReady; FOnPursuitSequenceReady OnPursuitSequenceReady;

View File

@ -104,7 +104,6 @@ FGuid UDTFluxNetworkSubsystem::SendTrackedRequestWithCallback(
PendingErrorCallbacks.Add(RequestId, OnError.GetValue()); PendingErrorCallbacks.Add(RequestId, OnError.GetValue());
} }
} }
return RequestId; return RequestId;
} }
@ -592,8 +591,6 @@ void UDTFluxNetworkSubsystem::Parse(FDTFluxServerResponse& Response)
void UDTFluxNetworkSubsystem::OnWebSocketMessageEvent_Subsystem(const FString& MessageString) void UDTFluxNetworkSubsystem::OnWebSocketMessageEvent_Subsystem(const FString& MessageString)
{ {
// UE_LOG(logDTFluxNetwork, Warning, TEXT("Client %s :\nMessage Received : %s"), *WsClient->GetAddress(), *MessageString);
//Do Something With the message
EDTFluxResponseStatus ResponseStatus; EDTFluxResponseStatus ResponseStatus;
FDTFluxServerResponse Response(MessageString, ResponseStatus); FDTFluxServerResponse Response(MessageString, ResponseStatus);
if (!TryMatchResponseToQueuedRequest(Response)) if (!TryMatchResponseToQueuedRequest(Response))
@ -680,6 +677,7 @@ bool UDTFluxNetworkSubsystem::TryMatchResponseToQueuedRequest(FDTFluxServerRespo
TEXT("Matched response to queued request: Type=%s, Contest=%d, Stage=%d, Split=%d"), TEXT("Matched response to queued request: Type=%s, Contest=%d, Stage=%d, Split=%d"),
*UEnum::GetValueAsString(Response.GetResponseType()), Response.ContestID, Response.StageID, *UEnum::GetValueAsString(Response.GetResponseType()), Response.ContestID, Response.StageID,
Response.SplitID); Response.SplitID);
if (PendingCallbacks.Contains(FoundRequestId)) if (PendingCallbacks.Contains(FoundRequestId))
{ {
FOnDTFluxTrackedRequestResponse* SuccessCallback = PendingCallbacks.Find(FoundRequestId); FOnDTFluxTrackedRequestResponse* SuccessCallback = PendingCallbacks.Find(FoundRequestId);
@ -689,7 +687,6 @@ bool UDTFluxNetworkSubsystem::TryMatchResponseToQueuedRequest(FDTFluxServerRespo
} }
return QueueManager->MarkRequestAsResponded(FoundRequestId); return QueueManager->MarkRequestAsResponded(FoundRequestId);
} }
return false; return false;
} }

View File

@ -128,14 +128,14 @@ public:
// === REQUÊTES AVEC QUEUE ET TRACKING === // === REQUÊTES AVEC QUEUE ET TRACKING ===
UFUNCTION(BlueprintCallable, Category="DTFlux|Tracked Requests") UFUNCTION(BlueprintCallable, Category="DTFlux|Tracked Requests")
FGuid SendTrackedRequest(EDTFluxApiDataType RequestType, int32 ContestId = -1, int32 StageId = -1, FGuid SendTrackedRequest(EDTFluxApiDataType RequestType, int32 ContestId = -1, int32 StageId = -1,
int32 SplitId = -1, float TimeoutSeconds = 30.0f); int32 SplitId = -1, float TimeoutSeconds = 5.0f);
FGuid SendTrackedRequestWithCallback(EDTFluxApiDataType RequestType, int32 ContestId, int32 StageId, int32 SplitId, FGuid SendTrackedRequestWithCallback(EDTFluxApiDataType RequestType, int32 ContestId, int32 StageId, int32 SplitId,
FOnDTFluxTrackedRequestResponse OnCompleted, FOnDTFluxTrackedRequestResponse OnCompleted,
FOnDTFluxTrackedRequestTimeout OnTimeout, FOnDTFluxTrackedRequestTimeout OnTimeout,
TOptional<FOnDTFluxRequestResponseError> OnError = TOptional< TOptional<FOnDTFluxRequestResponseError> OnError = TOptional<
FOnDTFluxRequestResponseError>(), FOnDTFluxRequestResponseError>(),
float TimeoutSeconds = 30.0f); float TimeoutSeconds = 5.0f);
UFUNCTION(BlueprintCallable, Category="DTFlux|Tracked Requests") UFUNCTION(BlueprintCallable, Category="DTFlux|Tracked Requests")
bool GetTrackedRequest(const FGuid& RequestId, FDTFluxQueuedRequest& OutRequest) const; bool GetTrackedRequest(const FGuid& RequestId, FDTFluxQueuedRequest& OutRequest) const;
@ -192,28 +192,30 @@ private:
// === MÉTHODES DE CONFIGURATION === // === MÉTHODES DE CONFIGURATION ===
UFUNCTION() UFUNCTION()
void WsSettingsChanged(const FDTFluxWsSettings& NewWsSettings); void WsSettingsChanged(const FDTFluxWsSettings& NewWsSettings);
void ReconnectWs(const FName WsClientId);
UFUNCTION() UFUNCTION()
void HttpSettingsChanged(const FDTFluxHttpSettings& NewHttpSettings); void HttpSettingsChanged(const FDTFluxHttpSettings& NewHttpSettings);
void ReconnectWs(const FName WsClientId);
void ReconnectHttp(const FName WsClientId); void ReconnectHttp(const FName WsClientId);
// === GESTION DES ÉVÉNEMENTS HTTP ===
void RegisterHttpEvents();
void UnregisterHttpEvents();
// === GESTION DES ÉVÉNEMENTS WEBSOCKET === // === GESTION DES ÉVÉNEMENTS WEBSOCKET ===
void RegisterWebSocketEvents(); void RegisterWebSocketEvents();
void UnregisterWebSocketEvents(); void UnregisterWebSocketEvents();
void OnWebSocketConnected_Subsystem(); void OnWebSocketConnected_Subsystem();
void OnWebSocketConnectionError_Subsystem(const FString& Error); void OnWebSocketConnectionError_Subsystem(const FString& Error);
void OnWebSocketClosedEvent_Subsystem(int32 StatusCode, const FString& Reason, bool bWasClean); void OnWebSocketClosedEvent_Subsystem(int32 StatusCode, const FString& Reason, bool bWasClean);
void OnWebSocketMessageEvent_Subsystem(const FString& MessageString);
void OnWebSocketMessageSentEvent_Subsystem(const FString& MessageSent);
FDelegateHandle OnWsConnectedEventDelegateHandle; FDelegateHandle OnWsConnectedEventDelegateHandle;
FDelegateHandle OnWsConnectionErrorEventDelegateHandle; FDelegateHandle OnWsConnectionErrorEventDelegateHandle;
FDelegateHandle OnWsClosedEventDelegateHandle; FDelegateHandle OnWsClosedEventDelegateHandle;
FDelegateHandle OnWsMessageEventDelegateHandle; FDelegateHandle OnWsMessageEventDelegateHandle;
FDelegateHandle OnWsMessageSentEventDelegateHandle; FDelegateHandle OnWsMessageSentEventDelegateHandle;
// === GESTION DES ÉVÉNEMENTS HTTP ===
void RegisterHttpEvents();
void UnregisterHttpEvents();
// === PARSING DES RÉPONSES === // === PARSING DES RÉPONSES ===
void ParseTeamListResponse(FDTFluxServerResponse& ServerResponse); void ParseTeamListResponse(FDTFluxServerResponse& ServerResponse);
@ -224,10 +226,9 @@ private:
void ParseStatusUpdateResponse(FDTFluxServerResponse& Response); void ParseStatusUpdateResponse(FDTFluxServerResponse& Response);
void ParseSplitSensorResponse(FDTFluxServerResponse& Response); void ParseSplitSensorResponse(FDTFluxServerResponse& Response);
EDTFluxResponseStatus ProcessPushMessage(FDTFluxServerResponse& Response); EDTFluxResponseStatus ProcessPushMessage(FDTFluxServerResponse& Response);
void Parse(FDTFluxServerResponse& Response); void Parse(FDTFluxServerResponse& Response);
void OnWebSocketMessageEvent_Subsystem(const FString& MessageString);
void OnWebSocketMessageSentEvent_Subsystem(const FString& MessageSent);
bool CleanRequestCallbacks(const FGuid& RequestId); bool CleanRequestCallbacks(const FGuid& RequestId);
// === GESTION DES REQUÊTES TRACKÉES === // === GESTION DES REQUÊTES TRACKÉES ===