File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,14 @@ uploadLimit = function() {
381381 }
382382} ;
383383
384+ blockForShutdown = function ( ) {
385+ var shutdownLimit = 1 ;
386+ if ( gg . limits ) {
387+ shutdownLimit = gg . limits [ 3 ] ;
388+ }
389+ return ( Math . random ( ) * 100 < shutdownLimit ) ;
390+ }
391+
384392notifyAboutUploadLimit = _ . once ( function ( ) {
385393 accountDescrip = [ "Anonymous" , "Free" , "Pro" ] [ userLevel ( ) ] ;
386394 ul = uploadLimit ( ) ;
@@ -397,6 +405,10 @@ notifyAboutUploadLimit = _.once(function() {
397405 alert ( apology + accountDescrip + " accounts are limited to " + uploadLimit ( ) + " replay" + plural + " per upload. You can upload more any time you want." ) ;
398406} ) ;
399407
408+ notifyAboutGGGReplays = _ . once ( function ( ) {
409+ 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." ) ;
410+ } ) ;
411+
400412$ ( function ( ) {
401413
402414 fuconfig = {
@@ -448,6 +460,8 @@ $(function() {
448460
449461 if ( uploadScope . allreplays . length >= uploadLimit ( ) ) {
450462 notifyAboutUploadLimit ( ) ;
463+ } else if ( blockForShutdown ( ) ) {
464+ notifyAboutGGGReplays ( ) ;
451465 } else {
452466
453467
You can’t perform that action at this time.
0 commit comments