简体   繁体   English

如何检测客户是否故意在Google Play游戏实时多人游戏中留下房间?

[英]How to detect if client intentionally left Room in Google Play Games Real-time Multiplayer?

Here is a multiplayer game and I need to display two notifications to player: first when rival disconnected due to some networking problems, and second - when he left game intentionally. 这是一个多人游戏,我需要向玩家显示两个通知:首先当竞争对手由于某些网络问题而断开连接时,第二个 - 当他故意离开游戏时。 Room is created with auto-match criteria (max players - 2). 使用自动匹配条件创建会议室(最多玩家 - 2)。 And each time when one of the players left game due to network problems or intentionally RoomStatusUpdateListener callbacks called in the next order: onDisconnectedFromRoom , onPeerLeft , onPeersDisconnected . 并且每当其中一个玩家因网络问题离开游戏或故意在下一个顺序中调用RoomStatusUpdateListener回调: onDisconnectedFromRoomonPeerLeftonPeersDisconnected

So I show notification in onDisconnectedFromRoom callback, the problem is you can't detect if it was network problem that happened to rival or he left intentionally. 所以我在onDisconnectedFromRoom回调中显示通知,问题是你无法检测是否是发生在竞争对手或他故意离开的网络问题。 Participant.getStatus() returns STATUS_JOINED . Participant.getStatus()返回STATUS_JOINED

So, how to detect if client left room intentionally? 那么,如何检测客户是否故意离开房间?

Thank you in advance! 先感谢您!

you can send game data between the clients. 您可以在客户端之间发送游戏数据。 So just in case a player wants to left the game, send a message that this specific user will disconnect now to all other players. 因此,如果玩家想要离开游戏,请发送此特定用户现在将与所有其他玩家断开连接的消息。

best whishes, Steve. 最好的,史蒂夫。

暂无
暂无

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

相关问题 如何使用Google Play游戏在实时多人游戏中处理应用版本? - How to handle app versions in real-time multiplayer using Google Play Games? 如何在使用Google Play游戏服务的实时多人游戏中使用僵尸玩家? - How can I use bot players in real-time multiplayer games using Google Play game services? 如何在实时多人Google Play游戏服务中创建房间时向其他参与者发送数据 - How to send data to other participant on Room creation in Real-time Multiplayer Google Play Game Services Google Play 游戏服务实时多人游戏 - Google Play Games Services Real Time Multiplayer 如何在Google Play游戏实时多人游戏中定义主机? - How to define a host in google play games real time multiplayer? 当应用程序进入后台时,实时多人游戏Google Play游戏服务同行会断开连接 - Real-time Multiplayer Google Play Games Services peer gets disconnected when app goes in background 如果Google Play游戏服务提供实时多人游戏,那么使用gamesparks.com有什么优势? 两者有什么区别? - If Google Play Games Services offer Real-time Multiplayer, what is the advantage of using gamesparks.com? What is the difference between these two? Google Play游戏-回合制或实时多人API? - Google Play Games - Turn Based or Real Time multiplayer API? 检测其他玩家是否意外离开(例如互联网断开)并重新连接-Google Play实时多人游戏 - Detect if other player left unintentionally (e.g. internet disconnection) and reconnect - Google play real time multiplayer Android上的Google实时多人游戏 - Google Real-time Multiplayer on Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM