private void Refresh()
        {
            foreach (var v in _playerById.Values)
            {
                v.RealPlayer = null;
                v.Bots.Clear();
            }
            MyAPIGateway.Players.GetPlayers(null, (x) =>
            {
                PlayerAuxData aux;
                _playerBySteamId.TryGetValue(x.SteamUserId, out aux);
                _playerById.TryGetValue(x.IdentityId, out aux);
                if (aux == null)
                {
                    aux = new PlayerAuxData(x.SteamUserId);
                }
                _playerById[x.IdentityId]       = aux;
                _playerBySteamId[x.SteamUserId] = aux;

                ResearchCore.ResearchCore.LoggerStatic?.Debug($"Found player {x.IdentityId} ({x.IsBot})");
                if (x.IsBot)
                {
                    aux.Bots.Add(x);
                }
                else
                {
                    Utilities.Assert(aux.RealPlayer == null, "Real player occured twice");
                    aux.RealPlayer = x;
                }
                return(false);
            });

            _keysToRemove.Clear();
            _keysToRemove.AddRange(_playerById.Where(x => x.Value.RealPlayer == null && x.Value.Bots.Count == 0)
                                   .Select(x => x.Key));
            foreach (var l in _keysToRemove)
            {
                ResearchCore.ResearchCore.LoggerStatic.Debug($"Removing player {l}/{_playerById[l].AssociatedSteamId} because no entries");
                _playerBySteamId.Remove(_playerById[l].AssociatedSteamId);
                _playerById.Remove(l);
            }
            _keysToRemove.Clear();
        }
        private void Refresh()
        {
            foreach (var v in _playerById.Values)
            {
                v.RealPlayer = null;
                v.Bots.Clear();
            }
            MyAPIGateway.Players.GetPlayers(null, (x) =>
            {
                PlayerAuxData aux;
                if (!_playerById.TryGetValue(x.IdentityId, out aux))
                {
                    aux = new PlayerAuxData(x.SteamUserId);
                    _playerById.Add(x.IdentityId, aux);
                    _playerBySteamId.Add(x.SteamUserId, aux);
                }
                if (x.IsBot)
                {
                    aux.Bots.Add(x);
                }
                else
                {
                    aux.RealPlayer = x;
                }
                return(false);
            });

            _keysToRemove.Clear();
            _keysToRemove.AddRange(_playerById.Where(x => x.Value.RealPlayer == null && x.Value.Bots.Count == 0)
                                   .Select(x => x.Key));
            foreach (var l in _keysToRemove)
            {
                _playerBySteamId.Remove(_playerById[l].AssociatedSteamId);
                _playerById.Remove(l);
            }
            _keysToRemove.Clear();
        }