Thread: Is this possible to make

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Is this possible to make 
    Why are you looking here?


    Join Date
    Jul 2012
    Age
    30
    Posts
    3,214
    Thanks given
    830
    Thanks received
    357
    Rep Power
    559
    Hello guys,I have been thinking about some commands and Im wondering if this is possible to make,

    Lets say a staff member types in a command :howaccs and all of the persons accounts from that ip shows up as a list on the staffs member screen?is this possible to code,so for example some kid gets mad on someone and he makes a new account and starts flaming,so staff could see do :howaccs and all accounts from the persons ip shows up,so they would be able to know whos the main,is this possible to code?
    Reply With Quote  
     

  2. #2  
    Spread Love

    Dhruv's Avatar
    Join Date
    Feb 2012
    Age
    28
    Posts
    1,011
    Thanks given
    157
    Thanks received
    167
    Rep Power
    215
    Yeah probably is. You could add an interface with it too, to make it look better
    Reply With Quote  
     

  3. Thankful user:

    Normal DonatorRob

  4. #3  
    Why are you looking here?


    Join Date
    Jul 2012
    Age
    30
    Posts
    3,214
    Thanks given
    830
    Thanks received
    357
    Rep Power
    559
    Quote Originally Posted by Y O L O View Post
    Yeah probably is. You could add an interface with it too, to make it look better
    Any idea how that could possible be made?
    Reply With Quote  
     

  5. #4  
    Explicit Jerba™'s Avatar
    Join Date
    May 2012
    Posts
    720
    Thanks given
    83
    Thanks received
    167
    Rep Power
    55
    Do you mean like this sort of concept?

    Player A Rags like hell and makes new accounts...

    ::getaccounts Player A

    it will then print all the accounts made by that specific ip address?


    Reply With Quote  
     

  6. Thankful user:

    Normal DonatorRob

  7. #5  
    Spread Love

    Dhruv's Avatar
    Join Date
    Feb 2012
    Age
    28
    Posts
    1,011
    Thanks given
    157
    Thanks received
    167
    Rep Power
    215
    Make an interface hook it up to a command then hook other shit with it. I don't know how too do it but it would be a sick idea.
    Reply With Quote  
     

  8. Thankful user:

    Normal DonatorRob

  9. #6  
    Why are you looking here?


    Join Date
    Jul 2012
    Age
    30
    Posts
    3,214
    Thanks given
    830
    Thanks received
    357
    Rep Power
    559
    Quote Originally Posted by 'Jerba View Post
    Do you mean like this sort of concept?

    Player A Rags like hell and makes new accounts...

    ::getaccounts Player A

    it will then print all the accounts made by that specific ip address?
    Yep thats what I mean
    Reply With Quote  
     

  10. #7  
    Registered Member
    Join Date
    Jul 2012
    Posts
    900
    Thanks given
    66
    Thanks received
    85
    Rep Power
    0
    check the ip the player is connected to, then check the accounts for the ip they were last logged in with
    Reply With Quote  
     

  11. #8  
    Registered Member

    Join Date
    Apr 2012
    Posts
    762
    Thanks given
    0
    Thanks received
    276
    Rep Power
    213
    Code:
    PlayerSave.java
    	
    	charafterfile.write("ip-address = ", 0, 13);
    	characterfile.write(p.connectedFrom, 0, p.connectedFrom.length());
    	
    Commands.java
    
    	if (playerCommand.equalsIgnoreCase("showaccounts")) {
    		String[] args = playerCommand.split(" ");
    		String name = args[1];
    		for (int i = 0; i < Server.playerHandler.players.length; i++) {
    			Client o = (Client) Server.playerHandler.players[i];
    			if (o != null) {
    				if (o.playerName.equalsIgnoreCase(name)) {
    					String address = o.connectedFrom;
    					c.getPA().showAccounts(address);
    				}
    			}
    		}
    	}
    	
    PlayerAssistant.java
    
    	public void showAccounts(String address) {
    		File path = new File(".Data/characters/");
    		File[] characterFiles = path.listFiles();
    		for (int i = 0; i < characterFiles.length; i++) {
    			try {
    				String name = characterFiles[i].getName();
    				BufferedReader b = new BufferedReader(new FileReader(path +""+ name));
    				String line;
    				try {
    					line = b.readLine();
    					while (line != null) {
    						if (line.startsWith("ip-address")) {
    							int spot = line.indexOf("=");
    							String ip = line.substring(0, (spot + 1));
    							if (ip.equalsIgnoreCase(address)) {
    								c.sendMessage(name +" - "+ ip);
    							}
    						}
    					}
    				} finally {
    					b.close();
    				}
    			} catch (FileNotFoundException e) {
    				e.printStackTrace();
    			}
    		}
    	}
    Not tested
    Reply With Quote  
     

  12. #9  
    Why are you looking here?


    Join Date
    Jul 2012
    Age
    30
    Posts
    3,214
    Thanks given
    830
    Thanks received
    357
    Rep Power
    559
    Quote Originally Posted by L__A View Post
    Code:
    PlayerSave.java
    	
    	charafterfile.write("ip-address = ", 0, 13);
    	characterfile.write(p.connectedFrom, 0, p.connectedFrom.length());
    	
    Commands.java
    
    	if (playerCommand.equalsIgnoreCase("showaccounts")) {
    		String[] args = playerCommand.split(" ");
    		String name = args[1];
    		for (int i = 0; i < Server.playerHandler.players.length; i++) {
    			Client o = (Client) Server.playerHandler.players[i];
    			if (o != null) {
    				if (o.playerName.equalsIgnoreCase(name)) {
    					String address = o.connectedFrom;
    					c.getPA().showAccounts(address);
    				}
    			}
    		}
    	}
    	
    PlayerAssistant.java
    
    	public void showAccounts(String address) {
    		File path = new File(".Data/characters/");
    		File[] characterFiles = path.listFiles();
    		for (int i = 0; i < characterFiles.length; i++) {
    			try {
    				String name = characterFiles[i].getName();
    				BufferedReader b = new BufferedReader(new FileReader(path +""+ name));
    				String line;
    				try {
    					line = b.readLine();
    					while (line != null) {
    						if (line.startsWith("ip-address")) {
    							int spot = line.indexOf("=");
    							String ip = line.substring(0, (spot + 1));
    							if (ip.equalsIgnoreCase(address)) {
    								c.sendMessage(name +" - "+ ip);
    							}
    						}
    					}
    				} finally {
    					b.close();
    				}
    			} catch (FileNotFoundException e) {
    				e.printStackTrace();
    			}
    		}
    	}
    Not tested
    Thanks for this,also is this all I need to insert into the file and just test it by doing the command?
    Reply With Quote  
     

  13. #10  
    i want a PM. The best in life is free.
    Project M's Avatar
    Join Date
    Mar 2012
    Posts
    368
    Thanks given
    20
    Thanks received
    13
    Rep Power
    14
    Code:
    src\server\model\mobile\players\PlayerAssistant.java:154: error: cannot find sym
    bol
                    File path = new File(".Data/characters/");
                    ^
      symbol:   class File
      location: class PlayerAssistant
    src\server\model\mobile\players\PlayerAssistant.java:154: error: cannot find sym
    bol
                    File path = new File(".Data/characters/");
                                    ^
      symbol:   class File
      location: class PlayerAssistant
    src\server\model\mobile\players\PlayerAssistant.java:155: error: cannot find sym
    bol
                    File[] characterFiles = path.listFiles();
                    ^
      symbol:   class File
      location: class PlayerAssistant
    src\server\model\mobile\players\PlayerAssistant.java:159: error: cannot find sym
    bol
                                    BufferedReader b = new BufferedReader(new FileRe
    ader(path +""+ name));
                                    ^
      symbol:   class BufferedReader
      location: class PlayerAssistant
    src\server\model\mobile\players\PlayerAssistant.java:159: error: cannot find sym
    bol
                                    BufferedReader b = new BufferedReader(new FileRe
    ader(path +""+ name));
                                                           ^
      symbol:   class BufferedReader
      location: class PlayerAssistant
    src\server\model\mobile\players\PlayerAssistant.java:159: error: cannot find sym
    bol
                                    BufferedReader b = new BufferedReader(new FileRe
    ader(path +""+ name));
                                                                              ^
      symbol:   class FileReader
      location: class PlayerAssistant
    src\server\model\mobile\players\PlayerAssistant.java:175: error: cannot find sym
    bol
                            } catch (FileNotFoundException e) {
                                     ^
      symbol:   class FileNotFoundException
      location: class PlayerAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    7 errors
    Trykk en tast for ĺ fortsette...
    Reply With Quote  
     

  14. Thankful user:

    Normal DonatorRob

Page 1 of 2 12 LastLast

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: 29
    Last Post: 01-30-2012, 11:54 PM
  2. Replies: 4
    Last Post: 09-07-2011, 03:55 AM
  3. Replies: 5
    Last Post: 06-29-2010, 10:49 PM
  4. How to Make Cook X, Make X and Craft X Work.
    By minutes in forum Tutorials
    Replies: 9
    Last Post: 01-11-2010, 02:24 AM
  5. Replies: 1
    Last Post: 08-21-2009, 03:02 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
  •