Skip to content

Commit a283cd6

Browse files
committed
chore: Cleanup code
1 parent 8f15a47 commit a283cd6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

common/buf/pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func Put(buf []byte) error {
1616

1717
func PutMulti(buffers [][]byte) {
1818
for _, buffer := range buffers {
19-
Put(buffer)
19+
Put(buffer) //nolint:errcheck
2020
}
2121
}
2222

common/buf/readv_reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (r *ReaderV) readMulti() (net.Buffers, error) {
105105
}
106106

107107
for i := nBuf; i < len(bs); i++ {
108-
Put(bs[i])
108+
Put(bs[i]) //nolint:errcheck
109109
bs[i] = nil
110110
}
111111

service/minecraft/handler.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"log"
7+
"math"
78
"net"
89
"strings"
910

@@ -97,8 +98,10 @@ func NewConnHandler(s *config.ConfigProxyService,
9798
switch s.Minecraft.PingMode {
9899
case pingModeDisconnect:
99100
case pingMode0ms:
100-
err = conn.WritePacket(
101-
packet.Marshal(0x01, packet.Long(1<<63-1))) // max int64 value
101+
err = conn.WritePacket(packet.Marshal(
102+
0x01, // Client bound : Ping Response
103+
packet.Long(math.MaxInt64),
104+
))
102105
if err != nil {
103106
return nil, err
104107
}

0 commit comments

Comments
 (0)