コード例 #1
0
        private bool JackpotTableMatch(IgnitionTableTitle tableTitleData)
        {
            if (!tableTitleData.IsJackpot)
            {
                return(false);
            }

            if (!uint.TryParse(tableTitleData.TournamentId, out uint tournamentId))
            {
                return(false);
            }

            if (TournamentId != tournamentId)
            {
                return(false);
            }

            TableName = tableTitleData.TableName;

            if (IsAdvancedLoggingEnabled)
            {
                LogProvider.Log.Info(this, $"Jackpot table is detected: {tableTitleData.TableName}, {tableTitleData.TournamentId} [{tableTitleData.OriginalTitle}] [{Identifier}]");
            }

            return(true);
        }
コード例 #2
0
        private bool TournamentTableMatch(IgnitionTableTitle tableTitleData)
        {
            if (!tableTitleData.IsTournament)
            {
                return(false);
            }

            var match = !string.IsNullOrEmpty(tableTitleData.TableName) && tableTitleData.TableName.Equals(TableName, StringComparison.OrdinalIgnoreCase) &&
                        int.TryParse(tableTitleData.TableId, out int tableId) && (TableIndex == 0 || (TableIndex != 0 && tableId == TableIndex));

            if (IsAdvancedLoggingEnabled && match)
            {
                LogProvider.Log.Info(this, $"Tournament table is detected: {tableTitleData.TableName}, {tableTitleData.TableId} [{tableTitleData.OriginalTitle}] [{Identifier}]");
            }

            return(match);
        }
コード例 #3
0
        private bool IsWindowMatch(string title, string className)
        {
            if (string.IsNullOrWhiteSpace(className) ||
                className.IndexOf(WindowClassName, StringComparison.OrdinalIgnoreCase) < 0)
            {
                return(false);
            }

            var tableTitleData = new IgnitionTableTitle(title);

            if (!tableTitleData.IsValid)
            {
                return(false);
            }

            if (IsZonePokerTable)
            {
                return(ZonePokerTableMatch(tableTitleData));
            }

            if (IsJackpotTable)
            {
                return(JackpotTableMatch(tableTitleData));
            }

            if (IsTournament)
            {
                return(TournamentTableMatch(tableTitleData));
            }

            if (IsAdvancedLoggingEnabled)
            {
                LogProvider.Log.Info(this, $"Cash table is detected. [{tableTitleData.OriginalTitle}]");
            }

            return(true);
        }
コード例 #4
0
ファイル: IgnitionCatcher.cs プロジェクト: Michael-Z/DriveHud
        protected void NotifyNotDetectableWindows()
        {
            try
            {
                var windowsToNotify = new List <IntPtr>();

                foreach (ProcessThread thread in pokerClientProcess.Threads)
                {
                    WinApi.EnumThreadWindows(thread.Id, (hWnd, lParam) =>
                    {
                        var sb = new StringBuilder(256);

                        if (hWnd != IntPtr.Zero && WinApi.GetClassName(hWnd, sb, sb.Capacity) != 0 &&
                            sb.ToString().Contains(WindowClassName))
                        {
                            var windowTitle = WinApi.GetWindowText(hWnd);

                            var titleInfo = new IgnitionTableTitle(windowTitle);

                            if (titleInfo.IsValid && !titleInfo.IsZone)
                            {
                                windowsToNotify.Add(hWnd);
                            }
                        }

                        return(true);
                    }, IntPtr.Zero);
                }

                NotifyNotDetectableWindows(windowsToNotify);
            }
            catch (Exception e)
            {
                LogProvider.Log.Error(this, $"Could not notify not detectable windows. [{Identifier}]", e);
            }
        }
コード例 #5
0
 private bool ZonePokerTableMatch(IgnitionTableTitle tableTitleData)
 {
     return(false);
 }