diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 23:18:56 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 23:18:56 -0400 |
commit | 4c572a775a7c28b102b4462af94214148e6df1d2 (patch) | |
tree | 545d97081772988b2f5c479b97d413d916c64d07 /app/models | |
parent | b35fa4b6f79d13d46eab4c9ba9e631eeb20ba73b (diff) | |
parent | deaf1f5db268b8fd2ff1838e461c8142d3882dc8 (diff) |
Forced Merger - Hostile Takeover.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/match.rb | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/app/models/match.rb b/app/models/match.rb index e817b71..d4c0ce5 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -12,41 +12,22 @@ class Match < ActiveRecord::Base ok = true tournament_stage.scoring_method.stats_needed.each do |stat| ok &= statistics.where(match: self, name: stat).nil? - end ok end - def is_match_over(match, firstPlayer) - #response = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/summoner/by-name/#{firstPlayer}?api_key=ad539f86-22fd-474d-9279-79a7a296ac38") - #riot_id = response["#{firstPlayer}"]['id'] - #recent game information - #game_info = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/game/by-summoner/#{riot_id}/recent?api_key=ad539f86-22fd-474d-9279-79a7a296ac38") - #first_id = game_info["games"][0]["gameId"] - - count = 0 - while true do - #sleep(5) #wait four minutes - - puts("Every 4 minutes.") - puts("Every 4 minutes.") - count += 1 - #game_info = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/game/by-summoner/#{riot_id}/recent?api_key=ad539f86-22fd-474d-9279-79a7a296ac38") - #current_id = game_info["games"][0]["gameId"] + def win?(player) + winner.players.include? player + end - #if current_id != first_id - if count > 2 - puts(count) - #sleep(10) - match.status = 2 - match.save - return true - end - end #while + def handle_sampling(params) + # TODO end - #handle_asynchronously :is_match_over - def win?(player) - winner.players.include? player + def render_sampling(user) + # TODO end + def finished? + # TODO + end end |