Thread: PlayerSave

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1 PlayerSave 
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    My server used to be able to send items into the playersave once a player died in an instanced fight. However, now it only does it to new players and not the old ones. Why is this and how can I fix it?
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Can you show us some video about this happening? Also perhaps the code involve?


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

  3. #3  
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by arch337 View Post
    Can you show us some video about this happening? Also perhaps the code involve?
    So basically, if an older player dies in an instanced fight with a NPC, the player's items just disappear completely. If a new player dies in the same instance to a NPC, that player's items will then go into that instance's death store. I can't seem to figure out why the older players aren't "writing" the items into the playersave.java


    Code:
    } else if (token.equals("lost-items")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getZulrahLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					} else if (token.equals("lost-items-cerberus")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getCerberusLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					} else if (token.equals("lost-items-skotizo")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getSkotizoLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}					
    					} else if (token.equals("lost-items-pvp")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getStatusHandlerLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					} else if (token.equals("lost-items-kraken")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getKrakenLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					}
    					break;
    Code:
    characterfile.newLine();
    			characterfile.write("lost-items = ");
    			for (GameItem item : p.getZulrahLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.write("lost-items-cerberus = ");
    			for (GameItem item : p.getCerberusLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.write("lost-items-skotizo = ");
    			for (GameItem item : p.getSkotizoLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.write("lost-items-pvp = ");
    			for (GameItem item : p.getStatusHandlerLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.write("lost-items-kraken = ");
    			for (GameItem item : p.getKrakenLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by Regenerating View Post
    So basically, if an older player dies in an instanced fight with a NPC, the player's items just disappear completely. If a new player dies in the same instance to a NPC, that player's items will then go into that instance's death store. I can't seem to figure out why the older players aren't "writing" the items into the playersave.java


    Code:
    } else if (token.equals("lost-items")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getZulrahLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					} else if (token.equals("lost-items-cerberus")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getCerberusLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					} else if (token.equals("lost-items-skotizo")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getSkotizoLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}					
    					} else if (token.equals("lost-items-pvp")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getStatusHandlerLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					} else if (token.equals("lost-items-kraken")) {
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getKrakenLostItems().add(new GameItem(itemId, itemAmount));
    							}
    						}
    					}
    					break;
    Code:
    characterfile.newLine();
    			characterfile.write("lost-items = ");
    			for (GameItem item : p.getZulrahLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.write("lost-items-cerberus = ");
    			for (GameItem item : p.getCerberusLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.write("lost-items-skotizo = ");
    			for (GameItem item : p.getSkotizoLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.write("lost-items-pvp = ");
    			for (GameItem item : p.getStatusHandlerLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    			characterfile.newLine();
    			characterfile.write("lost-items-kraken = ");
    			for (GameItem item : p.getKrakenLostItems()) {
    				if (item == null) {
    					continue;
    				}
    				characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    			}
    			characterfile.newLine();
    Seems like they are missing the lost item lines in their save.
    You need to make them if a player file do not have it.


    "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. #5  
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by arch337 View Post
    Seems like they are missing the lost item lines in their save.
    You need to make them if a player file do not have it.
    Think you could help me with that or point me in the right direction?

    Character files show that the lines are there.

    Lines of older player after death:
    Code:
    lost-items = 
    lost-items-cerberus = 
    lost-items-skotizo = 
    
    
    
    lost-items-pvp = 
    
    lost-items-kraken =
    Lines of new player after death:
    Code:
    lost-items = 
    lost-items-cerberus = 
    lost-items-skotizo = 4151	1	4151	1	4151	1	4151	1	4151	1	4151	1	
    
    
    
    lost-items-pvp = 
    
    lost-items-kraken =
    Reply With Quote  
     

  6. #6  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by Regenerating View Post
    Think you could help me with that or point me in the right direction?

    Character files show that the lines are there.

    Lines of older player after death:
    Code:
    lost-items = 
    lost-items-cerberus = 
    lost-items-skotizo = 
    
    
    
    lost-items-pvp = 
    
    lost-items-kraken =
    Lines of new player after death:
    Code:
    lost-items = 
    lost-items-cerberus = 
    lost-items-skotizo = 4151	1	4151	1	4151	1	4151	1	4151	1	4151	1	
    
    
    
    lost-items-pvp = 
    
    lost-items-kraken =
    Try and check a character that is old that it happend towards. See if it got the lines. Also before you do that under:
    characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    try add a debug: System.out.println("sends save!");
    Then with the old account try and die at where this should be trigged and logout to see if it trigger the debug.


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

  7. #7  
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by arch337 View Post
    Try and check a character that is old that it happend towards. See if it got the lines. Also before you do that under:
    characterfile.write(item.getId() + "\t" + item.getAmount() + "\t");
    try add a debug: System.out.println("sends save!");
    Then with the old account try and die at where this should be trigged and logout to see if it trigger the debug.
    Old account:
    Code:
    [10/20/17 8:08 PM]: Game saved for player 1
    [10/20/17 8:08 PM]: [Logged out]: 1
    Doesn't receive the debug.


    New account:
    Code:
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: Game saved for player 2
    [10/20/17 8:08 PM]: [Logged out]: 2
    Received debug.
    Reply With Quote  
     

  8. #8  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by Regenerating View Post
    Old account:
    Code:
    [10/20/17 8:08 PM]: Game saved for player 1
    [10/20/17 8:08 PM]: [Logged out]: 1
    Doesn't receive the debug.


    New account:
    Code:
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: sends save!
    [10/20/17 8:08 PM]: Game saved for player 2
    [10/20/17 8:08 PM]: [Logged out]: 2
    Received debug.
    And you made sure that the old account had these lines? Cause it seems like it was not otherwise it would of send the code.


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

  9. #9  
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by arch337 View Post
    And you made sure that the old account had these lines? Cause it seems like it was not otherwise it would of send the code.
    Yes, the old account has the lines. I even deleted the lines, logged back in and out, and it re-created the lines.
    Reply With Quote  
     

  10. #10  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by Regenerating View Post
    Yes, the old account has the lines. I even deleted the lines, logged back in and out, and it re-created the lines.
    Alright try:
    Code:
    					} else if (token.equals("lost-items-skotizo")) {
    System.out.println("sending save request...");
    						if (token3.length > 1) {
    							for (int i = 0; i < token3.length; i += 2) {
    								int itemId = Integer.parseInt(token3[i]);
    								int itemAmount = Integer.parseInt(token3[i + 1]);
    								p.getSkotizoLostItems().add(new GameItem(itemId, itemAmount));
    System.out.println("Found.." + itemId + ", " + itemAmount + ".");
    							}
    						}
    to see if it is even reading the file correctly. If it do not, then something else is up.
    If it does read it tthen something else is being wierd like the itemId and itemAmount or the method set.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    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. PlayerSave line throws: OutofBounds: Expectation.
    By Haskell Curry in forum Help
    Replies: 5
    Last Post: 01-04-2011, 06:15 PM
  2. PlayerSave.java: 2kB for a FULL player
    By Colby in forum Snippets
    Replies: 18
    Last Post: 12-19-2010, 02:15 AM
  3. [Shard] Playersaving
    By u piguy u in forum Help
    Replies: 1
    Last Post: 04-11-2010, 02:45 PM
  4. [508] playersave
    By josue992222 in forum Help
    Replies: 1
    Last Post: 06-04-2009, 11:10 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
  •