Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MCausc78 committed Sep 6, 2023
1 parent 44e6ebc commit 20dc35c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gorcon.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func (client *RCONClient) Login(password string) error {
switch packet.Type {
case PacketCommand:
if packet.RequestID != client.RequestID {
if err = client.Close(); err != nil {
return err
}
return InvalidPassword
}
}
Expand All @@ -119,6 +122,9 @@ func (client *RCONClient) SendCommand(command string) (string, error) {
if err != nil {
return res, err
}
if packet.Type != PacketResponse {
continue
}
if len(packet.Data) < PacketChunkLength {
break
}
Expand Down

0 comments on commit 20dc35c

Please sign in to comment.