Skip to content

Commit 7bb5c2d

Browse files
committed
ref #106 on online-bot example
1 parent 61f9625 commit 7bb5c2d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

bot/example_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ func ExampleClient_JoinServer_offline() {
4848
func ExampleClient_JoinServer_online() {
4949
c := NewClient()
5050

51-
//Login Mojang account to get AccessToken
51+
// Login Mojang account to get AccessToken
52+
// To use Microsoft Account, see issue #106
53+
// https://github.com/Tnze/go-mc/issues/106
5254
auth, err := yggdrasil.Authenticate("Your E-mail", "Your Password")
5355
if err != nil {
5456
panic(err)
5557
}
5658

59+
// As long as you set these three fields correctly,
60+
// the client can connect to the online-mode server
5761
c.Auth.UUID, c.Auth.Name = auth.SelectedProfile()
5862
c.Auth.AsTk = auth.AccessToken()
5963

examples/daze/daze.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ package main
55
import (
66
"errors"
77
"flag"
8-
"github.com/Tnze/go-mc/bot/world"
9-
"github.com/Tnze/go-mc/level"
108
"log"
119
"time"
1210

@@ -16,9 +14,11 @@ import (
1614
"github.com/Tnze/go-mc/bot"
1715
"github.com/Tnze/go-mc/bot/basic"
1816
"github.com/Tnze/go-mc/bot/screen"
17+
"github.com/Tnze/go-mc/bot/world"
1918
"github.com/Tnze/go-mc/chat"
2019
"github.com/Tnze/go-mc/data/item"
2120
_ "github.com/Tnze/go-mc/data/lang/zh-cn"
21+
"github.com/Tnze/go-mc/level"
2222
)
2323

2424
var address = flag.String("address", "127.0.0.1", "The server address")

0 commit comments

Comments
 (0)