Tue 23 Jun 2009 02:54:05 AM UTC, SVN revision 5935:
Implementation of PacketPokerTablePicker(), merged from table-picker branch.
Detailed implementation logs are in table-picker branch, r5830 to r5933.
The commit message below contains a summary of the feature implementation
details. The feature itself is best documented in the "Semantics" section
for the PacketPokerTablePicker() (in pokerpackets.py). This merge
closes sr #2364.
Implementation Details:
* Expanded the method PokerService.listTables() to include various
additional criteria needed to find a list of tables that matched the
desired parameters sought by the requesting player. Additional
indexes were added on dbtable, pokertables, to speed this up.
* PokerService.getTableBestByCriteria() uses the aforementioned new
listTables(). getTableBestByCriteria() loops through the tables
returned by listTables(). It eliminates tables that:
+ are full, or
+ have too many players sitting out, such that the requested
minimum player count would (effectively) not be reached, or
+ have minimum buy-ins such that the requesting player could not
afford to play.
* Refactored PokerAvatar.handlePacketLogic() somewhat to create a
variety of so-called "perform" functions. These functions move some
of the code that was originally in-line inside the giant "if"
statement into their own methods.
* PokerAvatar.performPacketPokerTablePicker() takes advantage of the
aforementioned "perform" functions to ensure its sequence of
automatic packet operations work exactly as if the client had sent
those very packets itself.
* Added a helper function for constructing a string ready for
PokerService.listTables() in PokerAvatar.
Tests Implementation Details:
* Created PokerAvatarTestCaseBaseClass so additional client/server test
case classes can be created to reuse some of the methods from the
original PokerAvatarTestCase.
* Various feature-oriented tests are in PokerAvatarTablePickerTestCase,
which also serves as unit test coverage for handlePacketLogic().
* Standard unit test coverage for the new listTables() and for
getTableBestByCriteria() is provided.
Future Work:
During implementation, the idea came up that table selection by the
TablePicker should help keep the cash game tables site-wide as balanced
as possible, which is the inspiration for sr #2368 and for the
[...] currently-skipped test04_tablePicker_twoPossibleGivesMostEmpty
[...]
(Browse SVN revision 5935) |