Add srv parse support. Sorry for the breaking API change. (I said that on README.md:34)

This commit is contained in:
Tnze
2021-02-18 17:02:41 +08:00
parent 624fc138ba
commit d6b5accdc8
2 changed files with 41 additions and 12 deletions

View File

@ -2,21 +2,25 @@ package main
import (
"bytes"
"flag"
"log"
"github.com/google/uuid"
"github.com/Tnze/go-mc/bot"
"github.com/Tnze/go-mc/chat"
_ "github.com/Tnze/go-mc/data/lang/en-us"
_ "github.com/Tnze/go-mc/data/lang/zh-cn"
pk "github.com/Tnze/go-mc/net/packet"
)
var address = flag.String("address", "127.0.0.1", "The server address")
func main() {
flag.Parse()
c := bot.NewClient()
//Login
err := c.JoinServer("localhost", 25565)
err := c.JoinServer(*address)
if err != nil {
log.Fatal(err)
}