Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.URL;
- import java.net.URLConnection;
- import java.nio.charset.Charset;
- import java.security.MessageDigest;
- import java.security.NoSuchAlgorithmException;
- import menu.client.custommenu.GuiCustomMainMenu;
- import net.minecraft.client.Minecraft;
- public class PanelControlle {
- private String host = "www.scandicraft.net";
- public String username;
- public String password;
- public PanelControlle(String username, String password) {
- this.username = username;
- this.password = password;
- }
- private String getResultFromAPI() {
- StringBuilder a = new StringBuilder();
- try {
- URL uri = new URL("http://" + this.host + "/gestion/panel/index.php?user=" + this.username + "&password="
- + this.password);
- URLConnection ec = uri.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(ec.getInputStream(), "UTF-8"));
- System.out.println("http://" + this.host + "/gestion/panel/index.php?user=" + this.username + "&password="
- + this.password);
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- a.append(inputLine);
- }
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return a.toString();
- }
- public boolean checkPlayerAccount() {
- String result = getResultFromAPI();
- System.out.println(result + " 1");
- if (result.equals("true")) {
- return true;
- }else{
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement