-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
69 lines (57 loc) · 2.29 KB
/
Copy pathmain.cpp
File metadata and controls
69 lines (57 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "keyauth/keyauth.hpp"
#include <iostream>
int main()
{
try
{
// Initialize KeyAuth API
// Replace these with your actual credentials from keyauth.cc
KeyAuth::API api("Surakarndragon's Application", // Your application name
"mCoqYG4Adm", // Your owner ID (10 characters)
"1.0", // Your application version
"https://keyauth.win/api/1.3/" // KeyAuth API endpoint
);
std::cout << "Initializing..." << std::endl;
api.init();
if (!api.response.success)
{
std::cout << "Failed to initialize: " << api.response.message << std::endl;
return 1;
}
std::cout << "Initialized successfully!" << std::endl;
std::cout << "App Version: " << api.app_data.version << std::endl;
std::cout << "Total Users: " << api.app_data.numUsers << std::endl;
// Example: Login
std::string key;
std::cout << "\nEnter license key: ";
std::cin >> key;
api.license(key);
if (api.response.success)
{
std::cout << "\nLogin successful!" << std::endl;
std::cout << "Username: " << api.user_data.username << std::endl;
std::cout << "IP: " << api.user_data.ip << std::endl;
std::cout << "HWID: " << api.user_data.hwid << std::endl;
std::cout << "Created: " << api.user_data.createdate << std::endl;
std::cout << "Last Login: " << api.user_data.lastlogin << std::endl;
std::cout << "\nSubscriptions:" << std::endl;
for (const auto& sub : api.user_data.subscriptions)
std::cout << " - " << sub.name << " (Expires: " << sub.expiry << ")" << std::endl;
}
else
{
std::cout << "Login failed: " << api.response.message << std::endl;
}
// Example: Get a variable
std::string myVar = api.var("variable_id");
std::cout << "Variable value: " << myVar << std::endl;
// Example: Log something
api.log("User logged in successfully");
}
catch (const std::exception& e)
{
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
return 0;
}