Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AemStones, AndrewAMD, gamers, Kingware), 1,679 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 2 1 2
Generate Keys for your Games #108352
01/20/07 23:25
01/20/07 23:25
Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Shinobi Offline OP
User
Shinobi  Offline OP
User

Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Hi , i wasnt sure where to post this , it also could be posted in the Tutorials Forum.

Ok here we go , ever wanted to generate keys for your games and with this key make a shareware game to a full Game ? Then this contributaion is maybe interesting for you

You can download the complete code at the end of this Post but first read how it works.

I made a text file called "chars.txt" in this file i typed randomly (more secure) chars from "a - z" , "A - Z" and "1 - 0"
While generating a key the script is picking randomly chars out of this Text file and adds the number of steps to this char to a VAR called "temp_limit_maximum" . There is another VAR called "limit_maximum" (used to compare both VARs) you can enter a number here for example if its a high number the generated key is longer . After generating the key , you can test it , enter a key and if the key you entered is the same as that generated one , your key is a valid key. You get the idea what your able to do with it now ...right ? you can generate keys for your game and generate a key for your customer (for example)

In the text file there is no small "l" and no big "I" because they look the same in some fonts.

Start the code in SED and try it , after that check the code and you get the Idea . For Example if your generated key looks like this "Gfsj34n" you can also enter "sjGf4n3" its also valid because the nummer in "temp_limit_maximum" is the same . The important thing here are , the Chars must be the same as the generated one.

You can make it more complex if you like (its easy done with a little more code), its up to you . My script is just to show how it works.

Download the Code (save as)

Re: Generate Keys for your Games [Re: Shinobi] #108353
01/21/07 03:48
01/21/07 03:48
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
sounds like a very useful contribution , thnx.

Re: Generate Keys for your Games [Re: Why_Do_I_Die] #108354
01/21/07 15:25
01/21/07 15:25
Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Shinobi Offline OP
User
Shinobi  Offline OP
User

Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Quote:

sounds like a very useful contribution , thnx.




Hope it will

little more info :

You can change the chars.txt file with your own and add some sysmbols as well if you like , but dont use the same char , number or symbol 2 times .
For example you can change the limit_maximum to a different number for different games so that the key from game "a" dont work on game "b"

Re: Generate Keys for your Games [Re: Shinobi] #108355
01/21/07 23:34
01/21/07 23:34
Joined: Jul 2006
Posts: 783
London, UK
sheefo Offline
User
sheefo  Offline
User

Joined: Jul 2006
Posts: 783
London, UK
I love this contribution! Thanks a lot!

Re: Generate Keys for your Games [Re: sheefo] #108356
01/22/07 22:09
01/22/07 22:09
Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Shinobi Offline OP
User
Shinobi  Offline OP
User

Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
you´r welcome

Re: Generate Keys for your Games [Re: Shinobi] #108357
01/25/07 21:34
01/25/07 21:34
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline
Member
KojaK  Offline
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
Cool! Knowing C++ will help here, I see it easier to code file editing in good old fashoned C++. ((You young whippersnappers with your "C-script" ))

If I could make a suggestion, what about doing it a little differently? Say, have a key file be an index, and code it so it writes the key in keys.txt, and keyindex.txt. Then, it chooses at random letters and numbers and symbols, then makes that a key. It writes it to both key.txt and keyindex.txt. Then to test it, it reads off the key.txt and compares it with keyindex.txt. If they match up, case and all, it is valid. So, you can have forty million keys, all the same length, and all be different.

(Also in C++ you can have game.key, so it confuses the people, and can't change it from notepad. Or you can include it in game.wrs, for even more security! )


Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games
Re: Generate Keys for your Games [Re: KojaK] #108358
01/25/07 22:01
01/25/07 22:01
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline
Serious User
PrenceOfDarkness  Offline
Serious User

Joined: Aug 2004
Posts: 1,305
New York
This is a super contribution! One way you could improve this a bit is by having the generator save the key to a file, this way you never have the same file twice. Another thing would maybe be to have the user input a name (say the client wants to key registered to Billy Bob), then when the key is generated it could have something to do with the name, and when u enter it back in it checks for this.

Of course with hackers today, no amount of protection is ever enough -_-'


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: Generate Keys for your Games [Re: PrenceOfDarkness] #108359
01/25/07 22:16
01/25/07 22:16
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
the demo isn't working for me. besides that it sounds like it is a good contrib. i get an error when i press a key it says "invalid pointer in start_key_generator: file_str_read(filehandle,temp_string)


Wait, there isn't a "Make My Game Now" button?
Re: Generate Keys for your Games [Re: Bot190] #108360
01/25/07 22:29
01/25/07 22:29
Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
Shinobi Offline OP
User
Shinobi  Offline OP
User

Joined: Oct 2003
Posts: 560
Germany / NRW / Essen
@ Kojak , not everyone is able to code in c++ and this is a Gamestudio Forum , we all want to use the Acknex engine for our games and c-script is the language for that . Of course its better to use a dll in c++ to get better results but not everyone can do that. Feel free to show an example how to use c++ to make a better result.

@ PrenceOfDarkness , thanks i am sure its possible to improve this script with including the users Name and adress and stuff , but the code would be more complex for doing that. For generating a key only once you can save every generated key to a file and let the engine compare all generated keys with the new one. in my example i use 500 in the limit_maximum file , just increase it for more complex keys , but dont change that number after releasing the game . Use always the same number in one game or change the chars-txt file for other games.

@ bot190 , sounds like you need a wait(1) somewhere , dosent checked it yet because its running fine for me and the others. You can edit the script for your needs , if you have problems to get it working , let me know and i will try to help.

Re: Generate Keys for your Games [Re: Shinobi] #108361
01/25/07 22:35
01/25/07 22:35
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
i can't find the line though... thats what i don't get...


Wait, there isn't a "Make My Game Now" button?
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1