Module: Frostbitten::Methods::AdminCommands

Included in:
Client
Defined in:
lib/frostbitten/methods/admin.rb

Instance Method Summary collapse

Instance Method Details

#ban_list(start_index = 0) ⇒ Object



9
10
11
12
# File 'lib/frostbitten/methods/admin.rb', line 9

def ban_list(start_index=0)
	return nil unless @logged_in
	return BannedPlayer.players_from_list(send(['banList.list', "#{start_index}"]))
end

#events(start = true) ⇒ Object



23
24
25
26
# File 'lib/frostbitten/methods/admin.rb', line 23

def events(start=true)
	return nil unless @logged_in
	return send(['admin.eventsEnabled',(start ? 'true' : 'false')])
end

#map_list(start_index = 0) ⇒ Object



4
5
6
7
# File 'lib/frostbitten/methods/admin.rb', line 4

def map_list(start_index=0)
	return nil unless @logged_in 
	return Map.maps_from_list(send(['mapList.list', "#{start_index}"]))
end

#reserved_slots_list(start_index = 0) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/frostbitten/methods/admin.rb', line 14

def reserved_slots_list(start_index=0)
	return nil unless @logged_in
	return [].tap do |players|
		send(['reservedSlotsList.list', "#{start_index}"]).each do |player_name|
			players << Player.new({:name => player_name})
		end
	end
end