Class: Rcon::AuthResponse

Inherits:
Response show all
Defined in:
lib/rcon/response.rb

Overview

the Response subclass corresponding with authentication response packets from the server.

Constant Summary collapse

AUTH_FAILURE_RESPONSE =

when authentication fails, the ID field of the auth respone packet will be set to -1

-1

Instance Attribute Summary

Attributes inherited from Response

#body, #id, #type

Instance Method Summary collapse

Methods inherited from Response

from_packet, #initialize

Constructor Details

This class inherits a constructor from Rcon::Response

Instance Method Details

#success?Boolean

determines whether or not authentication has succeeded.

according to the RCON spec, when authentication fails, -1 is returned in the id field of the packet.

Returns:

  • (Boolean)


61
62
63
# File 'lib/rcon/response.rb', line 61

def success?
  id != AUTH_FAILURE_RESPONSE
end