修复一点风格问题
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
// "math"
|
// "math"
|
||||||
// "time"
|
// "time"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -123,6 +124,7 @@ func (c *Client) handlePacket(p pk.Packet) (disconnect bool, err error) {
|
|||||||
case data.NamedSoundEffect:
|
case data.NamedSoundEffect:
|
||||||
err = handleNamedSoundEffect(c, p)
|
err = handleNamedSoundEffect(c, p)
|
||||||
default:
|
default:
|
||||||
|
|
||||||
// fmt.Printf("ignore pack id %X\n", p.ID)
|
// fmt.Printf("ignore pack id %X\n", p.ID)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
// "github.com/Tnze/go-mc/authenticate"
|
"log"
|
||||||
|
|
||||||
"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"
|
// "github.com/Tnze/go-mc/authenticate"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Tnze/go-mc/bot"
|
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/Tnze/go-mc/bot"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
resp, delay, err := bot.PingAndList("play.miaoscraft.cn", 25565)
|
if len(os.Args) < 2 {
|
||||||
|
log.Fatalln("no host name. Useage: ping [hostname]")
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, delay, err := bot.PingAndList(os.Args[1], 25565)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("ping and list server fail: %v", err)
|
log.Fatalf("ping and list server fail: %v", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user