瀏覽代碼

Minor Community Board update

Changed `bbs_favorite` table collation to `utf8_unicode_ci`.
	Reported by: @jurchiks
Partially implemented Friends Board.
Replaced deprecated method at Clan Board.
Removed `StringTokenizer` usage at Clan Board.
	Reported by: @jurchiks
Zoey76 10 年之前
父節點
當前提交
36fc143365

+ 0 - 93
L2J_DataPack/dist/game/data/html/CommunityBoard/friends.html

@@ -1,93 +0,0 @@
-<html>
-	<body>
-		<center>
-			<br>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="0" width="755">
-				<tr>
-					<td width="755" align="center" valign="top">
-						<font name="hs12">&$2306;</font>
-					</td>
-				</tr>
-			</table>
-			<br>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="2" bgcolor="A7A19A" width="755">
-				<tr>
-					<td width="100" align="right">&amp;$412;</td>
-					<td width="480" align="center">&amp;$413;</td>                 
-					<td width="160" align="center">&amp;$2258;</td>
-				</tr>
-			</table>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="2" width="755">
-				<tr>
-					<td fixwidth="100" align="right" valign="top">
-						<img src="l2ui.ActionWnd.bbs_Webfolder" width="32" height="32">
-					</td>
-					<td fixwidth="480" align="left" valign="top">
-						<font color="AAAAAA">&amp;$2259;</font><br1>
-						<font color="AAAAAA">&amp;$2260;</font>
-					</td>
-					<td fixwidth="160" align="center" valign="top">
-						<button value="&$2258;" action="url !2265" back="l2ui_ct1.button.button_df_small_down" fore="l2ui_ct1.button.button_df_small" width="74" height="25"/>
-					</td>
-				</tr>
-			</table>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="0">
-				<tr>
-					<td width="755">
-						<img src="l2ui.squaregray" width="750" height="1">
-					</td>
-				</tr>
-			</table>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="2" width="755">
-				<tr>
-					<td fixwidth="100" align="right" valign="top">
-						<img src="l2ui.ActionWnd.bbs_Webfolder" width="32" height="32">
-					</td>
-					<td fixwidth="480" align="left" valign="top">
-						<font color="AAAAAA">&amp;$2261;</font><br1>
-						<font color="AAAAAA">&amp;$2262;</font>
-					</td>
-					<td fixwidth="160" align="center" valign="top">
-						<button value="&$2258;" action="url !2266" back="l2ui_ct1.button.button_df_small_down" fore="l2ui_ct1.button.button_df_small" width="74" height="25"/>
-					</td>
-				</tr>
-			</table>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="0">
-				<tr>
-					<td width="755">
-						<img src="l2ui.squaregray" width="750" height="1">
-					</td>
-				</tr>
-			</table>
-			<br>
-			<table border="0" cellspacing="0" cellpadding="2" width="755">
-				<tr>
-					<td fixwidth="100" align="right" valign="top">
-						<img src="l2ui.ActionWnd.bbs_Webfolder" width="32" height="32">
-					</td>
-					<td fixwidth="480" align="left" valign="top">
-						<font color="AAAAAA">&amp;$2263;</font><br1>
-						<font color="AAAAAA">&amp;$2264;</font>
-					</td>
-					<td fixwidth="160" align="center" valign="top">
-						<button value="&$2258;" action="url !2267" back="l2ui_ct1.button.button_df_small_down" fore="l2ui_ct1.button.button_df_small" width="74" height="25"/>
-					</td>
-				</tr>
-			</table>
-			<br>       
-			<table border="0" cellspacing="0" cellpadding="0">
-				<tr>
-					<td width="755">
-						<img src="l2ui.squaregray" width="750" height="1">
-					</td>
-				</tr>
-			</table>
-		</center>
-	</body>
-</html>

+ 79 - 0
L2J_DataPack/dist/game/data/html/CommunityBoard/friends_block_list.html

@@ -0,0 +1,79 @@
+<html>
+	<body>
+		<br>
+		<br>
+		<table border="0" width="755">
+			<tr>
+				<td width="10">
+				</td>
+				<td width="600" align="left">
+					<a action="bypass_friendlist">&$904;</a>&nbsp;>&nbsp;Ignore list
+				</td>
+			</tr>
+		</table>
+		<center>
+			<img src="L2UI.squareblank" width="1" height="10">
+			<table border="0" cellspacing="0" cellpadding="0" width="755" bgcolor="A7A19A">
+				<tr>
+					<td width="5">
+					</td>
+					<td height="10" width="750">
+					</td>
+				</tr>
+				<tr>
+					<td>
+					</td>
+					<td height="20">
+						<a action="bypass_friendlist">[Friends list]</a>&nbsp;[Ignore list]
+					</td>
+				</tr>
+				<tr>
+					<td>
+					</td>
+					<td height="10">
+					</td>
+				</tr>
+			</table>
+			<br>
+			Ignore list <img src="L2UI.squaregray" width="755" height="1">
+			<br>
+			<table border="0" cellspacing="0" cellpadding="0" width="755">
+				<tr>
+					<td>
+						%block_list%
+					</td>
+				</tr>
+			</table>
+			<br>
+			<img src="L2UI.squaregray" width="755" height="2">
+			<br>
+			<table width="755" height="45" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td align="center">
+						<table border="0">
+						<tr>
+							<td fixwidth="90" align="right">
+								Character name
+							</td>
+							<td fixwidth="130">
+								<edit var="block" width=130 height="15" length="64" />
+							</td>
+							<td>
+								<button value="Block" action="Write_friendblockadd_" back="l2ui_ct1.button.button_df_small_down" width="70" height="25" fore="l2ui_ct1.button.button_df_small">
+							</td>
+						</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td width="755" align="right">
+						<img src="L2UI.squaregray" width="755" height="1">
+						<img src="L2UI.squareblank" width="755" height="4">
+						<button value="Delete All" action="bypass_friendblockdeleteallconfirm_" back="l2ui_ct1.button.button_df_small_down" width="70" height="25" fore="l2ui_ct1.button.button_df_small">
+					</td>
+				</tr>
+			</table>
+			%delete_all_msg%
+		</center>
+	</body>
+</html>

+ 90 - 0
L2J_DataPack/dist/game/data/html/CommunityBoard/friends_list.html

@@ -0,0 +1,90 @@
+<html>
+	<body>
+		<br>
+		<br>
+		<table border="0" width="755">
+		<tr>
+			<td width="10">
+			</td>
+			<td width="600" align="left">
+				<a action="bypass_friendlist">&$904;</a>&nbsp;>&nbsp;Friends List
+			</td>
+		</tr>
+		</table>
+		<center>
+			<img src="L2UI.squareblank" width="1" height="10">
+			<table border="0" cellspacing="0" cellpadding="0" width="755" bgcolor="A7A19A">
+				<tr>
+					<td width="5">
+					</td>
+					<td height="10" width="750">
+					</td>
+				</tr>
+				<tr>
+					<td>
+					</td>
+					<td height="20">
+						[Friends list]&nbsp;<a action="bypass_friendblocklist">[Ignore list]</a>
+					</td>
+				</tr>
+				<tr>
+					<td>
+					</td>
+					<td height="10">
+					</td>
+				</tr>
+			</table>
+			<br>
+			Friends list <img src="L2UI.squaregray" width="755" height="1">
+			<br>
+			<table border="0" cellspacing="0" cellpadding="0" width="755">
+				<tr>
+					<td>
+						%friend_list%
+					</td>
+				</tr>
+			</table>
+			<br>
+			<img src="L2UI.squaregray" width="755" height="2">
+			<br>
+			<br>
+			<font color="999999">Selection list</font>
+			<img src="L2UI.squaregray" width="755" height="1">
+			<br>
+			<table border="0" cellspacing="0" cellpadding="0" width="755">
+				<tr>
+					<td>
+						 %selected_friend_list%
+					</td>
+				</tr>
+			</table>
+			<br>
+			<img src="L2UI.squaregray" width="755" height="1">
+			<table fixwidth="755" border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td height="10">
+					</td>
+				</tr>
+				<tr>
+					<td width="5">
+					</td>
+					<td align="center" width="540">
+					</td>
+					<td align="center" width="70">
+						<button value "Delete" action="bypass_frienddelete_" back="l2ui_ct1.button.button_df_small_down" width="70" height="25" fore="l2ui_ct1.button.button_df_small">
+					</td>
+					<td align="center" width="70">
+						<button value "Delete All" action="bypass_frienddeleteallconfirm_" back="l2ui_ct1.button.button_df_small_down" width="70" height="25" fore="l2ui_ct1.button.button_df_small">
+					</td>
+					<td width="5">
+					</td>
+				</tr>
+				<tr>
+					<td height="10">
+					</td>
+				</tr>
+			</table>
+			%delete_all_msg%
+		</center>
+	</body>
+</html>

+ 20 - 11
L2J_DataPack/dist/game/data/scripts/handlers/communityboard/ClanBoard.java

@@ -18,8 +18,6 @@
  */
 package handlers.communityboard;
 
-import java.util.StringTokenizer;
-
 import com.l2jserver.gameserver.datatables.ClanTable;
 import com.l2jserver.gameserver.handler.CommunityBoardHandler;
 import com.l2jserver.gameserver.handler.IWriteBoardHandler;
@@ -74,10 +72,15 @@ public class ClanBoard implements IWriteBoardHandler
 			}
 			else if (command.startsWith("_bbsclan_clanlist;"))
 			{
-				StringTokenizer st = new StringTokenizer(command, ";");
-				st.nextToken();
-				int index = Integer.parseInt(st.nextToken());
-				clanList(activeChar, index);
+				try
+				{
+					clanList(activeChar, Integer.parseInt(command.split(";")[1]));
+				}
+				catch (Exception e)
+				{
+					clanList(activeChar, 1);
+					LOG.warning(ClanBoard.class.getSimpleName() + ": Player " + activeChar + " send invalid clan list bypass " + command + "!");
+				}
 			}
 		}
 		else if (command.startsWith("_bbsclan_clanhome"))
@@ -90,10 +93,15 @@ public class ClanBoard implements IWriteBoardHandler
 			}
 			else if (command.startsWith("_bbsclan_clanhome;"))
 			{
-				StringTokenizer st = new StringTokenizer(command, ";");
-				st.nextToken();
-				int index = Integer.parseInt(st.nextToken());
-				clanHome(activeChar, index);
+				try
+				{
+					clanHome(activeChar, Integer.parseInt(command.split(";")[1]));
+				}
+				catch (Exception e)
+				{
+					clanHome(activeChar);
+					LOG.warning(ClanBoard.class.getSimpleName() + ": Player " + activeChar + " send invalid clan home bypass " + command + "!");
+				}
 			}
 		}
 		else if (command.startsWith("_bbsclan_clannotice_edit;"))
@@ -157,7 +165,7 @@ public class ClanBoard implements IWriteBoardHandler
 					
 					StringUtil.append(html, "</td></tr></table><img src=\"L2UI.Squaregray\" width=\"610\" height=\"1\"><br> <br><table width=610 border=0 cellspacing=2 cellpadding=0><tr><td>Edit Notice: </td></tr><tr><td height=5></td></tr><tr><td><MultiEdit var =\"Content\" width=610 height=100></td></tr></table><br><table width=610 border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></tr><tr><td align=center FIXWIDTH=65><button value=\"&$140;\" action=\"Write Notice Set _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td><td align=center FIXWIDTH=45></td><td align=center FIXWIDTH=500></td></tr></table></center></body></html>");
 					
-					Util.sendCBHtml(activeChar, html.toString(), activeChar.getClan().getNotice(), false);
+					Util.sendCBHtml(activeChar, html.toString(), activeChar.getClan().getNotice());
 				}
 				else
 				{
@@ -275,6 +283,7 @@ public class ClanBoard implements IWriteBoardHandler
 	@Override
 	public boolean writeCommunityBoardCommand(L2PcInstance activeChar, String arg1, String arg2, String arg3, String arg4, String arg5)
 	{
+		// TODO: Implement.
 		return false;
 	}
 }

+ 22 - 5
L2J_DataPack/dist/game/data/scripts/handlers/communityboard/FriendsBoard.java

