Пример #1
0
        public bool PeerDisconnected(Guid sessionId, IDisconnectInfo reason)
        {
            var peerRemoved = _roomPlayers.TryRemove(sessionId, out var roomPlayer);

            if (peerRemoved)
            {
                _packetSender.CleanupPeerData(roomPlayer.Peer);
            }
            _roomPropertiesContainer.RemovePlayer(sessionId);
            try
            {
                _roomController.ProcessPlayerDisconnected(sessionId, ResolveReason(reason.Reason), reason.Payload);
            }
            catch (Exception ex)
            {
                _logger.Error($"CleanUpPlayer error: {ex}");
            }
            UpdateRoomStateOnMm();
            return(peerRemoved);
        }
 public void CleanupPeerData(IPeerSender peer)
 {
     _packetSender.CleanupPeerData(peer);
 }