Thread: Ruse scoreboard fix

Results 1 to 3 of 3
  1. #1 Ruse scoreboard fix 
    Rune-Server Affiliate
    Join Date
    May 2011
    Posts
    203
    Thanks given
    21
    Thanks received
    6
    Discord
    View profile
    Rep Power
    19
    I was able to dig up a scoreboard to work for my server. My issue now is that it only pulls up players that are currently online.


    "for(Player p : World.getPlayers()) {"

    How do I change that so that it will also check the player save files for those that are offline?


    Code:
    public static ArrayList<ScoreboardEntry> getUpdatedList(Scoreboard scoreboard) {
    		ArrayList<ScoreboardEntry> entries = new ArrayList<ScoreboardEntry>();
    		for(Player p : World.getPlayers()) {
    			if(p == null)
    				continue;
    			if(scoreboard == Scoreboards.TOP_PKERS) {
    				int kc = p.getPlayerKillingAttributes().getPlayerKills();
    				int dc = p.getPlayerKillingAttributes().getPlayerDeaths();
    				double kdr = (double) ((kc < 2 || dc < 2) ? (0) : (kc/dc));
    				entries.add(new ScoreboardEntry(p.getUsername(), new String[]{String.valueOf(kdr), String.valueOf(kc), String.valueOf(dc)}));
    			} else if(scoreboard == Scoreboards.TOP_KILLSTREAKS) {
    				entries.add(new ScoreboardEntry(p.getUsername(), new String[]{String.valueOf(p.getPlayerKillingAttributes().getPlayerKillStreak())}));
    			} else if(scoreboard == Scoreboards.TOP_TOTAL_EXP) {
    				entries.add(new ScoreboardEntry(p.getUsername(), new String[]{String.valueOf(p.getSkillManager().getTotalExp())}));
    			} else if(scoreboard == Scoreboards.TOP_ACHIEVER) {
    				entries.add(new ScoreboardEntry(p.getUsername(), new String[]{String.valueOf(p.getPointsHandler().getAchievementPoints())}));
    			}
    		}
    		scoreboard.resort(entries);
    		return entries;
    	}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2017
    Posts
    119
    Thanks given
    7
    Thanks received
    19
    Discord
    View profile
    Rep Power
    9
    same way as server checks if a character file exists for a player

    check if the name exists within the folder

    if it does, get the data from the line

    add to map

    read from the map
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Jul 2011
    Posts
    922
    Thanks given
    196
    Thanks received
    169
    Rep Power
    189
    Quote Originally Posted by socklol View Post
    same way as server checks if a character file exists for a player

    check if the name exists within the folder

    if it does, get the data from the line

    add to map

    read from the map
    That's quite expensive in terms of performance. I would recommend using a database system or a simple txt file for storing the scores.
    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. [Ruse] Bug fixing, Features etc. [Ruse]
    By Itslovely in forum Selling
    Replies: 3
    Last Post: 01-12-2017, 07:17 AM
  2. [Paid] Ruse V2 fixes need doing
    By SinfulPS in forum Buying
    Replies: 0
    Last Post: 01-12-2017, 12:36 AM
  3. Ruse Base fixing doors.
    By Aerodude30 in forum Help
    Replies: 14
    Last Post: 08-20-2016, 03:45 AM
  4. Buying Ruse Client Fix
    By jkicools in forum Buying
    Replies: 2
    Last Post: 06-28-2016, 07:57 PM
  5. [Ruse] Construction fixes
    By angelpkz in forum Help
    Replies: 0
    Last Post: 01-25-2016, 02:09 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
  •