Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #41  
Old 07-31-2007, 05:46 PM
jakrpanda jakrpanda is offline
Member
 
Join Date: Jan 2007
Posts: 53
Default Re: Poker Hand XML

Heh, whats funny is I thought the same thing up front and had a button element in the seats section, then changed it and went with an attribute. I was thinking about using XPath to easily get the node value and it clouded my view. I'll put it back and post a revision.

I split the card elements up because I didn't want the end user having to parse a value after parsing the xml. They'd have to parse the XML and get the value, then split it based on spaces. This could lead to differences in implementation so I avoided it. But one could argue that "Ad" isn't exactly standard and parsing will be necessary anyway..

Also, I'll add a sum attribute to the //summary/seat elements, similar to how iPoker does it.
Reply With Quote
  #42  
Old 07-31-2007, 06:02 PM
Eratosthenes Eratosthenes is offline
Senior Member
 
Join Date: Oct 2004
Posts: 306
Default Re: Poker Hand XML

Hi all--

I've written a HH parser that converts PokerStars formats to xml. It used to work for some other sites as well, but I only play Stars now, so I don't know about other sites. It works for all of Stars flop and stud games.

I would be happy to work on a project like this if a suitable standard can be agreed to.

Here's and example Hold'em file:
<font class="small">Code:</font><hr /><pre>
&lt;handhistory xsi:noNamespaceSchemaLocation="HH.xsd"&gt;
&lt;players&gt;
&lt;player _name="player6" stack="200" seat="6"/&gt;
&lt;player _name="player3" stack="243.50" seat="3"/&gt;
&lt;player _name="player2" stack="78" seat="2"/&gt;
&lt;player _name="hero" showed_hand="false" stack="159" cards="AhTc" seat="4"/&gt;
&lt;player _name="player5" stack="210.50" seat="5"/&gt;
&lt;player _name="player1" stack="98.50" seat="1"/&gt;
&lt;/players&gt;

&lt;awards&gt;
&lt;award amount="34" pot="pot" player="player2"/&gt;
&lt;/awards&gt;

&lt;posts&gt;
&lt;post amount="1" live="true" post="small blind" player="player1"/&gt;
&lt;post amount="3" live="true" post="big blind" player="player2"/&gt;
&lt;post amount="1" live="false" post="small blind" player="player3"/&gt;
&lt;post amount="3" live="true" post="big blind" player="player3"/&gt;
&lt;/posts&gt;

&lt;betting&gt;

&lt;round _name="turn" n="3"&gt;
&lt;action amount="6" n="1" player="player2" act="bets"/&gt;
&lt;action n="2" player="hero" act="folds"/&gt;
&lt;action n="3" amount="-6" player="player2" act="returned"/&gt;
&lt;/round&gt;

&lt;round _name="flop" n="2"&gt;
&lt;action amount="3" n="1" player="player2" act="bets"/&gt;
&lt;action n="2" player="player3" act="folds"/&gt;
&lt;action amount="3" n="3" player="hero" act="calls"/&gt;
&lt;/round&gt;

&lt;round _name="preflop" n="1"&gt;
&lt;action n="1" player="player3" act="checks"/&gt;
&lt;action amount="6" n="2" player="hero" act="raises"/&gt;
&lt;action n="3" player="player5" act="folds"/&gt;
&lt;action n="4" player="player6" act="folds"/&gt;
&lt;action n="5" player="player1" act="folds"/&gt;
&lt;action amount="6" n="6" player="player2" act="raises"/&gt;
&lt;action amount="6" n="7" player="player3" act="calls"/&gt;
&lt;action amount="3" n="8" player="hero" act="calls"/&gt;
&lt;/round&gt;
&lt;/betting&gt;
&lt;handno&gt;9999999999&lt;/handno&gt;
&lt;time&gt;2006/08/30 19:55:41&lt;/time&gt;
&lt;max&gt;6&lt;/max&gt;
&lt;table&gt;TABLE&lt;/table&gt;
&lt;hero&gt;hero&lt;/hero&gt;
&lt;smallbet&gt;3&lt;/smallbet&gt;
&lt;symbol&gt;$&lt;/symbol&gt;
&lt;smallblind&gt;1&lt;/smallblind&gt;
&lt;bigbet&gt;6&lt;/bigbet&gt;
&lt;is_bigblind&gt;player2&lt;/is_bigblind&gt;
&lt;board&gt;3dJhKs4s&lt;/board&gt;
&lt;bigblind&gt;3&lt;/bigblind&gt;
&lt;casino&gt;POKERSTARS&lt;/casino&gt;
&lt;structure&gt;Limit&lt;/structure&gt;
&lt;game&gt;Holdem&lt;/game&gt;
&lt;button&gt;6&lt;/button&gt;
&lt;is_smallblind&gt;player1&lt;/is_smallblind&gt;
&lt;/handhistory&gt; </pre><hr />

and here's an example stud8 hand:
<font class="small">Code:</font><hr /><pre>
&lt;handhistory xsi:noNamespaceSchemaLocation="HH.xsd"&gt;

&lt;players&gt;
&lt;player _name="player7" showed_hand="false" stack="2000" cards="5c4d9sKd" seat="7"/&gt;
&lt;player _name="player6" showed_hand="false" stack="1360" cards="4s" seat="6"/&gt;
&lt;player _name="player3" showed_hand="true" ALLIN="1" stack="381" cards="3d4h5h7h6c8h5s" hand="HI: a straight, Four to Eight; LO: 7,6,5,4,3" seat="3"/&gt;
&lt;player _name="hero" showed_hand="false" stack="2190" cards="5d2c4c3c2s2dQc" seat="2"/&gt;
&lt;player _name="player8" showed_hand="false" stack="800" cards="As7sJs7d" seat="8"/&gt;
&lt;player _name="player5" showed_hand="false" stack="5232" cards="3sJcKh7c" seat="5"/&gt;
&lt;player _name="player1" showed_hand="true" stack="858" cards="QsTs8s6hJh9dTh" hand="HI: a straight, Eight to Queen" seat="1"/&gt;
&lt;/players&gt;

&lt;awards&gt;
&lt;award amount="2" pot="side pot" player="player1"/&gt;
&lt;award amount="1086" pot="main pot" player="player1"/&gt;
&lt;award amount="1085" pot="main pot" player="player3"/&gt;
&lt;/awards&gt;

&lt;posts&gt;
&lt;post amount="2" live="false" post="ante" player="player6"/&gt;
&lt;post amount="2" live="false" post="ante" player="player7"/&gt;
&lt;post amount="2" live="false" post="ante" player="player8"/&gt;
&lt;post amount="2" live="false" post="ante" player="player1"/&gt;
&lt;post amount="2" live="false" post="ante" player="hero"/&gt;
&lt;post amount="2" live="false" post="ante" player="player3"/&gt;
&lt;post amount="2" live="false" post="ante" player="player5"/&gt;
&lt;/posts&gt;

&lt;betting&gt;

&lt;round _name="4th street" n="2"&gt;
&lt;action amount="20" n="1" player="player8" act="bets"/&gt;
&lt;action amount="20" n="2" player="player1" act="calls"/&gt;
&lt;action amount="40" n="3" player="hero" act="raises"/&gt;
&lt;action amount="40" n="4" player="player3" act="calls"/&gt;
&lt;action amount="40" n="5" player="player5" act="calls"/&gt;
&lt;action amount="40" n="6" player="player7" act="calls"/&gt;
&lt;action amount="20" n="7" player="player8" act="calls"/&gt;
&lt;action amount="20" n="8" player="player1" act="calls"/&gt;
&lt;/round&gt;

&lt;round _name="6th street" n="4"&gt;
&lt;action amount="40" n="1" player="player8" act="bets"/&gt;
&lt;action amount="80" n="2" player="player1" act="raises"/&gt;
&lt;action amount="80" n="3" player="hero" act="calls"/&gt;
&lt;action amount="120" n="4" player="player3" act="raises"/&gt;
&lt;action amount="120" n="5" player="player5" act="calls"/&gt;
&lt;action amount="120" n="6" player="player7" act="calls"/&gt;
&lt;action amount="80" n="7" player="player8" act="calls"/&gt;
&lt;action amount="80" n="8" player="player1" act="raises"/&gt;
&lt;action amount="80" n="9" player="hero" act="calls"/&gt;
&lt;action amount="40" n="10" player="player3" act="calls"/&gt;
&lt;action amount="40" n="11" player="player5" act="calls"/&gt;
&lt;action amount="40" n="12" player="player7" act="calls"/&gt;
&lt;action amount="40" n="13" player="player8" act="calls"/&gt;
&lt;/round&gt;

&lt;round _name="river" n="5"&gt;
&lt;action n="1" player="player8" act="checks"/&gt;
&lt;action amount="40" n="2" player="player1" act="bets"/&gt;
&lt;action amount="40" n="3" player="hero" act="calls"/&gt;
&lt;action amount="39" allin="true" n="4" player="player3" act="calls"/&gt;
&lt;action n="5" player="player5" act="folds"/&gt;
&lt;action n="6" player="player7" act="folds"/&gt;
&lt;action n="7" player="player8" act="folds"/&gt;
&lt;/round&gt;

&lt;round _name="5th street" n="3"&gt;
&lt;action amount="40" n="1" player="player8" act="bets"/&gt;
&lt;action amount="80" n="2" player="player1" act="raises"/&gt;
&lt;action amount="80" n="3" player="hero" act="calls"/&gt;
&lt;action amount="120" n="4" player="player3" act="raises"/&gt;
&lt;action amount="120" n="5" player="player5" act="calls"/&gt;
&lt;action amount="120" n="6" player="player7" act="calls"/&gt;
&lt;action amount="80" n="7" player="player8" act="calls"/&gt;
&lt;action amount="40" n="8" player="player1" act="calls"/&gt;
&lt;action amount="40" n="9" player="hero" act="calls"/&gt;
&lt;/round&gt;

&lt;round _name="3rd street" n="1"&gt;
&lt;action amount="20" n="1" player="player5" act="bets"/&gt;
&lt;action n="2" player="player6" act="folds"/&gt;
&lt;action amount="20" n="3" player="player7" act="calls"/&gt;
&lt;action amount="20" n="4" player="player8" act="calls"/&gt;
&lt;action amount="20" n="5" player="player1" act="calls"/&gt;
&lt;action amount="20" n="6" player="hero" act="calls"/&gt;
&lt;action amount="20" n="7" player="player3" act="calls"/&gt;
&lt;/round&gt;
&lt;/betting&gt;
&lt;handno&gt;9999999999&lt;/handno&gt;
&lt;time&gt;2006/09/06 22:01:05&lt;/time&gt;
&lt;max&gt;8&lt;/max&gt;
&lt;table&gt;TABLE&lt;/table&gt;
&lt;hero&gt;hero&lt;/hero&gt;
&lt;highlow&gt;true&lt;/highlow&gt;
&lt;smallbet&gt;20&lt;/smallbet&gt;
&lt;ante&gt;2&lt;/ante&gt;
&lt;symbol&gt;$&lt;/symbol&gt;
&lt;bigbet&gt;40&lt;/bigbet&gt;
&lt;casino&gt;POKERSTARS&lt;/casino&gt;
&lt;allin&gt;true&lt;/allin&gt;
&lt;structure&gt;Limit&lt;/structure&gt;
&lt;game&gt;7 Card Stud Hi/Lo&lt;/game&gt;
&lt;mixed&gt;true&lt;/mixed&gt;
&lt;/handhistory&gt; </pre><hr />
Reply With Quote
  #43  
Old 07-31-2007, 06:03 PM
Tickner Tickner is offline
Senior Member
 
Join Date: Mar 2006
Posts: 3,554
Default Re: Poker Hand XML

1. I think the root element should be &lt;pokerhandxml&gt; instead of &lt;pokerhand&gt; because a PokerHandXML document may contain multiple &lt;pokerhand&gt;'s.

2. &lt;gameinformation&gt; is good, but you failed to include a &lt;bettingstyle&gt; (a better tag name anyone?) that indicates that this is a No-Limit game

