JIV 15 лет назад
Родитель
Сommit
03c0d09cc6

+ 0 - 72
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -2637,43 +2637,7 @@ public abstract class L2Character extends L2Object
 		}
 	}
 
-	/** Task lauching the function stopPvPFlag() */
-	class PvPFlag implements Runnable
-	{
-		public PvPFlag()
-		{
-
-		}
-
-		public void run()
-		{
-			try
-			{
-				if (System.currentTimeMillis() > getPvpFlagLasts())
-				{
-					stopPvPFlag();
-				}
-				else if (System.currentTimeMillis() > (getPvpFlagLasts() - 20000))
-				{
-					updatePvPFlag(2);
-				}
-				else
-				{
-					updatePvPFlag(1);
-					// Start a new PvP timer check
-					//checkPvPFlag();
-				}
-			}
-			catch (Exception e)
-			{
-				_log.log(Level.WARNING, "error in pvp flag task:", e);
-			}
-		}
-	}
 	// =========================================================
-
-
-
 	/** Task lauching the magic skill phases */
 	class FlyToLocationTask implements Runnable
 	{
@@ -6684,46 +6648,10 @@ public abstract class L2Character extends L2Object
 		_castInterruptTime = newSkillCastEndTick-2; 
 	}
 
-	private Future<?> _PvPRegTask;
-
-	private long _pvpFlagLasts;
-
 	private boolean _AIdisabled = false;
 
 	private boolean _isMinion = false;
 
-	public void setPvpFlagLasts(long time)
-	{
-		_pvpFlagLasts = time;
-	}
-
-	public long getPvpFlagLasts()
-	{
-		return _pvpFlagLasts;
-	}
-
-	public void startPvPFlag()
-	{
-		updatePvPFlag(1);
-
-		_PvPRegTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PvPFlag(), 1000, 1000);
-	}
-
-	public void stopPvpRegTask()
-	{
-		if (_PvPRegTask != null)
-			_PvPRegTask.cancel(true);
-	}
-
-	public void stopPvPFlag()
-	{
-		stopPvpRegTask();
-
-		updatePvPFlag(0);
-
-		_PvPRegTask = null;
-	}
-
 	public void updatePvPFlag(int value)
 	{
 		// Overridden in L2PcInstance

+ 81 - 7
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -512,11 +512,10 @@ public final class L2PcInstance extends L2Playable
 	
 	private boolean _inCrystallize;
 	private boolean _inCraftMode;
-    
-    private L2Transformation _transformation;
-    
-    private int _transformationId = 0;
-
+	
+	private L2Transformation _transformation;
+	private int _transformationId = 0;
+	
 	/** The table containing all L2RecipeList of the L2PcInstance */
 	private Map<Integer, L2RecipeList> _dwarvenRecipeBook = new FastMap<Integer, L2RecipeList>();
 	private Map<Integer, L2RecipeList> _commonRecipeBook = new FastMap<Integer, L2RecipeList>();
@@ -806,6 +805,76 @@ public final class L2PcInstance extends L2Playable
 	
 	private int _movieId = 0;
 	
+	private Future<?> _PvPRegTask;
+
+	private long _pvpFlagLasts;
+	
+	public void setPvpFlagLasts(long time)
+	{
+		_pvpFlagLasts = time;
+	}
+
+	public long getPvpFlagLasts()
+	{
+		return _pvpFlagLasts;
+	}
+
+	public void startPvPFlag()
+	{
+		updatePvPFlag(1);
+
+		_PvPRegTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new PvPFlag(), 1000, 1000);
+	}
+
+	public void stopPvpRegTask()
+	{
+		if (_PvPRegTask != null)
+			_PvPRegTask.cancel(true);
+	}
+
+	public void stopPvPFlag()
+	{
+		stopPvpRegTask();
+
+		updatePvPFlag(0);
+
+		_PvPRegTask = null;
+	}
+	
+	/** Task lauching the function stopPvPFlag() */
+	class PvPFlag implements Runnable
+	{
+		public PvPFlag()
+		{
+
+		}
+
+		public void run()
+		{
+			try
+			{
+				if (System.currentTimeMillis() > getPvpFlagLasts())
+				{
+					stopPvPFlag();
+				}
+				else if (System.currentTimeMillis() > (getPvpFlagLasts() - 20000))
+				{
+					updatePvPFlag(2);
+				}
+				else
+				{
+					updatePvPFlag(1);
+					// Start a new PvP timer check
+					//checkPvPFlag();
+				}
+			}
+			catch (Exception e)
+			{
+				_log.log(Level.WARNING, "error in pvp flag task:", e);
+			}
+		}
+	}
+	
 	// Character UI
 	private L2UIKeysSettings _uiKeySettings;
 	
@@ -1003,10 +1072,15 @@ public final class L2PcInstance extends L2Playable
 
 	public String getAccountName()
 	{
-		if (getClient() == null || getClient().isDetached())
-			return "disconnected";
+		if (getClient() == null)
+			return getAccountNamePlayer();
 		return getClient().getAccountName();
 	}
+	
+	public String getAccountNamePlayer()
+	{
+		return _accountName;
+	}
 
 	public Map<Integer, String> getAccountChars()
 	{