Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.cpp #59

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ api KeyAuthApp(name.decrypt(), ownerid.decrypt(), secret.decrypt(), version.decr
int main()
{
// Freeing memory to prevent memory leak or memory scraping
name.clear(); ownerid.clear(); secret.clear(); version.clear(); url.clear();

name.clear(); ownerid.clear(); secret.clear(); version.clear(); url.clear();
std::string consoleTitle = skCrypt("Loader - Built at: ").decrypt() + compilation_date + " " + compilation_time;
SetConsoleTitleA(consoleTitle.c_str());
std::cout << skCrypt("\n\n Connecting..");
KeyAuthApp.init();
if (!KeyAuthApp.data.success)
if (!KeyAuthApp.response.success)
{
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
std::cout << skCrypt("\n Status: ") << KeyAuthApp.response.message;
Sleep(1500);
exit(1);
}
Expand All @@ -41,10 +40,10 @@ int main()
{
std::string key = ReadFromJson("test.json", "license");
KeyAuthApp.license(key);
if (!KeyAuthApp.data.success)
if (!KeyAuthApp.response.success)
{
std::remove("test.json");
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
std::cout << skCrypt("\n Status: ") << KeyAuthApp.response.message;
Sleep(1500);
exit(1);
}
Expand All @@ -55,10 +54,10 @@ int main()
std::string username = ReadFromJson("test.json", "username");
std::string password = ReadFromJson("test.json", "password");
KeyAuthApp.login(username, password);
if (!KeyAuthApp.data.success)
if (!KeyAuthApp.response.success)
{
std::remove("test.json");
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
std::cout << skCrypt("\n Status: ") << KeyAuthApp.response.message;
Sleep(1500);
exit(1);
}
Expand Down Expand Up @@ -111,9 +110,9 @@ int main()
exit(1);
}

if (!KeyAuthApp.data.success)
if (!KeyAuthApp.response.success)
{
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
std::cout << skCrypt("\n Status: ") << KeyAuthApp.response.message;
Sleep(1500);
exit(1);
}
Expand All @@ -130,24 +129,24 @@ int main()


}

std::cout << skCrypt("\n User data:");
std::cout << skCrypt("\n Username: ") << KeyAuthApp.data.username;
std::cout << skCrypt("\n IP address: ") << KeyAuthApp.data.ip;
std::cout << skCrypt("\n Hardware-Id: ") << KeyAuthApp.data.hwid;
std::cout << skCrypt("\n Create date: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.data.createdate)));
std::cout << skCrypt("\n Last login: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.data.lastlogin)));
std::cout << skCrypt("\n Username: ") << KeyAuthApp.user_data.username;
std::cout << skCrypt("\n IP address: ") << KeyAuthApp.user_data.ip;
std::cout << skCrypt("\n Hardware-Id: ") << KeyAuthApp.user_data.hwid;
std::cout << skCrypt("\n Create date: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.user_data.createdate)));
std::cout << skCrypt("\n Last login: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.user_data.lastlogin)));
std::cout << skCrypt("\n Subscription(s): ");

for (int i = 0; i < KeyAuthApp.data.subscriptions.size(); i++) {
auto sub = KeyAuthApp.data.subscriptions.at(i);
for (int i = 0; i < KeyAuthApp.user_data.subscriptions.size(); i++) {
auto sub = KeyAuthApp.user_data.subscriptions.at(i);
std::cout << skCrypt("\n name: ") << sub.name;
std::cout << skCrypt(" : expiry: ") << tm_to_readable_time(timet_to_tm(string_to_timet(sub.expiry)));
}

std::cout << skCrypt("\n\n Closing in five seconds...");
Sleep(5000);

return 0;
}

Expand Down