-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bradley M. Kuhn wrote: > I believe the attached patch will solve the problem of tourneys starting > with a strange imbalance of players (i.e., starting a tourney of 12 > players with 5 per table yields tables of : 5, 5, 2 to start currently). > > I solved this by calling balanceGames() at the end of createGames(). I > think this is a reasonable solution, although it might be slightly > confusing because players might briefly be assigned to the wrong table > and switched as the tourney starts. FWIW, I've seen this very behavior > on proprietary poker sites. :) > > I had to rewrite a few tests, which relied on the fact that > createGames() did not balanceGames(). There is also a test that > exhibits the problem. > > > I should note that I don't think the current table balance routine is as > good as it should be. I didn't rewrite it with this patch, though, > because it's really a separate problem. > > The attached patch is also on the branch imbalance-tourney-table-start > at r5486. > > If there are no objections, I'll merge it into trunk sometime next > week. Please let me know if you have concerns. > > I license this patch GPLv3-or-later. > Hi,
Excellent patch (I like one liners ;-) I understand the tricky part was to write the associated tests. Regarding the problem of notifying the player twice at the beginning of the tournament (moving him from the original table), I think it ca be fixed without rewriting or restructuring. If you take advantage of the fact that the state of the PokerTournament object is TOURNAMENT_STATE_REGISTERING, the balanceGames() method can distinguish when it is called before starting the tournament or after a player gets busted. In the createGames() function, moving the game_filled callback out of the loop main loop will probably be enough to avoid notifying a player twice. Do you think I overlooked something that makes this solution impractical ? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmF6UIACgkQ8dLMyEl6F23VMgCePH1Rg4l7dnWMsfxkUlati68m UYAAoMY4U2OPRiqGfEaFpQkfAhxY98UL =GVgv -----END PGP SIGNATURE-----
begin:vcard fn:Loic Dachary n:Dachary;Loic org:pokersource adr:;;12 bd Magenta;Paris;;75010;France email;internet:[email protected] title:Senior Developer tel;work:+33 9 51 18 43 38 tel;cell:+33 6 64 03 29 07 x-mozilla-html:FALSE url:http://dachary.org/ version:2.1 end:vcard
_______________________________________________ Pokersource-users mailing list [email protected] https://mail.gna.org/listinfo/pokersource-users
