@@ -9,11 +9,12 @@ static std::time_t string_to_timet(std::string timestamp);
99static std::tm timet_to_tm (time_t timestamp);
1010const std::string compilation_date = (std::string)skCrypt(__DATE__);
1111const std::string compilation_time = (std::string)skCrypt(__TIME__);
12+ void sessionStatus ();
1213
1314using namespace KeyAuth ;
1415
1516// 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
1718std::string name = skCrypt(" name" ).decrypt();
1819std::string ownerid = skCrypt(" ownerid" ).decrypt();
1920std::string version = skCrypt(" 1.0" ).decrypt();
@@ -138,6 +139,7 @@ int main()
138139 */
139140 std::thread run (checkAuthenticated, ownerid);
140141 // do NOT remove checkAuthenticated(), it MUST stay for security reasons
142+ std::thread check (sessionStatus); // do NOT remove this function either.
141143
142144 if (KeyAuthApp.user_data .username .empty ()) exit (10 );
143145 std::cout << skCrypt (" \n User data:" );
@@ -160,6 +162,23 @@ int main()
160162 return 0 ;
161163}
162164
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+
163182std::string tm_to_readable_time (tm ctx) {
164183 char buffer[80 ];
165184
0 commit comments