/src/config/C4ConfigShareware.h

https://bitbucket.org/randrian/openclonk2 · C++ Header · 64 lines · 39 code · 6 blank · 19 comment · 0 complexity · 4b8c05dccad27e9c28add0a03246e1b9 MD5 · raw file

  1. /*
  2. * OpenClonk, http://www.openclonk.org
  3. *
  4. * Copyright (c) 2003, 2007 Matthes Bender
  5. * Copyright (c) 2005 G?nther Brammer
  6. * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
  7. *
  8. * Portions might be copyrighted by other authors who have contributed
  9. * to OpenClonk.
  10. *
  11. * Permission to use, copy, modify, and/or distribute this software for any
  12. * purpose with or without fee is hereby granted, provided that the above
  13. * copyright notice and this permission notice appear in all copies.
  14. * See isc_license.txt for full license and disclaimer.
  15. *
  16. * "Clonk" is a registered trademark of Matthes Bender.
  17. * See clonk_trademark_license.txt for full license.
  18. */
  19. #ifndef C4CONFIGSHAREWARE_H_INC
  20. #define C4CONFIGSHAREWARE_H_INC
  21. #include <C4Config.h>
  22. #include <C4Group.h>
  23. const int MaxRegDataLen = 4096;
  24. const char szInvalidKeyData[] = "r>iU218f3_030\r\n0ipX>ZeuX\r\nZichtVLpI=WeUt\r\nYNtzNcQy=EZs1\r\nAhVsloP=PYptk TE0e\r\n5Vtms5_0:-0^-0>\r\nDfhCqHy=27CIxFpB\r\n\r\nnxSR+?bD50+H[:fEnyW^UcASVTSR9n>Oez`2qHN3YWbz8P;SSqkvXtXMM6Z1UQNT\r\nrpFHRy/6pZ2T6E1iGF1Dt\370Ofw7f\370bUvuM3_jl8TsxWN8;d0kCj3v/JRWBO/Gvxpx\r\nTrBomp81>gkZoddjFcyTwx[J/dNIKEzt]Tj5em=]60w@\r\n";
  25. void UnscrambleString(char *szString);
  26. class C4ConfigShareware: public C4Config
  27. {
  28. public:
  29. C4ConfigShareware();
  30. ~C4ConfigShareware();
  31. protected:
  32. bool RegistrationValid;
  33. char RegData[MaxRegDataLen + 1];
  34. char KeyFile[CFG_MaxString + 1];
  35. char InvalidKeyFile[CFG_MaxString + 1];
  36. public:
  37. void Default();
  38. bool Save();
  39. bool Load(bool forceWorkingDirectory=true, const char *szCustomFile=NULL);
  40. public:
  41. void ClearRegistrationError();
  42. bool Registered();
  43. bool LoadRegistration();
  44. bool LoadRegistration(const char *szFrom);
  45. const char* GetRegistrationData(const char* strField);
  46. const char* GetRegistrationError();
  47. const char* GetKeyFilename();
  48. const char* GetInvalidKeyFilename();
  49. const char* GetKeyPath();
  50. StdStrBuf GetKeyMD5();
  51. // checks for phising attacks: Return true if input contains user's webcode
  52. bool IsConfidentialData(const char *szInput);
  53. protected:
  54. StdStrBuf RegistrationError;
  55. bool HandleError(const char *strMessage);
  56. };
  57. extern C4ConfigShareware Config;
  58. #endif // C4CONFIGSHAREWARE_H_INC