Author Topic: AllowRebuy '-1'  (Read 1450 times)

shushs

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
AllowRebuy '-1'
« on: December 24, 2020, 01:46:01 PM »
Some xml exports of my tournament files have the value for AllowRebuys set to -1.
I have tried to reproduce this to see the difference between 0, 1, and -1.
Allowed: 1
Not allowed: 0
???: -1

I have tried all the combinations I can think of (in the current version of TD) so I am thinking maybe this was only in an older version?

It isn't a problem, just something I want to understand better.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: AllowRebuy '-1'
« Reply #1 on: December 24, 2020, 04:00:07 PM »
At quick glance, I can't see where this might be the case.  Only StatsGenie and PokerDIY export to XML (and if you're still exporting to XML for StatsGenie you're probably doing it wrong).  But in either case, they're reflecting what internally is a boolean, which is only true or false.  Both write out 1 for true and 0 for false.  In any case, you should assume 0 is false and anything else is true.  It has piqued my curiosity a bit.  Which export are you using?

shushs

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: AllowRebuy '-1'
« Reply #2 on: December 26, 2020, 07:00:43 AM »
and if you're still exporting to XML for StatsGenie you're probably doing it wrong
----
Which export are you using?
It is quite possible I am doing it wrong. =)  I have been keeping track of my groups tournaments since I initially purchased a license, 2008. What I would _really_ like to do, is just parse the TDT file, but you and I have had that conversation. Because I am constantly trying to build a better experience for my players, I am constantly trying to improve. I am not a developer, but play one on TV. Anyway, I cannot tell you which export got me that value, it may be that when I translate from the xml output to json that a value is getting converted... so, this may be me. If there is a way to convert tdt -> json, that would save me a substantial level of effort (or a straight json export).

shushs

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: AllowRebuy '-1'
« Reply #3 on: December 26, 2020, 02:32:51 PM »
Well, I am not completely crazy... The xml export from this game shows a 'AllowRebuys' = -1.
Code: [Select]
<?xml version="1.0" encoding="ISO-8859-1"?>
<ExportFormat Target="LethalMedia" Version="1.0" TDVersion="3.4.3" Date="2018-10-31 15:02:31">
    <Tournament type="TD v2" League="Crush Poker" Season="2006" Name="Sugar High Tournament" TournamentType="No Limit" TournamentGame="Texas Hold 'Em" Buyin="30" ShowBuyinByPlayer="1" RebuyAmount="30" AllowRebuys="-1" AddOnAmount="0" AllowAddOns="0" BountiesAllowed="-1" TournamentStartDate="2006-11-03 21:08:57" TournamentEndDate="2006-11-04 00:29:38" TournamentComments="round(10 * sqrt(n) / sqrt(r)) - 9
            from the help, it gives everyone points based on where they placed in the tournament with more points being awarded for a higher finish. Additional full points are added per hit. Each Hit is worth two points.">
       
obv, this is both old and not a full xml dump, but it did get translated to a -1 value. I'm still interested to hear what I am doing wrong because I would like to fix it.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: AllowRebuy '-1'
« Reply #4 on: December 26, 2020, 03:37:55 PM »
Ah, so "The Poker Leaderboard" export, which is now a defunct site.  I've actually removed that export from the latest version.

That is apparently the default way to represent boolean for XML.  0 for false and -1 for true.  For other exports, such as StatsGenie, the TD code actually sets the value to 0 or 1, whereas this export sets the value to an actual boolean (true/false), and the internal XML code (internal to Internet Explorer) translates that to -1/0.  I don't recall a reason why one export would be different from another in this regard.  It is likely I coded the StatsGenie export differently as I probably had actual specifications to use from the StatsGenie staff.  I am still in contact with Martin from SG and still make changes when necessary.

By the way, there actually is code to export to JSON, but it's not exposed.  I think it had an eventual purpose that never panned out, so it was never completed (there's plenty of stuff missing as well as plenty of stuff that is unnecessary).  If you could get to it, you would see that it is actually broken in the latest version.  There's a bug but I didn't even know it existed because there's no way to trigger a JSON export.  I think in the next big version I will break out the "TD" export into HTML/XML/JSON options.

shushs

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: AllowRebuy '-1'
« Reply #5 on: December 27, 2020, 07:52:49 AM »
As always, thank you for the clear explanation. TBH, I already have my xml => json python written... and my json => mysql import. If I had either a tdt parser or a direct json output, that would certainly save me a step. As you can see, I have been your "customer" for over a decade. If there is a new major release, that requires a new license, count me in... You have done phenomenal work.