module MCLib

Constants

VERSION

Public Class Methods

banned_ips() click to toggle source
# File lib/mclib.rb, line 28
def self.banned_ips
  JSON.parse(File.open(@@mc_dir + 'banned-ips.json').read)
end
banned_players() click to toggle source
# File lib/mclib.rb, line 32
def self.banned_players
  JSON.parse(File.open(@@mc_dir + 'banned-players.json').read)
end
get_mc_dir() click to toggle source
# File lib/mclib.rb, line 14
def self.get_mc_dir
  @@mc_dir
end
ops() click to toggle source
# File lib/mclib.rb, line 18
def self.ops
  json = JSON.parse(File.open(@@mc_dir + 'ops.json').read)
  json.collect { |user| user['name'] }
end
set_mc_dir(dir) click to toggle source
# File lib/mclib.rb, line 9
def self.set_mc_dir(dir)
  dir.chomp! '/' # in case of trailing slash
  @@mc_dir = dir
end
whitelist() click to toggle source
# File lib/mclib.rb, line 23
def self.whitelist
  json = JSON.parse(File.open(@@mc_dir + 'whitelist.json').read)
  json.collect { |user| user['name'] }
end