Replace mcrcon command with system command
This commit is contained in:
parent
e8fb72653d
commit
7eca69b4a6
1 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ class VouchersController < ApplicationController
|
|||
# GET /vouchers
|
||||
def index
|
||||
@vouchers = Voucher.all
|
||||
whitelist = %x{mcrcon -c -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} 'whitelist list' | sed 's/There are*.*whitelisted players: //g'}.gsub("\n", "")
|
||||
whitelist = %x{mc-whitelist-users}.gsub("\n", "")
|
||||
|
||||
render json: { :vouchers => @vouchers, :whitelist => whitelist }.to_json
|
||||
end
|
||||
|
|
@ -19,7 +19,7 @@ class VouchersController < ApplicationController
|
|||
def create
|
||||
# Logic for creating a voucher
|
||||
output = ""
|
||||
whitelist = %x(mcrcon -c -H mine.vereto.net -p #{ENV["MC_RCON_PASS"]} "whitelist list" | sed 's/There are*.*whitelisted players: //g').gsub("\n", "").split(", ")
|
||||
whitelist = %x(mc-whitelist-users).gsub("\n", "").split(", ")
|
||||
|
||||
if Voucher.exists?(vouchee: params[:voucher]) && params[:voucher].in?(whitelist)
|
||||
@voucher = Voucher.new(voucher_params)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue