Class: ESM::Command::Server::Gamble

Inherits:
ApplicationCommand show all
Defined in:
lib/esm/command/server/gamble.rb

Defined Under Namespace

Modules: V1

Constant Summary collapse

WON_ACTION =
"won"
LOSS_ACTION =
"loss"

Instance Method Summary collapse

Instance Method Details

#on_executeObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/esm/command/server/gamble.rb', line 32

def on_execute
  return reply(send_stats) if arguments.amount.blank? || arguments.amount == "stats"

  check_for_connected_server!
  check_for_bad_amount!

  response = call_sqf_function!("ESMs_command_gamble", amount: arguments.amount)
  update_stats(response.data)
  send_results(response.data.response)
end