philroberts / FPDB-for-OSX

Free Poker DataBase development, with a focus on OSX.
http://fpdb.sf.net
56 stars 21 forks source link

HUD sometimes attaches itself to main fpdb window instead of poker table window #11

Open andersea opened 8 years ago

andersea commented 8 years ago

I am playing smallstakes and freeroll tournaments on the bwin/partypoker network using the danskespil.dk client. This works fine most of the time, but sometimes it seems fpdb gets confused about which window to attach the hud to, and then it attaches itself to the main window instead.

Only common thing I remember is that I was sitting at table 4 both the times it did it.

Screenshot

andersea commented 8 years ago

I can see that in poker table the window title exchanges the english word "Table" with the danish word "Bord", but it the hand history files it uses the word english word "Table".

philroberts commented 8 years ago

Hmm. At a guess it's seeing the number 4 in the FPDB window and latching on to that. If you look in the HUD log, are there any lines starting with something like the following?

Party.getTableTitleRe: returns: 

If so, what do they say it returns?

andersea commented 8 years ago

Here it has latched on to the tournament lobby instead of the poker table:

2016-03-14 20:03:32,092 parser INFO Party.getTableTitleRe: table_name='None' tournament='123048656' table_number='12' 2016-03-14 20:03:32,092 parser INFO Party.getTableTitleRe: returns: '#?12'

Here is a screenshot of the table title:

Table

Here is the lobby:

Lobby

andersea commented 8 years ago

I got moved to table 11 in the same tournament. Now it finds the right window.

2016-03-14 20:32:29,220 parser INFO Party.getTableTitleRe: table_name='None' tournament='123048656' table_number='11' 2016-03-14 20:32:29,220 parser INFO Party.getTableTitleRe: returns: '#?11'

philroberts commented 8 years ago

Yep. '#?12' will match any window with '12' in the title. It just gets a list of windows from the system and picks the first one (if any) that matches. I can think of a couple of ideas to make the matching more specific, but we have to be careful we don't break it for other tournament types. Maybe something like

<tournament ID>.*<table ID>

would work.

andersea commented 8 years ago

So I gather it is using a regular expression to match the title. In that case yes, that solution looks like an improvement. it would match first the tournament number, then 0 or many of any character followed by the table number.

philroberts commented 8 years ago

Yup. The only problem is, I didn't write this code - maybe the person who did had a good reason for making it this way. I guess I can make the change and if someone complains we can investigate further.

ChazDazzle commented 8 years ago

Feel free to be aggressive with changes to the getTableTitleRe regex. It doesn't have to support anything but the most current window naming pattern used by the sites (unlike hand histories which have loads of regression tests to deal with).

philroberts commented 8 years ago

That is a good point Chaz. My concern is that other tournament types might have different naming schemes. This is a bridge we can cross if we come to it.

philroberts commented 7 years ago

Well it took me a while but I made this change finally. Will be in next release.

ChazDazzle commented 7 years ago

Excellent!

dsnvwlmnt commented 7 years ago

Similarly on PokerStars the HUD sometimes attaches itself to the replayer instead of the table. Both windows are named identically...

I can work around it by closing the replayer, waiting for the next hand, then reopening the replayer, but that's a huge pita while streaming.

philroberts commented 7 years ago

Yeah unfortunately if the windows have identical names there's not much we can do under the current system. I do have a pipedream idea of letting the user manually specify a window to attach to, but I'm not sure if this is even possible. The problem you see on PokerStars doesn't happen if you already had the HUD attached to the correct window before you open the replayer, right? Or am I misremembering the behaviour?

dsnvwlmnt commented 7 years ago

The problem you see on PokerStars doesn't happen if you already had the HUD attached to the correct window before you open the replayer, right? Or am I misremembering the behaviour?

If it's already attached to the correct window, presumably it's fine. I guess i've mainly had this issue because the HUD is crashing for me constantly, so i have to reopen it dozens of times, and it sometimes attaches to the wrong window. If the Right Click Crashing goes away, it's probably not a big deal.