helppokersource - Support: sr #2364, table-picker packet server side...

 
 
Show feedback again

sr #2364: table-picker packet server side that gets user in an active cash game

Submitted by:  Bradley M. Kuhn <bkuhn>
Submitted on:  Sat 13 Jun 2009 04:07:37 PM UTC  
 
Category: poker-networkPriority: 9 - Immediate
Severity: 3 - NormalStatus: Done
Privacy: PublicAssigned to: Bradley M. Kuhn <bkuhn>
Open/Closed: ClosedOperating System: GNU/Linux
Effort: 24.00

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sun 21 Jun 2009 11:19:05 PM UTC, SVN revision 5905:

Completed implementation of PokerService.getTableBestByCriteria()

This method uses listTables() to get a list of tables and eliminates those
that the user cannot afford. The first one found that is affordable is
returned.

Minor improvements as well to the tests, mostly typo fixes.

This is continuing work to support the sr #2364 feature request.

(Browse SVN revision 5905)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sun 21 Jun 2009 10:21:14 PM UTC, SVN revision 5899:

Slight refactor of handlePacketLogic() to use sub-methods for certain packet operations.

The "perform" methods are designed so that the a minimal amount of code
related to receiving a packet that appears in the handlePacketLogic()
giant "if" statement. The primary motive for this is for things like
PacketTablePicker(), that need to perform operations as if the client
has sent additional packets. The desire is to keep completely parity
between what the individual packets do by themselves, and what
"super-packets" like PacketTablePicker() do. A secondary benefit is that
it makes that giant "if" statement in handlePacketLogic() above a bit
smaller.

This is work toward competition of feature request in sr #2364.

(Browse SVN revision 5899)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sun 21 Jun 2009 06:16:06 PM UTC, SVN revision 5891:

Properly implemented min_players feature for PokerService.listTables() and
corrected/augmented corresponding test. This work is towards sr #2364.

I realized that user2table shouldn't be used for finding minimum players,
but rather the players field in pokertables, since that is updated by the
underlying module, and saves an unnecessary join in the SQL statement and
more difficult building of the SQL string. That required numerous changes
to the SQL statements in the test. There were also some problems with the
test, mostly related to what happens when players is 0.

A few other tests also needed an extra \t field added, now that an
additional one is properly supported.

(Browse SVN revision 5891)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sun 21 Jun 2009 03:07:23 PM UTC, SVN revision 5884:

PokerService.listTables() can now take an additional criterion,
betting_structure, as part of the tab-separated list. The method for
building the query when more than one tab-separated argument is given has
been refactored entirely. This is work toward completion of the feature
request, sr #2364.

Note that two tests still fail in this commit. That's because they expect
a count of users to be included. That will be the next development effort
on this branch.

(Browse SVN revision 5884)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sun 21 Jun 2009 02:32:57 PM UTC, SVN revision 5882:

Added test to ensure that TablePicker packet doesn't assign a table that
the player cannot afford to buy into. This is part of continuing work on
sr #2364.

(Browse SVN revision 5882)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 20 Jun 2009 10:59:23 PM UTC, SVN revision 5879:

Test that should succeed on PACKET_POKER_TABLE_PICKER need to have enough
money, and cover the cases where the player is above and under best. This
is continuing work for the feature request sr #2364.

(Browse SVN revision 5879)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 20 Jun 2009 09:30:55 PM UTC, SVN revision 5876:

Added check for PacketPokerTablePicker success cases for the buy in
amounts, so that it now matches the documentation in pokerpackets.py.
This is toward implementation of the feature request in sr #2364.

(Browse SVN revision 5876)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 20 Jun 2009 07:52:16 PM UTC, SVN revision 5873:

sr #2364: Added expectation of PACKET_POKER_SIT when PACKET_POKER_TABLE_PICKER succeeds

(Browse SVN revision 5873)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 20 Jun 2009 07:26:23 PM UTC, SVN revision 5872:

Clarified documentation of PacketPokerTablePicker further toward better
understanding of the specification for sr #2364.

(Browse SVN revision 5872)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 20 Jun 2009 06:32:08 PM UTC, SVN revision 5871:

