Thread: Closed

Results 1 to 8 of 8
  1. #1 Closed 
    Solid Owner & Developer
    idyte's Avatar
    Join Date
    Jun 2013
    Posts
    70
    Thanks given
    2
    Thanks received
    0
    Rep Power
    33
    Closed
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Is it even connected?
    Do it stop here?
    Code:
    			if (!connect(HOST, DATABASE, USER, PASS)) {
    				return;
    			}


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Solid Owner & Developer
    idyte's Avatar
    Join Date
    Jun 2013
    Posts
    70
    Thanks given
    2
    Thanks received
    0
    Rep Power
    33
    Quote Originally Posted by arch337 View Post
    Is it even connected?
    Do it stop here?
    Code:
    			if (!connect(HOST, DATABASE, USER, PASS)) {
    				return;
    			}
    Idk if its connect. And what you mean with if it stop here? The code I got with the higscore but I changed it so i could run it. But I'm not the best on this. That's why i post here
    Reply With Quote  
     

  4. #4  
    Blurite

    Corey's Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,491
    Thanks given
    1,245
    Thanks received
    1,729
    Rep Power
    5000
    What did you "change so I could run it"?
    Add a print statement to the code mentioned above, see if it gets printed.
    Attached image
    Reply With Quote  
     

  5. #5  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by idyte View Post
    Idk if its connect. And what you mean with if it stop here? The code I got with the higscore but I changed it so i could run it. But I'm not the best on this. That's why i post here
    For example if it print out:
    Code:
    			if (!connect(HOST, DATABASE, USER, PASS)) {
    System.out.println("stops here.");
    				return;
    			}


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  6. #6  
    Solid Owner & Developer
    idyte's Avatar
    Join Date
    Jun 2013
    Posts
    70
    Thanks given
    2
    Thanks received
    0
    Rep Power
    33
    Quote Originally Posted by arch337 View Post
    For example if it print out:
    Code:
    			if (!connect(HOST, DATABASE, USER, PASS)) {
    System.out.println("stops here.");
    				return;
    			}
    Nothing happends
    Reply With Quote  
     

  7. #7  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by idyte View Post
    Nothing happends
    Next try:
    Code:
    	public HiscoreUpdater(Player player) {
    		this.player = player;
    System.out.println("Sends highscore!");
    	}
    Code:
    	public void run() {
    System.out.println("Attempt a run for highscore");
    		try {
    			if (!connect(HOST, DATABASE, USER, PASS)) {
    				return;
    			}
    			
    			String name = player.getUsername();
    			int totalPrestige = 0;
    			for (int prestige : player.getSkillPrestiges()) {
    				if (prestige > 0) {
    					totalPrestige += prestige;
    				}
    			}
    			
    			PreparedStatement stmt1 = prepare("DELETE FROM "+TABLE+" WHERE username=?");
    			stmt1.setString(1, player.getUsername().trim().replaceAll(" ", "_"));
    			stmt1.execute();
    				
    			PreparedStatement stmt2 = prepare(generateQuery());
    			stmt2.setString(1, player.getUsername().trim().replaceAll(" ", "_"));
    			stmt2.setInt(2, player.getRights());
    			stmt2.setInt(3, totalPrestige);
    			stmt2.setLong(4, player.getSkill().getTotalExperience());
    			
    			for (int i = 0; i < 44; i += 2) {
    				stmt2.setInt(5 + i, (int)player.getSkill().getExperience()[i/2]);
    				stmt2.setInt(5 + i + 1, (int)player.getSkillPrestiges()[i/2]);
    			}
    			stmt2.execute();
    			
    			destroy();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    If it do not send anything, then you have not told it to read the run value when your player log out.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  8. #8  
    Donator

    i dds you's Avatar
    Join Date
    Jun 2013
    Posts
    831
    Thanks given
    678
    Thanks received
    160
    Rep Power
    92
    is it even trying server sided? I added my method via logout, anyone who logs out it tries to connect and if it can't throws an error in the console.

    Hard to see what you're missing

    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. Replies: 0
    Last Post: 06-06-2017, 08:35 PM
  2. Vencillio Highscores
    By idyte in forum Buying
    Replies: 1
    Last Post: 05-18-2017, 11:18 PM
  3. Vencillio Highscores
    By Audi in forum Help
    Replies: 5
    Last Post: 08-15-2016, 08:27 PM
  4. Vencillio Highscores
    By BigDickDarrel in forum Help
    Replies: 3
    Last Post: 05-07-2016, 06:24 PM
  5. Replies: 206
    Last Post: 09-13-2008, 02:19 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •