decklist icon indicating copy to clipboard operation
decklist copied to clipboard

Old DCI Number Conversion

Open Nightfirecat opened this issue 11 years ago • 20 comments

Older (smaller) DCI numbers will need to be converted into the new format. Currently don't know the formula to do this, though.

Nightfirecat avatar Sep 29 '14 19:09 Nightfirecat

I'll ask my judge friends to find out how to do the conversion.

april avatar Sep 29 '14 19:09 april

http://pastebin.com/PG59ZsJ7

The process for generating DCI numbers is:

Prepend a zero Calculate check digit Prepend that check digit (and repeat until full length DCI number)

april avatar Sep 29 '14 20:09 april

Wow, that's complicated.

On the bright side, it looks like this should be usable to validate ALL DCI numbers - past, present, and future - regardless of length. That's handy.

Nightfirecat avatar Sep 29 '14 21:09 Nightfirecat

Totally! They have the most complicated check digit system I have ever seen. O_o But now can validate all DCI numbers, which is pretty sweet. :)

On Sep 29, 2014, at 4:03 PM, Jordan [email protected] wrote:

Wow, that's complicated.

On the bright side, it looks like this should be usable to validate ALL DCI numbers - past, present, and future - regardless of length. That's handy.

— Reply to this email directly or view it on GitHub.

april avatar Sep 29 '14 21:09 april

Alrighty, just checking in on this again, since I'm nearly done with the validation methods for #5, and I want to be sure they're all working before implementing the display status and tooltips for the fields.

As I understand this, the code in the pastebin does two things:

  1. Determines if a given DCI number is valid (using sum).
  2. Determines what the next digit for a given number would be for it to be a valid DCI number.

With that in mind, we could effectively break it up into those two parts - one for validation and one for check digit generation?

From there, we can use part 1 to check a given number. If it's an invalid number, the process is to prepend a 0 and use part 2 to get a valid number, and that's it, regardless of length? Or do we repeat that until a 9- or 10-digit number, exactly is reached?

Nightfirecat avatar Oct 13 '14 07:10 Nightfirecat

@Nightfirecat after doing some research, there seem to be 3 kinds of numbers

  1. Older <8 digit numbers - no checksum
  2. Intermediate 8 digit numbers
  3. Current 10 digit numbers
  • conversion from 1 to 2 is prepend zeros to get to 7 digits, then prepend a check digit
  • conversion 2 to 3 is prepend a zero, prepend a check digit

for a 1 you do both steps

ChaimW avatar Jun 28 '17 20:06 ChaimW

I'm planning to take a shot at it now.

ChaimW avatar Jun 28 '17 20:06 ChaimW

@Nightfirecat @april

I think I got everything except the wording for the warning message for shorter (older) dci numbers.

Currently: DCI Numbers with less than 8 digits cannot be validated Previously: Older DCI Numbers cannot be validated But neither one is quite what I want.

ChaimW avatar Jul 02 '17 07:07 ChaimW

I'm leaning toward wanting this to be a warning (eg. We recommend updating your DCI number to xxx, as it is currently in an old format) rather than a hard-and-fast error. That said, something like this would also be fine in my mind: We recommend updating your DCI number to xxx, as DCI numbers with fewer than 8 digits are in an old format.

Nightfirecat avatar Jul 02 '17 16:07 Nightfirecat

Current behavior is convert and warning.

The issue is that they don't have a checksum, so theoretically they could have an entry error that is another valid number (someone else's) that then gets compounded by doing the conversion process on the wrong number.

With a 8/10 digit number, the checksum can be validated, but with a <8 digit, there is simply no way to check. (unless we can get wizards to give us an api endpoint)

ChaimW avatar Jul 02 '17 18:07 ChaimW

@Nightfirecat I really want to say somthin to the effect of We cannot verify that your dci# is valid as it is in an old format. Please double-check and/or use the 8 or 10 digit form of your number.

oh, and to be clear, this is in pr #29

ChaimW avatar Jul 05 '17 22:07 ChaimW

I'd like to see the DCI number validation become optional, like with a checkbox below the DCI number input textbox that reads "Validate my DCI Number", checked by default. Two reasons:

  1. Out of pure vanity, I have a four-digit DCI number that I like to show off and it doesn't need validation. It goes into WER just fine as a four-digit number and I like the ooohs and aaahs from scorekeepers. Plus it's less for them to type.

  2. WER (at least in offline mode, have yet to test it in online mode) doesn't handle the 10-digit DCI number and 4-digit number correctly. If I enter a tournament using the "validated" 10-digit DCI number and then enter another player with the original 4-digit DCI number (supposedly the same player, right?) it actually enters them as two separate players. I can get paired up against myself!

andyrut avatar Nov 20 '17 00:11 andyrut

If I understand it correctly there are two steps performed automatically right now:

  • check if entered number is in an expected dci number format (digits + checksum check i guess?)
    • if not and/or too long: print error
    • if too short: convert given number to 10 digits version (which allows to validate them because of the included checksum)

We still never know if it is a real or valid DCI number, correct? It's just checked if it's form/style matches a theoretical real number from wizards?

tooomm avatar Dec 05 '17 13:12 tooomm

@tooomm basically, yes to all

ChaimW avatar Dec 05 '17 17:12 ChaimW

I'm okay with just validating and warning, without changing the official number in the PDF. Any objections to that?

april avatar Dec 05 '17 18:12 april

Seems reasonable, I can do that in a little bit.

ChaimW avatar Dec 05 '17 18:12 ChaimW

So you prefer to remove the expand to 10 digits "feature" completely? @april Or do you want to make the conversion an optional selection?

If the second... it could be an expanded warning message instead an option present to everybody next to the DCI field to keep the interface clean - just a huge minority is using the old numbers I would assume: Your DCI number isn't valid regarding new 10 digits conventions. If you're using an old, shorter number and prefer the new style - (we can convert it for you!) with the last part clickable. Or any other suitable shorter phrase for the warning. :)

The expanded warning message as alternative was just my first idea, there are other options too, I'm sure.

tooomm avatar Dec 05 '17 22:12 tooomm

Closed via #29? Unless we want to change the behavior to "Don't change the number entered, but notify user of the expanded 10-digit number"

Nightfirecat avatar Apr 03 '18 18:04 Nightfirecat

It's a bit confusing when a user enters an old (short) DCI number and it gets changed with no warning.
Plus, I believe those are still valid even without the expansion to 10 digits.

Would be better to do as @tooomm suggests, make it a button and optionally convert.

sombreroEnPuntas avatar Jun 22 '19 07:06 sombreroEnPuntas

I actually have time now, so I'll probably work on it this week.

ChaimW avatar Jun 23 '19 10:06 ChaimW