From fae3236486990631e1bba1900c529e1307f52a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=9F=E8=92=BB?= Date: Sat, 23 Aug 2025 17:49:15 +0800 Subject: [PATCH] cleanup code --- pkg/client/client.go | 4 ---- pkg/client/connection.go | 1 - 2 files changed, 5 deletions(-) delete mode 100644 pkg/client/connection.go diff --git a/pkg/client/client.go b/pkg/client/client.go index 1a0e0d5..879ef48 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -73,7 +73,6 @@ func (b *botClient) Inventory() bot.InventoryHandler { } func (b *botClient) Connect(ctx context.Context, addr string, options *bot.ConnectOptions) error { - // 套用 go-mc 的連接邏輯 host, portStr, err := net.SplitHostPort(addr) var port uint64 if err != nil { @@ -92,14 +91,12 @@ func (b *botClient) Connect(ctx context.Context, addr string, options *bot.Conne } } - // 建立連接 dialer := &mcnet.DefaultDialer b.conn, err = dialer.DialMCContext(ctx, addr) if err != nil { return err } - // 執行握手 if options != nil && options.FakeHost != "" { host = options.FakeHost } @@ -121,7 +118,6 @@ func (b *botClient) Connect(ctx context.Context, addr string, options *bot.Conne b.connected = true - // 啟動封包處理 goroutine return nil } diff --git a/pkg/client/connection.go b/pkg/client/connection.go deleted file mode 100644 index da13c8e..0000000 --- a/pkg/client/connection.go +++ /dev/null @@ -1 +0,0 @@ -package client