add online mode guide to daze example

This commit is contained in:
JunDao
2019-05-14 23:47:05 +08:00
parent 2bda0d63c2
commit abf8c72e26

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
// "github.com/Tnze/go-mc/authenticate"
"github.com/Tnze/go-mc/bot" "github.com/Tnze/go-mc/bot"
"github.com/Tnze/go-mc/chat" "github.com/Tnze/go-mc/chat"
"log" "log"
@ -8,6 +9,15 @@ import (
func main() { func main() {
c := bot.NewClient() c := bot.NewClient()
// For online-mode, you need login your Mojang account
// and load your Name and UUID to client:
//
// auth, err := authenticate.Authenticate(Your E-mail", "Your Password")
// if err != nil {
// panic(err)
// }
// c.Name, c.AsTk = auth.SelectedProfile.Name, auth.SelectedProfile.ID
//Login //Login
err := c.JoinServer("localhost", 25565) err := c.JoinServer("localhost", 25565)
if err != nil { if err != nil {