add "check Validate" support

This commit is contained in:
Tnze
2019-08-09 00:36:00 +08:00
parent bf46650ffc
commit 8d9d2a7695
6 changed files with 159 additions and 79 deletions

25
cmd/luncher/luncher.go Normal file
View File

@ -0,0 +1,25 @@
package main
import (
"flag"
"fmt"
"github.com/Tnze/go-mc/yggdrasil"
"os"
)
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())
}

View File

@ -374,7 +374,7 @@ func (c *Client) encryptionResponse() ([]byte, []byte, error) {
return nil, nil, err
}
if p.ID != 0x01 {
return nil, nil, fmt.Errorf("0x%02X is not Encryption AuthResp", p.ID)
return nil, nil, fmt.Errorf("0x%02X is not Encryption authResp", p.ID)
}
var (