News:

A forum for users of LackeyCCG

Main Menu

Deck Security Codes

Started by SwordSkill, September 08, 2013, 03:01:43 PM

Previous topic - Next topic

SwordSkill

Is there any way to make the program when a deck is loaded, it's own unique security code?
So, in that way, avoiding the cheating in tournaments?

So, if someone changes his deck in Game 2 for example you will know that it's not exactly the deck he used in the previous game, because the security code will have changed.

In Magic Workstation (Another program that you are able to play card games online.) the deck security code system allowed players to even being able to assemble tournaments there in competitive environment, due to the fact that one could be 100% sure if an opponent is cheating.

If that could be made, it would help the Magic-League community  (And other free online card game communities.)
To run their tournaments through Lackey.

I'm saying these because Magic Workstation (or simply known as MWS in Magic-League community.)
is a program full of bugs and disfunctions that make the game experience frustrating due to the habit of the program to crash all the time, Lackey doesn't do that in almost every game, and that's the reason it would be better for
Magic-League games to be handled through Lackey.

Thank you for spending your time reading this and I hope I get an answer from you soon. :)

Trevor

I can add security codes. What algorithm would you suggest I implement to generate the code?

SwordSkill

hm... I think an 8 digit code would be ok. Also I think an encryption to the code would be necessary (So that it won't be easy to figure out.)

Trevor

What I'm asking is if there is any sort of algorithm I should use. For example, a website may use a certain code, and people might want to see the exact same code in lackey.

SwordSkill

Yeah I know what you mean, Magic-League.com uses the same algorithm for deck security code as Magic Workstation.
I will try to get in touch with them to find the algorithm cause I don't know the exact details.

I will send a message when I find out how it works.

Metasyn

I am making assumptions about the way that Lackey works but if each card has a unique ID number then couldn't you just make a "checksum" of sorts by simply adding up 2^id of every card? This wouldn't be able to detect when multiples of a card had been added or taken out but it would make it much harder to cheat as not being able to add or remove cards from your deck is very limiting.

SwordSkill

Well, I'm not sure what you mean, but I wasn't thinking of something that prevents you from adding or remove cards. I was more thinking of something that when you add or remove cards, the security code (Which will be visible to both players at any time.) will change.

So if you are playing casual and you don't mind your friend changing decks between games then he simply would say ok, but if you are playing on a tournament or something you need to know that your opponent is using the exact same deck. Cause if he doesn't use the same, you will notice since the security code would have changed.

Of course I assume that the security code won't change if you are swapping cards from your main deck to your sideboard or vice versa since you are using the same deck but just sideboarded.

Example:

Player A Loads a deck "a0gh3jtu" (That's the potential security code of that deck.)
Player B Loads a deck "y8f8dk4i" (Player B's deck security code.)

If player A decides to sideboard, then the security code will remain the same, but if the Player A loads a new deck different than the one he loaded then the security code will change:

Let's see a hypothetical situation.

Game 1:

Player A Loads a deck "a0gh3jtu"
Player B Loads a deck "y8f8dk4i"

...the game goes on and Player A wins...

Game 2:

Player A Loads a deck "a0gh3jtu"
Player B Loads a deck "g8d7la8f"

Player A will know that Player B loaded a different deck since it's security code isn't the same as the deck he loaded last time. That's a clear proof that Player B loaded a different deck thus trying to cheat.

Trevor

I think what would be more useful is some code that is more widespread. Like if you build a deck on on some popular drafting site, for example, it would be handy if the code I generate would match the code they generate. I don't what site/s would be good, or how this would be actually used.

SwordSkill

Well, usually it's the other way around, I mean the program is the first that shows a security code, and then the sites will come around and ask for the algorithm so they can implement it to their exporting system.

For example, Cooper Sealed Simulator site (http://copper-dog.com/mtg-generator/2013-theros/) currently supports, Magic Online, Cockatrice, Apprentice and Magic Workstation as a means to export the sealed deck.

In other words it's not like Lackey has to follow anyone, but rather than everyone else has to follow Lackey (When it becomes as popular as Cockatrice that is.)

In my opinion Lackey has far more functions than both Magic Workstation and Cockatrice, and it's a pity to only see only about 5 -at the most- people playing around, when in Cockatrice there are 200++ people.

But I digress that is a discussion that I plan on opening it after the security code issue has been resolved.

CAVer

#9
Not sure if anyone still cares but the algorithm used is discussed here:
http://www.magi-soft.com/forum/viewtopic.php?f=11&t=5138

Basically it's take just the Uppercase Name of each card (no spaces or other characters, though I'm not sure how it handles converting letters that have diacritical marks)  add a # in front of the Side Board Cards, sort them (# should sort to the beginning), md5 the whole thing, but just take the first 8 characters from the hash...

Pay most attention to the delphi code if you can read it.  I don't know delphi but it looks like the actual code.

If you handle php better make sure to read both pages (specifically the last post).... I know just enough php to get myself into trouble, and looking at sunspots php, and reading what people on page 2 were saying, I don't think he added any support for sideboards (no code to add the # signs) nor the mention that the sideboard is first (though I don't recall if php sorts the # ahead of the alpha characters).

Looking at the delphi code it seems to mention the # signs. 
for k:=0 to D.SBCount-1 do S.Add('#'+p)

Though i can't decipher a mention of the # coming first when sorted, I guess that's just how delphi does it.

Chris

edit:
Just in case someone cares years from now and it's no longer available in it's original format:
http://archive.is/Alxw0

Trevor

If someone wants to convert that to a C++ function, I could add it instantly.