Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1.  
  2. import java.io.BufferedReader;
  3. import java.io.IOException;
  4. import java.io.InputStreamReader;
  5. import java.net.URL;
  6. import java.net.URLConnection;
  7. import java.nio.charset.Charset;
  8. import java.security.MessageDigest;
  9. import java.security.NoSuchAlgorithmException;
  10.  
  11. import menu.client.custommenu.GuiCustomMainMenu;
  12. import net.minecraft.client.Minecraft;
  13.  
  14. public class PanelControlle {
  15.  
  16. private String host = "www.scandicraft.net";
  17. public String username;
  18. public String password;
  19.  
  20. public PanelControlle(String username, String password) {
  21. this.username = username;
  22. this.password = password;
  23. }
  24.  
  25. private String getResultFromAPI() {
  26. StringBuilder a = new StringBuilder();
  27. try {
  28. URL uri = new URL("http://" + this.host + "/gestion/panel/index.php?user=" + this.username + "&password="
  29. + this.password);
  30. URLConnection ec = uri.openConnection();
  31. BufferedReader in = new BufferedReader(new InputStreamReader(ec.getInputStream(), "UTF-8"));
  32. System.out.println("http://" + this.host + "/gestion/panel/index.php?user=" + this.username + "&password="
  33. + this.password);
  34. String inputLine;
  35. while ((inputLine = in.readLine()) != null) {
  36. a.append(inputLine);
  37. }
  38. in.close();
  39.  
  40. } catch (IOException e) {
  41. e.printStackTrace();
  42. }
  43. return a.toString();
  44. }
  45.  
  46. public boolean checkPlayerAccount() {
  47. String result = getResultFromAPI();
  48. System.out.println(result + " 1");
  49. if (result.equals("true")) {
  50. return true;
  51. }else{
  52. return false;
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement