Thread: ArrayList and Playersave's

Results 1 to 4 of 4
  1. #1 ArrayList and Playersave's 
    Registered Member
    Join Date
    Sep 2018
    Posts
    47
    Thanks given
    21
    Thanks received
    17
    Rep Power
    37
    Hello everyone,

    I'm currently in the process of re-writing the slayer skill, and had decided to add the osrs slayer interface as it has a pretty unique look. While coding the newer slayer skill I came across ArrayLists, Which at the time seemed like a bigger improvement over using a regular String array for what I was doing. Which was coding removed slayer task lists. So far everything works, The names appear on the interface upon removing a task. They are sorted after 2 or more in the list. However, my issue comes from the saving portion I believe. After logging out, and Logging back in. The ArrayList is reformating itself to one line, Causing all names of the slayer tasks you removed to appear on only the first line of the interface (Examples Below). I have tried multiple things, but so far have had no luck. I would greatly appreciate if someone could possibly help me into the right direction for fixing this.

    Thanks,
    Sado

    Before Logout
    Attached image

    After Logout
    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member
    Smokey's Avatar
    Join Date
    Apr 2011
    Posts
    287
    Thanks given
    124
    Thanks received
    73
    Rep Power
    351
    What base are you using and is said arraylist being serialized or parsed and saved to a database? are your player files stored as text or gzipped? we need a lil more info than what's provided here in order to help you

    One thing im seeing is you have
    Code:
    .
    between all of those titles.

    I'm just gonna take a wild guess and say that the array list is being formatted into a single string and then saved that way and you're trying to just add the string to the arraylist, rather than using the split("."); function and iterating through the results and appending said results one by one to a new arraylist
    Spoiler for signature:

    He is richest who is content with the least, for contentment is the wealth of nature. - Socrates
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    ^
    How are you saving and loading it?
    Attached imageAttached image
    Reply With Quote  
     

  5. #4  
    Community Veteran

    Dexter Morgan's Avatar
    Join Date
    Nov 2008
    Age
    28
    Posts
    4,419
    Thanks given
    1,184
    Thanks received
    757
    Rep Power
    3098
    What's the point of making such a huge paragraph without showing the code..
    Reply With Quote  
     

  6. Thankful user:



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: 0
    Last Post: 04-14-2016, 08:06 PM
  2. Speed comparison between Array, ArrayList, and HashMap
    By Conscientia in forum Informative Threads
    Replies: 5
    Last Post: 01-08-2014, 11:56 AM
  3. Replies: 2
    Last Post: 12-11-2012, 04:57 AM
  4. Arraylists and playerName [PI] Rep++
    By chri55w in forum Help
    Replies: 2
    Last Post: 08-18-2011, 01:06 PM
  5. File writing and reading for ArrayLists
    By bloodargon in forum Snippets
    Replies: 8
    Last Post: 07-01-2009, 03:27 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
  •