@@ -31,7 +31,8 @@ public class FriendsBoard implements IParseBoardHandler
 {
 	private static final String[] COMMANDS =
 	{
-		"_friendlist"
+		"_friendlist",
+		"_friendblocklist"
 	};
 	
 	@Override
@@ -43,10 +44,26 @@ public class FriendsBoard implements IParseBoardHandler
 	@Override
 	public boolean parseCommunityBoardCommand(String command, L2PcInstance activeChar)
 	{
-		CommunityBoardHandler.getInstance().addBypass(activeChar, "Friend Command", command);
-		
-		final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/friends.html");
-		CommunityBoardHandler.separateAndSend(html, activeChar);
+		if (command.equals("_friendlist"))
+		{
+			CommunityBoardHandler.getInstance().addBypass(activeChar, "Friends List", command);
+			
+			final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/friends_list.html");
+			
+			CommunityBoardHandler.separateAndSend(html, activeChar);
+		}
+		else if (command.equals("_friendblocklist"))
+		{
+			CommunityBoardHandler.getInstance().addBypass(activeChar, "Ignore list", command);
+			
+			final String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/friends_block_list.html");
+			
+			CommunityBoardHandler.separateAndSend(html, activeChar);
+		}
+		else
+		{
+			
+		}
 		return true;
 	}
 }

+ 1 - 1
L2J_DataPack/dist/game/data/scripts/handlers/communityboard/HomeBoard.java

@@ -97,7 +97,7 @@ public final class HomeBoard implements IParseBoardHandler
 		}
 		catch (Exception e)
 		{
-			LOG.warning(FavoriteBoard.class.getSimpleName() + "Coudn't load favorites count for player " + player.getName());
+			LOG.warning(FavoriteBoard.class.getSimpleName() + ": Coudn't load favorites count for player " + player.getName());
 		}
 		return count;
 	}

+ 1 - 0
L2J_DataPack/dist/game/data/scripts/handlers/communityboard/MemoBoard.java

@@ -54,6 +54,7 @@ public class MemoBoard implements IWriteBoardHandler
 	@Override
 	public boolean writeCommunityBoardCommand(L2PcInstance activeChar, String arg1, String arg2, String arg3, String arg4, String arg5)
 	{
+		// TODO: Implement.
 		return false;
 	}
 }

+ 12 - 2
L2J_DataPack/dist/game/data/scripts/handlers/communityboard/RegionBoard.java

@@ -28,6 +28,7 @@ import com.l2jserver.gameserver.instancemanager.CastleManager;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Castle;
+import com.l2jserver.gameserver.util.Util;
 
 /**
  * Region board.
@@ -78,8 +79,16 @@ public class RegionBoard implements IWriteBoardHandler
 		}
 		else if (command.startsWith("_bbsloc;"))
 		{
-			CommunityBoardHandler.getInstance().addBypass(activeChar, command, "Region>");
-			// TODO: Implement region info.
+			CommunityBoardHandler.getInstance().addBypass(activeChar, "Region>", command);
+			
+			final String id = command.replace("_bbsloc;", "");
+			if (!Util.isDigit(id))
+			{
+				LOG.warning(RegionBoard.class.getSimpleName() + ": Player " + activeChar + " sent and invalid region bypass " + command + "!");
+				return false;
+			}
+			
+			// TODO: Implement.
 		}
 		return true;
 	}
@@ -87,6 +96,7 @@ public class RegionBoard implements IWriteBoardHandler
 	@Override
 	public boolean writeCommunityBoardCommand(L2PcInstance activeChar, String arg1, String arg2, String arg3, String arg4, String arg5)
 	{
+		// TODO: Implement.
 		return false;
 	}
 }

+ 1 - 1
L2J_DataPack/dist/sql/game/bbs_favorite.sql

@@ -8,5 +8,5 @@ CREATE TABLE `bbs_favorites` (
 	UNIQUE INDEX `favId_playerId` (`favId`, `playerId`)
 )
 COMMENT='This table saves the Favorite links from each player for the community board.'
-COLLATE='utf8_general_ci'
+COLLATE='utf8_unicode_ci'
 ENGINE=InnoDB;

+ 1 - 0
L2J_DataPack/dist/sql/game/updates/20141105update.sql

@@ -0,0 +1 @@
+ALTER TABLE `bbs_favorites` COLLATE='utf8_unicode_ci';