now the new yggdrasil package and /cmd s can pass go test >_<
This commit is contained in:
@ -47,9 +47,9 @@ func ExampleClient_JoinServer_online() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
c.Name = auth.SelectedProfile.Name
|
|
||||||
c.Auth.UUID = auth.SelectedProfile.ID
|
c.Auth.UUID, c.Name = auth.SelectedProfile()
|
||||||
c.AsTk = auth.AccessToken
|
c.AsTk = auth.AccessToken()
|
||||||
|
|
||||||
//Connect server
|
//Connect server
|
||||||
err = c.JoinServer("localhost", 25565)
|
err = c.JoinServer("localhost", 25565)
|
||||||
|
@ -39,18 +39,18 @@ type authResp struct {
|
|||||||
AccessToken string `json:"accessToken"`
|
AccessToken string `json:"accessToken"`
|
||||||
ClientToken string `json:"clientToken"` // identical to the one received
|
ClientToken string `json:"clientToken"` // identical to the one received
|
||||||
AvailableProfiles []struct {
|
AvailableProfiles []struct {
|
||||||
ID uuid.UUID `json:"ID"` // hexadecimal
|
ID string `json:"ID"` // hexadecimal
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Legacy bool `json:"legacy"` // In practice, this field only appears in the response if true. Default to false.
|
Legacy bool `json:"legacy"` // In practice, this field only appears in the response if true. Default to false.
|
||||||
} `json:"availableProfiles"` // only present if the agent field was received
|
} `json:"availableProfiles"` // only present if the agent field was received
|
||||||
|
|
||||||
SelectedProfile struct { // only present if the agent field was received
|
SelectedProfile struct { // only present if the agent field was received
|
||||||
ID uuid.UUID `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Legacy bool `json:"legacy"`
|
Legacy bool `json:"legacy"`
|
||||||
} `json:"selectedProfile"`
|
} `json:"selectedProfile"`
|
||||||
User struct { // only present if requestUser was true in the request authPayload
|
User struct { // only present if requestUser was true in the request authPayload
|
||||||
ID uuid.UUID `json:"id"` // hexadecimal
|
ID string `json:"id"` // hexadecimal
|
||||||
Properties []struct {
|
Properties []struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
@ -86,7 +86,7 @@ func Authenticate(user, password string) (*Access, error) {
|
|||||||
return &Access{ar: ar, ct: pl.ClientToken}, nil
|
return &Access{ar: ar, ct: pl.ClientToken}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Access) SelectedProfile() (ID uuid.UUID, Name string) {
|
func (a *Access) SelectedProfile() (ID, Name string) {
|
||||||
return a.ar.SelectedProfile.ID, a.ar.SelectedProfile.Name
|
return a.ar.SelectedProfile.ID, a.ar.SelectedProfile.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user