5#include "CoreMinimal.h"
8#include "ApexWebSocket.generated.h"
22 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Apex|Authentication Code")
31 virtual void FromJsonObject(
const TSharedPtr<FJsonObject>& JObject)
override
33 if (JObject->HasField(
"auth_code"))
34 AuthCode = JObject->GetStringField(
"auth_code");
65 void SetupSocket(TSharedPtr<IWebSocket>& Socket, FString Uri, FString Protocol);
bool IsWebsocketConnected()
void SetupSocket(TSharedPtr< IWebSocket > &Socket, FString Uri, FString Protocol)
void SendData(FString Data)
void RequestAuthorizationCode()
DECLARE_EVENT(ApexWebSocket, FApexSocketConnected)
DECLARE_EVENT_OneParam(ApexWebSocket, FApexSocketAuthCodeRetrieved, FString AuthenticationCode)
DECLARE_EVENT_OneParam(ApexWebSocket, FApexSocketAuthenticateComplete, class UVaRestJsonObject *LoginJsonObject)
FApexSocketAuthCodeRetrieved & OnApexAuthCodeRetrieved()
DECLARE_EVENT_OneParam(ApexWebSocket, FApexSocketConnectFailed, const FString &)
FApexSocketConnectFailed ApexConnectFailedEvent
void HandleAuthenticateComplete(UVaRestJsonObject *JsonObject)
FApexSocketConnectFailed & OnApexWebSocketConnectFailed()
bool AttemptConnect(FString Uri, FString Protocol="wss")
DECLARE_EVENT_ThreeParams(ApexWebSocket, FApexSocketDisconnected, int32 StatusCode, const FString &Reason, bool bWasClean)
void HandleAuthCodeReceived(UVaRestJsonObject *JsonObject)
FApexSocketDisconnected & OnApexWebSocketDisconnected()
FApexSocketAuthCodeRetrieved ApexAuthCodeRetrievedEvent
TSharedPtr< IWebSocket > WebSocket
FApexSocketConnected & OnApexWebSocketConnected()
FApexSocketConnected ApexConnectedEvent
FApexSocketDisconnected ApexDisconnectedEvent
FApexSocketAuthenticateComplete ApexAuthenticateCompleteEvent
FApexSocketAuthenticateComplete & OnApexAuthenticateComplete()
TArray< ApexWebSocketRequestType > PendingWebsocketRequests
void ProcessNextRequest()
UCLASS(BlueprintType, Blueprintable)
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject) override
FString AuthCode
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Apex|Authentication Code")
FAPEXAuthenticationCode()
virtual void FromJsonObject(const TSharedPtr< FJsonObject > &JObject)