In r5935, I have merged the implementation of PacketPokerTablePicker()
from table-picker branch:
http://svn.gna.org/viewcvs/pokersource?view=rev&rev=5935
I've also included my commit message below for your perusal here. As
always, my work is copyrighted by me and licensed under AGPLv3-or-later.
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
--
-- bkuhn
_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users