[Ue4] RPC, remote call

Source: Internet
Author: User
Tags dedicated server

RPC

1. Remote Procedure Call: Remote program call

2. One process calls the functions of another process

Because the "server-shoot" method is marked as "running on server", even though it is opening fire in the second window (client), the output information is: SERVER: Prepare for shooting, indicates that this is running on the server.

 

On the server, the "server-shoot" method calls the "muticast-shoot" method and the "muticast-shoot" method (marked as "multi-path transfer "), therefore, the server will notify all clients to execute this method.

The results show: SERVER: All shots and client 1: All shots.

Because "Run dedicated server" is not checked, the first window is both a server and a client. When "Multi-Channel Transmission" is used, messages are sent to the client itself, therefore, "server: All shots" is displayed"

2. remotely call actor ownership.

  1. If you use the get all actors of class function to obtain the role instance controlled by Client A, assign a value to the "server-shoot" method marked as "running on server" (the target is self by default ), run on client B (assign the client B instance to the target parameter "server-shoot"). The server does not perform this operation and is discarded, of course, it will not be spread to other clients.
  2. However, if the server calls the "server-shoot" method marked as "running on the server" on the server, no matter who the target parameter of "server-shoot" is assigned, it will be executed, it will also be spread to other clients.

 

The table below summarizes where specific RPC types will be executed based on the ownership of the actor that executes the call (the leftmost column.

RPC called by the slave server

Actor ownership

Not copied

NetMulticast

Server

Client

Client-owned actor

Run on the server

Run on the server and all clients

Run on the server

Run on the client to which the actor belongs

Server-owned actor

Run on the server

Run on the server and all clients

Run on the server

Run on the server

Unowned actor

Run on the server

Run on the server and all clients

Run on the server

Run on the server

RPC called from the client

Actor ownership

Not copied

NetMulticast

Server

Client

Owned by invoking Client

Run on the client that executes the call

Run on the client that executes the call

Run on the server

Run on the client that executes the call

Owned by a different client

Run on the client that executes the call

Run on the client that executes the call

Discard

Run on the client that executes the call

Server-owned actor

Run on the client that executes the call

Run on the client that executes the call

Discard

Run on the client that executes the call

Unowned actor

Run on the client that executes the call

Run on the client that executes the call

Discard

Run on the client that executes the call

For more information about RPC Remote calls see the official documentation: http://api.unrealengine.com/CHN/Gameplay/Networking/Actors/RPCs/index.html

[Ue4] RPC, remote call

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.