@@ -9,11 +9,12 @@ static std::time_t string_to_timet(std::string timestamp);
9
9
static std::tm timet_to_tm (time_t timestamp);
10
10
const std::string compilation_date = (std::string)skCrypt(__DATE__);
11
11
const std::string compilation_time = (std::string)skCrypt(__TIME__);
12
+ void sessionStatus ();
12
13
13
14
using namespace KeyAuth ;
14
15
15
16
// copy and paste from https://keyauth.cc/app/ and replace these string variables
16
- // Please watch tutorial HERE
17
+ // Please watch tutorial HERE https://www.youtube.com/watch?v=5x4YkTmFH-U
17
18
std::string name = skCrypt(" name" ).decrypt();
18
19
std::string ownerid = skCrypt(" ownerid" ).decrypt();
19
20
std::string version = skCrypt(" 1.0" ).decrypt();
@@ -138,6 +139,7 @@ int main()
138
139
*/
139
140
std::thread run (checkAuthenticated, ownerid);
140
141
// do NOT remove checkAuthenticated(), it MUST stay for security reasons
142
+ std::thread check (sessionStatus); // do NOT remove this function either.
141
143
142
144
if (KeyAuthApp.user_data .username .empty ()) exit (10 );
143
145
std::cout << skCrypt (" \n User data:" );
@@ -160,6 +162,23 @@ int main()
160
162
return 0 ;
161
163
}
162
164
165
+ void sessionStatus () {
166
+ KeyAuthApp.check (true ); // do NOT specify true usually, it is slower and will get you blocked from API
167
+ if (!KeyAuthApp.response .success ) {
168
+ exit (0 );
169
+ }
170
+
171
+ if (KeyAuthApp.response .isPaid ) {
172
+ while (true ) {
173
+ Sleep (20000 ); // this MUST be included or else you get blocked from API
174
+ KeyAuthApp.check ();
175
+ if (!KeyAuthApp.response .success ) {
176
+ exit (0 );
177
+ }
178
+ }
179
+ }
180
+ }
181
+
163
182
std::string tm_to_readable_time (tm ctx) {
164
183
char buffer[80 ];
165
184
0 commit comments