-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
86 lines (74 loc) · 2.12 KB
/
main.go
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package main
import (
"fmt"
"os"
"project/eauth" // Eauth API here
"time"
)
func main() {
/* Initialize Eauth (Important) */
if !eauth.Init() {
fmt.Println("Failed to initialize Eauth: " + eauth.ErrorMessage)
time.Sleep(3 * time.Second)
os.Exit(1)
}
eauth.ClearConsole() // clear the console
fmt.Println("▒█▀▀▀ ░█▀▀█ ▒█░▒█ ▀▀█▀▀ ▒█░▒█ ")
fmt.Println("▒█▀▀▀ ▒█▄▄█ ▒█░▒█ ░▒█░░ ▒█▀▀█ ")
fmt.Println("▒█▄▄▄ ▒█░▒█ ░▀▄▄▀ ░▒█░░ ▒█░▒█")
fmt.Println("[1] Login | [2] Register")
var option string
fmt.Print("user@eauth:~$ ")
fmt.Scanln(&option)
if option == "1" {
/* Login (username & password) */
eauth.ClearConsole() // clear the console
var username string
fmt.Print("Username: ")
fmt.Scanln(&username)
var password string
fmt.Print("Password: ")
fmt.Scanln(&password)
if eauth.Login(username, password) {
eauth.ClearConsole() // clear the console
fmt.Println(eauth.LoggedMessage + "\n")
fmt.Println("Rank: " + eauth.UserRank)
fmt.Println("Create Date: " + eauth.RegisterDate)
fmt.Println("Expire Date: " + eauth.ExpireDate)
fmt.Println("Hardware ID: " + eauth.HWID)
} else {
fmt.Println(eauth.ErrorMessage)
}
time.Sleep(3 * time.Second)
main() // return
} else if option == "2" {
/* Register (username & email & password & key) */
eauth.ClearConsole() // clear the console
var username string
fmt.Print("Username: ")
fmt.Scanln(&username)
var email string
fmt.Print("Email: ")
fmt.Scanln(&email)
var password string
fmt.Print("Password: ")
fmt.Scanln(&password)
var key string
fmt.Print("License Key: ")
fmt.Scanln(&key)
if eauth.Register(username, email, password, key) {
eauth.ClearConsole() // clear the console
fmt.Println(eauth.RegisteredMessage)
} else {
fmt.Println(eauth.ErrorMessage)
}
time.Sleep(3 * time.Second)
main() // return
} else {
/* None */
eauth.ClearConsole() // clear the console
fmt.Println("Invalid option!")
time.Sleep(3 * time.Second)
main() // return
}
}