Browse Source

BETA: Typo fixes and JavaDocs fixes.

Zoey76 13 years ago
parent
commit
4ef7642642

+ 45 - 28
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -592,8 +592,10 @@ public final class L2PcInstance extends L2Playable
 	/** The list containing all shortCuts of this L2PcInstance */
 	private final ShortCuts _shortCuts = new ShortCuts(this);
 	
-	/** The list containing all macroses of this L2PcInstance */
-	private final MacroList _macroses = new MacroList(this);
+	/**
+	 * The list containing all macros of this L2PcInstance.
+	 */
+	private final MacroList _macros = new MacroList(this);
 	
 	private final List<L2PcInstance> _snoopListener = new FastList<L2PcInstance>();
 	private final List<L2PcInstance> _snoopedPlayer = new FastList<L2PcInstance>();
@@ -1894,29 +1896,27 @@ public final class L2PcInstance extends L2Playable
 	}
 	
 	/**
-	 * Add a L2Macro to the L2PcInstance _macroses<BR><BR>
-	 * @param macro 
+	 * @param macro the macro to add to this L2PcInstance.
 	 */
 	public void registerMacro(L2Macro macro)
 	{
-		_macroses.registerMacro(macro);
+		_macros.registerMacro(macro);
 	}
 	
 	/**
-	 * Delete the L2Macro corresponding to the Identifier from the L2PcInstance _macroses.<BR><BR>
-	 * @param id 
+	 * @param id the macro Id to delete.
 	 */
 	public void deleteMacro(int id)
 	{
-		_macroses.deleteMacro(id);
+		_macros.deleteMacro(id);
 	}
 	
 	/**
 	 * @return all L2Macro of the L2PcInstance.
 	 */
-	public MacroList getMacroses()
+	public MacroList getMacros()
 	{
-		return _macroses;
+		return _macros;
 	}
 	
 	/**
@@ -7343,7 +7343,10 @@ public final class L2PcInstance extends L2Playable
 					player.setClassId(player.getBaseClass());
 					_log.warning("Player "+player.getName()+" reverted to base class. Possibly has tried a relogin exploit while subclassing.");
 				}
-				else player._activeClass = activeClassId;
+				else
+				{
+					player._activeClass = activeClassId;
+				}
 				
 				player.setApprentice(rset.getInt("apprentice"));
 				player.setSponsor(rset.getInt("sponsor"));
@@ -7363,9 +7366,6 @@ public final class L2PcInstance extends L2Playable
 				
 				player.setVitalityPoints(rset.getInt("vitality_points"), true);
 				
-				// Add the L2PcInstance object in _allObjects
-				//L2World.getInstance().storeObject(player);
-				
 				// Set the x,y,z position of the L2PcInstance and make it invisible
 				player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
 				
@@ -7400,20 +7400,24 @@ public final class L2PcInstance extends L2Playable
 			statement.close();
 			
 			// Set Hero status if it applies
-			if (Hero.getInstance().getHeroes() != null && Hero.getInstance().getHeroes().containsKey(objectId))
+			if (Hero.getInstance().isHero(objectId))
+			{
 				player.setHero(true);
+			}
 			
-			// Retrieve from the database all skills of this L2PcInstance and add them to _skills
 			// Retrieve from the database all items of this L2PcInstance and add them to _inventory
 			player.getInventory().restore();
 			player.getFreight().restore(); 
 			if (!Config.WAREHOUSE_CACHE)
+			{
 				player.getWarehouse();
+			}
 			
 			// Retrieve from the database all secondary data of this L2PcInstance
-			// and reward expertise/lucky skills if necessary.
 			// Note that Clan, Noblesse and Hero skills are given separately and not here.
+			// Retrieve from the database all skills of this L2PcInstance and add them to _skills
 			player.restoreCharData();
+			// Reward auto-get skills and all available skills if auto-learn skills is true.
 			player.rewardSkills();
 			
 			// buff and status icons
@@ -7425,7 +7429,8 @@ public final class L2PcInstance extends L2Playable
 			player.setCurrentHp(currentHp);
 			player.setCurrentMp(currentMp);
 			
-			if (currentHp < 0.5) {
+			if (currentHp < 0.5)
+			{
 				player.setIsDead(true);
 				player.stopHpMpRegeneration();
 			}
@@ -7455,7 +7460,6 @@ public final class L2PcInstance extends L2Playable
 		{
 			L2DatabaseFactory.close(con);
 		}
-		
 		return player;
 	}
 	
@@ -7559,15 +7563,26 @@ public final class L2PcInstance extends L2Playable
 	}
 	
 	/**
-	 * Restores secondary data for the L2PcInstance, based on the current class index.
+	 * Restores:
+	 * <ul>
+	 * 	<li>Skills</li>
+	 * 	<li>Macros</li>
+	 * 	<li>Short-cuts</li>
+	 * 	<li>Henna</li>
+	 * 	<li>Teleport Bookmark</li>
+	 * 	<li>Recipe Book</li>
+	 * 	<li>Recipe Shop List (If configuration enabled)</li>
+	 * 	<li>Premium Item List</li>
+	 * 	<li>Pet Inventory Items</li>
+	 * </ul>
 	 */
 	private void restoreCharData()
 	{
 		// Retrieve from the database all skills of this L2PcInstance and add them to _skills.
 		restoreSkills();
 		
-		// Retrieve from the database all macroses of this L2PcInstance and add them to _macroses.
-		_macroses.restore();
+		// Retrieve from the database all macroses of this L2PcInstance and add them to _macros.
+		_macros.restore();
 		
 		// Retrieve from the database all shortCuts of this L2PcInstance and add them to _shortCuts.
 		_shortCuts.restore();
@@ -7581,15 +7596,15 @@ public final class L2PcInstance extends L2Playable
 		// Retrieve from the database the recipe book of this L2PcInstance.
 		restoreRecipeBook(true);
 		
-		// Restore Recipe Shop list
+		// Restore Recipe Shop list.
 		if(Config.STORE_RECIPE_SHOPLIST)
 			restoreRecipeShopList();
 		
-		// Load Premium Item List
+		// Load Premium Item List.
 		loadPremiumItemList();
 		
-		// Check for items in pet inventory
-		checkPetInvItems();
+		// Restore items in pet inventory.
+		restorePetInventoryItems();
 	}
 	
 	/**
@@ -15083,10 +15098,12 @@ public final class L2PcInstance extends L2Playable
 		_petItems = haveit;
 	}
 	
-	private void checkPetInvItems()
+	/**
+	 * Restore Pet's inventory items from database.
+	 */
+	private void restorePetInventoryItems()
 	{
 		Connection con = null;
-		
 		try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();

+ 8 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Hero.java

@@ -1112,6 +1112,14 @@ public class Hero
 		}
 	}
 	
+	/**
+	 * @param objectId the player's object Id to verify.
+	 * @return {@code true} if there are heros and the player is in the list, {@code false} otherwise.
+	 */
+	public boolean isHero(int objectId)
+	{
+		return _heroes == null ? false : _heroes.containsKey(objectId);
+	}
 	
 	@SuppressWarnings("synthetic-access")
 	private static class SingletonHolder

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/L2GamePacketHandler.java

@@ -182,7 +182,7 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
 						// RequestEquipItem
 						break;
 					case 0x16:
-						msg = new RequestUnEquipItem();
+						//msg = new RequestUnEquipItem();
 						break;
 					case 0x17:
 						msg = new RequestDropItem();

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java

@@ -312,7 +312,7 @@ public class EnterWorld extends L2GameClientPacket
 		activeChar.broadcastUserInfo();
 		
 		// Send Macro List
-		activeChar.getMacroses().sendUpdate();
+		activeChar.getMacros().sendUpdate();
 		
 		// Send Item List
 		sendPacket(new ItemList(activeChar, false));