Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 11:29

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: LoL Modified Launcher scripts
PostPosted: 31 May 2010 21:58 

Joined: 08 May 2010 17:58
Posts: 55
Location: In vast nothingness of space...
Hi!

As league of legends US servers are often busy/offline (i dont play on eu, tho i actually am from eu...)i thought of solvin this problem by modifying the launcher scripts to connect to server even if launcher say's its down

very simple, adn nothing special, still i wanted to share it :D


make sure you back up the old one before replacing it with mine, in case something goes wrong

replace main.js in Riot Games\League of Legends\html\js with:

Code:
var serverOnline = 0;
var launcherReady = false;
var codeFull = [ 38, 40, 37, 39, 38, 38, 40, 40 ]; // udlruudd
var codeProgress = [];
var playOverride = false;
var dataRecieved = false;

var refreshInterval = 60;
var refreshTimeout = 5;
var contentScriptLocation = 'http://www.leagueoflegends.com/launcher/content.php';

$(function() {
   Launcher.setStatusCallback(statusCallback);
   Launcher.setDownloaderStatusCallback(statusCallback);
   Launcher.requestStatus();
   
   // Disable right click
   $(document).bind("contextmenu",function(e){
           return false;
       });

   $('#play_button').click(function() {
      if (!$(this).hasClass('play_button_disabled')) {
         Launcher.play();
      }
      
      return false;
   });
   
   $('#logs_button').click(function () {
      Launcher.openLogPage();
      return false;
   });
   
   $('#options_button').click(function () {
      Launcher.navigate('html\\settings-en.html', false);
      return false;
   });
   
   $('#exit_button').click(function() { Launcher.close(); });
   $('#minimize_button').click(function() { Launcher.minimize(); });
   $('#top_bar').mousedown(function () { Launcher.beginMoveWindow(); });
   
   $('#launcher_main').keyup(function(e) {
      if (codeProgress.length == 0) {
         codeProgress = [];
      
         for (var i in codeFull) {
            codeProgress[i] = codeFull[i];
         }
      }

      if (e.which == codeProgress[0]) {
         codeProgress.shift();
      } else if (codeProgress.length < codeFull.length) {
         codeProgress = [];
      
         for (var i in codeFull) {
            codeProgress[i] = codeFull[i];
         }
         
         return;
      }
      
      if (codeProgress.length == 0 && serverOnline != 3) {
         setServerStatus(1);
         $('#server_status p.message').text('');
      }
   });
   
   attemptContentRefresh();
});

function attemptContentRefresh() {
   dataRecieved = false;
   
   $('body').append('<script type="text/javascript" src="' + contentScriptLocation + '"><\/script>');
   
   if (refreshTimeout != null) {   
      $(document).oneTime(refreshTimeout * 1000, function() {
         if (dataRecieved) {
            return;
         }
         
         $('.loading').remove();
         setServerStatus(0);
         
         $('#server_status p.message').text('Are you connected to the Internet?');
      });
   }
}

function refreshContent(data) {
   dataRecieved = true;
   
   $('.loading').remove();
   
   setServerStatus(data.serverStatus);
   
   if (data.serverStatus != 1) {
      var statusMessage;

      if (data.serverStatus == 3) {
         statusMessage = '<a href="#" onclick="Launcher.navigate(\'' + data.blockedUrl + '\', true); return false">'
         statusMessage += data.message;
         statusMessage += '</a>';
      } else {
         statusMessage = data.message;
      }

      $('#server_status p.message').html(statusMessage);
   }
   
   $('#news_list li').remove();
   for (var i in data.news) {
      $('#news_list').append('<li><span class="date">' + data.news[i].date + '</span> <a href="' + data.news[i].url + '" onclick="Launcher.navigate(this.href, true); return false">' + data.news[i].title.substr(0, 43) + '</a></li>');
   }
   
   $('#community_list li').remove();
   for (var i in data.community) {
      $('#community_list').append('<li><a href="' + data.community[i].url + '" onclick="Launcher.navigate(this.href, true); return false">' + data.community[i].title.substr(0, 43) + '</a></li>');
   }
   
   if (data.serverStatus == 3) {
           Launcher.navigate(data.blockedUrl, true);
   } else {
//      $(document).oneTime(refreshInterval * 1000, function() { attemptContentRefresh(); });
   }
}

function setServerStatus(status) {
   serverOnline = status;

   
   if (launcherReady = true) {
      $('#play_button').removeClass('play_button_disabled').addClass('play_button_enabled');
      $('#server_status p.status').text('Launcher Script Modified!');
   }

        serverClass = 'online';
        if(serverOnline == 1){
            serverClass = 'online';
        }else if(serverOnline == 2){
            serverClass = 'online';
        }else if(serverOnline == 3) {
       serverClass = 'online';
   }

   $('#server_status')
      .removeClass('status_unknown')
      .removeClass('status_online')
      .removeClass('status_unavailable')
      .removeClass('status_busy')
      .removeClass('status_blocked')
      .addClass('status_' +  serverClass);
   
   $('#server_status p.status').text('Launcher Script Hacked!');
}

function statusCallback(packageName, packageListState, active, averageIncoming, bytesRead, bytesSent, copyBytesLeft, copyBytesTotal, currentIncoming, currentName, currentVersion, downloadBytesLeft, maxIncoming, packageType, patcherState, scanBytesLeft, targetName, targetVersion, totalBytes)
{
   var complete = Launcher.getCompletePercentage(packageListState, patcherState, totalBytes, copyBytesLeft, copyBytesTotal, downloadBytesLeft, scanBytesLeft);               

   if (patcherState == Launcher.PATCHER_STATE_ALLTASKSCOMPLETE) {
      launcherReady = true;
      
      if (serverOnline == 1) {
         $('#play_button').removeClass('play_button_disabled').addClass('play_button_enabled');
      }
   } else {
      launcherReady = false;
      $('#play_button').removeClass('play_button_enabled').addClass('play_button_disabled');
   }

   $('#progress_bar').css('width', complete * 100 + '%');
   
   $('#progress .text').text(Launcher.getStatusMessage(packageListState, active, packageName, currentVersion, targetVersion));
   $('#progress .subtext').text(Launcher.getDetailStatusMessage(packageListState, active, patcherState, totalBytes, copyBytesLeft, copyBytesTotal, downloadBytesLeft, scanBytesLeft, bytesRead, averageIncoming));       
   
   if (patcherState == Launcher.PATCHER_STATE_DOWNLOAD) {
      $('#download_progress').show();
      
      $('#download_progress .bytes').text(Launcher.getBytesLeftMessage(packageListState, active, patcherState, downloadBytesLeft));
      $('#download_progress .time').text(Launcher.getTimeEstimateMessage(packageListState, active, patcherState, downloadBytesLeft, bytesRead, averageIncoming));
   
      var speedText = Launcher.getTransferSpeedMessage(packageListState, active, patcherState, averageIncoming);
   
      if (speedText.length > 0) {
         $('#download_progress .speed').text(' | ' + speedText);
      }
   } else {
      $('#download_progress').hide();
   }
}

function customHandler(message)
{
   alert(message);
}


hope this helps someone :D


Top
 Profile  
 
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: