[Tool] Switch between EU and US Server

First Riot Post
12345 ... 7
Comment below rating threshold, click here to show it.

SHiiZL

This user has referred a friend to League of Legends, click for more information

Junior Member

11-27-2010

Ugly US/EU Switcher 0.1

Hey Folks,
want to play on EU without having to install the EU Client?
Or US without having to install the US Client?

This ugly little Tool written in Java will change your "lol.properties", so you can switch between EU and US with one click.

All you have to do is Download the attachment and Unzip it into your League of Legends Folder. (Usually C:/Riot Games/League of Leagends)

When you Run the Program for the first time you might want to create Backup, just click on the Backup Button and it will create a backup called "lolbackup.properties" in your "League of Legends/air/ " folder, that can be restored whenever you want.

A screenshot can be found here:
*******http://img94.imageshack.us/img94/2484/switcher.jpg********

But you need to have an Account for the Server you want to play on! This Tool wont transfer your Account because its impossible to do something like that at the moment.

This is my very first Code written in Java, so dont bother whether I could fish your Account, I wouldnt even be able to Code such stuff.
Here is the Code, feel free to give me hints if you see something I could change

Ugly US/EU Switcher 0.2

-Added a function that will close the Switcher after launching League of Legends
-Changed the method to run the Launcher (shouldnt freeze anymore)
-Updated Source Code in Forum


*** Make sure you download "switcher02.zip" , switcher.zip is the old version you might wanna use if you have problems with 02***

Code:
package switcher;

import java.awt.*;
import java.awt.event.*;
import java.io.*;

/**
 *
 * @author eddy
 */
public class Main extends Frame {

    private Button changeus;
    private Button changeeu;
    private Button changebu;
    private Button changebur;
    private Label status;
    private Button startlol;
    private Checkbox close;
    /*private boolean running = false;*/

public Main() {
    super();
    setLayout(null);
    setTitle("Ugly LOL-Switcher 0.2");
    setResizable(false);
    changeus = new Button("US");
    changeeu = new Button("EU");
    changebu = new Button("Backup");
    changebur = new Button("Restore Backup");
    startlol = new Button("Start LoL");
    close = new Checkbox("Close Switcher after LoL-Launch");
    status = new Label();

    changeus.setBounds(100,75,100,100);
    changeeu.setBounds(300,75,100,100);
    changebu.setBounds(200,30,100,25);
    changebur.setBounds(100,220,300,25);
    startlol.setBounds(200,75,100,100);
    close.setBounds(100,240,300,25);
    status.setBounds(100,175,300,50);
    status.setFont(new Font(Font.SERIF,Font.PLAIN,15));

    add(changeus);
    add(changeeu);
    add(changebu);
    add(changebur);
    add(startlol);
    add(close);
    add(status);

    this.changeus.addActionListener(new ButtonListenerUs());
    this.changeeu.addActionListener(new ButtonListenerEu());
    this.changebu.addActionListener(new ButtonListenerBu());
    this.changebur.addActionListener(new ButtonListenerBuR());
    this.startlol.addActionListener(new ButtonListenerStart());
    close.setState (true);
    addWindowListener(new WindowLauscher());
}

class WindowLauscher extends WindowAdapter{
    public void windowClosing(WindowEvent e){
        System.exit(0);
        }
}

class ButtonListenerBu implements ActionListener{
    public void actionPerformed(ActionEvent e){
    File org = new File ("./air/lol.properties");
    File bu = new File ("./air/lolbackup.properties");

    if (bu.exists()){
        status.setText("**********Backup-File already exists**********");
        }   
    if (org.exists()){
        org.renameTo(bu);
        status.setText("************Backup-File Created***************");
            }
        else{
            status.setText("*Unable to find lol.properties, no Backup created*");
        }
    }
}

class ButtonListenerBuR implements ActionListener{
    public void actionPerformed(ActionEvent e){
    File org = new File ("./air/lol.properties");
    File bu = new File ("./air/lolbackup.properties");

    if (bu.exists()){
    bu.renameTo(org);
    status.setText("**************Backup Restored*********************");
    }else{
   status.setText(" **No Backup-File found - Create Backup first**");
     }
    }
}

class ButtonListenerUs implements ActionListener{
        public void actionPerformed(ActionEvent e){
try {
    BufferedWriter dst = new BufferedWriter (new FileWriter("./air/lol.properties"));
    dst.write("host=beta.lol.riotgames.com");
    dst.write(System.getProperty("line.separator"));
    dst.write("xmpp_server_url=chat.na.lol.riotgames.com");
    dst.write(System.getProperty("line.separator"));
    dst.write("enableTutorialGame=true");
    dst.write(System.getProperty("line.separator"));
    dst.write("lobbyLandingURL=http://www.leagueoflegends.com/pvpnet_landing");
    dst.write(System.getProperty("line.separator"));
    dst.write("ladderURL=http://www.leagueoflegends.com/ladders");
    dst.write(System.getProperty("line.separator"));
    dst.write("storyPageURL=http://www.leagueoflegends.com/story");
    dst.flush();
    dst.close();
    System.out.println("US Activated");
    status.setText(" ********You will connect to US Server********");
        }
catch(Exception ex){
    System.out.println("Nee");
    System.out.println(ex.getMessage());
        }
    }
}

class ButtonListenerEu implements ActionListener{
    public void actionPerformed(ActionEvent e){
try {
    BufferedWriter dst = new BufferedWriter (new FileWriter("./air/lol.properties"));
    dst.write("host=prod.eu.lol.riotgames.com");
    dst.write(System.getProperty("line.separator"));
    dst.write("xmpp_server_url=chat.eu.lol.riotgames.com");
    dst.write(System.getProperty("line.separator"));
    dst.write("enableTutorialGame=true");
    dst.write(System.getProperty("line.separator"));
    dst.write("lobbyLandingURL=http://www.leagueoflegends.com/pvpnet_landing");
    dst.write(System.getProperty("line.separator"));
    dst.write("ladderURL=http://www.leagueoflegends.com/ladders");
    dst.write(System.getProperty("line.separator"));
    dst.write("storyPageURL=http://www.leagueoflegends.com/story");
    dst.flush();
    dst.close();
    System.out.println("EU Activated");
    status.setText(" ********You will connect to EU Server********");
        }
catch(Exception ex){
    System.out.println("Nee");
    System.out.println(ex.getMessage());
        }
    }
}

class ButtonListenerStart implements ActionListener{
    public void actionPerformed(ActionEvent e){
    try {
        String line;
        new ProcessBuilder("./lol.launcher.exe").start();
        System.out.println(close.getState());
        if (close.getState() == true){
            status.setText("Switcher will Close after LoL start");
            System.exit(0);
        }
    }
    catch (Exception err){
        err.printStackTrace();
    }
   }
}


