private void ProcessUnpauseMatch() { OnGenericUpdateEventArgs args = new OnGenericUpdateEventArgs { Message = $"{Match.CTName} vs {Match.TName} is live again", Guild = Manager.Guild, TimeStamp = DateTime.UtcNow.AddHours(Config.TimeZoneOffset), ServerId = ID }; OnGenericUpdate(args); }
private void ProcessRaw(string result) { if (Match.IsLive) { if (result.Contains(".ready") || result.Contains(".READY") || result.Contains(".gaben") || result.Contains(".GABEN")) { Match.ReadyCount++; } } if (result.Contains("Log file started")) { if (Match.ReadyCount > 8) { if (Match.SwapCount > 0) { if (Match.SwapCount == 1) { OnGenericUpdateEventArgs args = new OnGenericUpdateEventArgs { Message = $"{Match.CTName} vs {Match.TName} is now live in the second half", Guild = Manager.Guild, TimeStamp = DateTime.UtcNow.AddHours(Config.TimeZoneOffset), ServerId = ID }; Match.ReadyCount = 0; Match.Paused = false; OnGenericUpdate(args); } if (Match.SwapCount > 1) { OnGenericUpdateEventArgs args = new OnGenericUpdateEventArgs { Message = $"{Match.CTName} vs {Match.TName} is now live in OT {Match.SwapCount - 1}", Guild = Manager.Guild, TimeStamp = DateTime.UtcNow.AddHours(Config.TimeZoneOffset), ServerId = ID }; OnGenericUpdate(args); Match.ReadyCount = 0; Match.Paused = false; } } } } }
private void ProcessScoreUpdate() { if (Match.CTScore + Match.CTScore == 30) { OnGenericUpdateEventArgs args = new OnGenericUpdateEventArgs { Message = $"{Match.CTName} vs {Match.TName} is going OT", Guild = Manager.Guild, TimeStamp = DateTime.UtcNow.AddHours(Config.TimeZoneOffset), ServerId = ID }; } ScoreUpdateEventsArgs scoreUpdateArgs = new ScoreUpdateEventsArgs { Match = Match, GuildManager = Manager, TimeStamp = DateTime.UtcNow.AddHours(Config.TimeZoneOffset), }; OnScoreUpdate(scoreUpdateArgs); }
private void OnGenericUpdate(OnGenericUpdateEventArgs args) { OnGenericUpdateEventArgs?.Invoke(this, args); }
private async void CsServerGenericBroadcastUpdateAsync(object sender, OnGenericUpdateEventArgs e) { var notification = await GetChannelAsync(e.Guild, ChannelNames.Notifications) as ISocketMessageChannel; await notification.SendMessageAsync($"[{e.ServerId}] {MentionUtils.MentionRole((await GetRoleAsync(e.Guild, RoleNames.Broadcast) as IRole).Id)} {e.Message} - {e.TimeStamp.ToString("HH:mm:ss")}"); }