3. We need a better way to distinguish weather this is a cash game or tournament (are they the only two types of game styles?

4. I disagree that &lt;gametime&gt; needs an indication of the day in textual form, the program can figure that out.

5. I have a slight problem with the datetime element's value. You have "2007-07-31T11:38-5" and I think it should be properly formatted as "2007-07-31T11:38:00-05:00" ( you didnt include the second, and if there is no second it should default to 0, and your -5 doesnt give enough info, for ex NewFoundLand has a timezone that is off by half an hour so it IS possible for there to be a T11:38:00-5:30 for ex (not sure on exactly the hour its off by)) - basically I have a strict tolerence for consistency and consistency is key here

6. since we include "game" in the &lt;gameinformation&gt; element, there is no need to include game on the child elements, for ex ("gametype" can be renamed to "type" because we already know its part of the information for the game.

7. We need a &lt;currency&gt; child element under &lt;gameinformation&gt; to support all currencies

8. I like how you represent the seats. Intuitively I thought the element should be named "&lt;players&gt;" BUT I think that simply refrencing each player by name throughout the document means we dont need to actually define the players. Nice.

9. Blinds are standard, but I think a universally consistent 10.00 and 20.00 is better (always 2 decimals no matter what)

10. Your card ID is a good idea but I think that if we decide that we are going to assign cards an ID they should be incrementing and unique through the entire &lt;pokerhand&gt; element. For instance you have card IDS: 1 2 1 2 3 which overlap - I dont like this - and in fact I'm debating weather or not I like the idea of giving them IDs since (maybe?) that should be the program that is reading the PHXML job.

11. the pocket attribute is perfect and I like the idea of using "true" and "false" instead of a bunch of 1s and 0s even though it does take more space (what are others thoughts on this?)

12. I like the whole &lt;actions&gt; and &lt;action&gt; elements

13. in the &lt;summary&gt;&lt;seats&gt; element we need to find a better way to represent the summary data. For example the text "player1 won (160)" defeats the whole idea of encapsulating the data because its text with a lot of data in it and thus there are consisteny issues and it is error prone.

14. We need an action type "return" which is the poker site returning a player an uncalled bet

Overall I like this start, and if we can continue to improve on this that would be cool. I am working on my own version now with yours and my recommendations combined, but before I post it I want to hear more on yours.

Good job!

MikeChops, I think seperating the cards is a better solution because cramming data into a single element seems wrong. Perhaps it adds more text and is a little redundant but in my opinion a good idea especially if we are going to incoroporate a representation for more than just holdem.

The button idea is good, and I like it.

The profit/loss is definitley good. It puts more emphesis on the parser, but it is good because the readers of the XML are given a lot more informaiton and have qucik access to it (for example a program like HM when running though 100s of HHs to find out how much a player is up/down).
Reply With Quote
  #44  
Old 07-31-2007, 06:05 PM
bengele bengele is offline
Senior Member
 
Join Date: Dec 2004
Posts: 200
Default Re: Poker Hand XML

Here are a few thoughts:

1. Need site info.
2. Game type needs to be expanded to show bet type (limit, pot limit, no limit). I am also not too fond of using the string "Texas Hold-em" as a key to what game is being played. Something like "TEXAS_HOLDEM" seems better. Maybe it could be added as an attribute to keep a more human readable description.
3. Most of the summary information is redundant. IMHO redundant information should be left out but I wouldn't argue about it too long.
Reply With Quote
  #45  
Old 07-31-2007, 06:27 PM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default Re: Poker Hand XML

how about someone posts an example HH from stars (or another big site) with all "extraordinary" features:
- additional dead-blind (sb+bb) begin posted
- Allins
- Sidepot being awarded to different players
- ...

so everybody can create their example with the same "content" [img]/images/graemlins/smile.gif[/img]

also we might use something like:
http://nopaste.ch/en/

in order to provide links to example formats:
http://nopaste.ch/en/36b18aea70bc451.html
Reply With Quote
  #46  
Old 07-31-2007, 07:03 PM
Tickner Tickner is offline
Senior Member
 
Join Date: Mar 2006
Posts: 3,554
Default Re: Poker Hand XML

Okay,

Did this quickly so there might be some small errors or things I missed but thats okay, thats why we are working together.

http://nopaste.ch/en/bef65d72b02a28a.html

Let me know what you think.
Reply With Quote
  #47  
Old 07-31-2007, 07:17 PM
Tickner Tickner is offline
Senior Member
 
Join Date: Mar 2006
Posts: 3,554
Default Re: Poker Hand XML

Any elements that are blank are just there to show what COULD be there but in this case are not being used and thus should be omitted.

This format allows for multiple HHs in any PokerHandXML document.

Each PokerHand has the following elements:

GameInformation - info on the game
Seats - declares the seats and players within (I actually think we should change this to "players" and simply reference the seat number
ForcedBets - this simply decalres who is forced to bet before any cards are dealt and also what type of forced bet they are making (the forced bets values are declared in GameInformation)
Betting - this holds all the betting info
Summary - this wraps up the hand

gameinformation has 2 attributes, type (which can be tournament or cashgame) and online which can be true or false

gameinformation.currency is always the currency the players are playing for
gameinformation.id is the gameID that the pokerroom provides and is optional
gameinformation.tournament is only needed if this is a tournament and has the buyin, vig, tournament ID (from the poker room - not required), and currency
I added the currency in the tournamnet tag because when playing a tourney we arent using dollars we are using chips, so I used t because it seems to be standard for tournament chips

Notes:

1. I tihnk we should use "amount" instead of "wager"
2. Any time a piece of data that isnt "A-Za-z" (just letters) we should drop anything that isnt a letter and denote the words with a capital beginning, for example, "Texas Hold'em" will be "TexasHoldem" and "No-Limit" will be "NoLimit" just to keep things easy to remember and consistent. Also, using numbers for this stuff and for bets and raises ie bet=1 raise=2 etc would make it toally unreadable from a human perspective and would make programmers want to shoot themselves.
Reply With Quote
  #48  
Old 07-31-2007, 07:23 PM
Tickner Tickner is offline
Senior Member
 
Join Date: Mar 2006
Posts: 3,554
Default Re: Poker Hand XML

As you guys can see there is a huge amount of ground we need to cover. I think for now we should limit this exclusively to Holdem (cash,tournaments - limit,nl,pl) for now but KEEP IN MIND that Omaha and Stud will eventually be incorporated. If we start adding in games like Triple Draw, Pinapple, Double-Flop Holdem, 5 Card Draw, we will never get anywhere. And because of this, perhaps we should make &lt;pokerhand&gt; &lt;texasholdemhand&gt; and whenever we create a format for different games we just create a whole new set of elements etc as appropriate, so we will end up with

<font class="small">Code:</font><hr /><pre>
&lt;pokerhandxml&gt;
&lt;texasholdemhand&gt;
..
&lt;/texasholdemhand&gt;

&lt;omahahand&gt;
..
&lt;/omahahand&gt;

&lt;fivecarddrawhand&gt;
..
&lt;/fivecarddrawhand&gt;
&lt;/pokerhandxml&gt;
</pre><hr />

Basically what I am saying is that &lt;pokerhand&gt; is just way too broad of a data type to represent with ONE system in any type of sane manner
Reply With Quote
  #49  
Old 07-31-2007, 07:45 PM
mikechops mikechops is offline
Senior Member
 
Join Date: Aug 2005
Posts: 2,168
Default Re: Poker Hand XML

I still think I'd prefer cards coactenated. It's trivial to parse them, it takes up much less space and makes the hand a little easier on the eye. But whatever...
Reply With Quote
  #50  
Old 07-31-2007, 08:19 PM
pokergrader pokergrader is offline
Senior Member
 
Join Date: Apr 2005
Posts: 3,792
Default Re: Poker Hand XML

&lt;gamestakes&gt;$1.00+$0.20&lt;/gamestakes&gt;

I think there should be seperate tags for buy-in and vig in tournament play.

I also think the rake taken out of a pot should be a seperate tag in the same section of amount won by each player.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.