Fix several bugs in minecraft input (#2970)
This commit is contained in:
committed by
Daniel Nelson
parent
f2bb4acd4a
commit
cc3d420551
@@ -171,9 +171,17 @@ func (c *Client) Send(typ int32, command string) (response *Packet, err error) {
|
||||
}
|
||||
|
||||
body := make([]byte, header.Size-int32(PacketHeaderSize))
|
||||
|
||||
n, err = c.Connection.Read(body)
|
||||
|
||||
for n < len(body) {
|
||||
var nBytes int
|
||||
nBytes, err = c.Connection.Read(body[n:])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
n += nBytes
|
||||
}
|
||||
|
||||
if nil != err {
|
||||
return
|
||||
} else if n != len(body) {
|
||||
|
||||
Reference in New Issue
Block a user