Module: Frostbitten

Defined in:
lib/frostbitten.rb,
lib/frostbitten/map.rb,
lib/frostbitten/score.rb,
lib/frostbitten/client.rb,
lib/frostbitten/player.rb,
lib/frostbitten/server.rb,
lib/frostbitten/version.rb,
lib/frostbitten/connection.rb,
lib/frostbitten/methods/admin.rb,
lib/frostbitten/methods/normal.rb

Overview

This class will give you a shorthand to a Server object. and give you a easy way to execute methods on server that are predefined in this class.

Defined Under Namespace

Modules: Methods, Version Classes: BannedPlayer, Client, Connection, Map, Player, Score, Server

Class Method Summary collapse

Class Method Details

.connObject

Method to return the client object if raw access is needed



25
26
27
# File 'lib/frostbitten.rb', line 25

def self.conn
	return @client
end

.method_missing(meth, *args, &block) ⇒ Object

:nodoc:



30
31
32
33
34
35
36
# File 'lib/frostbitten.rb', line 30

def self.method_missing(meth, *args, &block) 
	if @client and @client.respond_to?(meth)
		@client.public_send(meth, *args, &block)
	else
		super
	end
end

.setup(uri, options = {}) ⇒ Object

Setup the module with a URI ‘fbrcon://password@ip:port’ Also accepts options { :keepalive = true/false, :socket_timeout => 1 }



20
21
22
# File 'lib/frostbitten.rb', line 20

def self.setup(uri,options={})
	@client = Frostbitten::Client.new(uri,options)
end