Skip to content

Commit

Permalink
Merge pull request #103 from getnamo/android-work
Browse files Browse the repository at this point in the history
Android work
  • Loading branch information
getnamo authored Oct 30, 2018
2 parents bb67c96 + 0e6f6c9 commit 2348672
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
6 changes: 4 additions & 2 deletions SocketIOClient.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "0.9.3",
"VersionName": "0.9.5",
"EngineVersion" : "4.20.0",
"FriendlyName": "Socket.IO Client",
"Description": "Real-time networking library Socket.IO Client usable from blueprints and c++.",
Expand All @@ -23,7 +23,8 @@
"WhitelistPlatforms": [
"Win64",
"Win32",
"Linux"
"Linux",
"Android"
]
},
{
Expand All @@ -34,6 +35,7 @@
"Win64",
"Win32",
"Linux",
"Android",
"Mac"
]
},
Expand Down
12 changes: 10 additions & 2 deletions Source/SocketIOClient/Private/SocketIONative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ void FSocketIONative::Connect(const FString& InAddressAndPort, const TSharedPtr<
PrivateClient->set_reconnect_attempts(MaxReconnectionAttempts);
PrivateClient->set_reconnect_delay(ReconnectionDelay);

//Add temporary workaround for android build of socket.io (doesn't have my fork changes so it won't have the 3 param connect function)
#if PLATFORM_ANDROID
PrivateClient->connect(StdAddressString, QueryMap);// , HeadersMap);
#else
PrivateClient->connect(StdAddressString, QueryMap, HeadersMap);
#endif

});
}

Expand Down Expand Up @@ -112,8 +118,10 @@ void FSocketIONative::Emit(const FString& EventName, const TSharedPtr<FJsonValue
auto ItemMessagePtr = MessageList[i];
ValueArray.Add(USIOMessageConvert::ToJsonValue(ItemMessagePtr));
}

SafeCallback(ValueArray);
if (SafeCallback)
{
SafeCallback(ValueArray);
}
}, Namespace);
}

Expand Down
12 changes: 7 additions & 5 deletions Source/SocketIOClient/SocketIOClient.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ public bool LoadLib(ReadOnlyTargetRules Target)
isLibrarySupported = true;

string PlatformString = "Android";
string BoostLibPath = Path.Combine(BoostThirdParty, "Lib");
//string AndroidPlatform = "arm64-v8a";
string AndroidPlatform = "armeabi-v7a"; //change to armeabi-v7a if using 32bit
string BoostLibPath = Path.Combine(BoostThirdParty, "Lib");
string SocketLibPath = Path.Combine(SocketIOThirdParty, "Lib");

PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, PlatformString, "libboost_date_time.a"));
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, PlatformString, "libboost_random.a"));
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, PlatformString, "libboost_system.a"));
PublicAdditionalLibraries.Add(Path.Combine(SocketLibPath, PlatformString, "libsioclient.a"));
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, PlatformString, AndroidPlatform, "libboost_date_time.a"));
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, PlatformString, AndroidPlatform, "libboost_random.a"));
PublicAdditionalLibraries.Add(Path.Combine(BoostLibPath, PlatformString, AndroidPlatform, "libboost_system.a"));
PublicAdditionalLibraries.Add(Path.Combine(SocketLibPath, PlatformString, AndroidPlatform, "libsioclient.a"));
}

return isLibrarySupported;
Expand Down
28 changes: 14 additions & 14 deletions Source/SocketIOClient/SocketIOClient_APL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
<resourceCopies>
<log text="Copying SocketIO Client runtime files to staging"/>
<isArch arch="armeabi-v7a">
<copyFile src="$S(PluginDir)/../../ThirdParty/SocketIO/Lib/Android/armeabi-v7a/libsioclient.a"
<copyFile src="$S(PluginDir)/Source/ThirdParty/SocketIO/Lib/Android/armeabi-v7a/libsioclient.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libsioclient.a" />
<copyFile src="$S(PluginDir)/../../ThirdParty/Boost/Lib/Android/armeabi-v7a/libboost_date_time-mt-1_60.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_date_time-mt-1_60.a" />
<copyFile src="$S(PluginDir)/../../ThirdParty/Boost/Lib/Android/armeabi-v7a/libboost_random-mt-1_60.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_random-mt-1_60.a" />
<copyFile src="$S(PluginDir)/../../ThirdParty/Boost/Lib/Android/armeabi-v7a/libboost_system-mt-1_60.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_system-mt-1_60.a" />
<copyFile src="$S(PluginDir)/Source/ThirdParty/Boost/Lib/Android/armeabi-v7a/libboost_date_time.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_date_time.a" />
<copyFile src="$S(PluginDir)/Source/ThirdParty/Boost/Lib/Android/armeabi-v7a/libboost_random.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_random.a" />
<copyFile src="$S(PluginDir)/Source/ThirdParty/Boost/Lib/Android/armeabi-v7a/libboost_system.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_system.a" />
<log text="armeabi-v7a SocketIO Client runtime files copied"/>
</isArch>
<isArch arch="arm64-v8a">
<copyFile src="$S(PluginDir)/../../ThirdParty/SocketIO/Lib/Android/arm64-v8a/libsioclient.a"
<copyFile src="$S(PluginDir)/Source/ThirdParty/SocketIO/Lib/Android/arm64-v8a/libsioclient.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libsioclient.a" />
<copyFile src="$S(PluginDir)/../../ThirdParty/Boost/Lib/Android/arm64-v8a/libboost_date_time-mt-1_60.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_date_time-mt-1_60.a" />
<copyFile src="$S(PluginDir)/../../ThirdParty/Boost/Lib/Android/arm64-v8a/libboost_random-mt-1_60.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_random-mt-1_60.a" />
<copyFile src="$S(PluginDir)/../../ThirdParty/Boost/Lib/Android/arm64-v8a/libboost_system-mt-1_60.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_system-mt-1_60.a" />
<copyFile src="$S(PluginDir)/Source/ThirdParty/Boost/Lib/Android/arm64-v8a/libboost_date_time.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_date_time.a" />
<copyFile src="$S(PluginDir)/Source/ThirdParty/Boost/Lib/Android/arm64-v8a/libboost_random.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_random.a" />
<copyFile src="$S(PluginDir)/Source/ThirdParty/Boost/Lib/Android/arm64-v8a/libboost_system.a"
dst="$S(BuildDir)/libs/armeabi-v7a/libboost_system.a" />
<log text="arm64-v8a SocketIO Client runtime files copied"/>
</isArch>
<isArch arch="x86">
Expand Down
Binary file not shown.

0 comments on commit 2348672

Please sign in to comment.