Skip to content

Commit

Permalink
Merge pull request #3 from gorcon/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
outdead authored Oct 18, 2020
2 parents be4d3fa + 566e361 commit 306d14e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [v1.2.2] - 2020-10-18
### Added
- Added one more workaround for Rust server. When sent command "Say" there is no response data from server
with packet.ID = SERVERDATA_EXECCOMMAND_ID, only previous console message that command was received with
packet.ID = -1, therefore, forcibly set packet.ID to SERVERDATA_EXECCOMMAND_ID.

## [v1.2.1] - 2020-10-06
### Added
- Added authentication failed test.
Expand Down Expand Up @@ -36,7 +42,8 @@ changed.
### Added
- Initial implementation.

[Unreleased]: https://github.com/gorcon/rcon/compare/v1.2.1...HEAD
[Unreleased]: https://github.com/gorcon/rcon/compare/v1.2.2...HEAD
[v1.2.2]: https://github.com/gorcon/rcon/compare/v1.2.1...v1.2.2
[v1.2.1]: https://github.com/gorcon/rcon/compare/v1.2.0...v1.2.1
[v1.2.0]: https://github.com/gorcon/rcon/compare/v1.1.2...v1.2.0
[v1.1.2]: https://github.com/gorcon/rcon/compare/v1.0.0...v1.1.2
15 changes: 12 additions & 3 deletions rcon.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,22 @@ func (c *Conn) read() (*Packet, error) {
return packet, err
}

// Workaround for Rust server. Rust rcon server responses packet with a
// type of 4 and the next packet is valid. It is undocumented, so skip
// packet and read next.
// Workaround for Rust server.
// Rust rcon server responses packet with a type of 4 and the next packet
// is valid. It is undocumented, so skip packet and read next.
if packet.Type == 4 {
if _, err := packet.ReadFrom(c.conn); err != nil {
return packet, err
}

// One more workaround for Rust server.
// When sent command "Say" there is no response data from server with
// packet.ID = SERVERDATA_EXECCOMMAND_ID, only previous console message
// that command was received with packet.ID = -1, therefore, forcibly
// set packet.ID to SERVERDATA_EXECCOMMAND_ID.
if packet.ID == -1 {
packet.ID = SERVERDATA_EXECCOMMAND_ID
}
}

return packet, nil
Expand Down

0 comments on commit 306d14e

Please sign in to comment.