怎么把ts侧用protobufjs生成的uint8Array 传到C++里并转成void*的数据格式 #1230
Unanswered
nathan77886
asked this question in
Q&A
Replies: 2 comments 2 replies
|
看arraybuffer的例子:https://github.com/chexiongsheng/puerts_unreal_demo/blob/master/TsProj/QuickStart.ts#L107 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
我现在尝试在ts层接入protobuf
现在ts是这么实现的
TestSendPb(): void {const reqTest = encodeC2M_TestRequest({RpcId: 1,ActorId: 8888,request:"1"});console.log(reqTest);}C++里是这么搞的
UFUNCTION()void SendPlatformMessage(TArray<uint8> buffer);void UGS_ServerClient::SendPlatformMessage(TArray<uint8> Buffer){if (!Socket || !this) {return;}auto arrayData = TArray<TArray<uint8>>();arrayData.Add(Buffer);if (Buffer.Num() > 0 && Socket->IsConnected()) {Socket->Send(arrayData.GetData(), Buffer.Num(), true);}}但我感觉我这么搞不对,我的C++功底不行,有没有大佬能指导一下啊
All reactions