    public static void main(String[] args) {
        // TODO code application logic here
        Main switcher = new Main();
        switcher.setBounds(0,0,500,300);
        switcher.setVisible(true);
    }
}

Here VirusTotal Online Scan:

http://www.virustotal.com/file-scan/...54e-1294543748

File name:
Switcher.jar
Submission date:
2011-01-09 03:29:08 (UTC)
Current status:
queued (#5) queued (#4) analysing finished
http://virustotal.hispasecsistemas.n...img/loader.gif
Result:
0/ 42 (0.0%)

0 VT Community user(s) with a total of 0 reputation credit(s) say(s) this sample is goodware. 0 VT Community user(s) with a total of 0 reputation credit(s) say(s) this sample is malware.

MD5 : da963b281705a295a55d51bf8f252e55


Comment below rating threshold, click here to show it.

Wiesky

Junior Member

11-27-2010

thank you so much works fine


Comment below rating threshold, click here to show it.

Erazuul

Member

11-27-2010

Installed it, made a shortcut, made a backup, switched to EU and indeed it had changed, closed LoL, wanted to change back but it doesn't respond so I closed; started again, changed back to US, launched LoL again and it worked, closed LoL, tried to close your program but it stopped responding to that as well for a short while. :S

Perhaps you could write a line that closes it after launching LoL?
Other then that, great stuff.
Thanks


Comment below rating threshold, click here to show it.

SHiiZL

This user has referred a friend to League of Legends, click for more information

Junior Member

11-27-2010

Thanks for the respond, ill try to fix that tomorrow!

I noticed this Programm will freeze if you try to close it by right clicking at the taskbar and select "close", if you hit the X at the window, it shouldnt freeze.


Comment below rating threshold, click here to show it.

Bloo Screen

Member

11-27-2010

It works! Yey! Nice job mate!


Comment below rating threshold, click here to show it.

fuzzy logic

This user has referred a friend to League of Legends, click for more information

Recruiter

11-28-2010

You should post this in general so people will actually see this great tool.


Comment below rating threshold, click here to show it.

Caegrim

Junior Member

11-28-2010

Thanks a lot! It works like a charm. Indeed a very great tool. Keep up the good work.


Comment below rating threshold, click here to show it.

fuzzy logic

This user has referred a friend to League of Legends, click for more information

Recruiter

11-29-2010

Bumping for great justice.


Comment below rating threshold, click here to show it.

Sw1tch13lade

Senior Member

11-29-2010

Is this against their TOS?


Comment below rating threshold, click here to show it.

SHiiZL

This user has referred a friend to League of Legends, click for more information

Junior Member

11-29-2010

Here we go.... UGLY LOL SWITCHER 0.2 is out

Changed the Method to Run the lol.launcher, should be stable now(at least it is for me).
And added a function to Close the Application after launching League of Legends.

Have fun, and thanks for your Feedback! If you have more additions let me know.


Edit:

I dont think its against their TOS, since everyone is allowed to download and play on both servers?
But i must admit that im not sure.
If it is someone will close and delete this thread i think.


12345 ... 7