Page 1 of 1

Please, HELP: problem with the 'GetUnlockKey' function

PostPosted: Tue Apr 25, 2006 4:09 pm
by regis
Hi to you all again,
As you may already know, I am implementing a RPN copy protection in my game.
Unfortunately, when entering the GetUnlockKey(XXX,XXX) function, the GE debugger tells me:
"Error line XXX: Undeclared identifier GetUnlockKey".
I am affraid such a function is not implemented in the GE package, and is only only available using the module which is downloadable here, on the "support" forum.
Unfortunately, I MUST incorporate such a RPN registration in my game without using any external module:
PLEASE, have you an idea which could help me? (I am so close to the end of my game!!!)

Many thanks for your help.
Regards
Regis

PostPosted: Tue Apr 25, 2006 5:40 pm
by twobob
Have you tried merging the module found on this forum into your game, or alternatively copy and paste the code into your game?
Make a copy of your game first just in case the merge overwrites any data in your game.

PostPosted: Tue Apr 25, 2006 10:46 pm
by regis
1000 thanks, twobob!
Your solution perfectly works ;-)
This is of great help these days.
I still wonder why it is necessary to merge the RPN module with my game in order to be able to use the GetOwnerKey function, and why it is not included in the original GE script. I suppose there is a good reason, that I ignore.
Anyway, it works!
best regards,
Regis

PostPosted: Wed Apr 26, 2006 8:01 am
by twobob
I am pleased it worked for you.
How are you getting on with the RPN formula for the special characters. I am still trying to get my head round it all.
I have a working formula, but it will not work with the special characters.
The best solution would have been if Handango implemented the hardware Id on their web site.
I also sent them a email on this and got the following reply:

‘We do not have plans at this time to collect customers' hardware IDs. Thank you for your feedback. We might consider implementing this sometime in the future’

In the module you have imported, I would incorporate a screen where you let the customer know their user id on screen before they purchase. This could also warn the buyer that they may need to change their user name if it has less than 5 characters.

I have the following text in my game:

*****IMPORTANT*****
WRITE DOWN YOUR POCKET PC OWNER
NAME BELOW AS YOU WILL NEED THIS
FOR REGISTRATION AT HANDANGO

It also checks the length of the name, and if less than 5 characters, will take the user to another screen where it informs them on this, and how to change their device name.

Hopefully, this will stop many errors in users trying to register.
I may also have to warn the users that special characters will not work.

Good luck in your game

twobob

PostPosted: Wed Apr 26, 2006 10:04 am
by regis
Hi,
Here is the RPN formula I propose to you:

i 0 == 1 * key + 47 c >= 32 * 48 c <= 57 c >= && c * 58 c <= 64 c >= && 32 * 65 c <= 90 c >= && c * 91 c <= 96 c >= && 32 * 97 c <= 122 c >= && c 32 - * 123 c <= 32 * + + + + + + +

Comments: : (1) all alphabetical letter is transformed into caps ('a' leads to the same code as 'A'); (2) every special letter is transformed into a blank ('é' leads to the same code a ' ').

You can test it on the following URL:
https://developer.handango.com/RegCode.jsp?siteId=1216

As you may see, the following entered names lead to the same RPN key (00578): 'José Musé' = 'JOSé MUSé' = 'josé musé' = 'jos mus ' = 'Jos Mus ' = 'JOS MUS ' (notice you should enter 2 blanks between 'jos' and 'mus': 1 for the traditional space between first name and surname and 1 for the 'é' replacement. These 2 blanks do not appear clearly here, previewing my message on the forum: I don't know why...)

During the registration process on the PPC (i.e. your game), you just have to warn the user that he must replace all special letters that his name may contain by a blank.

For instance, if my name is 'José Musé" (which is not :wink: ), my 2 actions will be the following:
1. On the Handango site, I enter "José Musé" and I receive the key 00578
2. On the PPC, registering the game, I enter "JOS MUS " (because (1) I suppose the chrs accepted in my game are only caps and (2) special letters are not supported by GE): the GetUnlockKey requires... the same code '00578'!

I want to thank here the people of the forum who helped me to come to this solution.

:idea:

PostPosted: Wed Apr 26, 2006 10:31 am
by regis
Well...
The method works, but it seems the GetUnlockKey() function in GE does not lead to the same code as the one provided by Handango:
For instance, if you enter 'JOSE' on handango with the RPN formula:
i 0 == 123 * key 2 * + 47 c >= 32 32 * * 48 c <= 57 c >= && c c * * 58 c <= 64 c >= && 32 32 * * 65 c <= 90 c >= && c c * * 91 c <= 96 c >= && 32 32 * * 97 c <= 122 c >= && c 32 - c 32 - * * 123 c <= 32 32 * * + + + + + + +
You receive '22759'
Putting the same formula in the RPN GE module, the GetUnlockKey computes '15959'... Which is wrong :cry:

Makslane, have you any idea?

PostPosted: Wed Apr 26, 2006 7:07 pm
by makslane
I don't know. I don't write the GetUnlockKey function.
There is a other C function to generate RPN at handango?

PostPosted: Thu Apr 27, 2006 5:23 pm
by twobob
It appears that the ASCII values returned for special characters are negative integers (the few I’ve tried) in the module.
Example
à returns a value of -31 (should return 224)
À returns a value of -63 (should return 192)
ë returns a value of -21 (should return 235)
í returns a value of -19 (should return 237)

Maybe it is because the Extended ASCII character set is not supported in the module.

One solution could be replacing the negative integers with the correct integers, or alter the code somehow?

Any ideas?

Thanks

PostPosted: Thu Apr 27, 2006 8:54 pm
by regis
Interesting remark.
But I think there are other problem(s), even with normal letters, because the name "JOSE" (which does not contain any special letter) leads to 2 different keys between Handango and the GE module, whereas the RPN formula is the same.

I wonder if I should program myself the Key using the GE script, in order to replicate the RPN fomula.

Regards
Regis

PostPosted: Thu Apr 27, 2006 10:58 pm
by twobob
Not every formula works, as I have found out. It does take a while producing many formulas and then comparing the results with handango and the module result to ensure that the results are the same. I have checked the name “JOSE” with my formula between handandgo and the module and it does produce the right code. It is a matter of trial and error until you find one that produces the same code whatever name you put in.
Mrdark7734 on the link http://game-editor.com/forum/viewtopic. ... hlight=rpn said he spends “between 2 to 8 hours finding a unique working algorithm” which I can well believe. It is a long process.

I will let you know if I can come up with a solution to the special character problem.

Re:

PostPosted: Wed Oct 03, 2007 10:00 pm
by jlorinser
Hi Regis and Twobob,

Great job on the RPN formulas, I don't have the least idea on how to go about making my own formulas, but...

regis wrote:every special letter is transformed into a blank ('é' leads to the same code a ' ').

...after reading that the special characters CAN be changed to a blank, I'm wondering if an RPN formula could transform all the special characters to "X" (or the char of your choice :) ), so "José Musé" or "JOSÉ MUSÉ" would translate to "JOSX MUSX" instead of "JOS MUS ".

regis wrote:During the registration process on the PPC (i.e. your game), you just have to warn the user that he must replace all special letters that his name may contain by a blank.

Even better would be to transform the special chars to their regular chars from the start, so "José Musé" or "JOSÉ MUSÉ" would translate to "JOSE MUSE" (é and è to e, á and à to a, etc.), and you wouldn't have to warn the users about entering a different (or modified) name during registration. I don't know if this would work with the GetUnlockKey() and if it would produce the same key in Handango.

Any ideas about how, or if, this could be implemented?

John