Rename cmd -> examples
This commit is contained in:
26
examples/luncher/luncher.go
Normal file
26
examples/luncher/luncher.go
Normal file
@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/Tnze/go-mc/yggdrasil"
|
||||
)
|
||||
|
||||
var user = flag.String("user", "", "Can be an email address or player name for unmigrated accounts")
|
||||
var pswd = flag.String("password", "", "Your password")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
resp, err := yggdrasil.Authenticate(*user, *pswd)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
id, name := resp.SelectedProfile()
|
||||
fmt.Println("user:", name)
|
||||
fmt.Println("uuid:", id)
|
||||
fmt.Println("astk:", resp.AccessToken())
|
||||
}
|
Reference in New Issue
Block a user