Subversion Repositories Games.Chess Giants

Rev

Rev 130 | Rev 136 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 130 Rev 133
Line 275... Line 275...
275
   wchar_t smiley_name[32];
275
   wchar_t smiley_name[32];
276
   smiley_t *smiley;
276
   smiley_t *smiley;
277
   void *inifile;
277
   void *inifile;
278
   int smiley_index;
278
   int smiley_index;
279
   int smiley_index2;
279
   int smiley_index2;
-
 
280
   HKEY hRegistryKey;
280
 
281
 
281
   // create a config file with the default values
282
   // create a config file with the default values
282
   inifile = INIFile_NewINIFile ();
283
   inifile = INIFile_NewINIFile ();
283
 
284
 
284
   // [gameplay]
285
   // [gameplay]
Line 361... Line 362...
361
   smiley_count = 0;
362
   smiley_count = 0;
362
 
363
 
363
   // now save the INI file
364
   // now save the INI file
364
   swprintf_s (filename, WCHAR_SIZEOF (filename), L"%s/config.ini", app_path);
365
   swprintf_s (filename, WCHAR_SIZEOF (filename), L"%s/config.ini", app_path);
365
   INIFile_SaveINIFile (filename, inifile);
366
   INIFile_SaveINIFile (filename, inifile);
-
 
367
 
-
 
368
   // SAFETY: if the current registration data is good, back it up in the registry if we can
-
 
369
   if (IsRegistrationCorrect (options.registration.user_email, options.registration.activation_code)
-
 
370
      && (RegOpenKeyEx (HKEY_CURRENT_USER, L"SOFTWARE\\Chess Giants", 0, KEY_SET_VALUE, &hRegistryKey) == 0))
-
 
371
   {
-
 
372
      RegSetValueEx (hRegistryKey, L"UserEmail", 0, REG_SZ, (BYTE *) options.registration.user_email, wcslen (options.registration.user_email) * sizeof (wchar_t));
-
 
373
      RegSetValueEx (hRegistryKey, L"ActivationCode", 0, REG_DWORD, (BYTE *) &options.registration.activation_code, sizeof (options.registration.activation_code));
-
 
374
      RegCloseKey (hRegistryKey); // once we've written the data we were interested in, close the registry key
-
 
375
   }
366
 
376
 
367
   return; // finished
377
   return; // finished
368
}
378
}