فهرست منبع

BETA: How many times with your GM which is in message refusal mode you have PMed a person and expecting to recieve a PM from him?
Well, here is your solution :)

Nik 13 سال پیش
والد
کامیت
3b1e690575

+ 6 - 1
L2J_Server_BETA/dist/game/config/Character.properties

@@ -749,4 +749,9 @@ StoreCharUiSettings = False
 # Character name restriction
 # Disallow characters to have a name which contains the words.
 # Split them with ",". Example: announcements,announce...
-ForbiddenNames = annou,ammou,amnou,anmou,anou,amou
+ForbiddenNames = annou,ammou,amnou,anmou,anou,amou
+
+# If enabled, when character in silence (block PMs) mode sends a PM to a character, silence mode no longer blocks this character, 
+# allowing both characters send each other PMs even with enabled silence mode.
+# The exclude list is cleared each time the character goes into silence mode.
+SilenceModeExclude = False

+ 2 - 0
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -231,6 +231,7 @@ public final class Config
 	public static boolean STORE_RECIPE_SHOPLIST;
 	public static boolean STORE_UI_SETTINGS;
 	public static String[] FORBIDDEN_NAMES;
+	public static boolean SILENCE_MODE_EXCLUDE;
 	
 	//--------------------------------------------------
 	// ClanHall Settings
@@ -1743,6 +1744,7 @@ public final class Config
 					STORE_RECIPE_SHOPLIST = Boolean.parseBoolean(Character.getProperty("StoreRecipeShopList", "False"));
 					STORE_UI_SETTINGS = Boolean.parseBoolean(Character.getProperty("StoreCharUiSettings", "False"));
 					FORBIDDEN_NAMES = Character.getProperty("ForbiddenNames", "").split(",");
+					SILENCE_MODE_EXCLUDE = Boolean.parseBoolean(Character.getProperty("SilenceModeExclude", "False"));
 					PLAYER_MOVEMENT_BLOCK_TIME = Integer.parseInt(Character.getProperty("NpcTalkBlockingTime", "0")) * 1000;
 				}
 				catch (Exception e)

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java

@@ -227,7 +227,7 @@ public class RegionBBSManager extends BaseBBSManager
 					_logChat.log(record);
 				}
 				CreatureSay cs = new CreatureSay(activeChar.getObjectId(), Say2.TELL, activeChar.getName(), ar3);
-				if (!receiver.isSilenceMode() && !BlockList.isBlocked(receiver, activeChar) )
+				if (!receiver.isSilenceMode(activeChar.getObjectId()) && !BlockList.isBlocked(receiver, activeChar) )
 				{
 					receiver.sendPacket(cs);
 					activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), Say2.TELL, "->" + receiver.getName(), ar3));

+ 20 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -14,6 +14,8 @@
  */
 package com.l2jserver.gameserver.model.actor.instance;
 
+import gnu.trove.TIntArrayList;
+
 import java.sql.Connection;
 import java.sql.Date;
 import java.sql.PreparedStatement;
@@ -664,6 +666,7 @@ public final class L2PcInstance extends L2Playable
 	private boolean _messageRefusal = false;    // message refusal mode
 	
 	private boolean _silenceMode = false;     // silence mode
+	private TIntArrayList _silenceModeExcluded = new TIntArrayList();     // silence mode
 	private boolean _dietMode = false;          // ignore weight penalty
 	private boolean _tradeRefusal = false;       // Trade refusal
 	private boolean _exchangeRefusal = false;   // Exchange refusal
@@ -14467,15 +14470,32 @@ public final class L2PcInstance extends L2Playable
 		return _silenceMode;
 	}
 	
+	/**
+	 * While at silenceMode, checks if this PC Instance blocks PMs for this user
+	 */
+	public boolean isSilenceMode(int objId)
+	{
+		if (Config.SILENCE_MODE_EXCLUDE && _silenceMode)
+			return !_silenceModeExcluded.contains(objId);
+		
+		return _silenceMode;
+	}
+	
 	/**
 	 * @param mode the _silenceMode to set
 	 */
 	public void setSilenceMode(boolean mode)
 	{
 		_silenceMode = mode;
+		_silenceModeExcluded.clear(); // Clear the excluded list on each setSilenceMode
 		sendPacket(new EtcStatusUpdate(this));
 	}
 	
+	public void addSilenceModeExcluded(int playerObjId)
+	{
+		_silenceModeExcluded.add(playerObjId);
+	}
+	
 	private void storeRecipeShopList()
 	{
 		Connection con = null;