public void ConfirmAllChanges(Guid repoId, int playerIndex)
        {
            if (!_idToSyncers.TryGetValue(repoId, out var syncer))
            {
                _logger.Error($"ConfirmAllChanges error: can not get repo with id {repoId}");
                return;
            }

            _confirmationManager.ConfirmAllChanges(repoId, playerIndex);
        }
Пример #2
0
        private void CheckConfirmations()
        {
            var missRates = _confirmationManager.GetPlayersMissRates(_id);

            foreach (var item in missRates)
            {
                if (item.Value >= _forceSyncThreshold)
                {
                    if (_playerRepo.IsPlayerExist(item.Key))
                    {
                        var sessionId = _playerRepo.GetPlayerSessionId(item.Key);
                        _logger.Error($"Forcing player {item.Key} to refresh repo with {typeof(TEvent)} (miss rate {item.Value})");
                        SendForceSync(sessionId);
                        _confirmationManager.ConfirmAllChanges(_id, item.Key);
                    }
                }
            }
        }