C
C
ColdSpirit2018-06-30 09:30:45
Computer networks
ColdSpirit, 2018-06-30 09:30:45

UNET - How to correctly terminate the server after a ClientRPC call?

Good afternoon. I'm trying to complete the game in the following order:

  1. Host sends ClientRPC with message "Bye"
  2. Host stops working
  3. All clients receive a message
  4. All clients stop working

But there is a problem - if the host is terminated immediately after the ClientRPC call, then the message will not be sent, and the clients will catch a wait error.
I know that you can solve this by waiting N times after the ClientRPC call, and then terminate the host, but since I do not know how long to wait exactly, this solution looks very crutch.
Does anyone know how to send an RPC immediately after an RPC function is called, or, for example, where are the RPCs that have not yet been sent so that they are counted and terminated by the host when they are 0? I would be glad to see other adequate solutions.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question