diff --git a/SocketIOClient.uplugin b/SocketIOClient.uplugin index e9a539e..adf1826 100644 --- a/SocketIOClient.uplugin +++ b/SocketIOClient.uplugin @@ -1,8 +1,8 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "2.4.4", - "EngineVersion": "5.0.0", + "VersionName": "2.5.0", + "EngineVersion": "5.1.0", "FriendlyName": "Socket.IO Client", "Description": "Real-time WebSocket networking via Socket.IO protocol usable from blueprints and c++.", "Category": "Networking", @@ -19,7 +19,7 @@ { "Name": "SocketIOClient", "Type": "Runtime", - "LoadingPhase": "Default", + "LoadingPhase": "PreDefault", "WhitelistPlatforms": [ "Win64", "Linux", diff --git a/Source/CoreUtility/Private/CUBlueprintLibrary.cpp b/Source/CoreUtility/Private/CUBlueprintLibrary.cpp index 87fea6e..c7413cd 100644 --- a/Source/CoreUtility/Private/CUBlueprintLibrary.cpp +++ b/Source/CoreUtility/Private/CUBlueprintLibrary.cpp @@ -204,10 +204,9 @@ TArray UCUBlueprintLibrary::Conv_SoundWaveToWavBytes(USoundWave* SoundWav TArray WavBytes; //memcpy raw data from soundwave, hmm this won't work for procedurals... - const void* LockedData = SoundWave->RawData.LockReadOnly(); - PCMBytes.SetNumUninitialized(SoundWave->RawData.GetBulkDataSize()); + const void* LockedData = SoundWave->GetResourceData(); + PCMBytes.SetNumUninitialized(SoundWave->GetResourceSize()); FMemory::Memcpy(PCMBytes.GetData(), LockedData, PCMBytes.Num()); - SoundWave->RawData.Unlock(); //add wav header SerializeWaveFile(WavBytes, PCMBytes.GetData(), PCMBytes.Num(), SoundWave->NumChannels, SoundWave->GetSampleRateForCurrentPlatform()); diff --git a/Source/SIOJson/Private/SIOJConvert.cpp b/Source/SIOJson/Private/SIOJConvert.cpp index 37a3c87..115e333 100644 --- a/Source/SIOJson/Private/SIOJConvert.cpp +++ b/Source/SIOJson/Private/SIOJConvert.cpp @@ -328,14 +328,14 @@ namespace if (!TheCppStructOps->ImportTextItem(ImportTextPtr, OutValue, PPF_None, nullptr, (FOutputDevice*)GWarn)) { // Fall back to trying the tagged property approach if custom ImportTextItem couldn't get it done - Property->ImportText(ImportTextPtr, OutValue, PPF_None, nullptr); + Property->ImportText_Direct(ImportTextPtr, OutValue, nullptr, PPF_None); } } else if (JsonValue->Type == EJson::String) { FString ImportTextString = JsonValue->AsString(); const TCHAR* ImportTextPtr = *ImportTextString; - Property->ImportText(ImportTextPtr, OutValue, PPF_None, nullptr); + Property->ImportText_Direct(ImportTextPtr, OutValue, nullptr, PPF_None); } else { @@ -370,7 +370,7 @@ namespace else if (JsonValue->Type == EJson::String) { // Default to expect a string for everything else - if (Property->ImportText(*JsonValue->AsString(), OutValue, 0, NULL) == NULL) + if (Property->ImportText_Direct(*JsonValue->AsString(), OutValue, nullptr, PPF_None) == nullptr) { UE_LOG(LogJson, Error, TEXT("BPEnumWA-JsonValueToUProperty - Unable import property type %s from string value for property %s"), *Property->GetClass()->GetName(), *Property->GetNameCPP()); return false; @@ -380,7 +380,7 @@ namespace else { // Default to expect a string for everything else - if (Property->ImportText(*JsonValue->AsString(), OutValue, 0, NULL) == NULL) + if (Property->ImportText_Direct(*JsonValue->AsString(), OutValue, nullptr, PPF_None) == nullptr) { UE_LOG(LogJson, Error, TEXT("BPEnumWA-JsonValueToUProperty - Unable import property type %s from string value for property %s"), *Property->GetClass()->GetName(), *Property->GetNameCPP()); return false; @@ -1081,9 +1081,3 @@ void USIOJConvert::ReplaceJsonValueNamesWithMap(TSharedPtr& JsonValu } } } - -FString USIOJConvert::EnumToString(const FString& enumName, const int32 value) -{ - UEnum* pEnum = FindObject(ANY_PACKAGE, *enumName); - return *(pEnum ? pEnum->GetNameStringByIndex(static_cast(value)) : "null"); -} diff --git a/Source/SIOJson/Public/SIOJConvert.h b/Source/SIOJson/Public/SIOJConvert.h index 56495ad..8b6965e 100644 --- a/Source/SIOJson/Public/SIOJConvert.h +++ b/Source/SIOJson/Public/SIOJConvert.h @@ -70,8 +70,6 @@ class SIOJSON_API USIOJConvert : public UObject static void SetTrimmedKeyMapForStruct(TSharedPtr& InMap, UStruct* Struct); static void SetTrimmedKeyMapForProp(TSharedPtr& InMap, FProperty* ArrayInnerProp); static void ReplaceJsonValueNamesWithMap(TSharedPtr& InValue, TSharedPtr KeyMap); - - static FString EnumToString(const FString& enumName, const int32 value); }; diff --git a/Source/SocketIOClient/Private/SocketIONative.cpp b/Source/SocketIOClient/Private/SocketIONative.cpp index ad2dff8..13f2ac3 100644 --- a/Source/SocketIOClient/Private/SocketIONative.cpp +++ b/Source/SocketIOClient/Private/SocketIONative.cpp @@ -416,7 +416,7 @@ void FSocketIONative::SetupInternalCallbacks() bIsConnected = false; ESIOConnectionCloseReason DisconnectReason = (ESIOConnectionCloseReason)reason; - FString DisconnectReasonString = USIOJConvert::EnumToString(TEXT("ESIOConnectionCloseReason"), DisconnectReason); + FString DisconnectReasonString = UEnum::GetValueAsString(DisconnectReason); if (VerboseLog) { UE_LOG(SocketIO, Log, TEXT("SocketIO Disconnected %s reason: %s"), *SessionId, *DisconnectReasonString);