Skip to content

Commit

Permalink
[unreal]使TS中支持Reliable RPC (Tencent#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticfarer authored Jul 19, 2021
1 parent cc4c9ca commit 5f133b4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/unreal/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class TsTestActor extends UE.Actor {

}

@rpc.flags(rpc.FunctionFlags.FUNC_Net | rpc.FunctionFlags.FUNC_NetServer)
@rpc.flags(rpc.FunctionFlags.FUNC_Net | rpc.FunctionFlags.FUNC_NetServer | rpc.FunctionFlags.FUNC_NetReliable)
FireServer(): void {

}
Expand Down
3 changes: 2 additions & 1 deletion unreal/Puerts/Content/JavaScript/puerts/uelazyload.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ var global = global || (function () { return this; }());

const FunctionFlags = {
"FUNC_Net" : 0x00000040, // Function is network-replicated.
"FUNC_NetReliable" : 0x00000080, // Function should be sent reliably on the network.
"FUNC_NetMulticast" : 0x00004000, // Function is networked multicast Server -> All Clients
"FUNC_NetServer" : 0x00200000, // Function is executed on servers (set by replication code if passes check)
"FUNC_NetClient" : 0x01000000, // function is executed on clients
Expand Down Expand Up @@ -204,4 +205,4 @@ var global = global || (function () { return this; }());

puerts.toManualReleaseDelegate = (x) => x;

}(global));
}(global));
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Tencent is pleased to support the open source community by making Puerts available.
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may be subject to their corresponding license terms.
Expand Down Expand Up @@ -510,7 +510,7 @@ void UPEBlueprintAsset::AddFunction(FName InName, bool IsVoid, FPEGraphPinType I

if (FunctionEntryNode)
{
const int32 NetMask = FUNC_Net | FUNC_NetMulticast | FUNC_NetServer | FUNC_NetClient;
const int32 NetMask = FUNC_Net | FUNC_NetMulticast | FUNC_NetServer | FUNC_NetClient | FUNC_NetReliable;
int32 NetFlags = InFlags & NetMask;
NetFlags = NetFlags ? FUNC_Net | NetFlags : 0;

Expand Down
1 change: 1 addition & 0 deletions unreal/Puerts/Typing/ue/puerts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ declare module "ue" {
namespace rpc {
export enum FunctionFlags {
FUNC_Net = 0x00000040, // Function is network-replicated.
FUNC_NetReliable = 0x00000080, // Function should be sent reliably on the network.
FUNC_NetMulticast = 0x00004000, // Function is networked multicast Server -> All Clients
FUNC_NetServer = 0x00200000, // Function is executed on servers (set by replication code if passes check)
FUNC_NetClient = 0x01000000, // function is executed on clients
Expand Down

0 comments on commit 5f133b4

Please sign in to comment.