Thread: Player xferring

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36
  1. #1 Player xferring 
    Registered Member
    Join Date
    May 2012
    Posts
    947
    Thanks given
    19
    Thanks received
    27
    Rep Power
    0
    need some help im trying to take my old player files and xfer them to my new player saving from the old saving method from the 718s to matrix rs3 account loading can anyone help me here little stuck trying to copy a whole player file over how would i go about doing this if you know what i mean.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    979
    Thanks given
    474
    Thanks received
    293
    Rep Power
    881
    No..What do you mean? Post both of them


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


    ― Ayn Rand
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2012
    Posts
    947
    Thanks given
    19
    Thanks received
    27
    Rep Power
    0
    I mean im trying to xfer the player files from .p to the .acc files on the new player saving

    Like xferring the player class fields to the player file on mx 830s player saving system
    Reply With Quote  
     

  4. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,556
    Thanks given
    652
    Thanks received
    640
    Rep Power
    358
    Would be useful if you posted the code relating to loading/saving for each of the files so we know which libs are used.
    Project thread
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2012
    Posts
    947
    Thanks given
    19
    Thanks received
    27
    Rep Power
    0
    Code:
    Player player = (Player) SerializableFilesManager.loadPlayer(accs);
    				Account account = (Account) JsonFileManager.loadJsonFile(new File("./data/accounts/blacksabath.acc"));
    				Player player2 = (Player) SerializationUtilities.loadObject(account.getFile(100));
    				
    				fields.clear();
    				for(final Field field : player.getClass().getDeclaredFields()) {
    					for(final Field field2 : player2.getClass().getDeclaredFields()) {
    					final int modifiers = field.getModifiers();
    					if(Modifier.isStatic(modifiers) || Modifier.isTransient(modifiers) || Modifier.isVolatile(modifiers)) {
    						continue;
    					}
    					if(field.getType() != String.class && field.getType() != boolean.class && field.getType() != byte.class && field.getType() != short.class && field.getType() != int.class && field.getType() != double.class && field.getType() != long.class && field.getType() != float.class) {
    						continue;
    					}
    					field.setAccessible(true);
    					fields.put(field.getName(), field);
    					Class<?> classz = field.getType();
    					field.set(player2, field.getType());
    					final ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(new File("./data/accounts/" + account.getFile(100) + ".acc")));
    					out.writeObject(player);
    					out.close();
    				
                       
                         
                       	 
                       
                		
                          
                              
                               
    
    					}
                     				//account.resetFileTransmit();
    				
    				JsonFileManager.saveAccount(account);
    im trying to do something the long the lines of this but not sure how to do it.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    979
    Thanks given
    474
    Thanks received
    293
    Rep Power
    881
    1) Is your server online? If not just delete the files and start over. 2) If it is online, why did you decide to change the structure of your player saving after releasing? You should've scrapped both matrix systems and just used json. I released it for matrix somewhere cba finding.


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


    ― Ayn Rand
    Reply With Quote  
     

  7. #7  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,556
    Thanks given
    652
    Thanks received
    640
    Rep Power
    358
    Quote Originally Posted by oblivion742 View Post
    Code:
    Player player = (Player) SerializableFilesManager.loadPlayer(accs);
    				Account account = (Account) JsonFileManager.loadJsonFile(new File("./data/accounts/blacksabath.acc"));
    				Player player2 = (Player) SerializationUtilities.loadObject(account.getFile(100));
    				
    				fields.clear();
    				for(final Field field : player.getClass().getDeclaredFields()) {
    					for(final Field field2 : player2.getClass().getDeclaredFields()) {
    					final int modifiers = field.getModifiers();
    					if(Modifier.isStatic(modifiers) || Modifier.isTransient(modifiers) || Modifier.isVolatile(modifiers)) {
    						continue;
    					}
    					if(field.getType() != String.class && field.getType() != boolean.class && field.getType() != byte.class && field.getType() != short.class && field.getType() != int.class && field.getType() != double.class && field.getType() != long.class && field.getType() != float.class) {
    						continue;
    					}
    					field.setAccessible(true);
    					fields.put(field.getName(), field);
    					Class<?> classz = field.getType();
    					field.set(player2, field.getType());
    					final ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(new File("./data/accounts/" + account.getFile(100) + ".acc")));
    					out.writeObject(player);
    					out.close();
    				
                       
                         
                       	 
                       
                		
                          
                              
                               
    
    					}
                     				//account.resetFileTransmit();
    				
    				JsonFileManager.saveAccount(account);
    im trying to do something the long the lines of this but not sure how to do it.
    So your issue is trying to convert the Player object that holds X data to an an Account object that holds Y data? And they're completely different objects?
    Project thread
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    May 2012
    Posts
    947
    Thanks given
    19
    Thanks received
    27
    Rep Power
    0
    yes so if you experimented with the 830s and 876s they are using mx3 login server thats what im using now but trying to convert the old saving player files to the new player saving. without losing the data.
    Reply With Quote  
     

  9. #9  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,556
    Thanks given
    652
    Thanks received
    640
    Rep Power
    358
    There's no automatic way to do this. If they're both objects with different data, then you will have to migrate each field manually.
    Project thread
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    May 2012
    Posts
    947
    Thanks given
    19
    Thanks received
    27
    Rep Power
    0
    how would i go about doing this.

    i am using json to save and load accs tho.
    Reply With Quote  
     

Page 1 of 4 123 ... 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. Are YOU a Player Mod for RuneScape?
    By ιаυяа in forum Voting
    Replies: 156
    Last Post: 06-23-2008, 11:03 PM
  2. Custom Player Title's
    By Dune in forum Tutorials
    Replies: 43
    Last Post: 09-03-2007, 11:34 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
  •