Thread: Character files ranks [RUSE]

Results 1 to 7 of 7
  1. #1 Character files ranks [RUSE] 
    Owner of BrutalPS

    Join Date
    Dec 2014
    Posts
    364
    Thanks given
    6
    Thanks received
    11
    Rep Power
    0
    So today i am having trouble, and here is my e.x

    So, when i create a character file and set the rank as DEVELOPER, OWNER, and login, it sets the rank, but when i log out, it stays logged out, and when i try too login, it says "Your account is already logged in, please try again in 60 seconds."

    So what i was wondering, if there was any way too remove the accountsecurity, and make it read from the character file.

    Code:
    package io.server.game.world.entity.mob.player;
    
    import java.util.Arrays;
    import java.util.Optional;
    
    import io.server.Config;
    import io.server.game.world.World;
    import io.server.game.world.entity.mob.data.LockType;
    import io.server.game.world.entity.mob.player.profile.Profile;
    import io.server.game.world.entity.mob.player.profile.ProfileRepository;
    
    /**
     * Handles account security.
     *
     * @author Adam
     */
    public class AccountSecurity {
    
    	/** The player instance. */
    	private Player player;
    
    	/** Constructs a new <code>AccountSecurity<code>. */
    	AccountSecurity(Player player) {
    		this.player = player;
    	}
    
    	/** Handles account login. */
    	public void login() {
    		String name = player.getName();
    		String host = player.lastHost;
    
    		if (!player.hostList.contains(host))
    			player.hostList.add(host);
    
    		ProfileRepository.put(new Profile(name, player.getPassword(), host, player.hostList, player.right));
    
    		if (!AccountData.forName(name).isPresent()) {
    			if (player.right == PlayerRight.MODERATOR || player.right == PlayerRight.OWNER
    					|| player.right == PlayerRight.ADMINISTRATOR || player.right == PlayerRight.DEVELOPER) {
    				player.right = PlayerRight.PLAYER;
    				player.inventory.clear();
    				player.equipment.clear();
    				player.pkPoints = 0;
    				player.skillingPoints = 0;
    				player.bossPoints = 0;
    				player.triviaPoints = 0;
    				player.votePoints = 0;
    				player.donation.setCredits(0);
    				player.pestPoints = 0;
    				player.kolodionPoints = 0;
    				player.bank.clear();
    				player.setVisible(true);
    			} else if (PlayerRight.isDonator(player)) {
    				player.setVisible(true);
    				player.donation.updateRank(true);
    			}
    			return;
    		}
    
    		player.interfaceManager.close();
    		AccountData account = AccountData.forName(name).get();
    		player.setVisible(true);
    
    		if (!Config.LIVE_SERVER || host.equals("")) {
    			return;
    		}
    
    		if (account.getName().equalsIgnoreCase(name)) {
    			if ((account.getRight() == PlayerRight.OWNER || account.getRight() == PlayerRight.DEVELOPER)
    					&& player.right != account.right)
    				player.right = account.right;
    
    			for (String hosts : account.getHost()) {
    				if (host.equalsIgnoreCase(hosts))
    					return;
    			}
    
    			if (account.getKey().isEmpty()) {
    				return;
    			}
    
    			player.locking.lock(LockType.MASTER_WITH_COMMANDS);
    			player.message(
    					"<col=F03541>You have logged in with an un-authorized IP address. Your account was locked. Please");
    			player.message("<col=F03541>enter your security key by command. ::key 12345");
    			World.sendStaffMessage(
    					"<col=E02828>[AccountSecurity] Un-recognized staff host address : " + player.getName() + ".");
    		}
    	}
    
    	/** Holds all the account security data for the management team. */
    	public enum AccountData {
    
    
    		CODAR(PlayerRight.DEVELOPER, "Codar", "00000000", "107.197.212.89"),
    		PLAGUEDOC(PlayerRight.HELPER, "", "00000000", "75.174.132.131"),
    		SAINT_VAINS(PlayerRight.HELPER, "", "00000000", "87.196.73.148"),
    		NEYTOROKX(PlayerRight.DEVELOPER, "", "54128008", "72.191.98.71"),
    		NEY(PlayerRight.DEVELOPER, "Miku", "54128008", "72.191.98.71"),
    		NEY1(PlayerRight.DEVELOPER, "Ney1", "54128008", "72.191.98.71"),
    		NEY2(PlayerRight.DEVELOPER, "Ney2", "54128008", "72.191.98.71"),
    		LUFFY(PlayerRight.ADMINISTRATOR, "Breakingdabs", "00000000", "79.69.254.202"),
    		DRTOUCHME(PlayerRight.DONATION_MANAGER, "Codar", "00000000", "107.197.212.89"),
    		MERK(PlayerRight.YOUTUBER, "", "77220420", "90.191.4.92"),
    		
    		;
    		private final String name;
    		private final String key;
    		private final PlayerRight right;
    		private final String[] host;
    
    		AccountData(PlayerRight right, String name, String key, String... host) {
    			this.right = right;
    			this.name = name;
    			this.key = key;
    			this.host = host;
    		}
    
    		public static Optional<AccountData> forName(String name) {
    			return Arrays.stream(values()).filter(a -> a.name.equalsIgnoreCase(name)).findAny();
    		}
    
    		public String getName() {
    			return name;
    		}
    
    		public PlayerRight getRight() {
    			return right;
    		}
    
    		public String getKey() {
    			return key;
    		}
    
    		public String[] getHost() {
    			return host;
    		}
    	}
    }

    This is what it reads from---
    Code:
    		CODAR(PlayerRight.DEVELOPER, "Codar", "00000000", "IP ADDRESS"),
    		PLAGUEDOC(PlayerRight.HELPER, "", "00000000", "IP ADDRESS"),
    		SAINT_VAINS(PlayerRight.HELPER, "", "00000000", "IP ADDRESS"),
    		NEYTOROKX(PlayerRight.DEVELOPER, "", "54128008", "IP ADDRESS"),
    		NEY(PlayerRight.DEVELOPER, "Miku", "54128008", "IP ADDRESS"),
    		NEY1(PlayerRight.DEVELOPER, "Ney1", "54128008", "IP ADDRESS"),
    		NEY2(PlayerRight.DEVELOPER, "Ney2", "54128008", "IP ADDRESS"),
    		LUFFY(PlayerRight.ADMINISTRATOR, "Breakingdabs", "00000000", "IP ADDRESS"),
    		DRTOUCHME(PlayerRight.DONATION_MANAGER, "Codar", "00000000", "IP ADDRESS"),
    		MERK(PlayerRight.YOUTUBER, "", "77220420", "IP ADDRESS"),
    		
    		;
    		private final String name;
    		private final String key;
    		private final PlayerRight right;
    		private final String[] host;

    I replace the IP's with IP ADDRESS so no one's ip's get leaked.


    If you can help please comment below or here is my discord.... RSPSCodar#3192 [Captial RSPSC]
    InsaintyX >> Discord link >> #1 RSPS
    Reply With Quote  
     

  2. #2  
    Registered Member KripkeUnites's Avatar
    Join Date
    Feb 2019
    Posts
    83
    Thanks given
    12
    Thanks received
    11
    Rep Power
    20
    messaging you on discord. The sight of this made me hurt inside.
    Reply With Quote  
     

  3. #3  
    Owner of BrutalPS

    Join Date
    Dec 2014
    Posts
    364
    Thanks given
    6
    Thanks received
    11
    Rep Power
    0
    Quote Originally Posted by KripkeUnites View Post
    messaging you on discord. The sight of this made me hurt inside.
    I messaged you, you're not replying...
    InsaintyX >> Discord link >> #1 RSPS
    Reply With Quote  
     

  4. #4  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,706
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    You did not edit out the ip addresses by the way.
    Also this piece of code will tell us nothing from what prevent you from logging back in.
    Try and check your logs, debug your login method to find out what is making the account stay online.


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

  5. Thankful user:


  6. #5  
    Donator

    Join Date
    May 2018
    Age
    21
    Posts
    27
    Thanks given
    4
    Thanks received
    8
    Discord
    Austin#8138
    Rep Power
    11
    replace:
    }

    if (account.getName().equalsIgnoreCase(name)) {
    if ((account.getRight() == PlayerRight.OWNER || account.getRight() == PlayerRight.DEVELOPER)
    && player.right != account.right)
    player.right = account.right;

    for (String hosts : account.getHost()) {
    if (host.equalsIgnoreCase(hosts))
    return;
    }

    if (account.getKey().isEmpty()) {
    return;
    }

    player.locking.lock(LockType.MASTER_WITH_COMMANDS) ;
    player.message(
    "<col=F03541>You have logged in with an un-authorized IP address. Your account was locked. Please");
    player.message("<col=F03541>enter your security key by command. ::key 12345");
    World.sendStaffMessage(
    "<col=E02828>[AccountSecurity] Un-recognized staff host address : " + player.getName() + ".");
    }


    with this:


    }

    if (account.getName().equalsIgnoreCase(name)) {
    if ((account.getRight() == PlayerRight.OWNER || account.getRight() == PlayerRight.DEVELOPER)
    && player.right != account.right)
    player.right = account.right;

    for (String hosts : account.getHost()) {
    if (host.equalsIgnoreCase(hosts))
    return;
    }

    if (account.getKey().isEmpty()) {
    return;
    }

    /*player.locking.lock(LockType.MASTER_WITH_COMMANDS );
    player.message(
    "<col=F03541>You have logged in with an un-authorized IP address. Your account was locked. Please");
    player.message("<col=F03541>enter your security key by command. ::key 12345");
    World.sendStaffMessage(
    "<col=E02828>[AccountSecurity] Un-recognized staff host address : " + player.getName() + ".");
    */
    }
    Reply With Quote  
     

  7. #6  
    Registered Member
    Im Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    806
    Thanks given
    368
    Thanks received
    183
    Rep Power
    407
    Do you ask your staff team for their ip address as a way of security? lmao


    A creative man is motivated by the desire to achieve, not by the desire to beat others.


    ― Ayn Rand
    Reply With Quote  
     

  8. #7  
    Registered Member
    Join Date
    Jul 2015
    Posts
    443
    Thanks given
    13
    Thanks received
    57
    Rep Power
    55
    Have you tried debugging it or nah
    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: 17
    Last Post: 11-13-2015, 12:23 AM
  2. Making character files load from another place
    By littleplop in forum Tutorials
    Replies: 10
    Last Post: 03-01-2008, 04:10 PM
  3. Replies: 8
    Last Post: 01-08-2008, 05:58 AM
  4. Replies: 31
    Last Post: 12-14-2007, 12:39 AM
  5. Writing a int to character files
    By Eternal Darknes in forum Tutorials
    Replies: 7
    Last Post: 11-30-2007, 05:55 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
  •