Переглянути джерело

Olympiad teleport time configurable.
Forced buff icon update on oly start.
Cleanup Olympiad buff packet.
Fix for memory leak in LS thread. Thx DS for report.

JIV 15 роки тому
батько
коміт
e924f0d747

+ 3 - 0
L2_GameServer/java/com/l2jserver/Config.java

@@ -511,6 +511,7 @@ public final class Config
 	public static boolean ALT_OLY_ANNOUNCE_GAMES;
 	public static boolean ALT_OLY_ANNOUNCE_GAMES;
 	public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
 	public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
 	public static int ALT_OLY_ENCHANT_LIMIT;
 	public static int ALT_OLY_ENCHANT_LIMIT;
+	public static byte ALT_OLY_WAIT_TIME;
 	public static int ALT_MANOR_REFRESH_TIME;
 	public static int ALT_MANOR_REFRESH_TIME;
 	public static int ALT_MANOR_REFRESH_MIN;
 	public static int ALT_MANOR_REFRESH_MIN;
 	public static int ALT_MANOR_APPROVE_TIME;
 	public static int ALT_MANOR_APPROVE_TIME;
@@ -2333,6 +2334,8 @@ public final class Config
 						LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
 						LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
 					}
 					}
 					ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiad.getProperty("AltOlyEnchantLimit","-1"));
 					ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiad.getProperty("AltOlyEnchantLimit","-1"));
+					ALT_OLY_WAIT_TIME = Byte.parseByte(olympiad.getProperty("AltOlyWaitTime","120"));
+					if (ALT_OLY_WAIT_TIME != 120 && ALT_OLY_WAIT_TIME != 60 && ALT_OLY_WAIT_TIME != 30 && ALT_OLY_WAIT_TIME != 15 && ALT_OLY_WAIT_TIME != 5) ALT_OLY_WAIT_TIME = 120;
 				}
 				}
 				catch (Exception e)
 				catch (Exception e)
 				{
 				{

+ 4 - 0
L2_GameServer/java/com/l2jserver/gameserver/LoginServerThread.java

@@ -424,6 +424,10 @@ public class LoginServerThread extends Thread
 			if (Config.DEBUG)
 			if (Config.DEBUG)
 				e.printStackTrace();
 				e.printStackTrace();
 		}
 		}
+		finally
+		{
+			_accountsInGameServer.remove(account);
+		}
 	}
 	}
 	
 	
 	public void addGameServerLogin(String account, L2GameClient client)
 	public void addGameServerLogin(String account, L2GameClient client)

+ 12 - 11
L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java

@@ -874,6 +874,7 @@ class OlympiadGame
 			for (L2PcInstance player : _players)
 			for (L2PcInstance player : _players)
 			{
 			{
 				player.setIsOlympiadStart(true);
 				player.setIsOlympiadStart(true);
+				player.updateEffectIcons();
 			}
 			}
 		}
 		}
 		catch (Exception e)
 		catch (Exception e)
@@ -1168,6 +1169,16 @@ class OlympiadGameTask implements Runnable
 			return false;
 			return false;
 		}
 		}
 
 
+		_game._spawnOne.getLastSpawn().deleteMe();
+		_game._spawnTwo.getLastSpawn().deleteMe();
+		_game._spawnOne = null;
+		_game._spawnTwo = null;
+		
+		if (!_game.makeCompetitionStart())
+		{
+			return false;
+		}
+		
 		_game._playerOne.sendPacket(new ExOlympiadUserInfo(_game._playerOne));
 		_game._playerOne.sendPacket(new ExOlympiadUserInfo(_game._playerOne));
 		_game._playerOne.sendPacket(new ExOlympiadUserInfo(_game._playerTwo));
 		_game._playerOne.sendPacket(new ExOlympiadUserInfo(_game._playerTwo));
 		_game._playerTwo.sendPacket(new ExOlympiadUserInfo(_game._playerTwo));
 		_game._playerTwo.sendPacket(new ExOlympiadUserInfo(_game._playerTwo));
@@ -1183,16 +1194,6 @@ class OlympiadGameTask implements Runnable
 				}
 				}
 			}
 			}
 		}
 		}
-
-		_game._spawnOne.getLastSpawn().deleteMe();
-		_game._spawnTwo.getLastSpawn().deleteMe();
-		_game._spawnOne = null;
-		_game._spawnTwo = null;
-		
-		if (!_game.makeCompetitionStart())
-		{
-			return false;
-		}
 		
 		
 		// Wait 3 mins (Battle)
 		// Wait 3 mins (Battle)
 		for (int i = 0; i < BATTLE_PERIOD; i += 10000)
 		for (int i = 0; i < BATTLE_PERIOD; i += 10000)
@@ -1218,7 +1219,7 @@ class OlympiadGameTask implements Runnable
 		SystemMessage sm;
 		SystemMessage sm;
 		// Waiting for teleport to arena
 		// Waiting for teleport to arena
 		byte step = 60;
 		byte step = 60;
-		for (byte i = 120; i > 0; i -= step)
+		for (byte i = Config.ALT_OLY_WAIT_TIME; i > 0; i -= step)
 		{
 		{
 			sm = new SystemMessage(SystemMessageId.YOU_WILL_ENTER_THE_OLYMPIAD_STADIUM_IN_S1_SECOND_S);
 			sm = new SystemMessage(SystemMessageId.YOU_WILL_ENTER_THE_OLYMPIAD_STADIUM_IN_S1_SECOND_S);
 			sm.addNumber(i);
 			sm.addNumber(i);

+ 16 - 18
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java

@@ -32,16 +32,16 @@ public class ExOlympiadSpelledInfo extends L2GameServerPacket
 {
 {
 	// chdd(dhd)
 	// chdd(dhd)
 	private static final String _S__FE_2A_OLYMPIADSPELLEDINFO = "[S] FE:7b ExOlympiadSpelledInfo";
 	private static final String _S__FE_2A_OLYMPIADSPELLEDINFO = "[S] FE:7b ExOlympiadSpelledInfo";
-	private L2PcInstance _player;
+	private int _playerID;
 	private List<Effect> _effects;
 	private List<Effect> _effects;
-
-
+	
+	
 	private class Effect
 	private class Effect
 	{
 	{
 		protected int _skillId;
 		protected int _skillId;
 		protected int _level;
 		protected int _level;
 		protected int _duration;
 		protected int _duration;
-
+		
 		public Effect(int pSkillId, int pLevel, int pDuration)
 		public Effect(int pSkillId, int pLevel, int pDuration)
 		{
 		{
 			_skillId = pSkillId;
 			_skillId = pSkillId;
@@ -49,35 +49,33 @@ public class ExOlympiadSpelledInfo extends L2GameServerPacket
 			_duration = pDuration;
 			_duration = pDuration;
 		}
 		}
 	}
 	}
-
+	
 	public ExOlympiadSpelledInfo(L2PcInstance player)
 	public ExOlympiadSpelledInfo(L2PcInstance player)
 	{
 	{
 		_effects = new FastList<Effect>();
 		_effects = new FastList<Effect>();
-        _player = player;
+		_playerID = player.getObjectId();
 	}
 	}
-
+	
 	public void addEffect(int skillId, int level, int duration)
 	public void addEffect(int skillId, int level, int duration)
 	{
 	{
 		_effects.add(new Effect(skillId, level, duration));
 		_effects.add(new Effect(skillId, level, duration));
 	}
 	}
-
+	
 	@Override
 	@Override
 	protected final void writeImpl()
 	protected final void writeImpl()
 	{
 	{
-        if (_player == null)
-            return;
 		writeC(0xfe);
 		writeC(0xfe);
 		writeH(0x7b);
 		writeH(0x7b);
-		writeD(_player.getObjectId());
+		writeD(_playerID);
 		writeD(_effects.size());
 		writeD(_effects.size());
-        for (Effect temp : _effects)
-        {
-        	writeD(temp._skillId);
-        	writeH(temp._level);
-        	writeD(temp._duration/1000);
-        }
+		for (Effect temp : _effects)
+		{
+			writeD(temp._skillId);
+			writeH(temp._level);
+			writeD(temp._duration/1000);
+		}
 	}
 	}
-
+	
 	/* (non-Javadoc)
 	/* (non-Javadoc)
 	 * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
 	 * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
 	 */
 	 */

+ 6 - 0
L2_GameServer/java/config/olympiad.properties

@@ -110,3 +110,9 @@ AltOlyEnchantLimit = -1
 # Log all Olympiad fights and outcome to olympiad.csv file.
 # Log all Olympiad fights and outcome to olympiad.csv file.
 # Default: False
 # Default: False
 AlyOlyLogFights = False
 AlyOlyLogFights = False
+
+# Time to wait before teleported to arena.
+# Possible choices are: 120, 60, 30, 15, or 5.
+# If any other number is entered, the time will be set to 120 seconds.
+# Default: 120
+AltOlyWaitTime = 120