/src/config/C4ConfigShareware.h
C++ Header | 64 lines | 39 code | 6 blank | 19 comment | 0 complexity | 4b8c05dccad27e9c28add0a03246e1b9 MD5 | raw file
Possible License(s): WTFPL, 0BSD, LGPL-2.1, CC-BY-3.0
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
20#ifndef C4CONFIGSHAREWARE_H_INC
21#define C4CONFIGSHAREWARE_H_INC
22
23#include <C4Config.h>
24#include <C4Group.h>
25
26const int MaxRegDataLen = 4096;
27const 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";
28
29void UnscrambleString(char *szString);
30
31class C4ConfigShareware: public C4Config
32 {
33 public:
34 C4ConfigShareware();
35 ~C4ConfigShareware();
36 protected:
37 bool RegistrationValid;
38 char RegData[MaxRegDataLen + 1];
39 char KeyFile[CFG_MaxString + 1];
40 char InvalidKeyFile[CFG_MaxString + 1];
41 public:
42 void Default();
43 bool Save();
44 bool Load(bool forceWorkingDirectory=true, const char *szCustomFile=NULL);
45 public:
46 void ClearRegistrationError();
47 bool Registered();
48 bool LoadRegistration();
49 bool LoadRegistration(const char *szFrom);
50 const char* GetRegistrationData(const char* strField);
51 const char* GetRegistrationError();
52 const char* GetKeyFilename();
53 const char* GetInvalidKeyFilename();
54 const char* GetKeyPath();
55 StdStrBuf GetKeyMD5();
56 // checks for phising attacks: Return true if input contains user's webcode
57 bool IsConfidentialData(const char *szInput);
58 protected:
59 StdStrBuf RegistrationError;
60 bool HandleError(const char *strMessage);
61 };
62
63extern C4ConfigShareware Config;
64#endif // C4CONFIGSHAREWARE_H_INC