From 96c97c7042ca82d0352ab92204fe118329c4d372 Mon Sep 17 00:00:00 2001 From: David Joerg Date: Sat, 21 Feb 2015 10:26:16 -0500 Subject: [PATCH 01/59] wtf --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 196800e..3986ad4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -138,4 +138,5 @@ # 404 match "*path" => 'application#not_found' + match "foo" => 'bar' end From eb337b579da2a39af15599540b25bece9546ce83 Mon Sep 17 00:00:00 2001 From: David Joerg Date: Tue, 3 Mar 2015 14:16:21 -0500 Subject: [PATCH 02/59] keep IP cache in memory rather than on disk --- config/initializers/rack-attack.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb index 50508f3..dc588ae 100644 --- a/config/initializers/rack-attack.rb +++ b/config/initializers/rack-attack.rb @@ -1,6 +1,8 @@ # In config/initializers/rack-attack.rb class Rack::Attack + Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new + throttle('req/ip', :limit => 300, :period => 5.minutes) do |req| req.ip # unless req.path.starts_with?('/assets') end From e990ea22fa322be50c53ca4152b42fef11811032 Mon Sep 17 00:00:00 2001 From: David Joerg Date: Thu, 26 Mar 2015 17:05:27 -0400 Subject: [PATCH 03/59] update for rest-client vulnerability --- Gemfile.lock | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e3717ff..28c8a64 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -119,6 +119,8 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.2.4) + domain_name (0.5.23) + unf (>= 0.0.5, < 1.0.0) ejs (1.1.1) erubis (2.7.0) execjs (2.0.2) @@ -141,6 +143,8 @@ GEM hashie (3.2.0) hike (1.2.3) hirb (0.7.1) + http-cookie (1.0.2) + domain_name (~> 0.5) i18n (0.6.11) jbuilder (1.5.2) activesupport (>= 3.0.0) @@ -168,7 +172,7 @@ GEM multipart-post (2.0.0) mysql2 (0.3.13) net-http-spy (0.2.1) - netrc (0.7.7) + netrc (0.10.3) newrelic_rpm (3.9.1.236) nokogiri (1.6.1) mini_portile (~> 0.5.0) @@ -225,7 +229,8 @@ GEM redis-namespace (~> 1.2) sinatra (>= 0.9.2) vegas (~> 0.1.2) - rest-client (1.7.2) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) rspec (2.14.1) @@ -273,6 +278,9 @@ GEM uglifier (2.3.0) execjs (>= 0.3.0) json (>= 1.8.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.6) unicorn (1.1.5) rack uuidtools (2.1.4) From 757ac379ce67f23affe8d4ed7254d2a6a01287f4 Mon Sep 17 00:00:00 2001 From: David Joerg Date: Fri, 19 Jun 2015 17:23:45 -0400 Subject: [PATCH 04/59] security update yay --- Gemfile | 2 +- Gemfile.lock | 62 ++++++++++++++++++++++++++-------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Gemfile b/Gemfile index 8bb32e7..b5cd3de 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' ruby '1.9.3' -gem 'rails', '3.2.21' +gem 'rails', '3.2.22' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index 28c8a64..5a42e31 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,12 +46,12 @@ GEM remote: https://rubygems.org/ specs: aasm (3.0.23) - actionmailer (3.2.21) - actionpack (= 3.2.21) + actionmailer (3.2.22) + actionpack (= 3.2.22) mail (~> 2.5.4) - actionpack (3.2.21) - activemodel (= 3.2.21) - activesupport (= 3.2.21) + actionpack (3.2.22) + activemodel (= 3.2.22) + activesupport (= 3.2.22) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -70,18 +70,18 @@ GEM json (~> 1.7) money (< 6.0.0) nokogiri (~> 1.4) - activemodel (3.2.21) - activesupport (= 3.2.21) + activemodel (3.2.22) + activesupport (= 3.2.22) builder (~> 3.0.0) - activerecord (3.2.21) - activemodel (= 3.2.21) - activesupport (= 3.2.21) + activerecord (3.2.22) + activemodel (= 3.2.22) + activesupport (= 3.2.22) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.21) - activemodel (= 3.2.21) - activesupport (= 3.2.21) - activesupport (3.2.21) + activeresource (3.2.22) + activemodel (= 3.2.22) + activesupport (= 3.2.22) + activesupport (3.2.22) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) arel (3.0.3) @@ -153,7 +153,7 @@ GEM jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.1) + json (1.8.3) juggernaut (2.1.1) redis listen (1.1.6) @@ -168,7 +168,7 @@ GEM money (5.1.1) i18n (~> 0.6.0) mono_logger (1.1.0) - multi_json (1.10.1) + multi_json (1.11.1) multipart-post (2.0.0) mysql2 (0.3.13) net-http-spy (0.2.1) @@ -186,7 +186,7 @@ GEM aws-sdk (>= 1.2.0) paperclip (>= 2.5.0) polyglot (0.3.5) - rack (1.4.5) + rack (1.4.7) rack-attack (4.2.0) rack rack-cache (1.2) @@ -195,24 +195,24 @@ GEM rack rack-ssl (1.3.4) rack - rack-test (0.6.2) + rack-test (0.6.3) rack (>= 1.0) - rails (3.2.21) - actionmailer (= 3.2.21) - actionpack (= 3.2.21) - activerecord (= 3.2.21) - activeresource (= 3.2.21) - activesupport (= 3.2.21) + rails (3.2.22) + actionmailer (= 3.2.22) + actionpack (= 3.2.22) + activerecord (= 3.2.22) + activeresource (= 3.2.22) + activesupport (= 3.2.22) bundler (~> 1.0) - railties (= 3.2.21) - railties (3.2.21) - actionpack (= 3.2.21) - activesupport (= 3.2.21) + railties (= 3.2.22) + railties (3.2.22) + actionpack (= 3.2.22) + activesupport (= 3.2.22) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.3.2) + rake (10.4.2) rb-fsevent (0.9.3) rb-inotify (0.9.2) ffi (>= 0.5.0) @@ -274,7 +274,7 @@ GEM treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.42) + tzinfo (0.3.44) uglifier (2.3.0) execjs (>= 0.3.0) json (>= 1.8.0) @@ -322,7 +322,7 @@ DEPENDENCIES paperclip paperclip-aws rack-attack - rails (= 3.2.21) + rails (= 3.2.22) rails-dev-boost! resque rspec From 60517c6819643e977603413bef17bfe550d9c1f6 Mon Sep 17 00:00:00 2001 From: David Joerg Date: Fri, 17 Jul 2015 17:20:35 -0400 Subject: [PATCH 05/59] enable "remember me" because some users just like it --- app/assets/stylesheets/ui/dialogs.css.scss | 9 ++++++++- app/views/dialogs/_join_aio.html.erb | 6 +++++- config/initializers/devise.rb | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/ui/dialogs.css.scss b/app/assets/stylesheets/ui/dialogs.css.scss index 8d25a7d..7ea8ad2 100644 --- a/app/assets/stylesheets/ui/dialogs.css.scss +++ b/app/assets/stylesheets/ui/dialogs.css.scss @@ -146,9 +146,16 @@ $dialog-inner-width: $dialog-width - $dialog-padding * 2; } } + #remember { + font-size: 12px; + display: inline-block; + word-spacing: 0px; + vertical-align: bottom; + } + li.action { // width: ($dialog-inner-width * 0.30); - width: 30%; + // width: 20px; button { @include button2(lighten(desaturate(green, 15%), 35%), black); diff --git a/app/views/dialogs/_join_aio.html.erb b/app/views/dialogs/_join_aio.html.erb index d566f88..b5bc1ee 100644 --- a/app/views/dialogs/_join_aio.html.erb +++ b/app/views/dialogs/_join_aio.html.erb @@ -23,7 +23,11 @@ <% end %> <%= f.inputs do %> - <%= f.input :password, :label => false, :input_html => {:placeholder => 'Password'} %> + <%= f.input :password, :label => false, :input_html => {:placeholder => 'Password'} %> +
+ <%= f.check_box :remember_me, :label => :remember_me %> + Remember me +
<%= f.action :submit, :as => :button, :label => 'login' %> <% end %> <% end %> diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index f5f225d..5916315 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -105,7 +105,7 @@ # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks + config.remember_for = 90.days # If true, extends the user's remember period when remembered via cookie. # config.extend_remember_period = false From 122e0bab1c35291e3f27668f0692b14b0b1faec4 Mon Sep 17 00:00:00 2001 From: eric-hu Date: Wed, 22 Jul 2015 19:11:10 +0700 Subject: [PATCH 06/59] Simplify "basic installation" notes Use the Rails-provided rake task for creating the dev database. Change database-schema loading instructions, which is more future-proof. Running migrations on the latest build resulted in this schema.rb difference: $ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: ../db/schema.rb no changes added to commit (use "git add" and/or "git commit -a") $ cd .. $ git diff diff --git a/db/schema.rb b/db/schema.rb index 6c263e3..904a869 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -95,7 +95,6 @@ ActiveRecord::Schema.define(:version => 20131101180159) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.string "handle" - t.boolean "anonymous", :default => false t.boolean "guest", :default => false t.datetime "processing_timestamp" t.string "access_token" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b0bd96a..9462591 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ On Mac OSX, you can use homebrew as package manager: http://mxcl.github.com/home * Copy and adjust database configuration (`cp config/database.yml.example config/database.yml`) * Copy secrets configuration (`cp config/secrets.yml.example config/secrets.yml`) * Copy s3 configuration (`cp config/s3.yml.example config/s3.yml`) - * Create the database ggtracker needs (`mysql -u root` and then `create database ggtracker_development;` and then `quit`) - * Run migrations (`bundle exec rake db:migrate`) + * Create the database ggtracker needs (`rake db:create`) + * Load the latest database schema (`bundle exec rake db:schema:load`) If you want to be able to upload replays, you'll need to have an Amazon S3 account. After setting that up, edit your config/s3.yml From fefac70c107268575c7937ae60ad15b4e874c4d5 Mon Sep 17 00:00:00 2001 From: eric-hu Date: Wed, 22 Jul 2015 19:48:18 +0700 Subject: [PATCH 07/59] Simplify test preparation notes --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 9462591..0d15bbc 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,7 @@ find each other correctly. #### Ruby (rspec) The first time you run tests, set up the test database with: - * `mysql -u root` - ** `create database ggtracker_test;` - ** `quit` + * `rake db:create` * `rake db:test:prepare` To run tests: `bundle exec rspec` From b0fdd28ecca64156893ae92e2a405c4510d1b990 Mon Sep 17 00:00:00 2001 From: David Joerg Date: Wed, 22 Jul 2015 09:24:40 -0400 Subject: [PATCH 08/59] user model should not have an anonymous field, it is unused --- db/schema.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 6c263e3..904a869 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -95,7 +95,6 @@ t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.string "handle" - t.boolean "anonymous", :default => false t.boolean "guest", :default => false t.datetime "processing_timestamp" t.string "access_token" From 90b7c529482e7a1a8ed5df38a8b4ea9b23d8bc72 Mon Sep 17 00:00:00 2001 From: Eric Hu Date: Wed, 22 Jul 2015 19:35:53 +0700 Subject: [PATCH 09/59] Configure simplecov to ignore spec folder Reduce noise in code coverage output. All spec files are run 100% in the test suite. This lowers the overall code coverage number...sorry :D --- spec/spec_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a2df784..1db7861 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,9 @@ # SimpleCov is ..rcov for 1.9+ # https://github.com/colszowka/simplecov require 'simplecov' -SimpleCov.start +SimpleCov.start do + add_filter "/spec/" +end # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' From c9e3560e61d89bb10f3a221313d0ffa77cb53ed1 Mon Sep 17 00:00:00 2001 From: Eric Hu Date: Mon, 3 Aug 2015 20:08:00 +0700 Subject: [PATCH 10/59] Add unit display on timeline for AI (1v1 only) --- app/assets/javascripts/angular/resources/match.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/angular/resources/match.js b/app/assets/javascripts/angular/resources/match.js index 7d51600..983948a 100644 --- a/app/assets/javascripts/angular/resources/match.js +++ b/app/assets/javascripts/angular/resources/match.js @@ -245,6 +245,8 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc this.entityIds = []; this.teams = {}; + var twoPlayerMatch = this.playerCount === 2; + for(var ei in this.entities) { // console.log("ei", ei, this.armies_by_frame, this.entities, this.entities[ei].identity.name); if (this.armies_by_frame && this.entities[ei].identity) { @@ -255,6 +257,8 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc } else if (this.entities[ei].identity.id in this.armies_by_frame) { entityArmy = this.armies_by_frame[this.entities[ei].identity.id]; // console.log("got abf for ei by id", ei, entityArmy); + } else if (this.entities[ei].identity.name.match(/A.I./) && twoPlayerMatch) { + entityArmy = this.armies_by_frame[0]; } this.entities[ei].armies_by_frame = entityArmy; } From 6017b9db5c9d00b7bf02470134a40227b888a4e2 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Wed, 7 Oct 2015 12:01:26 -0400 Subject: [PATCH 11/59] disable upload for now --- app/views/layouts/application.html.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2c40ee3..2807bf7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -168,12 +168,17 @@ _\%_____/\%_____/\%_____/\%_/ /\%___fx/\%_____/\__/ /\%_____/\__/ /.com_
From 2d8223d6421eb4ad54aa760da52f574e5343344f Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Fri, 13 Nov 2015 11:15:32 -0500 Subject: [PATCH 17/59] note no Archon mode --- app/views/home/replay_problems.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/replay_problems.html.erb b/app/views/home/replay_problems.html.erb index 63f9502..1ee3ae2 100644 --- a/app/views/home/replay_problems.html.erb +++ b/app/views/home/replay_problems.html.erb @@ -8,8 +8,8 @@

Sorry, we had trouble reading the replays you uploaded.

-

If these were ordinary ladder WoL/HotS Starcraft 2 replay files, please let me know and I'll take a closer look.

-

LotV is not supported, but it will be in time for the official launch.

+

If these were ordinary ladder Starcraft 2 replay files, please let me know and I'll take a closer look.

+

(Note that Archon mode is not supported TT)
















dont click hereor here
From f60fff64ad0e1447b1b578defa6219acc4feec24 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Fri, 13 Nov 2015 11:16:16 -0500 Subject: [PATCH 18/59] note no Archon mode --- app/views/home/replay_problems.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/replay_problems.html.erb b/app/views/home/replay_problems.html.erb index b212ecf..1ee3ae2 100644 --- a/app/views/home/replay_problems.html.erb +++ b/app/views/home/replay_problems.html.erb @@ -8,8 +8,8 @@

Sorry, we had trouble reading the replays you uploaded.

-

If these were ordinary ladder WoL/HotS Starcraft 2 replay files, please let me know and I'll take a closer look.

-

LotV is supported now, but there may be bugs so please let me know.

+

If these were ordinary ladder Starcraft 2 replay files, please let me know and I'll take a closer look.

+

(Note that Archon mode is not supported TT)
















dont click hereor here
From 3c4cf6ffa5ed7ed242af30146464b1a6ddbaae17 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Tue, 17 Nov 2015 10:11:38 -0500 Subject: [PATCH 19/59] update stats to be for LotV instead of HotS. remove desrow and WCS from main menu --- app/views/home/economy_stats.html | 2 +- app/views/home/economy_stats2.html | 2 +- app/views/layouts/application.html.erb | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/home/economy_stats.html b/app/views/home/economy_stats.html index 5ef4c3a..62098c2 100644 --- a/app/views/home/economy_stats.html +++ b/app/views/home/economy_stats.html @@ -67,7 +67,7 @@

See more about Saturation Speed here.

-

All games are 1v1 HotS Ladder, vs-AI excluded, from May 8, 2013 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

+

All games are 1v1 LotV Ladder, vs-AI excluded, from Nov 9, 2015 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

Stats are updated once per day.

Alternate view: all matchups, one league

diff --git a/app/views/home/economy_stats2.html b/app/views/home/economy_stats2.html index 40a25bc..05e6657 100644 --- a/app/views/home/economy_stats2.html +++ b/app/views/home/economy_stats2.html @@ -66,7 +66,7 @@

See more about Saturation Speed here.

-

All games are 1v1 HotS Ladder, vs-AI excluded, from May 8, 2013 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

+

All games are 1v1 LotV Ladder, vs-AI excluded, from Nov 9, 2015 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

Stats are updated once per day.

Alternate view: one matchup, all leagues

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2c40ee3..b309504 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -135,8 +135,6 @@ _\%_____/\%_____/\%_____/\%_/ /\%___fx/\%_____/\__/ /\%_____/\__/ /.com_
  • Spending Skill Stats
  • Economy Stats
  • TheStaircase Benchmarks
  • -
  •  Gold Speed Ahead with desRow
  • -
  • WCS matches
  •  
  • Frequently Asked Questions
  • From f2c0084984083245e64c596868113ff3402ad877 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Tue, 17 Nov 2015 10:15:00 -0500 Subject: [PATCH 20/59] update stats to LotV. remove desrow and WCS. --- app/views/home/economy_stats.html | 2 +- app/views/home/economy_stats2.html | 2 +- app/views/layouts/application.html.erb | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/home/economy_stats.html b/app/views/home/economy_stats.html index 5ef4c3a..62098c2 100644 --- a/app/views/home/economy_stats.html +++ b/app/views/home/economy_stats.html @@ -67,7 +67,7 @@

    See more about Saturation Speed here.

    -

    All games are 1v1 HotS Ladder, vs-AI excluded, from May 8, 2013 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

    +

    All games are 1v1 LotV Ladder, vs-AI excluded, from Nov 9, 2015 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

    Stats are updated once per day.

    Alternate view: all matchups, one league

    diff --git a/app/views/home/economy_stats2.html b/app/views/home/economy_stats2.html index 40a25bc..05e6657 100644 --- a/app/views/home/economy_stats2.html +++ b/app/views/home/economy_stats2.html @@ -66,7 +66,7 @@

    See more about Saturation Speed here.

    -

    All games are 1v1 HotS Ladder, vs-AI excluded, from May 8, 2013 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

    +

    All games are 1v1 LotV Ladder, vs-AI excluded, from Nov 9, 2015 to {{ es['PvP'][1].retrieval_time | date:'MMM d, y'}}.

    Stats are updated once per day.

    Alternate view: one matchup, all leagues

    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2c40ee3..b309504 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -135,8 +135,6 @@ _\%_____/\%_____/\%_____/\%_/ /\%___fx/\%_____/\__/ /\%_____/\__/ /.com_
  • Spending Skill Stats
  • Economy Stats
  • TheStaircase Benchmarks
  • -
  •  Gold Speed Ahead with desRow
  • -
  • WCS matches
  •  
  • Frequently Asked Questions
  • From 9c9ca71de6e3989794a79593a152b0b525c91d3c Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Thu, 3 Dec 2015 16:56:06 -0500 Subject: [PATCH 21/59] hide race-macro and creep spread stuff because its broken currently --- .../stylesheets/controllers/players.css.scss | 1 + app/views/layouts/application.html.erb | 2 -- app/views/matches/show.html.erb | 26 ------------------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/app/assets/stylesheets/controllers/players.css.scss b/app/assets/stylesheets/controllers/players.css.scss index 410a48c..b8847dd 100644 --- a/app/assets/stylesheets/controllers/players.css.scss +++ b/app/assets/stylesheets/controllers/players.css.scss @@ -162,6 +162,7 @@ tr th, tr td { padding: 4px 4px; } + .racemacro, .creep_spread { display: none; } } #player .matches table.staircase { diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b309504..4b43993 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -141,8 +141,6 @@ _\%_____/\%_____/\%_____/\%_/ /\%___fx/\%_____/\__/ /\%_____/\__/ /.com_
  • Spending Skill
  • Saturation Speed
  • Auto Uploader
  • -
  • Race-Specific Macro
  • -
  • All About Larva Injects
  • FAQ in Deutsch
  •  
  • diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 98c7154..3f54b5e 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -261,33 +261,7 @@ completed to when 3x640 = 1920 minerals per minute income is achieved." data-gra bases - - - - {{ entity.identity.name }}'s inject timing ({{ entity.race_macro_pretty() }}%) - - - - - - creep spread - - - - - - {{ entity.identity.name }}'s chronoboosts
    and nexus energy maxouts ({{ entity.race_macro_pretty() }}%) -
    -
    -
    - - - - {{ entity.identity.name }}'s Orbital Command
    usage and energy maxouts ({{ entity.race_macro_pretty() }}%) -
    -
    -
    <% end %> <% if signed_in? %> From e3b3908ec7230448247ee591adcf51f7476205de Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Tue, 22 Dec 2015 20:21:11 -0500 Subject: [PATCH 22/59] update staircase for LotV --- app/views/home/econ_staircase.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/home/econ_staircase.html b/app/views/home/econ_staircase.html index d2c5d6a..329ab27 100644 --- a/app/views/home/econ_staircase.html +++ b/app/views/home/econ_staircase.html @@ -51,7 +51,7 @@

    See more about TheStaircase and Saturation Speed.

    -

    Games are 1v1 HotS Ladder, vs-AI excluded, from May 8, 2013 to {{ es['now'] | date:'MMM d, y'}}.

    +

    Games are 1v1 LotV Ladder, vs-AI excluded, over the past 180 days.

    Benchmarks are set by calculating the median time for the given matchup and league. The times are then adjusted to the best-fit line from Silver to Masters using a standard least-squares regression. (In the rare case when the best-fit line slopes the wrong way, we use the Masters time for all leagues)

    Stats are updated once per day.

    From 3d5d759e2455f351fa6476741f27aa8a90832cae Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Sun, 10 Jan 2016 21:50:10 -0500 Subject: [PATCH 23/59] put race macro charts back in so JP can see them which will help him debug --- app/views/matches/show.html.erb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 3f54b5e..eb31482 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -261,7 +261,33 @@ completed to when 3x640 = 1920 minerals per minute income is achieved." data-gra bases + + + + {{ entity.identity.name }}'s inject timing ({{ entity.race_macro_pretty() }}%) + + + + + + creep spread + + + + + + {{ entity.identity.name }}'s chronoboosts
    and nexus energy maxouts ({{ entity.race_macro_pretty() }}%) +
    +
    +
    + + + + {{ entity.identity.name }}'s Orbital Command
    usage and energy maxouts ({{ entity.race_macro_pretty() }}%) +
    +
    +
    <% end %> <% if signed_in? %> From 59a0b245f449ae761c44706b0078e60ddddf0633 Mon Sep 17 00:00:00 2001 From: Anders Nickelsen Date: Mon, 11 Apr 2016 13:08:35 +0000 Subject: [PATCH 24/59] Run ggtracker in Vagrant. --- Gemfile | 2 +- Gemfile.lock | 12 +++++++++--- README.md | 13 +++++++++++++ Vagrantfile | 13 +++++++++++++ setup-vagrantbox.sh | 12 ++++++++++++ 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 Vagrantfile create mode 100644 setup-vagrantbox.sh diff --git a/Gemfile b/Gemfile index f12d598..5c48fed 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem 'rails', '3.2.22' gem 'mysql2' -gem 'unicorn', '1.1.5' +gem 'unicorn' # Gems used only for assets and not required # in production environments by default. diff --git a/Gemfile.lock b/Gemfile.lock index 5869570..cdc043e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -157,6 +157,7 @@ GEM json (1.8.3) juggernaut (2.1.1) redis + kgio (2.10.0) listen (1.1.6) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) @@ -213,6 +214,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) + raindrops (0.16.0) rake (10.4.2) rb-fsevent (0.9.3) rb-inotify (0.9.2) @@ -282,8 +284,9 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.6) - unicorn (1.1.5) - rack + unicorn (5.1.0) + kgio (~> 2.6) + raindrops (~> 0.7) uuidtools (2.1.4) vegas (0.1.11) rack (>= 1.0.0) @@ -332,4 +335,7 @@ DEPENDENCIES simplecov uglifier (>= 1.0.3) unf_ext (= 0.0.6) - unicorn (= 1.1.5) + unicorn + +BUNDLED WITH + 1.11.2 diff --git a/README.md b/README.md index 0d15bbc..0bb2c08 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,19 @@ The other repos involved in ggtracker are: used by this codebase +### Running with vagrant +You can either run ggtracker in a vagrant-controlled virtualbox or on your host operating system (described after this section). +To run with vagrant run the following commands: + + * Make sure you have vagrant+virtualbox installed on your computer + * Run `vagrant up` to create the virtual box + * Run `vagrant ssh` to ssh into the vagrant box + * Run `ssh-keygen` in the vagrant box to generate ssh-keys for github + * Upload your public keys to Github + * Clone `ggtracker` project to `vagrant` user's home directory in the vagrant box + * Run the installation and updating steps below + * The app will be on the vagrant box's ip instead of localhost. + ### Requirements * Ruby 1.9+ (get RVM: https://rvm.io/) diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..6f65c9d --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,13 @@ +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.network :private_network, type: "dhcp" + config.vm.hostname = "ggtracker" + + config.vm.provision "shell", path: "setup-vagrantbox.sh" + + config.vm.provider :virtualbox do |vb| + vb.memory = 1536 + vb.cpus = 2 + vb.name = "ggtracker" + end +end diff --git a/setup-vagrantbox.sh b/setup-vagrantbox.sh new file mode 100644 index 0000000..6b1e38f --- /dev/null +++ b/setup-vagrantbox.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +add-apt-repository ppa:chris-lea/redis-server -y + +apt-get update + +apt-get install -y ruby redis-server nodejs npm mysql-server git-core ruby-dev libcurl4-openssl-dev libmysqlclient-dev build-essential libxml2-dev libxslt-dev + +gem install bundler +npm install -g juggernaut From 7706245151bd92954763723fc4425520adb1af11 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Wed, 13 Apr 2016 09:04:45 -0400 Subject: [PATCH 25/59] only do setdocdomain when we have an actual hostname, not just an IP address --- app/assets/javascripts/setdocdomain.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/setdocdomain.js b/app/assets/javascripts/setdocdomain.js index 388db33..e192408 100644 --- a/app/assets/javascripts/setdocdomain.js +++ b/app/assets/javascripts/setdocdomain.js @@ -1,4 +1,8 @@ // Proxino.log("gg.js domain was " + document.domain); // weird, was ggtracker.com even though script was served via CDN -document.domain = /(\w+)(.\w+)?$/.exec(location.hostname)[0]; +if (location.hostname.match(/^[0-9.]*$/) == null) { + // only set document.domain if our location is a hostname like ggtracker.com or + // ggtracker.test. But if it's an IP address, dont bother. + document.domain = /(\w+)(.\w+)?$/.exec(location.hostname)[0]; +} // Proxino.log("now gg.js domain is " + document.domain); From e1417dca01a4bd40db539e6914a24e4976d7a341 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Wed, 13 Apr 2016 09:07:42 -0400 Subject: [PATCH 26/59] sc2ranks is long gone --- app/views/players/show.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/players/show.html.erb b/app/views/players/show.html.erb index e3763c8..4948d0f 100644 --- a/app/views/players/show.html.erb +++ b/app/views/players/show.html.erb @@ -11,7 +11,6 @@

    <%= @identity.name %>

    From 9fe1307024f1aed4b177a7bd78271bbbc15db2c2 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Wed, 29 Nov 2017 12:17:32 -0500 Subject: [PATCH 49/59] start preventing uploads with a configurable percentage of uploaders --- app/assets/javascripts/gg.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/assets/javascripts/gg.js b/app/assets/javascripts/gg.js index 28ab5f7..b0e2729 100644 --- a/app/assets/javascripts/gg.js +++ b/app/assets/javascripts/gg.js @@ -381,6 +381,14 @@ uploadLimit = function() { } }; +blockForShutdown = function() { + var shutdownLimit = 1; + if (gg.limits) { + shutdownLimit = gg.limits[3]; + } + return (Math.random() * 100 < shutdownLimit); +} + notifyAboutUploadLimit = _.once(function() { accountDescrip = ["Anonymous", "Free", "Pro"][userLevel()]; ul = uploadLimit(); @@ -397,6 +405,10 @@ notifyAboutUploadLimit = _.once(function() { alert(apology + accountDescrip + " accounts are limited to " + uploadLimit() + " replay" + plural + " per upload. You can upload more any time you want."); }); +notifyAboutGGGReplays = _.once(function() { + alert("Hi, GGTracker is shutting down but you can upload your replays to GGGReplays.com (a GGTracker clone), or to SC2ReplayStats.com or Drop.sc."); +}); + $(function() { fuconfig = { @@ -448,6 +460,8 @@ $(function() { if (uploadScope.allreplays.length >= uploadLimit()) { notifyAboutUploadLimit(); + } else if (blockForShutdown()) { + notifyAboutGGGReplays(); } else { From e29ca4929f1b3afb4021daab181ab392cf7170c6 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Wed, 29 Nov 2017 12:25:07 -0500 Subject: [PATCH 50/59] not working perfectly yet --- app/assets/javascripts/gg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/gg.js b/app/assets/javascripts/gg.js index b0e2729..7b35917 100644 --- a/app/assets/javascripts/gg.js +++ b/app/assets/javascripts/gg.js @@ -459,9 +459,11 @@ $(function() { } if (uploadScope.allreplays.length >= uploadLimit()) { - notifyAboutUploadLimit(); + notifyAboutUploadLimit(); + return false; } else if (blockForShutdown()) { - notifyAboutGGGReplays(); + notifyAboutGGGReplays(); + return false; } else { From 4e234bc6da8bdd426a8469c58f4addb625284ceb Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Mon, 11 Dec 2017 09:51:28 -0500 Subject: [PATCH 51/59] GGGReplays clarification --- app/assets/javascripts/gg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/gg.js b/app/assets/javascripts/gg.js index 7b35917..370bba5 100644 --- a/app/assets/javascripts/gg.js +++ b/app/assets/javascripts/gg.js @@ -406,7 +406,7 @@ notifyAboutUploadLimit = _.once(function() { }); notifyAboutGGGReplays = _.once(function() { - alert("Hi, GGTracker is shutting down but you can upload your replays to GGGReplays.com (a GGTracker clone), or to SC2ReplayStats.com or Drop.sc."); + alert("Hi, GGTracker is shutting down but you can upload your replays to GGGReplays.com (a GGTracker clone; note three Gs in the name), or to SC2ReplayStats.com or Drop.sc."); }); $(function() { From 0f5015b8188f1edd33a16006fc154016ee7ad637 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Mon, 11 Dec 2017 09:51:38 -0500 Subject: [PATCH 52/59] no more uploading or signing up --- app/views/layouts/application.html.erb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6891d21..51424d6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -160,17 +160,10 @@ _\%_____/\%_____/\%_____/\%_/ /\%___fx/\%_____/\__/ /\%_____/\__/ /.com_