- if(i==MAC_RETURN_KEY&&mainmenu==14){
- if(displaychars[0]){
- char serialstring[256];
- char tempstring[256];
- #if defined(__APPLE__)
- sprintf (tempstring, "%s", registrationname);
- #elif defined(_WIN32) || defined(__linux__)
- sprintf (tempstring, "%s-windows", registrationname);
- #else
- #error Please make sure you have the right registration key stuff here!
- #endif
- long num1;
- long num2;
- long num3;
- long num4;
- long long longnum;
- longnum = MD5_string ( tempstring);
- //longnum = 1111111111111111;
- num1 = longnum/100000000;
- num2 = longnum%100000000;
- sprintf (tempstring, "%d-%d-%d-%d\0\0\0\0\0", num1/10000, num1%10000, num2/10000, num2%10000);
-
- int goodcode=3;
- int numchars=3;
- if(num1/10000>999)numchars+=4;
- else if(num1/10000>99)numchars+=3;
- else if(num1/10000>9)numchars+=2;
- else numchars+=1;
- if(num1%10000>999)numchars+=4;
- else if(num1%10000>99)numchars+=3;
- else if(num1%10000>9)numchars+=2;
- else numchars+=1;
- if(num2/10000>999)numchars+=4;
- else if(num2/10000>99)numchars+=3;
- else if(num2/10000>9)numchars+=2;
- else numchars+=1;
- if(num2%10000>999)numchars+=4;
- else if(num2%10000>99)numchars+=3;
- else if(num2%10000>9)numchars+=2;
- else numchars+=1;
-
- //numchars=12;
-
- for(j=0;j<numchars;j++){
- if(displaytext[0][j]!=tempstring[j]&&tempstring[j]!=' '&&tempstring[j]!='\0')goodcode--;
- }
-
- if(longnum==LONGLONGCONST(5077041556214789))goodcode=-1;
-
- if(goodcode<0)goodcode=0;
-
- if(goodcode){
- registered=1;
- mainmenu=15;
-
- FILE *tfile;
- tfile=fopen( ":Data:Sounds:flame.ogg", "wb" );
- if (tfile)
- {
- int numchars;
- numchars=strlen(registrationname);
- fpackf(tfile, "Bb", registered);
- fpackf(tfile, "Bi", numchars);
- if(numchars>0)
- {
- for(j=0;j<numchars;j++)
- {
- fpackf(tfile, "Bb", registrationname[j]);
- }
- }
- fpackf(tfile, "Bi", num1);
- fpackf(tfile, "Bi", num2);
- fclose(tfile);
- }
- }
- else
- {
- mainmenu=16;
- }
- flashr=1;
- flashg=0;
- flashb=0;
- flashamount=1;
- flashdelay=1;
-
- float gLoc[3]={0,0,0};
- float vel[3]={0,0,0};
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 9999.0f, 99999.0f);
- PlaySoundEx( firestartsound, samp[firestartsound], NULL, true);
- FSOUND_3D_SetAttributes(channels[firestartsound], gLoc, vel);
- FSOUND_SetVolume(channels[firestartsound], 256);
- FSOUND_SetPaused(channels[firestartsound], false);
- FSOUND_Sample_SetMinMaxDistance(samp[firestartsound], 8.0f, 2000.0f);
-
- for(j=0;j<255;j++){
- displaytext[0][j]=' ';
- }
- displaychars[0]=0;
- displayselected=0;
- }}
-