diff --git a/Resources/Icon128.png b/Resources/Icon128.png index 1231d4aa..22fa1619 100644 Binary files a/Resources/Icon128.png and b/Resources/Icon128.png differ diff --git a/SocketIOClient.uplugin b/SocketIOClient.uplugin index ee99ca5f..d326e88c 100644 --- a/SocketIOClient.uplugin +++ b/SocketIOClient.uplugin @@ -1,31 +1,38 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "0.4.0", - "FriendlyName": "SocketIOClient", - "Description": "Socket IO C++ Client ported to UE4", + "VersionName": "0.4.2", + "FriendlyName": "Socket.IO Client", + "Description": "Real-time networking library Socket.IO Client usable from blueprints and c++.", "Category": "Networking", - "CreatedBy": "UE4 London Meetup", + "CreatedBy": "Getnamo", "CreatedByURL": "http://getnamo.com", "DocsURL": "https://github.com/getnamo/socketio-client-ue4", "MarketplaceURL": "", "SupportURL": "", "EnabledByDefault": false, "CanContainContent": false, + "IsBetaVersion": false, + "Installed": false, "Modules": [ { "Name": "SocketIOClient", "Type": "Runtime", - "LoadingPhase": "Default" + "LoadingPhase": "Default", + "WhitelistPlatforms": [ + "Win64", + "Win32" + ] }, { - "Name" : "SIOJson", - "Type" : "Runtime", + "Name": "SIOJson", + "Type": "Runtime", "LoadingPhase": "PreDefault" }, { "Name": "SIOJEditorPlugin", - "Type": "Developer" + "Type": "Developer", + "LoadingPhase": "Default" } ] } \ No newline at end of file diff --git a/Source/SIOJson/Private/SIOJLibrary.cpp b/Source/SIOJson/Private/SIOJLibrary.cpp index c2f7b1e8..c2911fe3 100644 --- a/Source/SIOJson/Private/SIOJLibrary.cpp +++ b/Source/SIOJson/Private/SIOJLibrary.cpp @@ -149,7 +149,7 @@ TArray USIOJLibrary::Conv_JsonValueToBytes(USIOJsonValue* InValue) return InValue->AsBinary(); } -void USIOJLibrary::CallURL(UObject* WorldContextObject, const FString& URL, ERequestVerb Verb, ERequestContentType ContentType, USIOJsonObject* SIOJJson, const FSIOJCallDelegate& Callback) +void USIOJLibrary::CallURL(UObject* WorldContextObject, const FString& URL, ESIORequestVerb Verb, ESIORequestContentType ContentType, USIOJsonObject* SIOJJson, const FSIOJCallDelegate& Callback) { UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject); if (World == nullptr) diff --git a/Source/SIOJson/Private/SIOJRequestJSON.cpp b/Source/SIOJson/Private/SIOJRequestJSON.cpp index fa889638..c66f9f0a 100644 --- a/Source/SIOJson/Private/SIOJRequestJSON.cpp +++ b/Source/SIOJson/Private/SIOJRequestJSON.cpp @@ -16,8 +16,8 @@ USIOJRequestJSON::USIOJRequestJSON(const class FObjectInitializer& PCIP) : Super(PCIP), BinaryContentType(TEXT("application/octet-stream")) { - RequestVerb = ERequestVerb::GET; - RequestContentType = ERequestContentType::x_www_form_urlencoded_url; + RequestVerb = ESIORequestVerb::GET; + RequestContentType = ESIORequestContentType::x_www_form_urlencoded_url; ResetData(); } @@ -29,8 +29,8 @@ USIOJRequestJSON* USIOJRequestJSON::ConstructRequest(UObject* WorldContextObject USIOJRequestJSON* USIOJRequestJSON::ConstructRequestExt( UObject* WorldContextObject, - ERequestVerb Verb, - ERequestContentType ContentType) + ESIORequestVerb Verb, + ESIORequestContentType ContentType) { USIOJRequestJSON* Request = ConstructRequest(WorldContextObject); @@ -40,7 +40,7 @@ USIOJRequestJSON* USIOJRequestJSON::ConstructRequestExt( return Request; } -void USIOJRequestJSON::SetVerb(ERequestVerb Verb) +void USIOJRequestJSON::SetVerb(ESIORequestVerb Verb) { RequestVerb = Verb; } @@ -50,7 +50,7 @@ void USIOJRequestJSON::SetCustomVerb(FString Verb) CustomVerb = Verb; } -void USIOJRequestJSON::SetContentType(ERequestContentType ContentType) +void USIOJRequestJSON::SetContentType(ESIORequestContentType ContentType) { RequestContentType = ContentType; } @@ -151,9 +151,9 @@ FString USIOJRequestJSON::GetURL() return HttpRequest->GetURL(); } -ERequestStatus USIOJRequestJSON::GetStatus() +ESIORequestStatus USIOJRequestJSON::GetStatus() { - return ERequestStatus((uint8)HttpRequest->GetStatus()); + return ESIORequestStatus((uint8)HttpRequest->GetStatus()); } int32 USIOJRequestJSON::GetResponseCode() @@ -222,23 +222,23 @@ void USIOJRequestJSON::ProcessRequest() // Set verb switch (RequestVerb) { - case ERequestVerb::GET: + case ESIORequestVerb::GET: HttpRequest->SetVerb(TEXT("GET")); break; - case ERequestVerb::POST: + case ESIORequestVerb::POST: HttpRequest->SetVerb(TEXT("POST")); break; - case ERequestVerb::PUT: + case ESIORequestVerb::PUT: HttpRequest->SetVerb(TEXT("PUT")); break; - case ERequestVerb::DEL: + case ESIORequestVerb::DEL: HttpRequest->SetVerb(TEXT("DELETE")); break; - case ERequestVerb::CUSTOM: + case ESIORequestVerb::CUSTOM: HttpRequest->SetVerb(CustomVerb); break; @@ -249,7 +249,7 @@ void USIOJRequestJSON::ProcessRequest() // Set content-type switch (RequestContentType) { - case ERequestContentType::x_www_form_urlencoded_url: + case ESIORequestContentType::x_www_form_urlencoded_url: { HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded")); @@ -278,7 +278,7 @@ void USIOJRequestJSON::ProcessRequest() break; } - case ERequestContentType::x_www_form_urlencoded_body: + case ESIORequestContentType::x_www_form_urlencoded_body: { HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded")); @@ -307,7 +307,7 @@ void USIOJRequestJSON::ProcessRequest() break; } - case ERequestContentType::binary: + case ESIORequestContentType::binary: { HttpRequest->SetHeader(TEXT("Content-Type"), BinaryContentType); HttpRequest->SetContent(RequestBytes); @@ -316,7 +316,7 @@ void USIOJRequestJSON::ProcessRequest() break; } - case ERequestContentType::json: + case ESIORequestContentType::json: { HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json")); diff --git a/Source/SIOJson/Public/SIOJLibrary.h b/Source/SIOJson/Public/SIOJLibrary.h index 61543a2b..f0e07a0c 100644 --- a/Source/SIOJson/Public/SIOJLibrary.h +++ b/Source/SIOJson/Public/SIOJLibrary.h @@ -188,7 +188,7 @@ class USIOJLibrary : public UBlueprintFunctionLibrary public: /** Easy way to process http requests */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Utility", meta = (WorldContext = "WorldContextObject")) - static void CallURL(UObject* WorldContextObject, const FString& URL, ERequestVerb Verb, ERequestContentType ContentType, USIOJsonObject* SIOJJson, const FSIOJCallDelegate& Callback); + static void CallURL(UObject* WorldContextObject, const FString& URL, ESIORequestVerb Verb, ESIORequestContentType ContentType, USIOJsonObject* SIOJJson, const FSIOJCallDelegate& Callback); /** Called when URL is processed (one for both success/unsuccess events)*/ static void OnCallComplete(USIOJRequestJSON* Request); diff --git a/Source/SIOJson/Public/SIOJRequestJSON.h b/Source/SIOJson/Public/SIOJRequestJSON.h index 090d9094..8d410a57 100644 --- a/Source/SIOJson/Public/SIOJRequestJSON.h +++ b/Source/SIOJson/Public/SIOJRequestJSON.h @@ -92,11 +92,11 @@ class SIOJSON_API USIOJRequestJSON : public UObject /** Creates new request with defined verb and content type */ UFUNCTION(BlueprintPure, meta = (DisplayName = "Construct Json Request", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"), Category = "SIOJ|Request") - static USIOJRequestJSON* ConstructRequestExt(UObject* WorldContextObject, ERequestVerb Verb, ERequestContentType ContentType); + static USIOJRequestJSON* ConstructRequestExt(UObject* WorldContextObject, ESIORequestVerb Verb, ESIORequestContentType ContentType); /** Set verb to the request */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Request") - void SetVerb(ERequestVerb Verb); + void SetVerb(ESIORequestVerb Verb); /** Set custom verb to the request */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Request") @@ -105,7 +105,7 @@ class SIOJSON_API USIOJRequestJSON : public UObject /** Set content type to the request. If you're using the x-www-form-urlencoded, * params/constaints should be defined as key=ValueString pairs from Json data */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Request") - void SetContentType(ERequestContentType ContentType); + void SetContentType(ESIORequestContentType ContentType); /** Set content type of the request for binary post data */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Request") @@ -169,7 +169,7 @@ class SIOJSON_API USIOJRequestJSON : public UObject /** Get status of http request */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Request") - ERequestStatus GetStatus(); + ESIORequestStatus GetStatus(); /** Get the response code of the last query */ UFUNCTION(BlueprintCallable, Category = "SIOJ|Response") @@ -278,10 +278,10 @@ class SIOJSON_API USIOJRequestJSON : public UObject USIOJsonObject* ResponseJsonObj; /** Verb for making request (GET,POST,etc) */ - ERequestVerb RequestVerb; + ESIORequestVerb RequestVerb; /** Content type to be applied for request */ - ERequestContentType RequestContentType; + ESIORequestContentType RequestContentType; /** Mapping of header section to values. Used to generate final header string for request */ TMap RequestHeaders; diff --git a/Source/SIOJson/Public/SIOJTypes.h b/Source/SIOJson/Public/SIOJTypes.h index 0ba037e2..f0d240c2 100644 --- a/Source/SIOJson/Public/SIOJTypes.h +++ b/Source/SIOJson/Public/SIOJTypes.h @@ -4,7 +4,7 @@ /** Verb (GET, PUT, POST) used by the request */ UENUM(BlueprintType) -enum class ERequestVerb : uint8 +enum class ESIORequestVerb : uint8 { GET, POST, @@ -16,7 +16,7 @@ enum class ERequestVerb : uint8 /** Content type (json, urlencoded, etc.) used by the request */ UENUM(BlueprintType) -enum class ERequestContentType : uint8 +enum class ESIORequestContentType : uint8 { x_www_form_urlencoded_url UMETA(DisplayName = "x-www-form-urlencoded (URL)"), x_www_form_urlencoded_body UMETA(DisplayName = "x-www-form-urlencoded (Request Body)"), @@ -26,7 +26,7 @@ enum class ERequestContentType : uint8 /** Enumerates the current state of an Http request */ UENUM(BlueprintType) -enum class ERequestStatus : uint8 +enum class ESIORequestStatus : uint8 { /** Has not been started via ProcessRequest() */ NotStarted, diff --git a/Source/SocketIOClient/Private/SocketIOClientComponent.cpp b/Source/SocketIOClient/Private/SocketIOClientComponent.cpp index 3b1de490..c1944f49 100644 --- a/Source/SocketIOClient/Private/SocketIOClientComponent.cpp +++ b/Source/SocketIOClient/Private/SocketIOClientComponent.cpp @@ -112,7 +112,7 @@ void USocketIOClientComponent::Connect(const FString& InAddressAndPort) { SessionId = FString(TEXT("invalid")); UE_LOG(SocketIOLog, Log, TEXT("SocketIO Disconnected")); - OnDisconnected.Broadcast((EConnectionCloseReason)reason); + OnDisconnected.Broadcast((ESIOConnectionCloseReason)reason); })); PrivateClient.set_socket_open_listener(sio::client::socket_listener([&](std::string const& nsp)