简体   繁体   English

Unity3d联网:当播放器接到电话时,联网会发生什么?

[英]Unity3d Networking: What happens to networking when the player receives a phone call?

I am building a multiplayer, turn based cards game . 我正在构建一个多人,回合制纸牌游戏 Since the answer to these question is not available in the docs, I am asking it here: 由于这些问题的答案在文档中不可用,所以我在这里问它:

The game uses Unity's networking HLAPI (NetworkClient and NetworkServer), and the client & server communicate exclusively with NetworkMessages, no RPC is used. 游戏使用Unity的联网HLAPI(NetworkClient和NetworkServer),并且客户端和服务器仅与NetworkMessages通信,不使用RPC。 What happens when: 什么时候发生:

(a) The client on an android smartphone is connected to the server & playing, and the player suddenly receives a call? (a)安卓智能手机上的客户端已连接到服务器并正在播放,而播放器突然接到了电话? With the client disconnect, or will it continue to send messages, or will it stall, not accepting any messages? 在客户端断开连接的情况下,或者它将继续发送消息,还是将其停顿,不接受任何消息?

(b) The player is playing over 3G and suddenly decides to switch over to Wi-Fi with the game still running. (b)玩家正在玩3G,突然决定在游戏仍在运行的情况下切换到Wi-Fi。 Will the client disconnect, or will the game somehow continue to run and the client stays connected to the server? 客户端会断开连接,还是游戏将继续运行并且客户端保持与服务器的连接?

a) If you are using 3g & receive call then , its obvious player will get disconnected . a)如果您使用3g接听电话,则其明显的播放器将断开连接。

b) If you are on wifi and receive call then , you will not get disconnected if your android can handle keeping your game in memory . b)如果您正在使用wifi并接听电话,那么如果您的android可以处理将您的游戏保存在内存中,您将不会断开连接。

c) If you switch network , the disconnection will depend upon game server . c)如果您切换网络,则断开连接将取决于游戏服务器。 Server will handle the part if the player reconnection should be whole new or just reconnect were he left . 如果播放器重新连接是全新的,或者刚离开时重新连接,服务器将处理该部分。

Looking to your game , the server should reconnect as new connection . 展望您的游戏,服务器应重新连接为新连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM