FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
keyauth-cpp-library/example/main.cpp at main · srkdragon/keyauth-cpp-library · GitHub
srkdragon
/
keyauth-cpp-library
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
keyauth-cpp-library
/
example
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
69 lines (57 loc) · 2.29 KB
Breadcrumbs
keyauth-cpp-library
/
example
/
main.cpp
Copy path
File metadata and controls
69 lines (57 loc) · 2.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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 <<
"
\n
Enter license key:
"
;
std::cin >> key;
api.
license
(key);
if
(api.
response
.
success
)
{
std::cout <<
"
\n
Login 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 <<
"
\n
Subscriptions:
"
<< 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
;
}
Back
|
FazBrowse Home
|
New Git URL