Rewrote semantics description of PacketPokerTablePicker().

This was based on discussions with dachary about the semantics of what is
expected by the feature as described in sr #2364. Relevant portion of
discussion:

The current specification for TablePicker as I understand it is
that it takes the player through JOIN and SEAT, but not BUY-IN.
I note that BUY_IN is the place in avatar where
service.autoRefill() is called. So, shouldn't we not do the
autoRefill() w/ tablePicker, since we expect BuyIn will do it?

SEAT + BUY_IN + SIT
OH!
JOIN + SEAT + BUY_IN + SIT
* bkuhn must change the tests then. :)
I thought we only too it to SEAT and then gave them a buy-in window.
tablepicker primary purpose is : get me to the action right now
I'm glad we cleared that now :-)

This conversation was circa 20:00 on 2009-06-20, and should be archived at:
http://pokersource.info/irc/pokersource@irc.freenode.net/2009-06-20.html

(Browse SVN revision 5871)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 20 Jun 2009 05:11:07 PM UTC, SVN revision 5870:

New packet, PacketPokerTablePicker, number 165. This packet will be used
when the client wishes the server to select a table and join/seat them
immediately based on a set of criteria. This is work toward resolving
sr #2364, which asks for this feature.

(Browse SVN revision 5870)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Tue 16 Jun 2009 12:49:58 AM UTC, SVN revision 5848:

Merged test-pokeravatar-speedup branch @ r5833, which implements the
following feature:

Created createClients() method, whereby each test must declare how many
clients it needs.

Previously, it was necessary to add more clients to the regular setUp()
routine for the avatar tests when you wrote a test that needed "one more"
client to be active. It makes more sense for each test to declare at its
start how many clients it needs, so that we don't needlessly create
clients.

I implemented this as prep work for sr #2364 (which will need tests that
create many clients); however, this change likely has useful implications
in mere speedup of these tests, an issue that Loic has been recently
complaining about.

(Browse SVN revision 5848)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sun 14 Jun 2009 07:23:46 AM UTC, comment #2:

I've looked into the speed problems of the avatar tests. And I am now convinced that they can hardly be faster. As you said : these tests are good because they actually run a server and clients each time. Limiting the number of clients will help a bit, but the bulk of the time spent is (as you previously said) not because of the number of clients.

Loic Dachary <loic>
Project Administrator
Sat 13 Jun 2009 07:27:54 PM UTC, SVN revision 5832:

Created createClients() method, whereby each test must declare how many clients it needs.

Previously, it was necessary to add more clients to the regular setUp()
routine for the avatar tests when you wrote a test that needed "one
more" client to be active. It makes more sense for each test to declare
at its start how many clients it needs, so that we don't needlessly
create clients.

I implemented this as prep work for sr #2364 (which will need tests that
create many clients); however, this change likely has useful
implications in mere speedup of these tests, an issue that Loic has been
recently complaining about.

(Browse SVN revision 5832)

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.
Sat 13 Jun 2009 04:07:37 PM UTC, original submission:

<dachary> describes this feature this way:

table-picker : pick a seat as if the player sent a tablejoin packet + seat packet to the first table that has an ongoing game (or a game with players if not, or any table if not)

The idea is that a player would like to forget the lobby, and simply be placed in a cash game that has an available seat and a game going. The hope is to find a seat whereby the player can start playing in a cash game immediately.

I think we should probably allow the user to set the game and the a minimum number of players they'd like to be sat with. Many users will not play heads up, for example, and it will only frustrate them and their opponent to be sat at a short-handed table only to immediately sit out because they do not like the number of opponents.

Bradley M. Kuhn <bkuhn>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by loic (Posted a comment)
  • -unavailable- added by bkuhn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 24 Jun 2009 03:38:46 PM UTCbkuhnOpen/ClosedOpen=>Closed
    Tue 23 Jun 2009 02:55:33 AM UTCbkuhnStatusIn Progress=>Done
    Sun 14 Jun 2009 07:23:56 AM UTCloicPriority5 - Normal=>9 - Immediate
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup