From 2d8223d6421eb4ad54aa760da52f574e5343344f Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Fri, 13 Nov 2015 11:15:32 -0500 Subject: [PATCH 01/39] 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 3c4cf6ffa5ed7ed242af30146464b1a6ddbaae17 Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Tue, 17 Nov 2015 10:11:38 -0500 Subject: [PATCH 02/39] 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 3d5d759e2455f351fa6476741f27aa8a90832cae Mon Sep 17 00:00:00 2001 From: dsjoerg Date: Sun, 10 Jan 2016 21:50:10 -0500 Subject: [PATCH 03/39] 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 04/39] 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 05/39] 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 06/39] 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 29/39] 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 30/39] 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 31/39] 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 32/39] 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_