Thread: [508] FileManager.java explain please?

Results 1 to 6 of 6
  1. #1 [508] FileManager.java explain please? 
    Registered Member

    Join Date
    Jun 2009
    Posts
    80
    Thanks given
    1
    Thanks received
    0
    Rep Power
    98
    Hey in fileManager.java when you make a new thing to save, you have to put something like
    Code:
     else if (line.startsWith("FamiliarType:")) {
                        p.FamiliarType = Integer.parseInt(line.substring(13));
    
                    }
    And I wanted to know what the
    Code:
    Integer.parseInt(line.substring(NUMBER));
    means? Because I have some stuff I want to add in there but I dont know what number I would use there. I will rep if you help thanks.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jun 2009
    Posts
    80
    Thanks given
    1
    Thanks received
    0
    Rep Power
    98
    Still need help
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jun 2009
    Posts
    80
    Thanks given
    1
    Thanks received
    0
    Rep Power
    98
    SOMEONE here has to know what it is.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Jumper''s Avatar
    Join Date
    Jan 2009
    Posts
    893
    Thanks given
    4
    Thanks received
    6
    Rep Power
    204
    It's basically for saving stuff like player rights, killcount points, etc

    Integer.parseInt(line.substring(NUMBER));
    That means

    (line.startsWith("FamiliarType:"))
    you see, the "FamiliarType:" is a total of 13 words, so you count it up and add the #13
    here:
    Integer.parseInt(line.substring(13));
    So if the code is
    else if (line.startsWith("Buttseks:")) {
    it would be
    Integer.parseInt(line.substring(9));
    so the whole code would look like this

    else if (line.startsWith("Buttseks:")) {
    p.Buttseks = Integer.parseInt(line.substring(9));

    }
    sorry if I cant explain properly i suck at explaining
    But if you still dont get it, i'll try to explain better

    Quote Originally Posted by runepurex123123 View Post
    don't flame me or I'm gonna rip yo dicks off and shove them up your asses b4 you hit the ground, cause I'm tired of this flaming bitch that is rune-server
    Beware.
    Reply With Quote  
     

  5. #5  
    Member [508] FileManager.java explain please? Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    It's the amount of letters/numbers it ignores before 'loading' whatever it is you're trying to load.

    As you can see, FamiliarType: is 12 letters and 1 :, so it ignores the first 13 characters then loads whatever is next (which is the FamiliarType variable).

    Attached imageAttached image
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jun 2009
    Posts
    80
    Thanks given
    1
    Thanks received
    0
    Rep Power
    98
    I get it. Thanks guys for actually answering repped
    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

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