summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-29 16:45:01 -0400
committertkimia <tkimia@purdue.edu>2014-04-29 16:45:01 -0400
commita3392e334f15dd852f550411394c27b3327db1e9 (patch)
tree46b67d2c5fd004d81b936e4d6a68f80f9cc8ff32
parent42d6e3b1cc05ef5172081682b53675e4827254d3 (diff)
parentd2da4866962e69fda4f3078afd19dbaf3d245882 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts: app/models/match.rb lib/scoring/winner_takes_all.rb
-rw-r--r--app/assets/stylesheets/patch54
-rw-r--r--app/controllers/sessions_controller.rb35
-rw-r--r--app/helpers/sessions_helper.rb22
-rw-r--r--app/models/match.rb4
-rw-r--r--app/views/sessions/new.html.erb43
-rw-r--r--blue.yaml200
-rw-r--r--doc/Sprint3-Retrospective.md150
-rw-r--r--lib/sampling/peer_review.rb20
-rw-r--r--lib/scoring/README.md2
-rw-r--r--lib/scoring/fibonacci_peer_with_blowout.rb16
-rw-r--r--lib/scoring/marginal_peer.rb2
-rw-r--r--lib/scoring/winner_takes_all.rb2
-rw-r--r--purple.yaml194
13 files changed, 230 insertions, 514 deletions
diff --git a/app/assets/stylesheets/patch b/app/assets/stylesheets/patch
deleted file mode 100644
index 0997417..0000000
--- a/app/assets/stylesheets/patch
+++ /dev/null
@@ -1,54 +0,0 @@
-commit 10f01633176ca214e7aec6be61ed3344035ec77e
-Merge: 99dff7e 20f7b74
-Author: webb39 <webb39@purdue.edu>
-Date: Mon Mar 10 20:41:27 2014 -0400
-
- Merge branch 'master' of https://github.com/LukeShu/Leaguer
-
-commit 99dff7e01a65986338824804651367e97a0d1923
-Merge: 1f00553 f0c03cd
-Author: webb39 <webb39@purdue.edu>
-Date: Mon Mar 10 20:41:16 2014 -0400
-
- Merge https://github.com/LukeShu/Leaguer
-
- Conflicts:
- doc/Sprint1-Retrospective.md
-
-commit 1f00553cbc5d281efe3ac1b434d16537a17bc969
-Author: webb39 <webb39@purdue.edu>
-Date: Mon Mar 10 20:36:31 2014 -0400
-
- added match controller information
-
-diff --git a/doc/Sprint1-Retrospective.md b/doc/Sprint1-Retrospective.md
-index 3da3669..ae1b07a 100644
---- a/doc/Sprint1-Retrospective.md
-+++ b/doc/Sprint1-Retrospective.md
-@@ -97,13 +97,24 @@ f
- f
-
- ## Login (UI) {#login-ui}
--
-+
- ## Tournament settings {#tourney-settings}
--
-+
- ## Tournament registration {#tourney-registration}
-
- ## Match controller {#match-controller}
-
-+The Match Controller creates the separate matches for a specific tournament.
-+When a tournament is started, it begins with an initial match that contains
-+no players. Currently, a player must join a match by entering the specific
-+tournament (by clicking the 'show' button on the tournament),
-+then they must enter the match (again by clicking the 'show' button but this
-+time on the match they desire to participate in) and then finally clicking
-+the 'join' button. This updates the match with the user as a participant in
-+the matc and then finally clicking the 'join' button. This updates the match
-+with the user as a participant in the match. A match can also be destroyed
-+by clicking the 'delete' button on the no longer desired match on the page.
-+
- ## Permissions system {#permissions}
-
- ## Tournament view {#tourney-view}
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index dfaeebc..5d96b3e 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -2,26 +2,24 @@ class SessionsController < ApplicationController
# GET /sessions/new
def new
- @user = User.new
- #@session = Session.new
end
# POST /sessions
# POST /sessions.json
def create
# find the user...
- @user = User.find_by_email(params[:session][:username_or_email]) || User.find_by_user_name(params[:session][:username_or_email])
+ user = User.find_by_email(params[:username_or_email].to_s) || User.find_by_user_name(params[:username_or_email].to_s)
#@session = Session.new(@user)
# ... and create a new session
respond_to do |format|
- if @user && @user.authenticate(params[:session][:password])
- sign_in @user
- format.html { redirect_to root_path }
+ if user && user.authenticate(params[:password].to_s)
+ sign_in user
+ format.html { redirect_to root_path, notice: "Welcome, #{user.name}" } # TODO; previous URL
#format.json { # TODO }
else
format.html { render action: 'new' }
- format.json { render json: @user.errors, status: :unprocessable_entity }
+ format.json { render json: user.errors, status: :unprocessable_entity }
end
end
end
@@ -38,14 +36,23 @@ class SessionsController < ApplicationController
end
private
- # Use callbacks to share common setup or constraints between actions.
- def set_session
- @token = Session.hash_token(cookies[:remember_token])
- @session = Session.find_by(token: @token)
+
+ # Only allow creating a session if not logged in.
+ def check_create
+ unless current_user.nil?
+ respond_to do |format|
+ format.html { redirect_to root_path, notice: "You are already logged in" } # TODO: previous URL
+ format.json { render json: {"errors" => ["already logged in"]}, status: :forbidden }
+ end
+ end
end
- # Never trust parameters from the scary internet, only allow the white list through.
- def session_params
- params.require(:session).permit(:session_email, :session_user_name, :session_password)
+ def check_delete
+ unless signed_in?
+ respond_to do |format|
+ format.html { redirect_to root_path, notice: "You are not logged in" } # TODO: previous URL
+ format.json { render json: {"errors" => ["not logged in"]}, status: :forbidden }
+ end
+ end
end
end
diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
index 499e988..7599a0a 100644
--- a/app/helpers/sessions_helper.rb
+++ b/app/helpers/sessions_helper.rb
@@ -2,25 +2,24 @@ require 'user'
module SessionsHelper
def sign_in(user)
- @session = Session.new(user: user)
- raw_token = @session.create_token
- @session.save # FIXME: error handling
+ session = Session.new(user: user)
+ raw_token = session.create_token
+ session.save!
- @token = Session.hash_token(raw_token)
+ token = Session.hash_token(raw_token)
cookies.permanent[:remember_token] = { value: raw_token, expires: 20.minutes.from_now.utc }
+ end
- #set the current user to be the given user
- @current_user = user
+ def current_session
+ Session.find_by(token: Session.hash_token(cookies[:remember_token]))
end
- # sets the @current_user instance virable to the user corresponding
+ # sets the @current_user instance varable to the user corresponding
# to the remember token, but only if @current_user is undefined
# since the remember token is hashed, we need to hash the cookie
# to find match the remember token
def current_user
- @token ||= Session.hash_token(cookies[:remember_token])
- @session ||= Session.find_by(token: @token)
- @current_user ||= (@session.nil? ? User::NilUser.new : @session.user)
+ return (current_session.nil? ? User::NilUser.new : current_session.user)
end
# checks if someone is currently signed in
@@ -30,9 +29,8 @@ module SessionsHelper
def sign_out
if signed_in?
- @session.destroy
+ current_session.destroy
end
- @current_user = User::NilUser.new
cookies.delete(:remember_token)
end
diff --git a/app/models/match.rb b/app/models/match.rb
index 65e2047..cdfa0d7 100644
--- a/app/models/match.rb
+++ b/app/models/match.rb
@@ -19,7 +19,7 @@ class Match < ActiveRecord::Base
# such that the match may be considered finished.
def finished?
ok = true
- tournament_stage.scoring.stats_needed.each do |stat|
+ tournament_stage.scoring.stats_needed(self).each do |stat|
self.users.each do |user|
ok &= statistics.where(match: self, user: user, name: stat)
end
@@ -87,7 +87,7 @@ class Match < ActiveRecord::Base
def figure_sampling_methods
if @sampling_methods.nil?
data = {}
- needed = self.tournament_stage.scoring.stats_needed
+ needed = self.tournament_stage.scoring.stats_needed(self)
methods_names = self.tournament_stage.tournament.sampling_methods
methods_names.each do |method_name|
method_class = "Sampling::#{method_name.camelcase}".constantize
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index ff27762..97f09b6 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,23 +1,26 @@
<h1>Sign in</h1>
-<% if @user.nil? %>
- <p class="errors"> The email/username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email/username and password. </p>
-<% end %>
- <div class="span6 offset3">
- <%= form_for(:session, url: sessions_path) do |f| %>
- <p>
- <%= f.label(:username_or_email, "Username/Email") %><br/>
- <%= f.text_field :username_or_email%>
- </p>
- <p>
- <%= f.label :password %><br/>
- <%= f.password_field :password %>
- </p>
- <p>
- <%= f.submit "Log in", class: "signin" %>
- </p>
- <% end %>
-
- <p>New user? <%= link_to("Sign up now!", new_user_path) %></p>
- </div>
+<div>
+ <%= form_tag(sessions_path, method: :post, id: :new_session) do %>
+ <% if params[:action] == "create" %>
+ <div id="error_explanation">
+ <p>The username/password pair you entered did
+ not match our records. Check your typing and
+ try again.</p>
+ </div>
+ <% end %>
+ <p>
+ <%= label_tag(:username_or_email, "Username/Email") %><br/>
+ <%= text_field_tag(:username_or_email) %>
+ </p>
+ <p>
+ <%= label_tag(:password) %><br/>
+ <%= password_field_tag(:password) %>
+ </p>
+ <p>
+ <%= submit_tag("Log in", class: :signin) %>
+ </p>
+ <% end %>
+ <p>New user? <%= link_to("Sign up now!", new_user_path) %></p>
+</div>
diff --git a/blue.yaml b/blue.yaml
deleted file mode 100644
index 720fa14..0000000
--- a/blue.yaml
+++ /dev/null
@@ -1,200 +0,0 @@
----
-M9Fumjaa:
- level: 16
- goldEarned: 11160
- numDeaths: 6
- minionsKilled: 80
- championsKilled: 4
- goldSpent: 10405
- totalDamageDealt: 86661
- totalDamageTaken: 18253
- team: 100
- win: true
- neutralMinionsKilled: 8
- largestMultiKill: 1
- physicalDamageDealtPlayer: 52332
- magicDamageDealtPlayer: 34328
- physicalDamageTaken: 9855
- magicDamageTaken: 8323
- largestCriticalStrike: 611
- timePlayed: 2437
- totalHeal: 467
- totalUnitsHealed: 1
- assists: 8
- item0: 3087
- item1: 3254
- item2: 3031
- item3: 3086
- item4: 1018
- item6: 3341
- sightWardsBought: 3
- visionWardsBought: 2
- magicDamageDealtToChampions: 9814
- physicalDamageDealtToChampions: 6069
- totalDamageDealtToChampions: 15883
- trueDamageTaken: 75
- wardKilled: 5
- wardPlaced: 5
- neutralMinionsKilledEnemyJungle: 1
- neutralMinionsKilledYourJungle: 7
- totalTimeCrowdControlDealt: 593
-spikevsnaruto:
- level: 17
- goldEarned: 11608
- numDeaths: 7
- turretsKilled: 3
- minionsKilled: 133
- championsKilled: 3
- goldSpent: 11275
- totalDamageDealt: 97547
- totalDamageTaken: 34598
- doubleKills: 1
- killingSprees: 1
- largestKillingSpree: 3
- team: 100
- win: true
- neutralMinionsKilled: 11
- largestMultiKill: 2
- physicalDamageDealtPlayer: 58212
- magicDamageDealtPlayer: 38603
- physicalDamageTaken: 24930
- magicDamageTaken: 8900
- timePlayed: 2437
- totalHeal: 198
- totalUnitsHealed: 1
- assists: 6
- item0: 3083
- item1: 3074
- item2: 3143
- item4: 1001
- item6: 3340
- magicDamageDealtToChampions: 6017
- physicalDamageDealtToChampions: 5486
- totalDamageDealtToChampions: 12235
- trueDamageDealtPlayer: 732
- trueDamageDealtToChampions: 732
- trueDamageTaken: 768
- wardPlaced: 8
- neutralMinionsKilledEnemyJungle: 5
- neutralMinionsKilledYourJungle: 6
- totalTimeCrowdControlDealt: 1128
-GoogleMaSkills:
- level: 16
- goldEarned: 12384
- numDeaths: 7
- barracksKilled: 1
- turretsKilled: 2
- minionsKilled: 107
- championsKilled: 4
- goldSpent: 12065
- totalDamageDealt: 134161
- totalDamageTaken: 34963
- killingSprees: 2
- largestKillingSpree: 2
- team: 100
- win: true
- neutralMinionsKilled: 40
- largestMultiKill: 1
- physicalDamageDealtPlayer: 122998
- magicDamageDealtPlayer: 726
- physicalDamageTaken: 28243
- magicDamageTaken: 6299
- largestCriticalStrike: 582
- timePlayed: 2437
- totalHeal: 6236
- totalUnitsHealed: 1
- assists: 8
- item0: 3035
- item1: 3046
- item2: 1037
- item3: 3072
- item4: 3006
- item5: 1018
- item6: 3340
- physicalDamageDealtToChampions: 7310
- totalDamageDealtToChampions: 7420
- trueDamageDealtPlayer: 10436
- trueDamageDealtToChampions: 110
- trueDamageTaken: 420
- wardPlaced: 9
- neutralMinionsKilledEnemyJungle: 15
- neutralMinionsKilledYourJungle: 25
- totalTimeCrowdControlDealt: 236
-james chamberlan:
- level: 18
- goldEarned: 17239
- numDeaths: 9
- barracksKilled: 1
- turretsKilled: 2
- minionsKilled: 179
- championsKilled: 14
- goldSpent: 14495
- totalDamageDealt: 212794
- totalDamageTaken: 31349
- doubleKills: 3
- tripleKills: 1
- killingSprees: 3
- largestKillingSpree: 5
- team: 100
- win: true
- neutralMinionsKilled: 24
- largestMultiKill: 3
- physicalDamageDealtPlayer: 179480
- magicDamageDealtPlayer: 31260
- physicalDamageTaken: 17890
- magicDamageTaken: 12640
- largestCriticalStrike: 898
- timePlayed: 2437
- totalHeal: 286
- totalUnitsHealed: 1
- assists: 8
- item0: 3072
- item1: 3046
- item2: 3031
- item3: 3250
- item4: 3071
- item6: 3340
- sightWardsBought: 1
- magicDamageDealtToChampions: 8376
- physicalDamageDealtToChampions: 28456
- totalDamageDealtToChampions: 37504
- trueDamageDealtPlayer: 2054
- trueDamageDealtToChampions: 672
- trueDamageTaken: 819
- wardKilled: 1
- wardPlaced: 5
- neutralMinionsKilledEnemyJungle: 4
- neutralMinionsKilledYourJungle: 20
- totalTimeCrowdControlDealt: 777
-Kaceytron:
- level: 15
- goldEarned: 9776
- numDeaths: 16
- barracksKilled: 1
- minionsKilled: 118
- goldSpent: 8245
- totalDamageDealt: 104719
- totalDamageTaken: 25219
- team: 100
- win: true
- physicalDamageDealtPlayer: 10231
- magicDamageDealtPlayer: 94127
- physicalDamageTaken: 16694
- magicDamageTaken: 8368
- timePlayed: 2437
- totalHeal: 163
- totalUnitsHealed: 1
- assists: 5
- item0: 3174
- item1: 3135
- item2: 1026
- item3: 3108
- item4: 1058
- item6: 3340
- magicDamageDealtToChampions: 13741
- physicalDamageDealtToChampions: 1933
- totalDamageDealtToChampions: 16034
- trueDamageDealtPlayer: 360
- trueDamageDealtToChampions: 360
- trueDamageTaken: 156
- totalTimeCrowdControlDealt: 372
diff --git a/doc/Sprint3-Retrospective.md b/doc/Sprint3-Retrospective.md
new file mode 100644
index 0000000..da87a05
--- /dev/null
+++ b/doc/Sprint3-Retrospective.md
@@ -0,0 +1,150 @@
+---
+title: "Team 6 - Project Leaguer: Sprint 2 Retrospective"
+author: [ Nathaniel Foy, Guntas Grewal, Tomer Kimia, Andrew Murrell, Luke Shumaker, Davis Webb ]
+---
+
+# Tasks
+
+The "size" is using the modified Fibonacci scale. A '1' is expected
+to take less than an hour. A '3' is expected to take 3-6 hours. A
+'5' should take the better part of a day or two. An 8 should take
+several days.
+
++---------------------------------------------------------+------+------------+----+
+| Tasks Implemented and Working | Size | Person\* | US |
++=========================================================+======+============+====+
+| [Intelligent Error Handling] (#error-hand) | 3 | Andrew | 3 |
++---------------------------------------------------------+------+------------+----+
+| [Search] (#search) | 5 | Tomer | 6 |
++---------------------------------------------------------+------+------------+----+
+| [Remote Game UserNames] (#remote_user) | 3 | Davis | 12 |
++---------------------------------------------------------+------+------------+----+
+| [Email verification] (#email-varify) | 8 | Luke | 2 |
++---------------------------------------------------------+------+------------+----+
+| [Alternate Scoring and pairing methods] (#alt-score-par)| 5 | G, A, D | 7,8|
++---------------------------------------------------------+------+------------+----+
+| [Tournament preference interface] (#tourn-prefer) | 3 | Andrew | 9 |
++---------------------------------------------------------+------+------------+----+
+| [More types of seeded settings] (#seed) | 2 | Andrew | 9 |
++---------------------------------------------------------+------+------------+----+
+| [Asynchronous Riot Pulls] (#async) | 5 | Nathaniel | 11 |
++---------------------------------------------------------+------+------------+----+
+| [Map out brackets scaffolding] (#brack-scaff) | 5 | Tomer | 10 |
++---------------------------------------------------------+------+------------+----+
+| [Create braket creation and submission gui] (#brack-gui)| 3 | Tomer | 10 |
++---------------------------------------------------------+------+------------+----+
+| [General Interface Cleanups] (#interface-cleean) | 2 | Tomer | 1 |
++---------------------------------------------------------+------+------------+----+
+| [Make it look professional] (#professional) | 3 | All | 1 |
++---------------------------------------------------------+------+------------+----+
+| [Expand Peer Evaluation] (#peer-expansion) | 3 | G, A, D | 7 |
++---------------------------------------------------------+------+------------+----+
+| [Private Messages] (#priv-messages) | 5 | N, L | 5 |
++---------------------------------------------------------+------+------------+----+
+| [Alerts] (#alerts) | 3 | Guntas | 4 |
++---------------------------------------------------------+------+------------+----+
+| [Project Leaguer Logo] (#logo) | spike| G, D | 1 |
++---------------------------------------------------------+------+------------+----+
+
+
+
+
++---------------------------------------------------------+------+------------+----+
+| Tasks Implemented and Not Working Well | Size | Person\* | US |
++=========================================================+======+============+====+
+TODO
+
+
+
+
++---------------------------------------------------------+------+------------+----+
+| Tasks Not Implemented | Size | Person\* | US |
++=========================================================+======+============+====+
+TODO
+
+
+
+
+# Implemented and working
+
+## Intelligent Error Handling (#error-hand)
+
+TODO
+
+## Search (#search)
+
+TODO
+
+## Remote Game UserNames (#remote_user)
+
+TODO
+
+## Email verification (#email-varify)
+
+TODO
+
+## Alternate Scoring and pairing methods (#alt-score-par)
+
+TODO
+
+## Tournament preference interface (#tourn-prefer)
+
+TODO
+
+## More types of seeded settings (#seed)
+
+TODO
+
+## Asynchronous Riot Pulls (#async)
+
+TODO
+
+## Map out brackets scaffolding (#brack-scaff)
+
+TODO
+
+## Create braket creation and submission gui (#brack-gui)
+
+TODO
+
+## General Interface Cleanups (#interface-cleean)
+
+TODO
+
+## Make it look professional (#professional)
+
+TODO
+
+## Expand Peer Evaluation (#peer-expansion)
+
+TODO
+
+## Private Messages (#priv-messages)
+
+TODO
+
+## Alerts (#alerts)
+
+TODO
+
+## Project Leaguer Logo (#logo))
+
+TODO
+
+
+
+# Implemented but not working well
+
+TODO
+
+
+
+# Not implemented
+
+TODO
+
+
+
+# How to improve
+
+TODO
diff --git a/lib/sampling/peer_review.rb b/lib/sampling/peer_review.rb
index 1aabe34..7faa241 100644
--- a/lib/sampling/peer_review.rb
+++ b/lib/sampling/peer_review.rb
@@ -5,7 +5,7 @@ module Sampling
end
def self.can_get?(setting_name)
- return setting_name.start_with?("feedback_from_") ? 2 : 0
+ return setting_name.start_with?("review_from_") ? 2 : 0
end
def self.uses_remote?
@@ -33,7 +33,7 @@ module Sampling
def render_user_interaction(user)
@user = user
@team = get_team(match)
- @feedbacks_missing = get_feedbacks_missing(match)
+ @reviews_missing = get_reviews_missing(match)
require 'erb'
erb_filename = File.join(__FILE__.sub(/\.rb$/, '.html.erb'))
@@ -46,7 +46,7 @@ module Sampling
i = 0
params[:peer_review].to_s.split(',').each do |user_name|
reviewed_user = User.find_by_user_name(user_name)
- user.statistics.create(match: @match, value: i)
+ reviewed_user.statistics.create(match: @match, name: "review_from_#{reviewing_user.user_name}", value: i)
i += 1
end
end
@@ -63,24 +63,24 @@ module Sampling
match.teams.find{|t|t.users.include?(@user)}
end
- def self.get_feedbacks(match)
+ def self.get_reviews(match)
ret = {}
- match.statistiscs.where("'name' LIKE 'feedback_from_%'").each do |statistic|
+ match.statistiscs.where("'name' LIKE 'review_from_%'").each do |statistic|
ret[statistic.user] ||= {}
- ret[statistic.user][User.find_by_user_name(statistic.name.sub(/^feedback_from_/,''))] = statistic.value
+ ret[statistic.user][User.find_by_user_name(statistic.name.sub(/^review_from_/,''))] = statistic.value
end
return ret
end
- def self.get_feedbacks_missing(match)
+ def self.get_reviews_missing(match)
require 'set'
ret = Set.new
- feedback = get_feedbacks(match)
+ review = get_reviews(match)
users = get_users(match)
- feedback.each do |feedback|
- (users - feedback.keys).each do |user|
+ review.each do |review|
+ (users - review.keys).each do |user|
ret.add(user)
end
end
diff --git a/lib/scoring/README.md b/lib/scoring/README.md
index dce71d0..efdc3cc 100644
--- a/lib/scoring/README.md
+++ b/lib/scoring/README.md
@@ -4,7 +4,7 @@ Scoring interface
Files in this directory should be _modules_ implementing the following
interface:
- - `stats_needed(Match) => Array[]=Symbol`
+ - `stats_needed(Match) => Array[]=String`
Returns which statistics need to be collected for this scoring
algorithm.
diff --git a/lib/scoring/fibonacci_peer_with_blowout.rb b/lib/scoring/fibonacci_peer_with_blowout.rb
index 9d72643..a13d76c 100644
--- a/lib/scoring/fibonacci_peer_with_blowout.rb
+++ b/lib/scoring/fibonacci_peer_with_blowout.rb
@@ -1,15 +1,17 @@
module Scoring
module FibonacciPeerWithBlowout
- def self.stats_needed
- return ["votes", "win", "blowout"]
+ def self.stats_needed(match)
+ return ["votes", "win", "blowout"] + match.users.map{|u|"review_from_#{u.user_name}"}
end
def self.score(match)
scores = {}
match.users.each do |user|
- stats = Statistic.where(user: user, match: match)
-
- votes = stats.where(name: "votes" ).first.value
+ stats = user.statistics.where(match: match)
+ votes = 0
+ match.users.each do |u|
+ votes += convert_place_to_votes stats.where(name: "review_from_#{u.user_name}").first.value
+ end
win = stats.where(name: "win" ).first.value
blowout = stats.where(name: "blowout").first.value
scores[user] = self.score_user(votes, win, blowout)
@@ -23,5 +25,9 @@ module Scoring
fibonacci = Hash.new { |h,k| h[k] = k < 2 ? k : h[k-1] + h[k-2] }
fibonacci[votes+3] + (win ? blowout ? 12 : 10 : blowout ? 5 : 7)
end
+
+ def self.convert_place_to_votes(place)
+ (place == 0 or place == 1) ? 1 : 0
+ end
end
end
diff --git a/lib/scoring/marginal_peer.rb b/lib/scoring/marginal_peer.rb
index 8559b3d..f2c0272 100644
--- a/lib/scoring/marginal_peer.rb
+++ b/lib/scoring/marginal_peer.rb
@@ -1,6 +1,6 @@
module Scoring
module MarginalPeer
- def self.stats_needed
+ def self.stats_needed(match)
return ["rating", "win"]
end
diff --git a/lib/scoring/winner_takes_all.rb b/lib/scoring/winner_takes_all.rb
index c807cba..6cffb28 100644
--- a/lib/scoring/winner_takes_all.rb
+++ b/lib/scoring/winner_takes_all.rb
@@ -1,6 +1,6 @@
module Scoring
module WinnerTakesAll
- def self.stats_needed
+ def self.stats_needed(match)
return ["win"]
end
diff --git a/purple.yaml b/purple.yaml
deleted file mode 100644
index 0413cde..0000000
--- a/purple.yaml
+++ /dev/null
@@ -1,194 +0,0 @@
----
-Sytrie:
- level: 16
- goldEarned: 9257
- numDeaths: 7
- turretsKilled: 1
- minionsKilled: 57
- championsKilled: 4
- goldSpent: 8025
- totalDamageDealt: 71437
- totalDamageTaken: 20413
- killingSprees: 1
- largestKillingSpree: 2
- team: 200
- win: false
- largestMultiKill: 1
- physicalDamageDealtPlayer: 15947
- magicDamageDealtPlayer: 55489
- physicalDamageTaken: 12706
- magicDamageTaken: 7567
- timePlayed: 2437
- totalHeal: 566
- totalUnitsHealed: 1
- assists: 11
- item0: 3027
- item1: 3020
- item2: 1056
- item3: 3135
- item4: 1026
- item6: 3340
- sightWardsBought: 3
- visionWardsBought: 1
- magicDamageDealtToChampions: 19109
- physicalDamageDealtToChampions: 1682
- totalDamageDealtToChampions: 20791
- trueDamageTaken: 140
- wardPlaced: 12
- totalTimeCrowdControlDealt: 77
-Derpanator115:
- level: 17
- goldEarned: 13648
- numDeaths: 7
- turretsKilled: 2
- minionsKilled: 218
- championsKilled: 10
- goldSpent: 12885
- totalDamageDealt: 161790
- totalDamageTaken: 27265
- killingSprees: 3
- largestKillingSpree: 4
- team: 200
- win: false
- largestMultiKill: 1
- physicalDamageDealtPlayer: 158065
- magicDamageDealtPlayer: 3724
- physicalDamageTaken: 16740
- magicDamageTaken: 10176
- largestCriticalStrike: 834
- timePlayed: 2437
- totalHeal: 2442
- totalUnitsHealed: 1
- assists: 12
- item0: 3035
- item1: 3072
- item2: 3250
- item3: 3031
- item4: 1028
- item6: 3340
- magicDamageDealtToChampions: 2286
- physicalDamageDealtToChampions: 21244
- totalDamageDealtToChampions: 23531
- trueDamageTaken: 348
- wardKilled: 2
- wardPlaced: 9
- totalTimeCrowdControlDealt: 90
-Wlknexe56:
- level: 16
- goldEarned: 11547
- numDeaths: 4
- minionsKilled: 144
- championsKilled: 10
- goldSpent: 12285
- totalDamageDealt: 112047
- totalDamageTaken: 19254
- killingSprees: 3
- largestKillingSpree: 5
- team: 200
- win: false
- largestMultiKill: 1
- physicalDamageDealtPlayer: 101821
- magicDamageDealtPlayer: 8983
- physicalDamageTaken: 10827
- magicDamageTaken: 7883
- largestCriticalStrike: 805
- timePlayed: 2437
- totalHeal: 1526
- totalUnitsHealed: 1
- assists: 10
- item0: 3270
- item1: 3035
- item2: 3074
- item3: 3071
- item4: 1031
- item6: 3340
- magicDamageDealtToChampions: 3039
- physicalDamageDealtToChampions: 21523
- totalDamageDealtToChampions: 25804
- trueDamageDealtPlayer: 1242
- trueDamageDealtToChampions: 1242
- trueDamageTaken: 544
- wardPlaced: 10
- totalTimeCrowdControlDealt: 49
-DVisionzz:
- level: 18
- goldEarned: 12520
- numDeaths: 5
- barracksKilled: 2
- turretsKilled: 1
- minionsKilled: 53
- championsKilled: 12
- goldSpent: 11353
- totalDamageDealt: 156993
- totalDamageTaken: 25675
- doubleKills: 1
- killingSprees: 2
- largestKillingSpree: 7
- team: 200
- win: false
- neutralMinionsKilled: 69
- largestMultiKill: 2
- physicalDamageDealtPlayer: 113041
- magicDamageDealtPlayer: 34822
- physicalDamageTaken: 21062
- magicDamageTaken: 4546
- largestCriticalStrike: 595
- timePlayed: 2437
- totalHeal: 6278
- totalUnitsHealed: 1
- assists: 4
- item0: 3160
- item1: 3260
- item2: 3078
- item3: 1036
- item4: 3172
- item5: 1011
- item6: 3340
- magicDamageDealtToChampions: 2229
- physicalDamageDealtToChampions: 17146
- totalDamageDealtToChampions: 19606
- trueDamageDealtPlayer: 9129
- trueDamageDealtToChampions: 231
- trueDamageTaken: 66
- wardPlaced: 13
- neutralMinionsKilledEnemyJungle: 26
- neutralMinionsKilledYourJungle: 43
- totalTimeCrowdControlDealt: 180
-HYP3RTONIC:
- level: 17
- goldEarned: 10739
- numDeaths: 3
- minionsKilled: 101
- championsKilled: 9
- goldSpent: 10275
- totalDamageDealt: 80887
- totalDamageTaken: 22178
- killingSprees: 1
- largestKillingSpree: 8
- team: 200
- win: false
- neutralMinionsKilled: 9
- largestMultiKill: 1
- physicalDamageDealtPlayer: 31149
- magicDamageDealtPlayer: 49738
- physicalDamageTaken: 13555
- magicDamageTaken: 7847
- timePlayed: 2437
- totalHeal: 1514
- totalUnitsHealed: 1
- assists: 11
- item0: 1056
- item1: 3255
- item2: 3135
- item3: 3027
- item4: 3003
- item5: 1028
- item6: 3340
- magicDamageDealtToChampions: 17867
- physicalDamageDealtToChampions: 3182
- totalDamageDealtToChampions: 21050
- trueDamageTaken: 776
- wardPlaced: 8
- neutralMinionsKilledEnemyJungle: 6
- neutralMinionsKilledYourJungle: 3
- totalTimeCrowdControlDealt: 62