Files
UnrealEngineUWP/Engine/Documentation/Source/Gameplay/HowTo/Networking/ReplicateFunction/ReplicateFunctionOverview.CHN.udn
mitchell wilson 62805384bf Copying //UE4/Dev-Documentation to Samples-Main (//UE4/Samples-Main) CL - 4860397
#rb none

#ROBOMERGE-OWNER: ryan.vance
#ROBOMERGE-AUTHOR: mitchell.wilson
#ROBOMERGE-SOURCE: CL 4860421 in //UE4/Main/...
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR)

[CL 4860484 by mitchell wilson in Dev-VR branch]
2019-01-31 15:44:30 -05:00

33 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
INTSourceChangelist:3429254
Availability: Public
Title:远程调用函数Replicating Functions
Crumbs: %ROOT%, Gameplay
Description:在多人游戏中远程调用函数的指南。
Version: 4.9
Parent:Gameplay
SkillLevel: Advanced
type:overview
order:16
**Function Replication**(远程过程调用或 RPC是在本地调用但在其他机器不同于执行调用的机器上远程执行的函数。RPC 函数非常有用,可允许客户端或服务器通过网络连接相互发送消息。
远程调用函数可设置为 **Reliable** 或 **Unreliable**,其中 Reliable 调用必定会发生,而 Unreliable 调用可能会在网络繁忙时被丢弃。大多数处理装饰视觉效果的远程调用函数应设置为 Unreliable以避免过多占用网络。
远程调用函数主要包括 3 种类型:**Multicast 广播**、**Run on Server 在服务端执行** 和 **Run on owning Client 在客户端执行**。广播函数在服务器上调用和执行,然后自动转发给客户端。
在服务端执行的函数由客户端调用,然后仅在服务器上执行。
在客户端执行的函数由服务器调用,然后仅在自有客户端上执行。
服务器和客户端复制函数存在一些限制,其中一条是它们仅可在具有 **Net Owner** 的 Actor 上使用。如果 Actor 为玩家控制器或归玩家控制器所有,则其具有 Net Owner。
例如,玩家控制器拥有的 Pawn 可在其上执行服务器或客户端远程调用函数。
(#ImplementationGuides)
## 实现指南
[DIR(output:"role" parent:"Gameplay/HowTo/Networking/ReplicateFunction" org:"hierarchy" end:"1")]