Sfoglia il codice sorgente

Adding Config option for list of player names in the Region BBS.
By default, player-names are hidden.

Fulminus 17 anni fa
parent
commit
5ea4f599b9

+ 1 - 0
L2_GameServer_T1/java/config/options.properties

@@ -204,6 +204,7 @@ GMAudit = False
 #  - Old = old Community Bord
 #  - off =  no community Board
 CommunityType = old
+BBSShowPlayerList = False
 BBSDefault = _bbshome
 # show level of character to others in Community Board
 ShowLevelOnCommunityBoard = False

+ 3 - 0
L2_GameServer_T1/java/net/sf/l2j/Config.java

@@ -669,6 +669,7 @@ public final class Config
     // Community Board
     /** Type of community */
     public static String COMMUNITY_TYPE;
+    public static boolean BBS_SHOW_PLAYERLIST;
     public static String BBS_DEFAULT;
     /** Show level of the community board ? */
     public static boolean SHOW_LEVEL_COMMUNITYBOARD;
@@ -1304,6 +1305,7 @@ public final class Config
                 GMAUDIT                         = Boolean.valueOf(optionsSettings.getProperty("GMAudit", "False"));
 
                 COMMUNITY_TYPE                  = optionsSettings.getProperty("CommunityType", "old").toLowerCase();
