go to initialize and search forand remove it.Code:checkVotes(playerName);
just add a claim account so then you won't have to be bothered by server login problems
|
I am trying to use my vote system but sometimes my website would go off and the vps will try to connect to the website and the vote will just not connect and kick everyone off
this is my code can someone hjelp pleasE?Code:public boolean checkVotes(String playerName) { try { String urlString = "http://mywebsite.org/vote/vote.php?type=checkvote&username="+playerName; urlString = urlString.replaceAll(" ", "%20"); URL url = new URL(urlString); BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String results = reader.readLine(); if(results.length() > 0) { if(results.equals("user needs reward...")) return true; else return false; } } catch (MalformedURLException e) { System.out.println("Malformed URL Exception in checkVotes(String playerName)"); } catch (IOException e) { System.out.println("IO Exception in checkVotes(String playerName)"); } return false; }
remove this method
then add this command...Code:checkVotes(playerName);
Code:if (playerCommand.equalsIgnoreCase("claim")) { if(c.checkVotes(c.playerName)) { c.getItems().addItem(995, 5000000); c.sendMessage("Thank you for voting!"); } }
none of the above fix the issue. have you tried
You have not given the stacktrace to the error so I cant really say completely, but thats a wild guess.Code:if(results == null) return false;
when his website goes down, then it's not able to connect to mysql right? after not being able to connect to mysql it prints error and at the same time not letting a player log in.
Bumpsz
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |