Add cloud-point-rpc integration (Linux only, v0.1.2)
NOTICE: The cloud-point-rpc library has been tested only on Linux on git tag v0.1.2. Other platforms are not supported by this version.
This commit is contained in:
parent
f995cf6721
commit
daa0a046fc
BIN
Assets/Plugins/libbase64.so.0
Executable file
BIN
Assets/Plugins/libbase64.so.0
Executable file
Binary file not shown.
27
Assets/Plugins/libbase64.so.0.meta
Normal file
27
Assets/Plugins/libbase64.so.0.meta
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 546eea41f021b0e30be6a8984dc504bf
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/libcloud_point_rpc.so
Executable file
BIN
Assets/Plugins/libcloud_point_rpc.so
Executable file
Binary file not shown.
29
Assets/Plugins/libcloud_point_rpc.so.meta
Normal file
29
Assets/Plugins/libcloud_point_rpc.so.meta
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c7282f05b709777cf86ba53a43c687f9
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: x86_64
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
OS: Linux
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/libglog.so
Executable file
BIN
Assets/Plugins/libglog.so
Executable file
Binary file not shown.
27
Assets/Plugins/libglog.so.meta
Normal file
27
Assets/Plugins/libglog.so.meta
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7311fb89543f24ef39ff5642731aa3dd
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/libtest_cloud_point.so
Executable file
BIN
Assets/Plugins/libtest_cloud_point.so
Executable file
Binary file not shown.
29
Assets/Plugins/libtest_cloud_point.so.meta
Normal file
29
Assets/Plugins/libtest_cloud_point.so.meta
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5ccfd5b5d9b42d0268d684657b2bd0a0
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: x86_64
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
OS: Linux
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/libyaml-cpp.so.0.8
Executable file
BIN
Assets/Plugins/libyaml-cpp.so.0.8
Executable file
Binary file not shown.
27
Assets/Plugins/libyaml-cpp.so.0.8.meta
Normal file
27
Assets/Plugins/libyaml-cpp.so.0.8.meta
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e052c6dbd313d545285cfcf5594e4f75
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -38,7 +38,7 @@ RenderSettings:
|
|||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 0}
|
m_Sun: {fileID: 0}
|
||||||
m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1}
|
m_IndirectSpecularColor: {r: 0.12731704, g: 0.13414729, b: 0.121078685, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
@ -2235,6 +2235,51 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1682170430}
|
m_GameObject: {fileID: 1682170430}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &1686741892
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1686741893}
|
||||||
|
- component: {fileID: 1686741894}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: MinimalRpcServer
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1686741893
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1686741892}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1686741894
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1686741892}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 3efe38e5bed73a892bb160f847afd04f, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
configPath: config.yml
|
||||||
--- !u!1 &2021891224
|
--- !u!1 &2021891224
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -2428,3 +2473,4 @@ SceneRoots:
|
|||||||
- {fileID: 763126626}
|
- {fileID: 763126626}
|
||||||
- {fileID: 670812665}
|
- {fileID: 670812665}
|
||||||
- {fileID: 409312061}
|
- {fileID: 409312061}
|
||||||
|
- {fileID: 1686741893}
|
||||||
|
|||||||
@ -55,6 +55,9 @@ namespace CloudPointRpc
|
|||||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
||||||
public static extern void crpc_init(byte[] configPath);
|
public static extern void crpc_init(byte[] configPath);
|
||||||
|
|
||||||
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
|
||||||
|
public static extern void crpc_init_with_address(byte[] ip, int port);
|
||||||
|
|
||||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void crpc_deinit();
|
public static extern void crpc_deinit();
|
||||||
|
|
||||||
@ -144,5 +147,11 @@ namespace CloudPointRpc
|
|||||||
var bytes = Encoding.UTF8.GetBytes(configPath + '\0');
|
var bytes = Encoding.UTF8.GetBytes(configPath + '\0');
|
||||||
CrpcServerApi.crpc_init(bytes);
|
CrpcServerApi.crpc_init(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CrpcInitWithAddress(string ip, int port)
|
||||||
|
{
|
||||||
|
var bytes = Encoding.UTF8.GetBytes(ip + '\0');
|
||||||
|
CrpcServerApi.crpc_init_with_address(bytes, port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
Assets/Scripts/MinimalRpcServer.cs
Normal file
29
Assets/Scripts/MinimalRpcServer.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using CloudPointRpc;
|
||||||
|
|
||||||
|
public class MinimalRpcServer : MonoBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] private string serverIp = "127.0.0.1";
|
||||||
|
[SerializeField] private int serverPort = 9095;
|
||||||
|
|
||||||
|
private static CrpcTestApi.RpcStringCallback _pingCallback;
|
||||||
|
|
||||||
|
[AOT.MonoPInvokeCallback(typeof(CrpcTestApi.RpcStringCallback))]
|
||||||
|
private static IntPtr OnPing(IntPtr rpcStringPtr)
|
||||||
|
{
|
||||||
|
var req = new RpcString(rpcStringPtr);
|
||||||
|
Debug.Log($"[MinimalRpcServer] ping received: {req.Data}");
|
||||||
|
return new RpcString("\"pong\"").Handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
_pingCallback = OnPing;
|
||||||
|
CrpcTestExtensions.CrpcInitWithAddress(serverIp, serverPort);
|
||||||
|
CrpcTestExtensions.CrpcAddMethod(_pingCallback, "ping");
|
||||||
|
Debug.Log($"[MinimalRpcServer] TCP server started on {serverIp}:{serverPort}, ping registered");
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy() => CrpcServerApi.crpc_deinit();
|
||||||
|
}
|
||||||
11
Assets/Scripts/MinimalRpcServer.cs.meta
Normal file
11
Assets/Scripts/MinimalRpcServer.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3efe38e5bed73a892bb160f847afd04f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
3
config.yml
Normal file
3
config.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
server:
|
||||||
|
ip: "127.0.0.1"
|
||||||
|
port: 9095
|
||||||
Loading…
x
Reference in New Issue
Block a user