Browse Source

MyTeleport restriction update.
IPv6 telnet config.

JIV 15 năm trước cách đây
mục cha
commit
9028d9a175

+ 20 - 11
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -13912,53 +13912,62 @@ public final class L2PcInstance extends L2Playable
     
     public boolean teleportBookmarkCondition(int type)
     {
-    	
     	if(this.isInCombat())
     	{
-    		sendPacket(new SystemMessage(2348));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_BATTLE));
     		return false;
     	}
     	else if (this.isInSiege())
     	{
-    		sendPacket(new SystemMessage(2349));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING));
     		return false;
     	}
     	else if (this.isInDuel())
     	{
-    		sendPacket(new SystemMessage(2350));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_DUEL));
     		return false;
     	}
     	else if (this.isFlying())
     	{
-    		sendPacket(new SystemMessage(2351));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_FLYING));
     		return false;
     	}
     	else if (this.isInOlympiadMode())
     	{
-    		sendPacket(new SystemMessage(2352));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING_IN_AN_OLYMPIAD_MATCH));
     		return false;
     	}
     	else if (this.isParalyzed())
     	{
-    		sendPacket(new SystemMessage(2353));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_PARALYZED));
     		return false;
     	}
     	else if (this.isDead())
     	{
-    		sendPacket(new SystemMessage(2354));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_DEAD));
+    		return false;
+    	}
+    	else if (isIn7sDungeon() && type == 1)
+    	{
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
     		return false;
     	}
     	else if (this.isInBoat() || this.isInAirShip() || this.isInJail() || this.isInsideZone(ZONE_NOSUMMONFRIEND))
     	{
     		if(type == 0)
-    			sendPacket(new SystemMessage(2355));
+    			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_IN_THIS_AREA));
     		else if (type == 1)
-    			sendPacket(new SystemMessage(2410));
+    			sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
     		return false;
     	}
     	else if (this.isInWater())
     	{
-    		sendPacket(new SystemMessage(2356));
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_UNDERWATER));
+    		return false;
+    	}
+    	else if (type == 1 && (this.isInsideZone(ZONE_SIEGE) || this.isInsideZone(ZONE_CLANHALL) || this.isInsideZone(ZONE_JAIL) || this.isInsideZone(ZONE_CASTLE) || this.isInsideZone(ZONE_NOSUMMONFRIEND) || this.isInsideZone(ZONE_FORT)))
+    	{
+    		sendPacket(new SystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));
     		return false;
     	}
     	/* TODO: Instant Zone still not implement

+ 78 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/SystemMessageId.java

@@ -13796,6 +13796,78 @@ public enum SystemMessageId
 	*/
 	CP_DISAPPEARS_WHEN_HIT_WITH_A_HALF_KILL_SKILL(2337),
 	
+	/**
+	* ID: 2348<br>
+	* Message: You cannot use My Teleports during a battle.
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_BATTLE(2348),
+	
+	/**
+	* ID: 2349<br>
+	* Message: You cannot use My Teleports while participating a large-scale battle such as a castle siege, fortress siege, or hideout siege..
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING(2349),
+
+	/**
+	* ID: 2350<br>
+	* Message: You cannot use My Teleports during a duel
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_DUEL(2350),
+
+	/**
+	* ID: 2351<br>
+	* Message: You cannot use My Teleports while flying
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_WHILE_FLYING(2351),
+
+	/**
+	* ID: 2352<br>
+	* Message: You cannot use My Teleports while participating in an Olympiad match
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING_IN_AN_OLYMPIAD_MATCH(2352),
+
+	/**
+	* ID: 2353<br>
+	* Message: You cannot use My Teleports while you are in a flint or paralyzed state
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_PARALYZED(2353),
+
+	/**
+	* ID: 2354<br>
+	* Message: You cannot use My Teleports while you are dead
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_DEAD(2354),
+
+	/**
+	* ID: 2355<br>
+	* Message: You cannot use My Teleports in this area
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_IN_THIS_AREA(2355),
+
+	/**
+	* ID: 2356<br>
+	* Message: You cannot use My Teleports underwater
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_UNDERWATER(2356),
+
+	/**
+	* ID: 2357<br>
+	* Message: You cannot use My Teleports in an instant zone
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_IN_AN_INSTANT_ZONE(2357),
+
+	/**
+	* ID: 2358<br>
+	* Message: You have no space to save the teleport location
+	*/
+	YOU_HAVE_NO_SPACE_TO_SAVE_THE_TELEPORT_LOCATION(2358),
+
+	/**
+	* ID: 2359<br>
+	* Message: You cannot teleport because you do not have a teleport item
+	*/
+	YOU_CANNOT_TELEPORT_BECAUSE_YOU_DO_NOT_HAVE_A_TELEPORT_ITEM(2359),
+	
 	/**
 	 * ID: 2366<br>
 	 * Message: The limited-time item has been deleted..
@@ -13850,6 +13922,12 @@ public enum SystemMessageId
 	*/
 	THE_NUMBER_OF_MY_TELEPORTS_SLOTS_HAS_BEEN_INCREASED(2409),
 	
+	/**
+	* ID: 2410<br>
+	* Message: You cannot use My Teleports to reach this area!
+	*/
+	YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA(2410),
+	
 	/**
 	* ID: 2424<br>
 	* Message: The collection has failed.

+ 1 - 1
L2_GameServer/java/com/l2jserver/status/GameStatusThread.java

@@ -135,7 +135,7 @@ public class GameStatusThread extends Thread
             telnetIS = new FileInputStream(new File(Config.TELNET_FILE));
             telnetSettings.load(telnetIS);
 
-            String HostList = telnetSettings.getProperty("ListOfHosts", "127.0.0.1,localhost");
+            String HostList = telnetSettings.getProperty("ListOfHosts", "127.0.0.1,localhost,::1");
 
             if ( Config.DEVELOPER ) telnetOutput(3, "Comparing ip to list...");
 

+ 1 - 1
L2_GameServer/java/com/l2jserver/status/LoginStatusThread.java

@@ -72,7 +72,7 @@ public class LoginStatusThread extends Thread
 			telnetIS = new FileInputStream(new File(Config.TELNET_FILE));
 			telnetSettings.load(telnetIS);
 
-			String HostList = telnetSettings.getProperty("ListOfHosts", "127.0.0.1,localhost");
+			String HostList = telnetSettings.getProperty("ListOfHosts", "127.0.0.1,localhost,::1");
 
 			if ( Config.DEVELOPER ) telnetOutput(3, "Comparing ip to list...");
 

+ 2 - 2
L2_GameServer/java/config/telnet.properties

@@ -23,5 +23,5 @@ StatusPW =
 
 # This list can contain IPs or Hosts of clients you wish to allow. Hostnames must be resolvable to an IP.
 # Example: 0.0.0.0,host,0.0.0.1,host2,host3,host4,0.0.0.3
-# Default: 127.0.0.1,localhost
-ListOfHosts = 127.0.0.1,localhost
+# Default: 127.0.0.1,localhost,::1
+ListOfHosts = 127.0.0.1,localhost,::1