Thread: [Ruse] Hiscores help

Results 1 to 3 of 3
  1. #1 [Ruse] Hiscores help 
    Registered Member
    Join Date
    Apr 2011
    Posts
    72
    Thanks given
    1
    Thanks received
    0
    Rep Power
    1
    Hi guys! Having a little trouble with hiscores on Ruse. Everything is set up properly, Only thing is, the hiscores isn't saving data into my database. I've ran a query through my database and it returns no data which means that it has to be the server that isn't uploading the data? Do I have to click 'All prestieges' when creating the table or do I click 'None' Does it matter? Also I have included the server's ip in my website's remote sql. I don't understand why it isn't displaying the hiscores?

    Here's the link to my hiscores: Phoenix - Hiscores

    MySQLController.java:

    Code:
    	public MySQLController() {
    		/* DATABASES */
    		DATABASES = new MySQLDatabase[]{
    				new MySQLDatabase("198.57.247.147", 3306, "richardj_hs", "richardj_user", "password"), 
    				//new MySQLDatabase("50.87.76.145", 3306, "rusepsco_recover", "rusepsco_recover", "i!Fa4nu[3OqL"),
    				//new MySQLDatabase("50.87.76.145", 3306, "rusepsco_grande", "rusepsco_grandeu", "MMNNBBHHYY123_c!!!"),
    		};
    		MySQLProcessor.process();
    	}
    Reply With Quote  
     

  2. #2  
    Jake from State Farm

    FKN Jake's Avatar
    Join Date
    Nov 2013
    Posts
    675
    Thanks given
    45
    Thanks received
    58
    Rep Power
    153
    It appears to be working?

    Go to MysqlController.java and make sure hiscores is declared.

    Code:
    	public enum Database {
    		HIGHSCORES,
    		RECOVERY,
    		GRAND_EXCHANGE,
    		PLAYERSONLINE,
    	}
    Hiscores.java:

    Code:
    package mysql.impl;
    
    import java.sql.PreparedStatement;
    
    import com.mpk.GameServer;
    import com.mpk.GameSettings;
    import com.mpk.model.PlayerRights;
    import com.mpk.model.Skill;
    import com.mpk.world.entity.impl.player.Player;
    
    import mysql.MySQLController;
    import mysql.MySQLController.Database;
    import mysql.MySQLDatabase;
    
    public class Hiscores {
    
    	public static void save(Player player) {
    		if(!GameSettings.MYSQL_ENABLED) {
    			return;
    		}
    		if(player.getRights() == PlayerRights.DEVELOPER || player.getRights() == PlayerRights.ADMINISTRATOR || player.getRights() == PlayerRights.OWNER)
    			return;
    		if(player.getSkillManager().getTotalLevel() <= 34)
    			return;	
    		MySQLDatabase highscores = MySQLController.getController().getDatabase(Database.HIGHSCORES);
    		if(!highscores.active || highscores.getConnection() == null) {
    			return;
    		}
    		GameServer.getLoader().getEngine().submit(() -> {
    			try {
    				PreparedStatement preparedStatement = highscores.getConnection().prepareStatement("DELETE FROM hs_users WHERE USERNAME = ?");
    				preparedStatement.setString(1, player.getUsername());
    				preparedStatement.executeUpdate();
    				preparedStatement = highscores.getConnection().prepareStatement("INSERT INTO hs_users (username,rights,overall_xp,attack_xp,defence_xp,strength_xp,constitution_xp,ranged_xp,prayer_xp,magic_xp,cooking_xp,woodcutting_xp,fletching_xp,fishing_xp,firemaking_xp,crafting_xp,smithing_xp,mining_xp,herblore_xp,agility_xp,thieving_xp,slayer_xp,farming_xp,runecrafting_xp,hunter_xp,construction_xp,summoning_xp,dungeoneering_xp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
    				preparedStatement.setString(1, player.getUsername());
    				preparedStatement.setInt(2, player.getRights().ordinal());
    				preparedStatement.setLong(3, player.getSkillManager().getTotalExp());
    				for (int i = 4; i <= 28; i++) {
                        preparedStatement.setInt(i, player.getSkillManager().getExperience(Skill.forId(i - 4)));
                    }
    				preparedStatement.executeUpdate();
    			} catch(Exception e) {
    				e.printStackTrace();
    			}
    		});
    	}
    }

    Also, did you import the SQL files provided into database?

    In gamesettings.java you need to make sure SQL is turned on

    Code:
    /**
    	 * Are the MYSQL services enabled?
    	 */
    	public static boolean MYSQL_ENABLED = true;
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2015
    Posts
    64
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    I am having the same issue, no data is entering the database, my highscores is local to the database so i use localhost as the host, as if i use the external ip it refuses the connection, but thats because an internal connection cant go out to just come back again.

    Any advise?
    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. Hiscores help
    By sowhat160 in forum Help
    Replies: 0
    Last Post: 11-06-2011, 11:02 PM
  2. Hiscore help
    By rockarocka in forum Help
    Replies: 0
    Last Post: 09-24-2010, 04:22 PM
  3. [$5][PI]Hiscores Help[PI][$5]
    By Cal_Short in forum Help
    Replies: 10
    Last Post: 08-26-2010, 12:44 PM
  4. Hiscores Help please :)
    By Death2You in forum Help
    Replies: 1
    Last Post: 08-23-2010, 09:43 PM
  5. [562][RS2HD] Hiscore Help
    By twistedlife in forum Help
    Replies: 3
    Last Post: 07-14-2010, 05:28 AM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •