Beispiel #1
0
        public async void SendMatchmakerAddNotification(SeekModel seek)
        {
            var toAddress = _internalAddress;
            var subject   = $"Pulse: PlayerId {seek.Player} joined the pool";
            var body      = JsonConvert.SerializeObject(seek);

            await SendMany(toAddress, subject, body);
        }
        /// <summary>
        /// Adds current player to the MatchmakerLog records
        /// </summary>
        /// <param name="playerDetails">The player details used by the matchmaker.</param>
        /// <returns></returns>
        public void Add(SeekModel playerDetails)
        {
            var matchmakerLog = new MatchmakerLog {
                PlayerId        = int.Parse(playerDetails.Player),
                AddedAt         = playerDetails.JoinedAt,
                Rating          = playerDetails.Rating,
                RecentOpponents = string.Join(",", playerDetails.RecentOpponents)
            };

            _context.Add <MatchmakerLog>(matchmakerLog);
            _context.SaveChanges();
        }