Exemple #1
0
        public async Task <DatabaseModel.Match> CreateNewMatchAsync(int roundId)
        {
            var settingRes = await _gameModeSettingService.GetSettingForType(GameModeType.JackpotCsgo);

            _currentMatchSettings = (DatabaseModel.JackpotSetting)settingRes ?? throw new NullReferenceException("The match setting is NULL!");

            _gameMode = await _repoServiceFactory.GameModeRepoService.Find(GameModeHelper.GetStringFromType(GameModeType.JackpotCsgo));

            var res = await base.CreateNewMatchAsync(roundId, _gameMode);

            var jackpotMatch = new JackpotMatch(
                roundId.ToString(),
                res.Hash,
                res.Salt,
                res.Percentage,
                MatchStatusHelper.GetMatchStatusFromInt(res.Status),
                new List <Bet>(),
                res.TimerStarted,
                new JackpotMatchSetting(
                    _currentMatchSettings.Rake,
                    TimeSpan.FromMilliseconds(_currentMatchSettings.TimmerInMilliSec),
                    _currentMatchSettings.ItemsLimit,
                    _currentMatchSettings.MaxItemAUserCanBet,
                    _currentMatchSettings.MinItemAUserCanBet,
                    _currentMatchSettings.MaxValueAUserCanBet,
                    _currentMatchSettings.MinValueAUserCanBet,
                    _currentMatchSettings.AllowCsgo,
                    _currentMatchSettings.AllowPubg,
                    TimeSpan.FromMilliseconds(_currentMatchSettings.DraftingTimeInMilliSec),
                    _currentMatchSettings.DraftingGraph
                    )
                );

            await _matchHubConnections.NewMatchCreated(jackpotMatch);

            _isClosed = false;
            return(res);
        }
Exemple #2
0
 public async Task NewMatchCreated(JackpotMatch jackpotMatch)
 {
     await SendToAll(jackpotMatch, "onCreated");
 }