Thread: pi simple checkvote help

Results 1 to 9 of 9
  1. #1 pi simple checkvote help 
    .supersyn

    myK-'s Avatar
    Join Date
    Aug 2008
    Posts
    1,781
    Thanks given
    22
    Thanks received
    40
    Rep Power
    399
    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

    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;
            }
    this is my code can someone hjelp pleasE?
    Reply With Quote  
     

  2. #2  
    Registered Member Aleksandr's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    1,034
    Thanks given
    455
    Thanks received
    134
    Rep Power
    74
    go to initialize and search for
    Code:
    checkVotes(playerName);
    and remove it.

    just add a claim account so then you won't have to be bothered by server login problems
    Reply With Quote  
     

  3. #3  
    OoO Donor <3
    Rockstar Jax's Avatar
    Join Date
    Mar 2011
    Age
    27
    Posts
    608
    Thanks given
    77
    Thanks received
    78
    Rep Power
    21
    remove this method

    Code:
    checkVotes(playerName);
    then add this command...

    Code:
    					if (playerCommand.equalsIgnoreCase("claim")) {
    			      if(c.checkVotes(c.playerName)) {
                                    c.getItems().addItem(995, 5000000);				
    					c.sendMessage("Thank you for voting!");
    }
    }
    Reply With Quote  
     

  4. #4  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    none of the above fix the issue. have you tried

    Code:
    if(results == null)
        return false;
    You have not given the stacktrace to the error so I cant really say completely, but thats a wild guess.
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member Aleksandr's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    1,034
    Thanks given
    455
    Thanks received
    134
    Rep Power
    74
    basically it's not able to connect to mysql so it gives error and doesn't let a player log in.
    Reply With Quote  
     

  7. #6  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by aleksandr View Post
    basically it's not able to connect to mysql so it gives error and doesn't let a player log in.
    no he isnt using that... he is using a php script to handle it, but it still works in the same way it has to connect to his website rather then a database.
    Reply With Quote  
     

  8. #7  
    Registered Member Aleksandr's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    1,034
    Thanks given
    455
    Thanks received
    134
    Rep Power
    74
    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.
    Reply With Quote  
     

  9. #8  
    .supersyn

    myK-'s Avatar
    Join Date
    Aug 2008
    Posts
    1,781
    Thanks given
    22
    Thanks received
    40
    Rep Power
    399
    Quote Originally Posted by thispixel View Post
    none of the above fix the issue. have you tried

    Code:
    if(results == null)
        return false;
    You have not given the stacktrace to the error so I cant really say completely, but thats a wild guess.
    Didn't work and all I get is a communication link failure because website went down.

    Then i would do ::redeem and it would kick everyone.

    and the redeem code is the same code as that kid who posted before me.
    Reply With Quote  
     

  10. #9  
    .supersyn

    myK-'s Avatar
    Join Date
    Aug 2008
    Posts
    1,781
    Thanks given
    22
    Thanks received
    40
    Rep Power
    399
    Bumpsz
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [HALP] checkvote [HELP!]
    By Mickt3 in forum Help
    Replies: 12
    Last Post: 07-07-2011, 08:47 PM
  2. Simple Average program, simple error?
    By Sieg in forum Application Development
    Replies: 6
    Last Post: 01-02-2011, 02:50 PM
  3. Simple HD Help
    By Mr NYC in forum Help
    Replies: 5
    Last Post: 03-18-2009, 10:43 PM
  4. A simple question requires a simple answer!
    By Matt_ in forum RS2 Server
    Replies: 2
    Last Post: 12-23-2007, 12:10 AM
  5. Replies: 14
    Last Post: 12-13-2007, 12:39 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •