private void HandleClientDisconnect(object?sender, NetChannelArgs e)
        {
            _entityManager.DropPlayerState(_playerManager.GetSessionById(e.Channel.SessionId));

            if (_ackedStates.ContainsKey(e.Channel.ConnectionId))
            {
                _ackedStates.Remove(e.Channel.ConnectionId);
            }
        }
Esempio n. 2
0
        private void HandleClientDisconnect(object?sender, NetChannelArgs e)
        {
            _ackedStates.Remove(e.Channel.ConnectionId);

            if (!_playerManager.TryGetSessionByChannel(e.Channel, out var session))
            {
                return;
            }

            _entityManager.DropPlayerState(session);
        }