+                BBS_SHOW_PLAYERLIST             = Boolean.valueOf(optionsSettings.getProperty("BBSShowPlayerList", "false"));
                 BBS_DEFAULT                     = optionsSettings.getProperty("BBSDefault", "_bbshome");
                 SHOW_LEVEL_COMMUNITYBOARD       = Boolean.valueOf(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
                 SHOW_STATUS_COMMUNITYBOARD      = Boolean.valueOf(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
@@ -2246,6 +2248,7 @@ public final class Config
         else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.valueOf(pValue);
 
         else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = pValue.toLowerCase();
+        else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
         else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(pValue);

+ 78 - 72
L2_GameServer_T1/java/net/sf/l2j/gameserver/communitybbs/Manager/RegionBBSManager.java

@@ -406,41 +406,44 @@ public class RegionBBSManager extends BaseBBSManager
 	        htmlCode.append(trClose);
 	        htmlCode.append("</table>");
 
-	        htmlCode.append("<table border=0>");
-	        htmlCode.append("<tr><td><table border=0>");
-
-	        int cell = 0;
-	        for (L2PcInstance player : getOnlinePlayers(page))
+            int cell = 0;
+	        if (Config.BBS_SHOW_PLAYERLIST)
 	        {
-	            cell++;
-
-	            if (cell == 1) htmlCode.append(trOpen);
-
-	            htmlCode.append("<td align=left valign=top FIXWIDTH=110><a action=\"bypass _bbsloc;playerinfo;"
-	                + player.getName() + "\">");
-
-	            if (player.isGM()) htmlCode.append("<font color=\"LEVEL\">" + player.getName()
-	                + "</font>");
-	            else htmlCode.append(player.getName());
-
-	            htmlCode.append("</a></td>");
-
-	            if (cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(colSpacer);
-
-	            if (cell == Config.NAME_PER_ROW_COMMUNITYBOARD)
-	            {
-	                cell = 0;
-	                htmlCode.append(trClose);
-	            }
-	        }
-	        if (cell > 0 && cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(trClose);
-	        htmlCode.append("</table><br></td></tr>");
-
-	        htmlCode.append(trOpen);
-	        htmlCode.append("<td><img src=\"sek.cbui355\" width=600 height=1><br></td>");
-	        htmlCode.append(trClose);
-
-	        htmlCode.append("</table>");
+    	        htmlCode.append("<table border=0>");
+    	        htmlCode.append("<tr><td><table border=0>");
+    
+    	        for (L2PcInstance player : getOnlinePlayers(page))
+    	        {
+    	            cell++;
+    
+    	            if (cell == 1) htmlCode.append(trOpen);
+    
+    	            htmlCode.append("<td align=left valign=top FIXWIDTH=110><a action=\"bypass _bbsloc;playerinfo;"
+    	                + player.getName() + "\">");
+    
+    	            if (player.isGM()) htmlCode.append("<font color=\"LEVEL\">" + player.getName()
+    	                + "</font>");
+    	            else htmlCode.append(player.getName());
+    
+    	            htmlCode.append("</a></td>");
+    
+    	            if (cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(colSpacer);
+    
+    	            if (cell == Config.NAME_PER_ROW_COMMUNITYBOARD)
+    	            {
+    	                cell = 0;
+    	                htmlCode.append(trClose);
+    	            }
+    	        }
+    	        if (cell > 0 && cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(trClose);
+    	        htmlCode.append("</table><br></td></tr>");
+    
+    	        htmlCode.append(trOpen);
+    	        htmlCode.append("<td><img src=\"sek.cbui355\" width=600 height=1><br></td>");
+    	        htmlCode.append(trClose);
+    
+    	        htmlCode.append("</table>");
+			}
 
 	        if (getOnlineCount("gm") > Config.NAME_PAGE_SIZE_COMMUNITYBOARD)
 	        {
@@ -514,45 +517,48 @@ public class RegionBBSManager extends BaseBBSManager
 	        htmlCode.append(trClose);
 	        htmlCode.append("</table>");
 
-	        htmlCode.append("<table border=0>");
-	        htmlCode.append("<tr><td><table border=0>");
-
-	        cell = 0;
-	        for (L2PcInstance player : getOnlinePlayers(page))
+	        if (Config.BBS_SHOW_PLAYERLIST) 
 	        {
-	            if ((player == null) || (player.getAppearance().getInvisible()))
-	                continue;                           // Go to next
-
-	            cell++;
-
-	            if (cell == 1) htmlCode.append(trOpen);
-
-	            htmlCode.append("<td align=left valign=top FIXWIDTH=110><a action=\"bypass _bbsloc;playerinfo;"
-	                + player.getName() + "\">");
-
-	            if (player.isGM()) htmlCode.append("<font color=\"LEVEL\">" + player.getName()
-	                + "</font>");
-	            else htmlCode.append(player.getName());
-
-	            htmlCode.append("</a></td>");
-
-	            if (cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(colSpacer);
-
-	            if (cell == Config.NAME_PER_ROW_COMMUNITYBOARD)
-	            {
-	                cell = 0;
-	                htmlCode.append(trClose);
-	            }
-	        }
-	        if (cell > 0 && cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(trClose);
-	        htmlCode.append("</table><br></td></tr>");
-
-	        htmlCode.append(trOpen);
-	        htmlCode.append("<td><img src=\"sek.cbui355\" width=600 height=1><br></td>");
-	        htmlCode.append(trClose);
-
-	        htmlCode.append("</table>");
-
+    	        htmlCode.append("<table border=0>");
+    	        htmlCode.append("<tr><td><table border=0>");
+    
+    	        cell = 0;
+    	        for (L2PcInstance player : getOnlinePlayers(page))
+    	        {
+    	            if ((player == null) || (player.getAppearance().getInvisible()))
+    	                continue;                           // Go to next
+    
+    	            cell++;
+    
+    	            if (cell == 1) htmlCode.append(trOpen);
+    
+    	            htmlCode.append("<td align=left valign=top FIXWIDTH=110><a action=\"bypass _bbsloc;playerinfo;"
+    	                + player.getName() + "\">");
+    
+    	            if (player.isGM()) htmlCode.append("<font color=\"LEVEL\">" + player.getName()
+    	                + "</font>");
+    	            else htmlCode.append(player.getName());
+    
+    	            htmlCode.append("</a></td>");
+    
+    	            if (cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(colSpacer);
+    
+    	            if (cell == Config.NAME_PER_ROW_COMMUNITYBOARD)
+    	            {
+    	                cell = 0;
+    	                htmlCode.append(trClose);
+    	            }
+    	        }
+    	        if (cell > 0 && cell < Config.NAME_PER_ROW_COMMUNITYBOARD) htmlCode.append(trClose);
+    	        htmlCode.append("</table><br></td></tr>");
+    
+    	        htmlCode.append(trOpen);
+    	        htmlCode.append("<td><img src=\"sek.cbui355\" width=600 height=1><br></td>");
+    	        htmlCode.append(trClose);
+    
+    	        htmlCode.append("</table>");
+			}
+	        
 	        if (getOnlineCount("pl") > Config.NAME_PAGE_SIZE_COMMUNITYBOARD)
 	        {
 		        htmlCode.append("<table border=0 width=600>");