class MinecraftServerCheck

Public Instance Methods

status(options) click to toggle source
# File lib/gg_check/plugins/MinecraftServer.rb, line 16
def status(options)
  check_result = {}
  # Send \xfe command to see if server is ready
  result = socket '127.0.0.1', 25565, "\xfe", 3
  if result[0].ord == 255
    check_result['status'] = 0
  else
    check_result['status'] = 2
    check_result['message_key'] = 'event.not_running'
  end
  check_result
end