Adding Status and Last server response handled but not tested

This commit is contained in:
2025-07-03 17:28:51 +02:00
parent 2855fa1e98
commit fa5493adcf
43 changed files with 2035 additions and 379 deletions

View File

@ -17,6 +17,24 @@ FDTFluxWebSocketClient::FDTFluxWebSocketClient()
FDTFluxWebSocketClient::LastId++;
}
bool FDTFluxWebSocketClient::CanSend() const
{
return Ws.IsValid();
}
TSharedPtr<FDTFluxWebSocketClient> FDTFluxWebSocketClient::GetClient(
const TArray<TSharedPtr<FDTFluxWebSocketClient>> InClients, const FName InName)
{
for(auto Client: InClients)
{
if(Client->ClientId == InName)
{
return Client;
}
}
return nullptr;
}
void FDTFluxWebSocketClient::Connect()
{
Ws = FWebSocketsModule::Get().CreateWebSocket(WsAddress);
@ -80,7 +98,10 @@ void FDTFluxWebSocketClient::AddError(const FDTFluxWsClientError Error)
void FDTFluxWebSocketClient::Send(const FString& Message) const
{
Ws->Send(Message);
if(Ws.IsValid())
{
Ws->Send(Message);
}
}