Class: GoldSrcServer

Inherits:
Object
  • Object
show all
Includes:
GameServer
Defined in:
lib/steam/servers/goldsrc_server.rb

Constant Summary

Constants included from GameServer

GameServer::REQUEST_CHALLENGE, GameServer::REQUEST_INFO, GameServer::REQUEST_PLAYER, GameServer::REQUEST_RULES

Instance Method Summary collapse

Methods included from GameServer

#handle_response_for_request, #init, #ping, player_status_attributes, #players, #rcon_authenticated?, #rules, #server_info, split_player_status, #to_s, #update_challenge_number, #update_ping, #update_player_info, #update_rules_info, #update_server_info

Methods included from Server

#rotate_ip

Constructor Details

#initialize(address, port = 27015, is_hltv = false) ⇒ GoldSrcServer

Returns a new instance of GoldSrcServer.



13
14
15
16
17
# File 'lib/steam/servers/goldsrc_server.rb', line 13

def initialize(address, port = 27015, is_hltv = false)
  super address, port

  @is_hltv = is_hltv
end

Instance Method Details

#init_socketObject

Initializes the socket to communicate with the GoldSrc server



20
21
22
# File 'lib/steam/servers/goldsrc_server.rb', line 20

def init_socket
  @socket = GoldSrcSocket.new @ip_address, @port, @is_hltv
end

#rcon_auth(password) ⇒ Object



24
25
26
27
# File 'lib/steam/servers/goldsrc_server.rb', line 24

def rcon_auth(password)
  @rcon_password = password
  true
end

#rcon_exec(command) ⇒ Object



29
30
31
# File 'lib/steam/servers/goldsrc_server.rb', line 29

def rcon_exec(command)
  @socket.rcon_exec(@rcon_password, command).strip
end