Browse Source

Community Board refactoring:
Removed Community Server support.
Added support for Community Board externalized as DataPack scripts.
Removed most hardcoded boards and it's performance problems.

Zoey76 10 years ago
parent
commit
ee9dcfd701
42 changed files with 310 additions and 2871 deletions
  1. 0 1
      L2J_Server/.classpath
  2. 0 58
      L2J_Server/dist/game/config/CommunityServer.properties
  3. 4 22
      L2J_Server/dist/game/config/General.properties
  4. BIN
      L2J_Server/dist/libs/netcon-1.7.jar
  5. 4 48
      L2J_Server/java/com/l2jserver/Config.java
  6. 0 3
      L2J_Server/java/com/l2jserver/gameserver/GameServer.java
  7. 0 11
      L2J_Server/java/com/l2jserver/gameserver/Shutdown.java
  8. 0 157
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/CommunityBoard.java
  9. 0 69
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/AdminBBSManager.java
  10. 0 28
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/BaseBBSManager.java
  11. 0 276
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/ClanBBSManager.java
  12. 5 38
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/PostBBSManager.java
  13. 0 568
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java
  14. 0 85
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/TopBBSManager.java
  15. 10 49
      L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/TopicBBSManager.java
  16. 1 5
      L2J_Server/java/com/l2jserver/gameserver/datatables/ClanTable.java
  17. 235 0
      L2J_Server/java/com/l2jserver/gameserver/handler/CommunityBoardHandler.java
  18. 18 14
      L2J_Server/java/com/l2jserver/gameserver/handler/IParseBoardHandler.java
  19. 16 14
      L2J_Server/java/com/l2jserver/gameserver/handler/IWriteBoardHandler.java
  20. 2 30
      L2J_Server/java/com/l2jserver/gameserver/model/L2Clan.java
  21. 0 29
      L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  22. 0 6
      L2J_Server/java/com/l2jserver/gameserver/model/actor/stat/PlayableStat.java
  23. 0 4
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/AllyDismiss.java
  24. 0 4
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/AllyLeave.java
  25. 0 6
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
  26. 0 11
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestAnswerJoinAlly.java
  27. 4 26
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestBBSwrite.java
  28. 6 46
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java
  29. 4 28
      L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestShowBoard.java
  30. 0 270
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/CommunityServerThread.java
  31. 0 62
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/AuthResponse.java
  32. 0 86
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/ClanNoticeInfo.java
  33. 0 82
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/InitCS.java
  34. 0 54
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/RequestPlayerShowBoard.java
  35. 0 145
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/RequestPlayerShowMessage.java
  36. 0 150
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/RequestWorldInfo.java
  37. 0 35
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/BlowFishKey.java
  38. 0 157
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/InitWorldInfo.java
  39. 0 40
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/RequestCommunityBoardWrite.java
  40. 0 35
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/RequestShowCommunityBoard.java
  41. 0 118
      L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/WorldInfo.java
  42. 1 1
      L2J_Server/java/com/l2jserver/gameserver/util/Util.java

+ 0 - 1
L2J_Server/.classpath

@@ -8,7 +8,6 @@
 	<classpathentry kind="lib" path="dist/libs/jython-engine-2.2.1.jar" />
 	<classpathentry kind="lib" path="dist/libs/mail-1.5.2.jar" />
 	<classpathentry kind="lib" path="dist/libs/mmocore.jar" />
-	<classpathentry kind="lib" path="dist/libs/netcon-1.7.jar" />
 	<classpathentry kind="lib" path="dist/libs/Subnet-1.0.jar" />
 	<classpathentry kind="lib" path="dist/libs/L2J_GeoAbstraction.jar" />
 	<classpathentry kind="lib" path="dist/libs/weupnp-0.1.3.jar" />

+ 0 - 58
L2J_Server/dist/game/config/CommunityServer.properties

@@ -1,58 +0,0 @@
-# ---------------------------------------------------------------------------
-# Community Server Settings
-# ---------------------------------------------------------------------------
-
-# When this is enabled the server will listen for the Community Server.
-# Default: False
-EnableCommunityBoard = False
-# The address on which the server will listen for the Community Server.
-CommunityServerHostname = 127.0.0.1
-# The port on which the server will listen for the Community Server.
-# Default: 9013
-CommunityServerPort = 9013
-# Community Server SQL DP Id
-# Default: 200
-CommunityServerSqlDpId = 200
-# Community Server Hex Id
-# Default: 123456
-CommunityServerHexId = 123456
-
-# ================================================================
-# TCP Server start
-# ================================================================
-
-# ExternalHostAddress: Use * bind all available IPs
-# Default: *
-ExternalHostAddress = *
-# ExternalPort: Use 0 bind all available Ports
-# Default: 0
-ExternalPort = 0
-# ConnectionQueue: Maximum connections.
-# Default: 50
-ConnectionQueue = 50
-
-# Default: False
-FloodProtectionEnabled = False
-# Default: 15
-FastConnectionLimit = 15
-# Default: 350
-FastConnectionTime = 350
-# Default: 700
-NormalConnectionTime = 700
-# Default: 50
-MaxConnectionperIP = 50
-# Default: False
-IPBannEnabled = False
-# Default:
-IPBannList =
-
-# ================================================================
-# TCP Client start
-# ================================================================
-
-# SendBufferSize: DO NOT TOUCH!
-# Default: 8192
-SendBufferSize = 8192
-# SendBufferSize: DO NOT TOUCH!
-# Default: 8192
-ReceiveBufferSize = 8192

+ 4 - 22
L2J_Server/dist/game/config/General.properties

@@ -577,32 +577,14 @@ AllowPetWalkers = True
 # Default: False
 ShowServerNews = False
 
-# Type of the Community board:
-# 0 = community is disabled
-# 1 = old community
-# 2 = full community (not fully implemented, experimental)
-# Default: 1
-CommunityType = 1
-
-# Default: False
-BBSShowPlayerList = False
+# Enable the Community Board.
+# Default: True
+EnableCommunityBoard = True
 
+# Default Community Board page.
 # Default: _bbshome
 BBSDefault = _bbshome
 
-# show level of character to others in Community Board
-# Default: False
-ShowLevelOnCommunityBoard = False
-
-# Default: False
-ShowStatusOnCommunityBoard = False
-
-# Default: 50
-NamePageSizeOnCommunityBoard = 50
-
-# Default: 5
-NamePerRowOnCommunityBoard = 5
-
 # Enable chat filter
 # Default = False
 UseChatFilter = False

BIN
L2J_Server/dist/libs/netcon-1.7.jar


+ 4 - 48
L2J_Server/java/com/l2jserver/Config.java

@@ -97,7 +97,6 @@ public final class Config
 	public static final String FLOOD_PROTECTOR_FILE = "./config/FloodProtector.properties";
 	public static final String MMO_CONFIG_FILE = "./config/MMO.properties";
 	public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.properties";
-	public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
 	public static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.properties";
 	public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.properties";
 	public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
@@ -548,13 +547,8 @@ public final class Config
 	public static boolean ALLOW_MANOR;
 	public static boolean ALLOW_PET_WALKERS;
 	public static boolean SERVER_NEWS;
-	public static int COMMUNITY_TYPE;
-	public static boolean BBS_SHOW_PLAYERLIST;
+	public static boolean ENABLE_COMMUNITY_BOARD;
 	public static String BBS_DEFAULT;
-	public static boolean SHOW_LEVEL_COMMUNITYBOARD;
-	public static boolean SHOW_STATUS_COMMUNITYBOARD;
-	public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
-	public static int NAME_PER_ROW_COMMUNITYBOARD;
 	public static boolean USE_SAY_FILTER;
 	public static String CHAT_FILTER_CHARS;
 	public static int[] BAN_CHAT_CHANNELS;
@@ -952,15 +946,6 @@ public final class Config
 	public static boolean LOGIN_SERVER_SCHEDULE_RESTART;
 	public static long LOGIN_SERVER_SCHEDULE_RESTART_TIME;
 	
-	// --------------------------------------------------
-	// CommunityServer Settings
-	// --------------------------------------------------
-	public static boolean ENABLE_COMMUNITY_BOARD;
-	public static String COMMUNITY_SERVER_ADDRESS;
-	public static int COMMUNITY_SERVER_PORT;
-	public static byte[] COMMUNITY_SERVER_HEX_ID;
-	public static int COMMUNITY_SERVER_SQL_DP_ID;
-	
 	// --------------------------------------------------
 	// MMO Settings
 	// --------------------------------------------------
@@ -1190,15 +1175,6 @@ public final class Config
 			GAME_SERVER_SUBNETS = ipcd.getSubnets();
 			GAME_SERVER_HOSTS = ipcd.getHosts();
 			
-			// Load Community Properties file (if exists)
-			final PropertiesParser communityServerSettings = new PropertiesParser(COMMUNITY_CONFIGURATION_FILE);
-			
-			ENABLE_COMMUNITY_BOARD = communityServerSettings.getBoolean("EnableCommunityBoard", false);
-			COMMUNITY_SERVER_ADDRESS = communityServerSettings.getString("CommunityServerHostname", "localhost");
-			COMMUNITY_SERVER_PORT = communityServerSettings.getInt("CommunityServerPort", 9013);
-			COMMUNITY_SERVER_HEX_ID = new BigInteger(communityServerSettings.getString("CommunityServerHexId", "0"), 16).toByteArray();
-			COMMUNITY_SERVER_SQL_DP_ID = communityServerSettings.getInt("CommunityServerSqlDpId", 200);
-			
 			// Load Feature L2Properties file (if exists)
 			final PropertiesParser Feature = new PropertiesParser(FEATURE_CONFIG_FILE);
 			
@@ -1880,13 +1856,8 @@ public final class Config
 			ALLOW_CURSED_WEAPONS = General.getBoolean("AllowCursedWeapons", true);
 			ALLOW_PET_WALKERS = General.getBoolean("AllowPetWalkers", true);
 			SERVER_NEWS = General.getBoolean("ShowServerNews", false);
-			COMMUNITY_TYPE = General.getInt("CommunityType", 1);
-			BBS_SHOW_PLAYERLIST = General.getBoolean("BBSShowPlayerList", false);
+			ENABLE_COMMUNITY_BOARD = General.getBoolean("EnableCommunityBoard", true);
 			BBS_DEFAULT = General.getString("BBSDefault", "_bbshome");
-			SHOW_LEVEL_COMMUNITYBOARD = General.getBoolean("ShowLevelOnCommunityBoard", false);
-			SHOW_STATUS_COMMUNITYBOARD = General.getBoolean("ShowStatusOnCommunityBoard", false);
-			NAME_PAGE_SIZE_COMMUNITYBOARD = General.getInt("NamePageSizeOnCommunityBoard", 50);
-			NAME_PER_ROW_COMMUNITYBOARD = General.getInt("NamePerRowOnCommunityBoard", 5);
 			USE_SAY_FILTER = General.getBoolean("UseChatFilter", false);
 			CHAT_FILTER_CHARS = General.getString("ChatFilterChars", "^_^");
 			String[] propertySplit4 = General.getString("BanChatChannels", "0;1;8;17").trim().split(";");
@@ -3104,27 +3075,12 @@ public final class Config
 			case "allowpetwalkers":
 				ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
 				break;
-			case "communitytype":
-				COMMUNITY_TYPE = Integer.parseInt(pValue);
-				break;
-			case "bbsshowplayerlist":
-				BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
+			case "enablecommunityboard":
+				ENABLE_COMMUNITY_BOARD = Boolean.parseBoolean(pValue);
 				break;
 			case "bbsdefault":
 				BBS_DEFAULT = pValue;
 				break;
-			case "showleveloncommunityboard":
-				SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
-				break;
-			case "showstatusoncommunityboard":
-				SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
-				break;
-			case "namepagesizeoncommunityboard":
-				NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
-				break;
-			case "nameperrowoncommunityboard":
-				NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
-				break;
 			case "showservernews":
 				SERVER_NEWS = Boolean.parseBoolean(pValue);
 				break;

+ 0 - 3
L2J_Server/java/com/l2jserver/gameserver/GameServer.java

@@ -132,7 +132,6 @@ import com.l2jserver.gameserver.model.events.EventDispatcher;
 import com.l2jserver.gameserver.model.olympiad.Olympiad;
 import com.l2jserver.gameserver.network.L2GameClient;
 import com.l2jserver.gameserver.network.L2GamePacketHandler;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
 import com.l2jserver.gameserver.pathfinding.PathFinding;
 import com.l2jserver.gameserver.script.faenor.FaenorScriptEngine;
 import com.l2jserver.gameserver.scripting.L2ScriptEngineManager;
@@ -414,8 +413,6 @@ public class GameServer
 		_loginThread = LoginServerThread.getInstance();
 		_loginThread.start();
 		
-		CommunityServerThread.initialize();
-		
 		final SelectorConfig sc = new SelectorConfig();
 		sc.MAX_READ_PER_PASS = Config.MMO_MAX_READ_PER_PASS;
 		sc.MAX_SEND_PER_PASS = Config.MMO_MAX_SEND_PER_PASS;

+ 0 - 11
L2J_Server/java/com/l2jserver/gameserver/Shutdown.java

@@ -42,7 +42,6 @@ import com.l2jserver.gameserver.model.entity.Hero;
 import com.l2jserver.gameserver.model.olympiad.Olympiad;
 import com.l2jserver.gameserver.network.L2GameClient;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
 import com.l2jserver.gameserver.network.gameserverpackets.ServerStatus;
 import com.l2jserver.gameserver.network.serverpackets.ServerClose;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
@@ -245,16 +244,6 @@ public class Shutdown extends Thread
 				// ignore
 			}
 			
-			try
-			{
-				CommunityServerThread.getInstance().interrupt();
-				_log.info("Community Server Thread: Thread interruped(" + tc.getEstimatedTimeAndRestartCounter() + "ms).");
-			}
-			catch (Throwable t)
-			{
-				// ignore
-			}
-			
 			try
 			{
 				LoginServerThread.getInstance().interrupt();

+ 0 - 157
L2J_Server/java/com/l2jserver/gameserver/communitybbs/CommunityBoard.java

@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.communitybbs;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.communitybbs.Manager.ClanBBSManager;
-import com.l2jserver.gameserver.communitybbs.Manager.PostBBSManager;
-import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager;
-import com.l2jserver.gameserver.communitybbs.Manager.TopBBSManager;
-import com.l2jserver.gameserver.communitybbs.Manager.TopicBBSManager;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.L2GameClient;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
-
-public class CommunityBoard
-{
-	public static CommunityBoard getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	public void handleCommands(L2GameClient client, String command)
-	{
-		L2PcInstance activeChar = client.getActiveChar();
-		if (activeChar == null)
-		{
-			return;
-		}
-		
-		switch (Config.COMMUNITY_TYPE)
-		{
-			default:
-			case 0: // disabled
-				activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-				break;
-			case 1: // old
-				RegionBBSManager.getInstance().parsecmd(command, activeChar);
-				break;
-			case 2: // new
-				if (command.startsWith("_bbsclan"))
-				{
-					ClanBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else if (command.startsWith("_bbsmemo"))
-				{
-					TopicBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else if (command.startsWith("_bbstopics"))
-				{
-					TopicBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else if (command.startsWith("_bbsposts"))
-				{
-					PostBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else if (command.startsWith("_bbstop"))
-				{
-					TopBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else if (command.startsWith("_bbshome"))
-				{
-					TopBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else if (command.startsWith("_bbsloc"))
-				{
-					RegionBBSManager.getInstance().parsecmd(command, activeChar);
-				}
-				else
-				{
-					ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101");
-					activeChar.sendPacket(sb);
-					activeChar.sendPacket(new ShowBoard(null, "102"));
-					activeChar.sendPacket(new ShowBoard(null, "103"));
-				}
-				break;
-		}
-	}
-	
-	/**
-	 * @param client
-	 * @param url
-	 * @param arg1
-	 * @param arg2
-	 * @param arg3
-	 * @param arg4
-	 * @param arg5
-	 */
-	public void handleWriteCommands(L2GameClient client, String url, String arg1, String arg2, String arg3, String arg4, String arg5)
-	{
-		L2PcInstance activeChar = client.getActiveChar();
-		if (activeChar == null)
-		{
-			return;
-		}
-		
-		switch (Config.COMMUNITY_TYPE)
-		{
-			case 2:
-				if (url.equals("Topic"))
-				{
-					TopicBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
-				}
-				else if (url.equals("Post"))
-				{
-					PostBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
-				}
-				else if (url.equals("Region"))
-				{
-					RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
-				}
-				else if (url.equals("Notice"))
-				{
-					ClanBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
-				}
-				else
-				{
-					ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + url + " is not implemented yet</center><br><br></body></html>", "101");
-					activeChar.sendPacket(sb);
-					activeChar.sendPacket(new ShowBoard(null, "102"));
-					activeChar.sendPacket(new ShowBoard(null, "103"));
-				}
-				break;
-			case 1:
-				RegionBBSManager.getInstance().parsewrite(arg1, arg2, arg3, arg4, arg5, activeChar);
-				break;
-			default:
-			case 0:
-				ShowBoard sb = new ShowBoard("<html><body><br><br><center>The Community board is currently disabled</center><br><br></body></html>", "101");
-				activeChar.sendPacket(sb);
-				activeChar.sendPacket(new ShowBoard(null, "102"));
-				activeChar.sendPacket(new ShowBoard(null, "103"));
-				break;
-		}
-	}
-	
-	private static class SingletonHolder
-	{
-		protected static final CommunityBoard _instance = new CommunityBoard();
-	}
-}

+ 0 - 69
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/AdminBBSManager.java

@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.communitybbs.Manager;
-
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
-
-public class AdminBBSManager extends BaseBBSManager
-{
-	/**
-	 * Gets the single instance of AdminBBSManager.
-	 * @return single instance of AdminBBSManager
-	 */
-	public static AdminBBSManager getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	@Override
-	public void parsecmd(String command, L2PcInstance activeChar)
-	{
-		if (!activeChar.isGM())
-		{
-			return;
-		}
-		if (command.startsWith("admin_bbs"))
-		{
-			separateAndSend("<html><body><br><br><center>This Page is only an exemple :)<br><br>command=" + command + "</center></body></html>", activeChar);
-		}
-		else
-		{
-			ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101");
-			activeChar.sendPacket(sb);
-			activeChar.sendPacket(new ShowBoard(null, "102"));
-			activeChar.sendPacket(new ShowBoard(null, "103"));
-		}
-		
-	}
-	
-	@Override
-	public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
-	{
-		if (!activeChar.isGM())
-		{
-			return;
-		}
-	}
-	
-	private static class SingletonHolder
-	{
-		protected static final AdminBBSManager _instance = new AdminBBSManager();
-	}
-}

+ 0 - 28
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/BaseBBSManager.java

@@ -31,34 +31,6 @@ public abstract class BaseBBSManager
 	
 	public abstract void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar);
 	
-	protected void separateAndSend(String html, L2PcInstance acha)
-	{
-		if (html == null)
-		{
-			return;
-		}
-		if (html.length() < 4096)
-		{
-			acha.sendPacket(new ShowBoard(html, "101"));
-			acha.sendPacket(new ShowBoard(null, "102"));
-			acha.sendPacket(new ShowBoard(null, "103"));
-			
-		}
-		else if (html.length() < 8192)
-		{
-			acha.sendPacket(new ShowBoard(html.substring(0, 4096), "101"));
-			acha.sendPacket(new ShowBoard(html.substring(4096), "102"));
-			acha.sendPacket(new ShowBoard(null, "103"));
-			
-		}
-		else if (html.length() < 16384)
-		{
-			acha.sendPacket(new ShowBoard(html.substring(0, 4096), "101"));
-			acha.sendPacket(new ShowBoard(html.substring(4096, 8192), "102"));
-			acha.sendPacket(new ShowBoard(html.substring(8192), "103"));
-		}
-	}
-	
 	/**
 	 * @param html
 	 * @param acha

+ 0 - 276
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/ClanBBSManager.java

@@ -1,276 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.communitybbs.Manager;
-
-import java.util.StringTokenizer;
-
-import com.l2jserver.gameserver.datatables.ClanTable;
-import com.l2jserver.gameserver.model.L2Clan;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.util.StringUtil;
-
-public class ClanBBSManager extends BaseBBSManager
-{
-	public static ClanBBSManager getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	/**
-	 * @param command
-	 * @param activeChar
-	 */
-	@Override
-	public void parsecmd(String command, L2PcInstance activeChar)
-	{
-		if (command.equals("_bbsclan"))
-		{
-			if ((activeChar.getClan() == null) || (activeChar.getClan().getLevel() < 2))
-			{
-				clanlist(activeChar, 1);
-			}
-			else
-			{
-				clanhome(activeChar);
-			}
-		}
-		else if (command.startsWith("_bbsclan_clanlist"))
-		{
-			if (command.equals("_bbsclan_clanlist"))
-			{
-				clanlist(activeChar, 1);
-			}
-			else if (command.startsWith("_bbsclan_clanlist;"))
-			{
-				StringTokenizer st = new StringTokenizer(command, ";");
-				st.nextToken();
-				int index = Integer.parseInt(st.nextToken());
-				clanlist(activeChar, index);
-			}
-		}
-		else if (command.startsWith("_bbsclan_clanhome"))
-		{
-			if (command.equals("_bbsclan_clanhome"))
-			{
-				clanhome(activeChar);
-			}
-			else if (command.startsWith("_bbsclan_clanhome;"))
-			{
-				StringTokenizer st = new StringTokenizer(command, ";");
-				st.nextToken();
-				int index = Integer.parseInt(st.nextToken());
-				clanhome(activeChar, index);
-			}
-		}
-		else if (command.startsWith("_bbsclan_clannotice_edit;"))
-		{
-			clanNotice(activeChar, activeChar.getClanId());
-		}
-		else if (command.startsWith("_bbsclan_clannotice_enable"))
-		{
-			if (activeChar.getClan() != null)
-			{
-				activeChar.getClan().setNoticeEnabled(true);
-			}
-			clanNotice(activeChar, activeChar.getClanId());
-		}
-		else if (command.startsWith("_bbsclan_clannotice_disable"))
-		{
-			if (activeChar.getClan() != null)
-			{
-				activeChar.getClan().setNoticeEnabled(false);
-			}
-			clanNotice(activeChar, activeChar.getClanId());
-		}
-		else
-		{
-			separateAndSend("<html><body><br><br><center>Command : " + command + " needs core development</center><br><br></body></html>", activeChar);
-		}
-	}
-	
-	private void clanNotice(L2PcInstance activeChar, int clanId)
-	{
-		final L2Clan cl = ClanTable.getInstance().getClan(clanId);
-		if (cl != null)
-		{
-			if (cl.getLevel() < 2)
-			{
-				activeChar.sendPacket(SystemMessageId.NO_CB_IN_MY_CLAN);
-				parsecmd("_bbsclan_clanlist", activeChar);
-			}
-			else
-			{
-				final StringBuilder html = StringUtil.startAppend(2000, "<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> &gt; <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a>  &gt; <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), "\"> &amp;$802; </a></td></tr></table>");
-				if (activeChar.isClanLeader())
-				{
-					StringUtil.append(html, "<br><br><center><table width=610 border=0 cellspacing=0 cellpadding=0><tr><td fixwidth=610><font color=\"AAAAAA\">The Clan Notice function allows the clan leader to send messages through a pop-up window to clan members at login.</font> </td></tr><tr><td height=20></td></tr>");
-					
-					if (activeChar.getClan().isNoticeEnabled())
-					{
-						StringUtil.append(html, "<tr><td fixwidth=610> Clan Notice Function:&nbsp;&nbsp;&nbsp;on&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<a action=\"bypass _bbsclan_clannotice_disable\">off</a>");
-					}
-					else
-					{
-						StringUtil.append(html, "<tr><td fixwidth=610> Clan Notice Function:&nbsp;&nbsp;&nbsp;<a action=\"bypass _bbsclan_clannotice_enable\">on</a>&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;off");
-					}
-					
-					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>");
-					send1001(html.toString(), activeChar);
-					send1002(activeChar, activeChar.getClan().getNotice(), " ", "0");
-				}
-				else
-				{
-					StringUtil.append(html, "<img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=0><tr><td>You are not your clan's leader, and therefore cannot change the clan notice</td></tr></table>");
-					if (activeChar.getClan().isNoticeEnabled())
-					{
-						StringUtil.append(html, "<table border=0 cellspacing=0 cellpadding=0><tr><td>The current clan notice:</td></tr><tr><td fixwidth=5></td><td FIXWIDTH=600 align=left>" + activeChar.getClan().getNotice() + "</td><td fixqqwidth=5></td></tr></table>");
-					}
-					StringUtil.append(html, "</center></body></html>");
-					separateAndSend(html.toString(), activeChar);
-				}
-			}
-		}
-	}
-	
-	/**
-	 * @param activeChar
-	 * @param index
-	 */
-	private void clanlist(L2PcInstance activeChar, int index)
-	{
-		if (index < 1)
-		{
-			index = 1;
-		}
-		
-		// header
-		final StringBuilder html = StringUtil.startAppend(2000, "<html><body><br><br><center><br1><br1><table border=0 cellspacing=0 cellpadding=0><tr><td FIXWIDTH=15>&nbsp;</td><td width=610 height=30 align=left><a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixWIDTH=600><a action=\"bypass _bbsclan_clanhome;", String.valueOf((activeChar.getClan() != null) ? activeChar.getClan().getId() : 0), "\">[GO TO MY CLAN]</a>&nbsp;&nbsp;</td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table><br><table border=0 cellspacing=0 cellpadding=2 bgcolor=5A5A5A width=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=200 align=center>CLAN NAME</td><td FIXWIDTH=200 align=center>CLAN LEADER</td><td FIXWIDTH=100 align=center>CLAN LEVEL</td><td FIXWIDTH=100 align=center>CLAN MEMBERS</td><td FIXWIDTH=5></td></tr></table><img src=\"L2UI.Squareblank\" width=\"1\" height=\"5\">");
-		
-		int i = 0;
-		for (L2Clan cl : ClanTable.getInstance().getClans())
-		{
-			if (i > ((index + 1) * 7))
-			{
-				break;
-			}
-			
-			if (i++ >= ((index - 1) * 7))
-			{
-				StringUtil.append(html, "<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\"><table border=0 cellspacing=0 cellpadding=0 width=610><tr> <td FIXWIDTH=5></td><td FIXWIDTH=200 align=center><a action=\"bypass _bbsclan_clanhome;", String.valueOf(cl.getId()), "\">", cl.getName(), "</a></td><td FIXWIDTH=200 align=center>", cl.getLeaderName(), "</td><td FIXWIDTH=100 align=center>", String.valueOf(cl.getLevel()), "</td><td FIXWIDTH=100 align=center>", String.valueOf(cl.getMembersCount()), "</td><td FIXWIDTH=5></td></tr><tr><td height=5></td></tr></table><img src=\"L2UI.SquareBlank\" width=\"610\" height=\"3\"><img src=\"L2UI.SquareGray\" width=\"610\" height=\"1\">");
-			}
-		}
-		
-		html.append("<img src=\"L2UI.SquareBlank\" width=\"610\" height=\"2\"><table cellpadding=0 cellspacing=2 border=0><tr>");
-		
-		if (index == 1)
-		{
-			html.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
-		}
-		else
-		{
-			StringUtil.append(html, "<td><button action=\"_bbsclan_clanlist;", String.valueOf(index - 1), "\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
-		}
-		
-		i = 0;
-		int nbp;
-		nbp = ClanTable.getInstance().getClans().length / 8;
-		if ((nbp * 8) != ClanTable.getInstance().getClans().length)
-		{
-			nbp++;
-		}
-		for (i = 1; i <= nbp; i++)
-		{
-			if (i == index)
-			{
-				StringUtil.append(html, "<td> ", String.valueOf(i), " </td>");
-			}
-			else
-			{
-				StringUtil.append(html, "<td><a action=\"bypass _bbsclan_clanlist;", String.valueOf(i), "\"> ", String.valueOf(i), " </a></td>");
-			}
-			
-		}
-		if (index == nbp)
-		{
-			html.append("<td><button action=\"\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
-		}
-		else
-		{
-			StringUtil.append(html, "<td><button action=\"bypass _bbsclan_clanlist;", String.valueOf(index + 1), "\" back=\"l2ui_ch3.next1_down\" fore=\"l2ui_ch3.next1\" width=16 height=16 ></td>");
-		}
-		html.append("</tr></table><table border=0 cellspacing=0 cellpadding=0><tr><td width=610><img src=\"sek.cbui141\" width=\"610\" height=\"1\"></td></tr></table><table border=0><tr><td><combobox width=65 var=keyword list=\"Name;Ruler\"></td><td><edit var = \"Search\" width=130 height=11 length=\"16\"></td>" +
-		// TODO: search (Write in BBS)
-		"<td><button value=\"&$420;\" action=\"Write 5 -1 0 Search keyword keyword\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td> </tr></table><br><br></center></body></html>");
-		separateAndSend(html.toString(), activeChar);
-	}
-	
-	/**
-	 * @param activeChar
-	 */
-	private void clanhome(L2PcInstance activeChar)
-	{
-		clanhome(activeChar, activeChar.getClan().getId());
-	}
-	
-	private static class SingletonHolder
-	{
-		protected static final ClanBBSManager _instance = new ClanBBSManager();
-	}
-	
-	/**
-	 * @param activeChar
-	 * @param clanId
-	 */
-	private void clanhome(L2PcInstance activeChar, int clanId)
-	{
-		L2Clan cl = ClanTable.getInstance().getClan(clanId);
-		if (cl != null)
-		{
-			if (cl.getLevel() < 2)
-			{
-				activeChar.sendPacket(SystemMessageId.NO_CB_IN_MY_CLAN);
-				parsecmd("_bbsclan_clanlist", activeChar);
-			}
-			else
-			{
-				final String html = StringUtil.concat("<html><body><center><br><br><br1><br1><table border=0 cellspacing=0 cellpadding=0><tr><td FIXWIDTH=15>&nbsp;</td><td width=610 height=30 align=left><a action=\"bypass _bbshome\">HOME</a> &gt; <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a>  &gt; <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), "\"> &amp;$802; </a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixwidth=600><a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";announce\">[CLAN ANNOUNCEMENT]</a> <a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";cbb\">[CLAN BULLETIN BOARD]</a><a action=\"bypass _bbsclan_clanhome;", String.valueOf(clanId), ";cmail\">[CLAN MAIL]</a>&nbsp;&nbsp;<a action=\"bypass _bbsclan_clannotice_edit;", String.valueOf(clanId), ";cnotice\">[CLAN NOTICE]</a>&nbsp;&nbsp;</td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=610><tr><td height=10></td></tr><tr><td fixWIDTH=5></td><td fixwidth=290 valign=top></td><td fixWIDTH=5></td><td fixWIDTH=5 align=center valign=top><img src=\"l2ui.squaregray\" width=2  height=128></td><td fixWIDTH=5></td><td fixwidth=295><table border=0 cellspacing=0 cellpadding=0 width=295><tr><td fixWIDTH=100 align=left>CLAN NAME</td><td fixWIDTH=195 align=left>", cl.getName(), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN LEVEL</td><td fixWIDTH=195 align=left height=16>", String.valueOf(cl.getLevel()), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN MEMBERS</td><td fixWIDTH=195 align=left height=16>", String.valueOf(cl.getMembersCount()), "</td></tr><tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>CLAN LEADER</td><td fixWIDTH=195 align=left height=16>", cl.getLeaderName(), "</td></tr><tr><td height=7></td></tr>" +
-				// ADMINISTRATOR ??
-				/*
-				 * html.append("<tr>"); html.append("<td fixWIDTH=100 align=left>ADMINISTRATOR</td>"); html.append("<td fixWIDTH=195 align=left height=16>"+cl.getLeaderName()+"</td>"); html.append("</tr>");
-				 */
-				"<tr><td height=7></td></tr><tr><td fixWIDTH=100 align=left>ALLIANCE</td><td fixWIDTH=195 align=left height=16>", (cl.getAllyName() != null) ? cl.getAllyName() : "", "</td></tr></table></td><td fixWIDTH=5></td></tr><tr><td height=10></td></tr></table>" +
-				// TODO: the BB for clan :)
-				// html.append("<table border=0 cellspacing=0 cellpadding=0 width=610  bgcolor=333333>");
-				"<img src=\"L2UI.squareblank\" width=\"1\" height=\"5\"><img src=\"L2UI.squaregray\" width=\"610\" height=\"1\"><br></center><br> <br></body></html>");
-				separateAndSend(html, activeChar);
-			}
-		}
-	}
-	
-	@Override
-	public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
-	{
-		if (ar1.equals("Set"))
-		{
-			activeChar.getClan().setNotice(ar4);
-			parsecmd("_bbsclan_clanhome;" + activeChar.getClan().getId(), activeChar);
-		}
-	}
-}

File diff suppressed because it is too large
+ 5 - 38
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/PostBBSManager.java


+ 0 - 568
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/RegionBBSManager.java

@@ -1,568 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.communitybbs.Manager;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-import javolution.util.FastMap;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.GameServer;
-import com.l2jserver.gameserver.datatables.ClassListData;
-import com.l2jserver.gameserver.datatables.ExperienceTable;
-import com.l2jserver.gameserver.model.BlockList;
-import com.l2jserver.gameserver.model.L2World;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.itemcontainer.Inventory;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.clientpackets.Say2;
-import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
-import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
-import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
-import com.l2jserver.util.StringUtil;
-
-public class RegionBBSManager extends BaseBBSManager
-{
-	private static final Logger _logChat = Logger.getLogger("chat");
-	
-	private int _onlineCount = 0;
-	private int _onlineCountGm = 0;
-	private static Map<Integer, List<L2PcInstance>> _onlinePlayers = new FastMap<Integer, List<L2PcInstance>>().shared();
-	private static Map<Integer, Map<String, String>> _communityPages = new FastMap<Integer, Map<String, String>>().shared();
-	
-	@Override
-	public void parsecmd(String command, L2PcInstance activeChar)
-	{
-		if (command.equals("_bbsloc"))
-		{
-			showOldCommunity(activeChar, 1);
-		}
-		else if (command.startsWith("_bbsloc;page;"))
-		{
-			StringTokenizer st = new StringTokenizer(command, ";");
-			st.nextToken();
-			st.nextToken();
-			int page = 0;
-			try
-			{
-				page = Integer.parseInt(st.nextToken());
-			}
-			catch (NumberFormatException nfe)
-			{
-			}
-			
-			showOldCommunity(activeChar, page);
-		}
-		else if (command.startsWith("_bbsloc;playerinfo;"))
-		{
-			StringTokenizer st = new StringTokenizer(command, ";");
-			st.nextToken();
-			st.nextToken();
-			String name = st.nextToken();
-			
-			showOldCommunityPI(activeChar, name);
-		}
-		else
-		{
-			if (Config.COMMUNITY_TYPE == 1)
-			{
-				showOldCommunity(activeChar, 1);
-			}
-			else
-			{
-				ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101");
-				activeChar.sendPacket(sb);
-				activeChar.sendPacket(new ShowBoard(null, "102"));
-				activeChar.sendPacket(new ShowBoard(null, "103"));
-			}
-		}
-	}
-	
-	/**
-	 * Show old community player info.
-	 * @param activeChar the active char
-	 * @param name the player name
-	 */
-	private void showOldCommunityPI(L2PcInstance activeChar, String name)
-	{
-		final StringBuilder htmlCode = StringUtil.startAppend(1000, "<html><body><br><table border=0><tr><td FIXWIDTH=15></td><td align=center>L2J Community Board<img src=\"sek.cbui355\" width=610 height=1></td></tr><tr><td FIXWIDTH=15></td><td>");
-		L2PcInstance player = L2World.getInstance().getPlayer(name);
-		
-		if (player != null)
-		{
-			String sex = "Male";
-			if (player.getAppearance().getSex())
-			{
-				sex = "Female";
-			}
-			String levelApprox = "low";
-			if (player.getLevel() >= 60)
-			{
-				levelApprox = "very high";
-			}
-			else if (player.getLevel() >= 40)
-			{
-				levelApprox = "high";
-			}
-			else if (player.getLevel() >= 20)
-			{
-				levelApprox = "medium";
-			}
-			
-			StringUtil.append(htmlCode, "<table border=0><tr><td>", player.getName(), " (", sex, " ", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "):</td></tr><tr><td>Level: ", levelApprox, "</td></tr><tr><td><br></td></tr>");
-			
-			if ((activeChar != null) && (activeChar.isGM() || (player.getObjectId() == activeChar.getObjectId()) || Config.SHOW_LEVEL_COMMUNITYBOARD))
-			{
-				long nextLevelExp = 0;
-				long nextLevelExpNeeded = 0;
-				if (player.getLevel() < (ExperienceTable.getInstance().getMaxLevel() - 1))
-				{
-					nextLevelExp = ExperienceTable.getInstance().getExpForLevel(player.getLevel() + 1);
-					nextLevelExpNeeded = nextLevelExp - player.getExp();
-				}
-				
-				StringUtil.append(htmlCode, "<tr><td>Level: ", String.valueOf(player.getLevel()), "</td></tr><tr><td>Experience: ", String.valueOf(player.getExp()), "/", String.valueOf(nextLevelExp), "</td></tr><tr><td>Experience needed for level up: ", String.valueOf(nextLevelExpNeeded), "</td></tr><tr><td><br></td></tr>");
-			}
-			
-			int uptime = (int) player.getUptime() / 1000;
-			int h = uptime / 3600;
-			int m = (uptime - (h * 3600)) / 60;
-			int s = ((uptime - (h * 3600)) - (m * 60));
-			
-			StringUtil.append(htmlCode, "<tr><td>Uptime: ", String.valueOf(h), "h ", String.valueOf(m), "m ", String.valueOf(s), "s</td></tr><tr><td><br></td></tr>");
-			
-			if (player.getClan() != null)
-			{
-				StringUtil.append(htmlCode, "<tr><td>Clan: ", player.getClan().getName(), "</td></tr><tr><td><br></td></tr>");
-			}
-			
-			StringUtil.append(htmlCode, "<tr><td><multiedit var=\"pm\" width=240 height=40><button value=\"Send PM\" action=\"Write Region PM ", player.getName(), " pm pm pm\" width=110 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><tr><td><br><button value=\"Back\" action=\"bypass _bbsloc\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></td></tr></table></body></html>");
-			separateAndSend(htmlCode.toString(), activeChar);
-		}
-		else
-		{
-			ShowBoard sb = new ShowBoard(StringUtil.concat("<html><body><br><br><center>No player with name ", name, "</center><br><br></body></html>"), "101");
-			activeChar.sendPacket(sb);
-			activeChar.sendPacket(new ShowBoard(null, "102"));
-			activeChar.sendPacket(new ShowBoard(null, "103"));
-		}
-	}
-	
-	/**
-	 * Show old community.
-	 * @param activeChar the active char
-	 * @param page the page
-	 */
-	private void showOldCommunity(L2PcInstance activeChar, int page)
-	{
-		separateAndSend(getCommunityPage(page, activeChar.isGM() ? "gm" : "pl"), activeChar);
-	}
-	
-	@Override
-	public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
-	{
-		if (activeChar == null)
-		{
-			return;
-		}
-		
-		if (ar1.equals("PM"))
-		{
-			final StringBuilder htmlCode = StringUtil.startAppend(500, "<html><body><br><table border=0><tr><td FIXWIDTH=15></td><td align=center>L2J Community Board<img src=\"sek.cbui355\" width=610 height=1></td></tr><tr><td FIXWIDTH=15></td><td>");
-			
-			try
-			{
-				
-				L2PcInstance receiver = L2World.getInstance().getPlayer(ar2);
-				if (receiver == null)
-				{
-					StringUtil.append(htmlCode, "Player not found!<br><button value=\"Back\" action=\"bypass _bbsloc;playerinfo;", ar2, "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></body></html>");
-					separateAndSend(htmlCode.toString(), activeChar);
-					return;
-				}
-				if (Config.JAIL_DISABLE_CHAT && receiver.isJailed())
-				{
-					activeChar.sendMessage("Player is in jail.");
-					return;
-				}
-				if (receiver.isChatBanned())
-				{
-					activeChar.sendMessage("Player is chat banned.");
-					return;
-				}
-				if (activeChar.isJailed() && Config.JAIL_DISABLE_CHAT)
-				{
-					activeChar.sendMessage("You can not chat while in jail.");
-					return;
-				}
-				if (activeChar.isChatBanned())
-				{
-					activeChar.sendMessage("You are banned from using chat");
-					return;
-				}
-				
-				if (Config.LOG_CHAT)
-				{
-					LogRecord record = new LogRecord(Level.INFO, ar3);
-					record.setLoggerName("chat");
-					record.setParameters(new Object[]
-					{
-						"TELL",
-						"[" + activeChar.getName() + " to " + receiver.getName() + "]"
-					});
-					_logChat.log(record);
-				}
-				CreatureSay cs = new CreatureSay(activeChar.getObjectId(), Say2.TELL, activeChar.getName(), ar3);
-				if (!receiver.isSilenceMode(activeChar.getObjectId()) && !BlockList.isBlocked(receiver, activeChar))
-				{
-					receiver.sendPacket(cs);
-					activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), Say2.TELL, "->" + receiver.getName(), ar3));
-					StringUtil.append(htmlCode, "Message Sent<br><button value=\"Back\" action=\"bypass _bbsloc;playerinfo;", receiver.getName(), "\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></body></html>");
-					separateAndSend(htmlCode.toString(), activeChar);
-				}
-				else
-				{
-					SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE);
-					activeChar.sendPacket(sm);
-					parsecmd("_bbsloc;playerinfo;" + receiver.getName(), activeChar);
-				}
-			}
-			catch (StringIndexOutOfBoundsException e)
-			{
-				// ignore
-			}
-		}
-		else
-		{
-			ShowBoard sb = new ShowBoard(StringUtil.concat("<html><body><br><br><center>the command: ", ar1, " is not implemented yet</center><br><br></body></html>"), "101");
-			activeChar.sendPacket(sb);
-			activeChar.sendPacket(new ShowBoard(null, "102"));
-			activeChar.sendPacket(new ShowBoard(null, "103"));
-		}
-		
-	}
-	
-	/**
-	 * Change community board.
-	 */
-	public void changeCommunityBoard()
-	{
-		_onlinePlayers.clear();
-		_onlineCount = 0;
-		_onlineCountGm = 0;
-		
-		for (L2PcInstance player : L2World.getInstance().getPlayersSortedBy(Comparator.comparing(L2PcInstance::getName, String::compareToIgnoreCase)))
-		{
-			addOnlinePlayer(player);
-		}
-		
-		_communityPages.clear();
-		writeCommunityPages();
-	}
-	
-	/**
-	 * Adds the online player.
-	 * @param player the player
-	 */
-	private void addOnlinePlayer(L2PcInstance player)
-	{
-		boolean added = false;
-		
-		for (List<L2PcInstance> page : _onlinePlayers.values())
-		{
-			if (page.size() < Config.NAME_PAGE_SIZE_COMMUNITYBOARD)
-			{
-				if (!page.contains(player))
-				{
-					page.add(player);
-					if (!player.isInvisible())
-					{
-						_onlineCount++;
-					}
-					_onlineCountGm++;
-				}
-				added = true;
-				break;
-			}
-			else if (page.contains(player))
-			{
-				added = true;
-				break;
-			}
-		}
-		
-		if (!added)
-		{
-			List<L2PcInstance> temp = new ArrayList<>();
-			int page = _onlinePlayers.size() + 1;
-			if (temp.add(player))
-			{
-				_onlinePlayers.put(page, temp);
-				if (!player.isInvisible())
-				{
-					_onlineCount++;
-				}
-				_onlineCountGm++;
-			}
-		}
-	}
-	
-	/**
-	 * Write community pages.
-	 */
-	private void writeCommunityPages()
-	{
-		final StringBuilder htmlCode = new StringBuilder(2000);
-		final String tdClose = "</td>";
-		final String tdOpen = "<td align=left valign=top>";
-		final String trClose = "</tr>";
-		final String trOpen = "<tr>";
-		final String colSpacer = "<td FIXWIDTH=15></td>";
-		
-		for (int page : _onlinePlayers.keySet())
-		{
-			Map<String, String> communityPage = new FastMap<>();
-			htmlCode.setLength(0);
-			StringUtil.append(htmlCode, "<html><body><br><table>" + trOpen + "<td align=left valign=top>Server Restarted: ", String.valueOf(GameServer.dateTimeServerStarted.getTime()), tdClose + trClose + "</table><table>" + trOpen + tdOpen + "XP Rate: x", String.valueOf(Config.RATE_XP), tdClose + colSpacer + tdOpen + "Party XP Rate: x", String.valueOf(Config.RATE_XP * Config.RATE_PARTY_XP), tdClose + colSpacer + tdOpen + "XP Exponent: ", String.valueOf(Config.ALT_GAME_EXPONENT_XP), tdClose + trClose + trOpen + tdOpen + "SP Rate: x", String.valueOf(Config.RATE_SP), tdClose + colSpacer + tdOpen + "Party SP Rate: x", String.valueOf(Config.RATE_SP * Config.RATE_PARTY_SP), tdClose + colSpacer + tdOpen + "SP Exponent: ", String.valueOf(Config.ALT_GAME_EXPONENT_SP), tdClose + trClose + trOpen + tdOpen + "Drop Rate: ", String.valueOf(Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER), tdClose + colSpacer + tdOpen + "Spoil Rate: ", String.valueOf(Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER), tdClose + colSpacer + tdOpen + "Adena Rate: ", String.valueOf(Config.RATE_DROP_AMOUNT_MULTIPLIER.containsKey(Inventory.ADENA_ID) ? Config.RATE_DROP_AMOUNT_MULTIPLIER.get(Inventory.ADENA_ID).floatValue() : 1f), tdClose + trClose + "</table><table>" + trOpen + "<td><img src=\"sek.cbui355\" width=600 height=1><br></td>" + trClose + trOpen + tdOpen, String.valueOf(L2World.getInstance().getVisibleObjectsCount()), " Object count</td>" + trClose + trOpen + tdOpen, String.valueOf(getOnlineCount("gm")), " Player(s) Online</td>" + trClose + "</table>");
-			
-			int cell = 0;
-			if (Config.BBS_SHOW_PLAYERLIST)
-			{
-				htmlCode.append("<table border=0><tr><td><table border=0>");
-				
-				for (L2PcInstance player : getOnlinePlayers(page))
-				{
-					cell++;
-					
-					if (cell == 1)
-					{
-						htmlCode.append(trOpen);
-					}
-					
-					StringUtil.append(htmlCode, "<td align=left valign=top FIXWIDTH=110><a action=\"bypass _bbsloc;playerinfo;", player.getName(), "\">");
-					
-					if (player.isGM())
-					{
-						StringUtil.append(htmlCode, "<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>" + trOpen + "<td><img src=\"sek.cbui355\" width=600 height=1><br></td>" + trClose + "</table>");
-			}
-			
-			if (getOnlineCount("gm") > Config.NAME_PAGE_SIZE_COMMUNITYBOARD)
-			{
-				htmlCode.append("<table border=0 width=600><tr>");
-				if (page == 1)
-				{
-					htmlCode.append("<td align=right width=190><button value=\"Prev\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				else
-				{
-					StringUtil.append(htmlCode, "<td align=right width=190><button value=\"Prev\" action=\"bypass _bbsloc;page;", String.valueOf(page - 1), "\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				
-				StringUtil.append(htmlCode, "<td FIXWIDTH=10></td><td align=center valign=top width=200>Displaying ", String.valueOf(((page - 1) * Config.NAME_PAGE_SIZE_COMMUNITYBOARD) + 1), " - ", String.valueOf(((page - 1) * Config.NAME_PAGE_SIZE_COMMUNITYBOARD) + getOnlinePlayers(page).size()), " player(s)</td><td FIXWIDTH=10></td>");
-				if (getOnlineCount("gm") <= (page * Config.NAME_PAGE_SIZE_COMMUNITYBOARD))
-				{
-					htmlCode.append("<td width=190><button value=\"Next\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				else
-				{
-					StringUtil.append(htmlCode, "<td width=190><button value=\"Next\" action=\"bypass _bbsloc;page;", String.valueOf(page + 1), "\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				htmlCode.append("</tr></table>");
-			}
-			
-			htmlCode.append("</body></html>");
-			
-			communityPage.put("gm", htmlCode.toString());
-			
-			htmlCode.setLength(0);
-			StringUtil.append(htmlCode, "<html><body><br><table>" + trOpen + "<td align=left valign=top>Server Restarted: ", String.valueOf(GameServer.dateTimeServerStarted.getTime()), tdClose + trClose + "</table><table>" + trOpen + tdOpen + "XP Rate: ", String.valueOf(Config.RATE_XP), tdClose + colSpacer + tdOpen + "Party XP Rate: ", String.valueOf(Config.RATE_PARTY_XP), tdClose + colSpacer + tdOpen + "XP Exponent: ", String.valueOf(Config.ALT_GAME_EXPONENT_XP), tdClose + trClose + trOpen + tdOpen + "SP Rate: ", String.valueOf(Config.RATE_SP), tdClose + colSpacer + tdOpen + "Party SP Rate: ", String.valueOf(Config.RATE_PARTY_SP), tdClose + colSpacer + tdOpen + "SP Exponent: ", String.valueOf(Config.ALT_GAME_EXPONENT_SP), tdClose + trClose + trOpen + tdOpen + "Drop Rate: ", String.valueOf(Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER), tdClose + colSpacer + tdOpen + "Spoil Rate: ", String.valueOf(Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER), tdClose + colSpacer + tdOpen + "Adena Rate: ", String.valueOf(Config.RATE_DROP_AMOUNT_MULTIPLIER.containsKey(Inventory.ADENA_ID) ? Config.RATE_DROP_AMOUNT_MULTIPLIER.get(Inventory.ADENA_ID).floatValue() : 1f), tdClose + trClose + "</table><table>" + trOpen + "<td><img src=\"sek.cbui355\" width=600 height=1><br></td>" + trClose + trOpen + tdOpen, String.valueOf(getOnlineCount("pl")), " Player(s) Online</td>" + trClose + "</table>");
-			
-			if (Config.BBS_SHOW_PLAYERLIST)
-			{
-				htmlCode.append("<table border=0><tr><td><table border=0>");
-				
-				cell = 0;
-				for (L2PcInstance player : getOnlinePlayers(page))
-				{
-					if ((player == null) || (player.isInvisible()))
-					{
-						continue; // Go to next
-					}
-					
-					cell++;
-					
-					if (cell == 1)
-					{
-						htmlCode.append(trOpen);
-					}
-					
-					StringUtil.append(htmlCode, "<td align=left valign=top FIXWIDTH=110><a action=\"bypass _bbsloc;playerinfo;", player.getName(), "\">");
-					
-					if (player.isGM())
-					{
-						StringUtil.append(htmlCode, "<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>" + trOpen + "<td><img src=\"sek.cbui355\" width=600 height=1><br></td>" + trClose + "</table>");
-			}
-			
-			if (getOnlineCount("pl") > Config.NAME_PAGE_SIZE_COMMUNITYBOARD)
-			{
-				htmlCode.append("<table border=0 width=600><tr>");
-				
-				if (page == 1)
-				{
-					htmlCode.append("<td align=right width=190><button value=\"Prev\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				else
-				{
-					StringUtil.append(htmlCode, "<td align=right width=190><button value=\"Prev\" action=\"bypass _bbsloc;page;", String.valueOf(page - 1), "\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				
-				StringUtil.append(htmlCode, "<td FIXWIDTH=10></td><td align=center valign=top width=200>Displaying ", String.valueOf(((page - 1) * Config.NAME_PAGE_SIZE_COMMUNITYBOARD) + 1), " - ", String.valueOf(((page - 1) * Config.NAME_PAGE_SIZE_COMMUNITYBOARD) + getOnlinePlayers(page).size()), " player(s)</td><td FIXWIDTH=10></td>");
-				
-				if (getOnlineCount("pl") <= (page * Config.NAME_PAGE_SIZE_COMMUNITYBOARD))
-				{
-					htmlCode.append("<td width=190><button value=\"Next\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				else
-				{
-					StringUtil.append(htmlCode, "<td width=190><button value=\"Next\" action=\"bypass _bbsloc;page;", String.valueOf(page + 1), "\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
-				}
-				
-				htmlCode.append("</tr></table>");
-			}
-			
-			htmlCode.append("</body></html>");
-			
-			communityPage.put("pl", htmlCode.toString());
-			
-			_communityPages.put(page, communityPage);
-		}
-	}
-	
-	/**
-	 * Gets the online count.
-	 * @param type the type, Game Masters or normal players
-	 * @return the online count
-	 */
-	private int getOnlineCount(String type)
-	{
-		if (type.equalsIgnoreCase("gm"))
-		{
-			return _onlineCountGm;
-		}
-		
-		return _onlineCount;
-	}
-	
-	/**
-	 * Gets the online players.
-	 * @param page the page
-	 * @return the online players
-	 */
-	private List<L2PcInstance> getOnlinePlayers(int page)
-	{
-		return _onlinePlayers.get(page);
-	}
-	
-	/**
-	 * Gets the community page.
-	 * @param page the page
-	 * @param type the type
-	 * @return the community page
-	 */
-	public String getCommunityPage(int page, String type)
-	{
-		if (_communityPages.get(page) != null)
-		{
-			return _communityPages.get(page).get(type);
-		}
-		
-		return null;
-	}
-	
-	/**
-	 * Gets the single instance of RegionBBSManager.
-	 * @return single instance of RegionBBSManager
-	 */
-	public static RegionBBSManager getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	private static class SingletonHolder
-	{
-		protected static final RegionBBSManager _instance = new RegionBBSManager();
-	}
-}

+ 0 - 85
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/TopBBSManager.java

@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.communitybbs.Manager;
-
-import java.util.StringTokenizer;
-
-import com.l2jserver.gameserver.cache.HtmCache;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
-
-public class TopBBSManager extends BaseBBSManager
-{
-	@Override
-	public void parsecmd(String command, L2PcInstance activeChar)
-	{
-		if (command.equals("_bbstop"))
-		{
-			String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/index.htm");
-			if (content == null)
-			{
-				content = "<html><body><br><br><center>404 :File not found: 'data/html/CommunityBoard/index.htm' </center></body></html>";
-			}
-			separateAndSend(content, activeChar);
-		}
-		else if (command.equals("_bbshome"))
-		{
-			String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/index.htm");
-			if (content == null)
-			{
-				content = "<html><body><br><br><center>404 :File not found: 'data/html/CommunityBoard/index.htm' </center></body></html>";
-			}
-			separateAndSend(content, activeChar);
-		}
-		else if (command.startsWith("_bbstop;"))
-		{
-			StringTokenizer st = new StringTokenizer(command, ";");
-			st.nextToken();
-			int idp = Integer.parseInt(st.nextToken());
-			String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/" + idp + ".htm");
-			if (content == null)
-			{
-				content = "<html><body><br><br><center>404 :File not found: 'data/html/CommunityBoard/" + idp + ".htm' </center></body></html>";
-			}
-			separateAndSend(content, activeChar);
-		}
-		else
-		{
-			ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: " + command + " is not implemented yet</center><br><br></body></html>", "101");
-			activeChar.sendPacket(sb);
-			activeChar.sendPacket(new ShowBoard(null, "102"));
-			activeChar.sendPacket(new ShowBoard(null, "103"));
-		}
-	}
-	
-	@Override
-	public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2PcInstance activeChar)
-	{
-	}
-	
-	public static TopBBSManager getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	private static class SingletonHolder
-	{
-		protected static final TopBBSManager _instance = new TopBBSManager();
-	}
-}

File diff suppressed because it is too large
+ 10 - 49
L2J_Server/java/com/l2jserver/gameserver/communitybbs/Manager/TopicBBSManager.java


+ 1 - 5
L2J_Server/java/com/l2jserver/gameserver/datatables/ClanTable.java

@@ -54,8 +54,6 @@ import com.l2jserver.gameserver.model.events.impl.character.player.clan.OnPlayer
 import com.l2jserver.gameserver.model.events.impl.clan.OnClanWarFinish;
 import com.l2jserver.gameserver.model.events.impl.clan.OnClanWarStart;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo;
 import com.l2jserver.gameserver.network.serverpackets.PledgeShowInfoUpdate;
 import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAll;
@@ -82,7 +80,7 @@ public class ClanTable
 	protected ClanTable()
 	{
 		// forums has to be loaded before clan data, because of last forum id used should have also memo included
-		if (Config.COMMUNITY_TYPE > 0)
+		if (Config.ENABLE_COMMUNITY_BOARD)
 		{
 			ForumsBBSManager.getInstance().initRoot();
 		}
@@ -209,8 +207,6 @@ public class ClanTable
 		player.sendPacket(new ExBrExtraUserInfo(player));
 		player.sendPacket(new PledgeShowMemberListUpdate(player));
 		player.sendPacket(SystemMessageId.CLAN_CREATED);
-		// notify CB server that a new Clan is created
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, clan, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 		
 		// Notify to scripts
 		EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanCreate(player, clan));

+ 235 - 0
L2J_Server/java/com/l2jserver/gameserver/handler/CommunityBoardHandler.java

@@ -0,0 +1,235 @@
+/*
+ * Copyright (C) 2004-2014 L2J Server
+ * 
+ * This file is part of L2J Server.
+ * 
+ * L2J Server is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J Server is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.handler;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Logger;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.util.Util;
+
+/**
+ * Community Board handler.
+ * @author Zoey76
+ */
+public final class CommunityBoardHandler implements IHandler<IParseBoardHandler, String>
+{
+	private static final Logger LOG = Logger.getLogger(CommunityBoardHandler.class.getName());
+	/** The registered handlers. */
+	private final Map<String, IParseBoardHandler> _datatable = new HashMap<>();
+	/** The bypasses used by the players. */
+	private final Map<Integer, String> _bypasses = new ConcurrentHashMap<>();
+	
+	protected CommunityBoardHandler()
+	{
+		// Prevent external initialization.
+	}
+	
+	@Override
+	public void registerHandler(IParseBoardHandler handler)
+	{
+		for (String cmd : handler.getCommunityBoardCommands())
+		{
+			_datatable.put(cmd.toLowerCase(), handler);
+		}
+	}
+	
+	@Override
+	public synchronized void removeHandler(IParseBoardHandler handler)
+	{
+		for (String cmd : handler.getCommunityBoardCommands())
+		{
+			_datatable.remove(cmd.toLowerCase());
+		}
+	}
+	
+	@Override
+	public IParseBoardHandler getHandler(String cmd)
+	{
+		for (IParseBoardHandler cb : _datatable.values())
+		{
+			for (String command : cb.getCommunityBoardCommands())
+			{
+				if (cmd.toLowerCase().startsWith(command.toLowerCase()))
+				{
+					return cb;
+				}
+			}
+		}
+		return null;
+	}
+	
+	@Override
+	public int size()
+	{
+		return _datatable.size();
+	}
+	
+	/**
+	 * Verifies if the string is a registered community board command.
+	 * @param cmd the command to verify
+	 * @return {@code true} if the command has been registered, {@code false} otherwise
+	 */
+	public boolean isCommunityBoardCommand(String cmd)
+	{
+		return getHandler(cmd) != null;
+	}
+	
+	/**
+	 * Parses a community board command.
+	 * @param command the command
+	 * @param player the player
+	 */
+	public void handleParseCommand(String command, L2PcInstance player)
+	{
+		if (player == null)
+		{
+			return;
+		}
+		
+		if (!Config.ENABLE_COMMUNITY_BOARD)
+		{
+			player.sendPacket(SystemMessageId.CB_OFFLINE);
+			return;
+		}
+		
+		final IParseBoardHandler cb = getHandler(command);
+		if (cb == null)
+		{
+			LOG.warning(CommunityBoardHandler.class.getSimpleName() + ": Couldn't find parse handler for command " + command + "!");
+			return;
+		}
+		
+		cb.parseCommunityBoardCommand(command, player);
+	}
+	
+	/**
+	 * Writes a command into the client.
+	 * @param player the player
+	 * @param url the command URL
+	 * @param arg1 the first argument
+	 * @param arg2 the second argument
+	 * @param arg3 the third argument
+	 * @param arg4 the fourth argument
+	 * @param arg5 the fifth argument
+	 */
+	public void handleWriteCommand(L2PcInstance player, String url, String arg1, String arg2, String arg3, String arg4, String arg5)
+	{
+		if (player == null)
+		{
+			return;
+		}
+		
+		if (!Config.ENABLE_COMMUNITY_BOARD)
+		{
+			player.sendPacket(SystemMessageId.CB_OFFLINE);
+			return;
+		}
+		
+		String cmd = "";
+		switch (url)
+		{
+			case "Topic":
+			{
+				cmd = "_bbstop";
+				break;
+			}
+			case "Post":
+			{
+				cmd = "_bbspos"; // TODO: Implement.
+				break;
+			}
+			case "Region":
+			{
+				cmd = "_bbsloc";
+				break;
+			}
+			case "Notice":
+			{
+				cmd = "_bbsclan";
+				break;
+			}
+			default:
+			{
+				separateAndSend("<html><body><br><br><center>The command: " + url + " is not implemented yet.</center><br><br></body></html>", player);
+				return;
+			}
+		}
+		
+		final IParseBoardHandler cb = getHandler(cmd);
+		if (cb == null)
+		{
+			LOG.warning(CommunityBoardHandler.class.getSimpleName() + ": Couldn't find write handler for command " + cmd + "!");
+			return;
+		}
+		
+		if (!(cb instanceof IWriteBoardHandler))
+		{
+			LOG.warning(CommunityBoardHandler.class.getSimpleName() + ": " + cb.getClass().getSimpleName() + " doesn't implement write!");
+			return;
+		}
+		((IWriteBoardHandler) cb).writeCommunityBoardCommand(player, arg1, arg2, arg3, arg4, arg5);
+	}
+	
+	/**
+	 * Sets the last bypass used by the player.
+	 * @param player the player
+	 * @param title the title
+	 * @param bypass the bypass
+	 */
+	public void addBypass(L2PcInstance player, String title, String bypass)
+	{
+		_bypasses.put(player.getObjectId(), title + "&" + bypass);
+	}
+	
+	/**
+	 * Removes the last bypass used by the player.
+	 * @param player the player
+	 * @return the last bypass used
+	 */
+	public String removeBypass(L2PcInstance player)
+	{
+		return _bypasses.remove(player.getObjectId());
+	}
+	
+	/**
+	 * Separates and send an HTML into multiple packets, to display into the community board.<br>
+	 * The limit is 16383 characters.
+	 * @param html the HTML to send
+	 * @param player the player
+	 */
+	public static void separateAndSend(String html, L2PcInstance player)
+	{
+		Util.sendCBHtml(player, html);
+	}
+	
+	public static CommunityBoardHandler getInstance()
+	{
+		return SingletonHolder._instance;
+	}
+	
+	private static class SingletonHolder
+	{
+		protected static final CommunityBoardHandler _instance = new CommunityBoardHandler();
+	}
+}

+ 18 - 14
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/ConnectionError.java → L2J_Server/java/com/l2jserver/gameserver/handler/IParseBoardHandler.java

@@ -16,27 +16,31 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
+package com.l2jserver.gameserver.handler;
 
 import java.util.logging.Logger;
 
-import org.netcon.BaseReadPacket;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 
 /**
- * @authors Forsaiken, Gigiikun
+ * Community Board interface.
+ * @author Zoey76
  */
-public final class ConnectionError extends BaseReadPacket
+public interface IParseBoardHandler
 {
-	private static final Logger _log = Logger.getLogger(ConnectionError.class.getName());
+	public static final Logger LOG = Logger.getLogger(IParseBoardHandler.class.getName());
 	
-	public ConnectionError(final byte[] data)
-	{
-		super(data);
-	}
+	/**
+	 * Parses a community board command.
+	 * @param command the command
+	 * @param player the player
+	 * @return
+	 */
+	public boolean parseCommunityBoardCommand(String command, L2PcInstance player);
 	
-	@Override
-	public final void run()
-	{
-		_log.info("ConnectionErrorPacket received: " + super.readC());
-	}
+	/**
+	 * Gets the community board commands.
+	 * @return the community board commands
+	 */
+	public String[] getCommunityBoardCommands();
 }

+ 16 - 14
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/GameServerAuth.java → L2J_Server/java/com/l2jserver/gameserver/handler/IWriteBoardHandler.java

@@ -16,23 +16,25 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-package com.l2jserver.gameserver.network.communityserver.writepackets;
+package com.l2jserver.gameserver.handler;
 
-import org.netcon.BaseWritePacket;
-
-import com.l2jserver.Config;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 
 /**
- * @authors Forsaiken, Gigiikun
+ * Community Board interface.
+ * @author Zoey76
  */
-public final class GameServerAuth extends BaseWritePacket
+public interface IWriteBoardHandler extends IParseBoardHandler
 {
-	public GameServerAuth()
-	{
-		super.writeC(0x00);
-		super.writeC(0x01);
-		super.writeD(Config.COMMUNITY_SERVER_HEX_ID.length);
-		super.writeB(Config.COMMUNITY_SERVER_HEX_ID);
-		super.writeD(Config.COMMUNITY_SERVER_SQL_DP_ID);
-	}
+	/**
+	 * Writes a community board command into the client.
+	 * @param player the player
+	 * @param arg1 the first argument
+	 * @param arg2 the second argument
+	 * @param arg3 the third argument
+	 * @param arg4 the fourth argument
+	 * @param arg5 the fifth argument
+	 * @return
+	 */
+	public boolean writeCommunityBoardCommand(L2PcInstance player, String arg1, String arg2, String arg3, String arg4, String arg5);
 }

+ 2 - 30
L2J_Server/java/com/l2jserver/gameserver/model/L2Clan.java

@@ -58,8 +58,6 @@ import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.gameserver.model.zone.ZoneId;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
 import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo;
 import com.l2jserver.gameserver.network.serverpackets.ExSubPledgeSkillAdd;
@@ -305,10 +303,7 @@ public class L2Clan implements IIdentifiable, INamable
 		
 		broadcastClanStatus();
 		broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_LEADER_PRIVILEGES_HAVE_BEEN_TRANSFERRED_TO_C1).addString(member.getName()));
-		if (CommunityServerThread.getInstance() != null)
-		{
-			CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
-		}
+		
 		_log.log(Level.INFO, "Leader of Clan: " + getName() + " changed to: " + member.getName() + " ex leader: " + exMember.getName());
 	}
 	
@@ -367,8 +362,6 @@ public class L2Clan implements IIdentifiable, INamable
 		player.sendPacket(new PledgeShowMemberListUpdate(player));
 		player.sendPacket(new PledgeSkillList(this));
 		addSkillEffects(player);
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 		
 		// Notify to scripts
 		EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanJoin(member, this));
@@ -387,8 +380,6 @@ public class L2Clan implements IIdentifiable, INamable
 		}
 		
 		addClanMember(member);
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 	}
 	
 	/**
@@ -522,11 +513,6 @@ public class L2Clan implements IIdentifiable, INamable
 		{
 			removeMemberInDatabase(exMember, clanJoinExpiryTime, getLeaderId() == objectId ? System.currentTimeMillis() + (Config.ALT_CLAN_CREATE_DAYS * 86400000L) : 0);
 		}
-		// notify CB server about the change
-		if (CommunityServerThread.getInstance() != null)
-		{
-			CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
-		}
 		
 		// Notify to scripts
 		EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLeft(exMember, this));
@@ -704,7 +690,7 @@ public class L2Clan implements IIdentifiable, INamable
 	public void setLevel(int level)
 	{
 		_level = level;
-		if ((_level >= 2) && (_forum == null) && (Config.COMMUNITY_TYPE > 0))
+		if ((_level >= 2) && (_forum == null) && Config.ENABLE_COMMUNITY_BOARD)
 		{
 			final Forum forum = ForumsBBSManager.getInstance().getForumByName("ClanRoot");
 			if (forum != null)
@@ -2520,8 +2506,6 @@ public class L2Clan implements IIdentifiable, INamable
 		
 		// TODO: Need correct message id
 		player.sendMessage("Alliance " + allyName + " has been created.");
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 	}
 	
 	public void dissolveAlly(L2PcInstance player)
@@ -2553,8 +2537,6 @@ public class L2Clan implements IIdentifiable, INamable
 				clan.setAllyName(null);
 				clan.setAllyPenaltyExpiryTime(0, 0);
 				clan.updateClanInDB();
-				// notify CB server about the change
-				CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, clan, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 			}
 		}
 		
@@ -2566,8 +2548,6 @@ public class L2Clan implements IIdentifiable, INamable
 		
 		// The clan leader should take the XP penalty of a full death.
 		player.deathPenalty(false, false, false);
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 	}
 	
 	public boolean levelUpClan(L2PcInstance player)
@@ -2843,14 +2823,6 @@ public class L2Clan implements IIdentifiable, INamable
 		// notify all the members about it
 		broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_LEVEL_INCREASED));
 		broadcastToOnlineMembers(new PledgeShowInfoUpdate(this));
-		/*
-		 * Micht : - use PledgeShowInfoUpdate instead of PledgeStatusChanged to update clan level ingame - remove broadcastClanStatus() to avoid members duplication
-		 */
-		// clan.broadcastToOnlineMembers(new PledgeStatusChanged(clan));
-		// clan.broadcastClanStatus();
-		
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, this, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 	}
 	
 	/**

+ 0 - 29
L2J_Server/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -68,7 +68,6 @@ import com.l2jserver.gameserver.cache.HtmCache;
 import com.l2jserver.gameserver.cache.WarehouseCacheManager;
 import com.l2jserver.gameserver.communitybbs.BB.Forum;
 import com.l2jserver.gameserver.communitybbs.Manager.ForumsBBSManager;
-import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager;
 import com.l2jserver.gameserver.datatables.AdminTable;
 import com.l2jserver.gameserver.datatables.CharNameTable;
 import com.l2jserver.gameserver.datatables.CharSummonTable;
@@ -260,8 +259,6 @@ import com.l2jserver.gameserver.model.zone.ZoneId;
 import com.l2jserver.gameserver.model.zone.type.L2BossZone;
 import com.l2jserver.gameserver.network.L2GameClient;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 import com.l2jserver.gameserver.network.serverpackets.AbstractHtmlPacket;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.network.serverpackets.ChangeWaitType;
@@ -6225,10 +6222,6 @@ public final class L2PcInstance extends L2Playable
 			_apprentice = 0;
 			_sponsor = 0;
 			_activeWarehouse = null;
-			if (_isOnline)
-			{
-				CommunityServerThread.getInstance().sendPacket(new WorldInfo(this, null, WorldInfo.TYPE_UPDATE_PLAYER_DATA));
-			}
 			return;
 		}
 		
@@ -6240,10 +6233,6 @@ public final class L2PcInstance extends L2Playable
 		}
 		
 		_clanId = clan.getId();
-		if (_isOnline)
-		{
-			CommunityServerThread.getInstance().sendPacket(new WorldInfo(this, null, WorldInfo.TYPE_UPDATE_PLAYER_DATA));
-		}
 	}
 	
 	/**
@@ -11417,14 +11406,6 @@ public final class L2PcInstance extends L2Playable
 			_log.log(Level.SEVERE, "deleteMe()", e);
 		}
 		
-		try
-		{
-			CommunityServerThread.getInstance().sendPacket(new WorldInfo(this, null, WorldInfo.TYPE_UPDATE_PLAYER_STATUS));
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, "deleteMe()", e);
-		}
 		// Recommendations must be saved before task (timer) is canceled
 		try
 		{
@@ -11717,16 +11698,6 @@ public final class L2PcInstance extends L2Playable
 		L2World.getInstance().removeObject(this);
 		L2World.getInstance().removeFromAllPlayers(this); // force remove in case of crash during teleport
 		
-		// update bbs
-		try
-		{
-			RegionBBSManager.getInstance().changeCommunityBoard();
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "Exception on deleteMe() changeCommunityBoard: " + e.getMessage(), e);
-		}
-		
 		try
 		{
 			notifyFriends();

+ 0 - 6
L2J_Server/java/com/l2jserver/gameserver/model/actor/stat/PlayableStat.java

@@ -32,8 +32,6 @@ import com.l2jserver.gameserver.model.events.impl.character.playable.OnPlayableE
 import com.l2jserver.gameserver.model.events.returns.TerminateReturn;
 import com.l2jserver.gameserver.model.zone.ZoneId;
 import com.l2jserver.gameserver.model.zone.type.L2SwampZone;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 
 public class PlayableStat extends CharStat
 {
@@ -175,10 +173,6 @@ public class PlayableStat extends CharStat
 		
 		getActiveChar().getStatus().setCurrentHp(getActiveChar().getStat().getMaxHp());
 		getActiveChar().getStatus().setCurrentMp(getActiveChar().getStat().getMaxMp());
-		if (getActiveChar() instanceof L2PcInstance)
-		{
-			CommunityServerThread.getInstance().sendPacket(new WorldInfo((L2PcInstance) getActiveChar(), null, WorldInfo.TYPE_UPDATE_PLAYER_DATA));
-		}
 		
 		return true;
 	}

+ 0 - 4
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/AllyDismiss.java

@@ -23,8 +23,6 @@ import com.l2jserver.gameserver.datatables.ClanTable;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 
 public final class AllyDismiss extends L2GameClientPacket
 {
@@ -92,8 +90,6 @@ public final class AllyDismiss extends L2GameClientPacket
 		clan.changeAllyCrest(0, true);
 		clan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED * 86400000L), L2Clan.PENALTY_TYPE_CLAN_DISMISSED); // 24*60*60*1000 = 86400000
 		clan.updateClanInDB();
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, clan, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 		
 		player.sendPacket(SystemMessageId.YOU_HAVE_EXPELED_A_CLAN);
 	}

+ 0 - 4
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/AllyLeave.java

@@ -22,8 +22,6 @@ import com.l2jserver.Config;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 
 public final class AllyLeave extends L2GameClientPacket
 {
@@ -70,8 +68,6 @@ public final class AllyLeave extends L2GameClientPacket
 		clan.changeAllyCrest(0, true);
 		clan.setAllyPenaltyExpiryTime(currentTime + (Config.ALT_ALLY_JOIN_DAYS_WHEN_LEAVED * 86400000L), L2Clan.PENALTY_TYPE_CLAN_LEAVED); // 24*60*60*1000 = 86400000
 		clan.updateClanInDB();
-		// notify CB server about the change
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, clan, WorldInfo.TYPE_UPDATE_CLAN_DATA));
 		
 		player.sendPacket(SystemMessageId.YOU_HAVE_WITHDRAWN_FROM_ALLIANCE);
 	}

+ 0 - 6
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java

@@ -25,7 +25,6 @@ import com.l2jserver.gameserver.Announcements;
 import com.l2jserver.gameserver.LoginServerThread;
 import com.l2jserver.gameserver.SevenSigns;
 import com.l2jserver.gameserver.cache.HtmCache;
-import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager;
 import com.l2jserver.gameserver.datatables.AdminTable;
 import com.l2jserver.gameserver.datatables.SkillTreesData;
 import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
@@ -62,8 +61,6 @@ import com.l2jserver.gameserver.model.quest.QuestState;
 import com.l2jserver.gameserver.model.skills.CommonSkill;
 import com.l2jserver.gameserver.model.zone.ZoneId;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 import com.l2jserver.gameserver.network.serverpackets.Die;
 import com.l2jserver.gameserver.network.serverpackets.EtcStatusUpdate;
 import com.l2jserver.gameserver.network.serverpackets.ExBasicActionList;
@@ -541,9 +538,6 @@ public class EnterWorld extends L2GameClientPacket
 			}
 		}
 		
-		RegionBBSManager.getInstance().changeCommunityBoard();
-		CommunityServerThread.getInstance().sendPacket(new WorldInfo(activeChar, null, WorldInfo.TYPE_UPDATE_PLAYER_STATUS));
-		
 		TvTEvent.onLogin(activeChar);
 		
 		if (Config.WELCOME_MESSAGE_ENABLED)

+ 0 - 11
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestAnswerJoinAlly.java

@@ -18,12 +18,9 @@
  */
 package com.l2jserver.gameserver.network.clientpackets;
 
-import com.l2jserver.gameserver.datatables.ClanTable;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
 
 public final class RequestAnswerJoinAlly extends L2GameClientPacket
 {
@@ -77,14 +74,6 @@ public final class RequestAnswerJoinAlly extends L2GameClientPacket
 				activeChar.getClan().setAllyPenaltyExpiryTime(0, 0);
 				activeChar.getClan().changeAllyCrest(clan.getAllyCrestId(), true);
 				activeChar.getClan().updateClanInDB();
-				for (L2Clan c : ClanTable.getInstance().getClanAllies(clan.getAllyId()))
-				{
-					if (c.getAllyId() == clan.getAllyId())
-					{
-						// notify CB server about the change
-						CommunityServerThread.getInstance().sendPacket(new WorldInfo(null, c, WorldInfo.TYPE_UPDATE_CLAN_DATA));
-					}
-				}
 			}
 		}
 		

+ 4 - 26
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestBBSwrite.java

@@ -18,16 +18,11 @@
  */
 package com.l2jserver.gameserver.network.clientpackets;
 
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.communitybbs.CommunityBoard;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.RequestCommunityBoardWrite;
+import com.l2jserver.gameserver.handler.CommunityBoardHandler;
 
 /**
- * Format SSSSSS
- * @author -Wooden-
+ * RequestBBSwrite client packet implementation.
+ * @author -Wooden-, Zoey76
  */
 public final class RequestBBSwrite extends L2GameClientPacket
 {
@@ -53,24 +48,7 @@ public final class RequestBBSwrite extends L2GameClientPacket
 	@Override
 	protected final void runImpl()
 	{
-		if (Config.ENABLE_COMMUNITY_BOARD)
-		{
-			L2PcInstance activeChar = getClient().getActiveChar();
-			
-			if (activeChar == null)
-			{
-				return;
-			}
-			
-			if (!CommunityServerThread.getInstance().sendPacket(new RequestCommunityBoardWrite(activeChar.getObjectId(), _url, _arg1, _arg2, _arg3, _arg4, _arg5)))
-			{
-				activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-			}
-		}
-		else
-		{
-			CommunityBoard.getInstance().handleWriteCommands(getClient(), _url, _arg1, _arg2, _arg3, _arg4, _arg5);
-		}
+		CommunityBoardHandler.getInstance().handleWriteCommand(getActiveChar(), _url, _arg1, _arg2, _arg3, _arg4, _arg5);
 	}
 	
 	@Override

+ 6 - 46
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java

@@ -23,12 +23,12 @@ import java.util.logging.Level;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.communitybbs.CommunityBoard;
 import com.l2jserver.gameserver.datatables.AdminTable;
 import com.l2jserver.gameserver.enums.InstanceType;
 import com.l2jserver.gameserver.enums.PlayerAction;
 import com.l2jserver.gameserver.handler.AdminCommandHandler;
 import com.l2jserver.gameserver.handler.BypassHandler;
+import com.l2jserver.gameserver.handler.CommunityBoardHandler;
 import com.l2jserver.gameserver.handler.IAdminCommandHandler;
 import com.l2jserver.gameserver.handler.IBypassHandler;
 import com.l2jserver.gameserver.model.L2Object;
@@ -42,8 +42,6 @@ import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcManorBypass
 import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerBypass;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.RequestShowCommunityBoard;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.network.serverpackets.ConfirmDlg;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -57,7 +55,7 @@ import com.l2jserver.gameserver.util.Util;
 public final class RequestBypassToServer extends L2GameClientPacket
 {
 	private static final String _C__23_REQUESTBYPASSTOSERVER = "[C] 23 RequestBypassToServer";
-	// FIXME: This is for compatibility, will be changed when bypass functionallity got an overhaul by Nos
+	// FIXME: This is for compatibility, will be changed when bypass functionality got an overhaul by Nos
 	private static final String[] _possibleNonHtmlCommands =
 	{
 		"_bbs",
@@ -170,6 +168,10 @@ public final class RequestBypassToServer extends L2GameClientPacket
 					ach.useAdminCommand(_command, activeChar);
 				}
 			}
+			else if (CommunityBoardHandler.getInstance().isCommunityBoardCommand(_command))
+			{
+				CommunityBoardHandler.getInstance().handleParseCommand(_command, activeChar);
+			}
 			else if (_command.equals("come_here") && activeChar.isGM())
 			{
 				comeHere(activeChar);
@@ -225,48 +227,6 @@ public final class RequestBypassToServer extends L2GameClientPacket
 					_log.log(Level.WARNING, "NFE for command [" + _command + "]", nfe);
 				}
 			}
-			else if (_command.startsWith("_bbs"))
-			{
-				if (Config.ENABLE_COMMUNITY_BOARD)
-				{
-					if (!CommunityServerThread.getInstance().sendPacket(new RequestShowCommunityBoard(activeChar.getObjectId(), _command)))
-					{
-						activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-					}
-				}
-				else
-				{
-					CommunityBoard.getInstance().handleCommands(getClient(), _command);
-				}
-			}
-			else if (_command.startsWith("bbs"))
-			{
-				if (Config.ENABLE_COMMUNITY_BOARD)
-				{
-					if (!CommunityServerThread.getInstance().sendPacket(new RequestShowCommunityBoard(activeChar.getObjectId(), _command)))
-					{
-						activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-					}
-				}
-				else
-				{
-					CommunityBoard.getInstance().handleCommands(getClient(), _command);
-				}
-			}
-			else if (_command.startsWith("_mail"))
-			{
-				if (!CommunityServerThread.getInstance().sendPacket(new RequestShowCommunityBoard(activeChar.getObjectId(), "_bbsmail")))
-				{
-					activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-				}
-			}
-			else if (_command.startsWith("_friend"))
-			{
-				if (!CommunityServerThread.getInstance().sendPacket(new RequestShowCommunityBoard(activeChar.getObjectId(), "_bbsfriend")))
-				{
-					activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-				}
-			}
 			else if (_command.startsWith("_match"))
 			{
 				String params = _command.substring(_command.indexOf("?") + 1);

+ 4 - 28
L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/RequestShowBoard.java

@@ -19,14 +19,11 @@
 package com.l2jserver.gameserver.network.clientpackets;
 
 import com.l2jserver.Config;
-import com.l2jserver.gameserver.communitybbs.CommunityBoard;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.RequestShowCommunityBoard;
+import com.l2jserver.gameserver.handler.CommunityBoardHandler;
 
 /**
- * packet type id 0x57 sample 57 01 00 00 00 // unknown (always 1?) format: cd
+ * RequestShowBoard client packet implementation.
+ * @author Zoey76
  */
 public final class RequestShowBoard extends L2GameClientPacket
 {
@@ -44,28 +41,7 @@ public final class RequestShowBoard extends L2GameClientPacket
 	@Override
 	protected void runImpl()
 	{
-		if (Config.ENABLE_COMMUNITY_BOARD)
-		{
-			L2PcInstance activeChar = getClient().getActiveChar();
-			
-			if (activeChar == null)
-			{
-				return;
-			}
-			
-			if (CommunityServerThread.getInstance().isAuthed())
-			{
-				CommunityServerThread.getInstance().sendPacket(new RequestShowCommunityBoard(activeChar.getObjectId(), "_bbshome"), true);
-			}
-			else
-			{
-				activeChar.sendPacket(SystemMessageId.CB_OFFLINE);
-			}
-		}
-		else
-		{
-			CommunityBoard.getInstance().handleCommands(getClient(), Config.BBS_DEFAULT);
-		}
+		CommunityBoardHandler.getInstance().handleParseCommand(Config.BBS_DEFAULT, getActiveChar());
 	}
 	
 	@Override

+ 0 - 270
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/CommunityServerThread.java

@@ -1,270 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver;
-
-import java.io.IOException;
-import java.net.SocketException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.netcon.BaseReadPacket;
-import org.netcon.BaseWritePacket;
-import org.netcon.NetConnection;
-import org.netcon.NetConnectionConfig;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.ThreadPoolManager;
-import com.l2jserver.gameserver.network.communityserver.readpackets.AuthResponse;
-import com.l2jserver.gameserver.network.communityserver.readpackets.ClanNoticeInfo;
-import com.l2jserver.gameserver.network.communityserver.readpackets.ConnectionError;
-import com.l2jserver.gameserver.network.communityserver.readpackets.InitCS;
-import com.l2jserver.gameserver.network.communityserver.readpackets.RequestPlayerShowBoard;
-import com.l2jserver.gameserver.network.communityserver.readpackets.RequestPlayerShowMessage;
-import com.l2jserver.gameserver.network.communityserver.readpackets.RequestWorldInfo;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class CommunityServerThread extends NetConnection
-{
-	private static final Logger _log = Logger.getLogger(CommunityServerThread.class.getName());
-	
-	private static CommunityServerThread _instance;
-	
-	public static final void initialize()
-	{
-		if (_instance == null)
-		{
-			if (Config.ENABLE_COMMUNITY_BOARD)
-			{
-				try
-				{
-					_instance = new CommunityServerThread(new NetConnectionConfig(Config.COMMUNITY_CONFIGURATION_FILE));
-					_instance.start();
-				}
-				catch (Exception e)
-				{
-					_log.log(Level.WARNING, "CommunityServerThread: Failed loading config file! " + e.getMessage(), e);
-				}
-			}
-			else
-			{
-				_log.log(Level.INFO, "CommunityServerThread: Deactivated by config.");
-				_instance = new CommunityServerThread(null);
-			}
-		}
-	}
-	
-	public static final CommunityServerThread getInstance()
-	{
-		return _instance;
-	}
-	
-	private boolean _authed;
-	
-	private CommunityServerThread(final NetConnectionConfig config)
-	{
-		super(config);
-	}
-	
-	public final boolean isAuthed()
-	{
-		return _authed;
-	}
-	
-	public final void setAuthed(final boolean authed)
-	{
-		_authed = authed;
-	}
-	
-	public final void forceClose(final BaseWritePacket packet)
-	{
-		_authed = false;
-		
-		try
-		{
-			super.close(packet);
-		}
-		catch (IOException e)
-		{
-			_log.log(Level.INFO, "CommunityServerThread: Failed disconnecting server, server already disconnected: " + e.getMessage(), e);
-		}
-	}
-	
-	public boolean sendPacket(final BaseWritePacket packet)
-	{
-		return sendPacket(packet, true);
-	}
-	
-	public boolean sendPacket(final BaseWritePacket packet, final boolean needAuth)
-	{
-		if (needAuth && !_authed)
-		{
-			return false;
-		}
-		
-		try
-		{
-			super.write(packet);
-		}
-		catch (IOException e)
-		{
-			_log.log(Level.INFO, "CommunityServerThread: Failed sending TCP packet: " + e.getMessage(), e);
-			return false;
-		}
-		return true;
-	}
-	
-	@Override
-	public void run()
-	{
-		_log.log(Level.INFO, "CommunityServerThread: Activated by config.");
-		
-		int packetType1 = 0xFF;
-		int packetType2 = 0xFF;
-		
-		BaseReadPacket packet = null;
-		byte[] data = null;
-		
-		while (!isInterrupted())
-		{
-			try
-			{
-				sleep(10000L);
-			}
-			catch (InterruptedException e)
-			{
-				return;
-			}
-			
-			_log.log(Level.INFO, "CommunityServerThread: Trying to connect to " + Config.COMMUNITY_SERVER_ADDRESS + " on port " + Config.COMMUNITY_SERVER_PORT + ".");
-			
-			try
-			{
-				_instance.connect(Config.COMMUNITY_SERVER_ADDRESS, Config.COMMUNITY_SERVER_PORT);
-			}
-			catch (SocketException se)
-			{
-				_log.log(Level.INFO, "CommunityServerThread: Connecting to " + Config.COMMUNITY_SERVER_ADDRESS + " on port " + Config.COMMUNITY_SERVER_PORT + " failed.");
-				continue;
-			}
-			catch (IOException e)
-			{
-				_log.log(Level.INFO, "CommunityServerThread: Connection failed: " + e.getMessage(), e);
-				continue;
-			}
-			
-			try
-			{
-				long gameServerConnectStart = System.currentTimeMillis();
-				while (!isInterrupted())
-				{
-					data = super.read();
-					packetType1 = data[0] & 0xFF;
-					packetType2 = data[1] & 0xFF;
-					
-					if (Config.PACKET_HANDLER_DEBUG)
-					{
-						_log.log(Level.INFO, "Received packet: 0x" + Integer.toHexString(packetType1) + "-0x" + Integer.toHexString(packetType2));
-					}
-					
-					switch (packetType1)
-					{
-						case 0x00:
-						{
-							switch (packetType2)
-							{
-								case 0x00:
-									packet = new InitCS(data, this);
-									break;
-								case 0x01:
-									_log.info("Server connected in " + ((System.currentTimeMillis() - gameServerConnectStart) / 1000) + " seconds");
-									packet = new AuthResponse(data, this);
-									break;
-								case 0x02:
-									packet = new ConnectionError(data);
-									break;
-							}
-							break;
-						}
-						
-						case 0x01:
-						{
-							switch (packetType2)
-							{
-								case 0x00:
-									packet = new RequestWorldInfo(data, this, RequestWorldInfo.SERVER_LOAD);
-									break;
-								case 0x01:
-									packet = new RequestWorldInfo(data, this, RequestWorldInfo.PLAYER_DATA_UPDATE);
-									break;
-								case 0x02:
-									packet = new RequestWorldInfo(data, this, RequestWorldInfo.CLAN_DATA_UPDATE);
-									break;
-								case 0x03:
-									packet = new ClanNoticeInfo(data, 0);
-									break;
-								case 0x04:
-									packet = new ClanNoticeInfo(data, 1);
-									break;
-								case 0x05:
-									packet = new ClanNoticeInfo(data, this, 2);
-									break;
-							}
-							break;
-						}
-						
-						case 0x02:
-						{
-							switch (packetType2)
-							{
-								case 0x00:
-									packet = new RequestPlayerShowBoard(data);
-									break;
-								case 0x01:
-									packet = new RequestPlayerShowMessage(data);
-									break;
-							}
-							break;
-						}
-					}
-					
-					if (packet != null)
-					{
-						ThreadPoolManager.getInstance().executePacket(packet);
-					}
-					else
-					{
-						throw new IOException("Invalid packet!");
-					}
-				}
-				if (isInterrupted())
-				{
-					forceClose(null);
-				}
-			}
-			catch (IOException e)
-			{
-				_log.log(Level.WARNING, "CommunityServerThread: TCP Connection lost: " + e.getMessage(), e);
-				
-				forceClose(null);
-			}
-		}
-	}
-}

+ 0 - 62
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/AuthResponse.java

@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
-
-import java.util.logging.Logger;
-
-import org.netcon.BaseReadPacket;
-
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class AuthResponse extends BaseReadPacket
-{
-	private static final Logger _log = Logger.getLogger(AuthResponse.class.getName());
-	
-	public static final byte AUTHED = 0;
-	public static final byte REASON_WRONG_HEX_ID = 1;
-	public static final byte REASON_HEX_ID_IN_USE = 2;
-	public static final byte REASON_WRONG_SQL_DP_ID = 3;
-	public static final byte REASON_SQL_DP_ID_IN_USE = 4;
-	
-	private final CommunityServerThread _cst;
-	
-	public AuthResponse(final byte[] data, final CommunityServerThread cst)
-	{
-		super(data);
-		_cst = cst;
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int status = super.readC();
-		
-		switch (status)
-		{
-			case AUTHED:
-				_cst.setAuthed(true);
-				break;
-		}
-		
-		_log.info("COMMUNITY_SERVER_THREAD: Auth " + status);
-	}
-}

+ 0 - 86
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/ClanNoticeInfo.java

@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
-
-import java.util.logging.Logger;
-
-import org.netcon.BaseReadPacket;
-
-import com.l2jserver.gameserver.datatables.ClanTable;
-import com.l2jserver.gameserver.model.L2Clan;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class ClanNoticeInfo extends BaseReadPacket
-{
-	private static Logger _log = Logger.getLogger(ClanNoticeInfo.class.getName());
-	private final int _type;
-	private final CommunityServerThread _cst;
-	
-	public ClanNoticeInfo(final byte[] data, int type)
-	{
-		super(data);
-		_cst = null;
-		_type = type;
-	}
-	
-	public ClanNoticeInfo(final byte[] data, final CommunityServerThread cst, int type)
-	{
-		super(data);
-		_type = type;
-		_cst = cst;
-	}
-	
-	@Override
-	public final void run()
-	{
-		switch (_type)
-		{
-			case 0:
-				int clanId = super.readD();
-				L2Clan c = ClanTable.getInstance().getClan(clanId);
-				String notice = super.readS();
-				c.setNotice(notice);
-				boolean noticeEnabled = (super.readC() == 1 ? true : false);
-				c.setNoticeEnabled(noticeEnabled);
-				break;
-			case 1:
-				clanId = super.readD();
-				c = ClanTable.getInstance().getClan(clanId);
-				noticeEnabled = (super.readC() == 1 ? true : false);
-				c.setNoticeEnabled(noticeEnabled);
-				break;
-			case 2:
-				clanId = super.readD();
-				L2Clan clan = ClanTable.getInstance().getClan(clanId);
-				if (clan != null)
-				{
-					_cst.sendPacket(new WorldInfo(null, clan, WorldInfo.TYPE_SEND_CLAN_NOTICE));
-				}
-				else
-				{
-					_log.warning("Can't find clan with id: " + clanId);
-				}
-				break;
-		}
-	}
-}

+ 0 - 82
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/InitCS.java

@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
-
-import java.math.BigInteger;
-import java.security.KeyFactory;
-import java.security.interfaces.RSAPublicKey;
-import java.security.spec.RSAKeyGenParameterSpec;
-import java.security.spec.RSAPublicKeySpec;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.crypto.Cipher;
-
-import org.netcon.BaseReadPacket;
-import org.netcon.crypt.NewCrypt;
-
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.BlowFishKey;
-import com.l2jserver.gameserver.network.communityserver.writepackets.GameServerAuth;
-import com.l2jserver.util.Rnd;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class InitCS extends BaseReadPacket
-{
-	protected static final Logger _log = Logger.getLogger(InitCS.class.getName());
-	private final CommunityServerThread _cst;
-	
-	public InitCS(final byte[] data, final CommunityServerThread cst)
-	{
-		super(data);
-		_cst = cst;
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int length = super.readD();
-		final byte[] key = super.readB(length);
-		
-		try
-		{
-			final KeyFactory kfac = KeyFactory.getInstance("RSA");
-			final RSAPublicKeySpec kspec1 = new RSAPublicKeySpec(new BigInteger(key), RSAKeyGenParameterSpec.F4);
-			final RSAPublicKey publicKey = (RSAPublicKey) kfac.generatePublic(kspec1);
-			
-			final byte[] privateKey = new byte[40];
-			Rnd.nextBytes(privateKey);
-			
-			final Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
-			rsaCipher.init(Cipher.ENCRYPT_MODE, publicKey);
-			final byte[] tempKey = rsaCipher.doFinal(privateKey);
-			
-			_cst.sendPacket(new BlowFishKey(tempKey), false);
-			_cst.setCrypt(new NewCrypt(privateKey));
-			_cst.sendPacket(new GameServerAuth(), false);
-			
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.WARNING, "", e);
-		}
-	}
-}

+ 0 - 54
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/RequestPlayerShowBoard.java

@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
-
-import org.netcon.BaseReadPacket;
-
-import com.l2jserver.gameserver.model.L2World;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.serverpackets.CSShowComBoard;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class RequestPlayerShowBoard extends BaseReadPacket
-{
-	// private static final Logger _log = Logger.getLogger(RequestPlayerShowBoard.class.getName());
-	
-	public RequestPlayerShowBoard(final byte[] data)
-	{
-		super(data);
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int playerObjId = super.readD();
-		final int length = super.readD();
-		final byte[] html = super.readB(length);
-		
-		L2PcInstance player = L2World.getInstance().getPlayer(playerObjId);
-		if (player == null)
-		{
-			return;
-		}
-		
-		player.sendPacket(new CSShowComBoard(html));
-	}
-}

+ 0 - 145
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/RequestPlayerShowMessage.java

@@ -1,145 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
-
-import java.util.logging.Logger;
-
-import org.netcon.BaseReadPacket;
-
-import com.l2jserver.gameserver.model.L2World;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.SystemMessageId;
-import com.l2jserver.gameserver.network.serverpackets.ExMailArrived;
-import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class RequestPlayerShowMessage extends BaseReadPacket
-{
-	private static final Logger _log = Logger.getLogger(RequestPlayerShowMessage.class.getName());
-	
-	public RequestPlayerShowMessage(final byte[] data)
-	{
-		super(data);
-	}
-	
-	@Override
-	public final void run()
-	{
-		final int playerObjId = super.readD();
-		final int type = super.readD();
-		
-		L2PcInstance player = L2World.getInstance().getPlayer(playerObjId);
-		if (player == null)
-		{
-			return;
-		}
-		
-		switch (type)
-		{
-			case -1: // mail arrived
-				player.sendPacket(ExMailArrived.STATIC_PACKET);
-				break;
-			case 0: // text message
-				player.sendMessage(super.readS());
-				break;
-			case 236:
-				player.sendPacket(SystemMessageId.ONLY_THE_CLAN_LEADER_IS_ENABLED);
-				break;
-			case 1050:
-				player.sendPacket(SystemMessageId.NO_CB_IN_MY_CLAN);
-				break;
-			case 1070:
-				player.sendPacket(SystemMessageId.NO_READ_PERMISSION);
-				break;
-			case 1071:
-				player.sendPacket(SystemMessageId.NO_WRITE_PERMISSION);
-				break;
-			case 1205:
-				player.sendPacket(SystemMessageId.MAILBOX_FULL);
-				break;
-			case 1206:
-				player.sendPacket(SystemMessageId.MEMOBOX_FULL);
-				break;
-			case 1227:
-				try
-				{
-					SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_UNREAD_MESSAGES);
-					final int number = super.readD();
-					sm.addInt(number);
-					player.sendPacket(sm);
-				}
-				catch (Exception e)
-				{
-					_log.info("Incorrect packet from CBserver!");
-				}
-				break;
-			case 1228:
-				try
-				{
-					SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_BLOCKED_YOU_CANNOT_MAIL);
-					final String name = super.readS();
-					sm.addString(name);
-					player.sendPacket(sm);
-				}
-				catch (Exception e)
-				{
-					_log.info("Incorrect packet from CBserver!");
-				}
-				break;
-			case 1229:
-				player.sendPacket(SystemMessageId.NO_MORE_MESSAGES_TODAY);
-				break;
-			case 1230:
-				player.sendPacket(SystemMessageId.ONLY_FIVE_RECIPIENTS);
-				break;
-			case 1231:
-				player.sendPacket(SystemMessageId.SENT_MAIL);
-				break;
-			case 1232:
-				player.sendPacket(SystemMessageId.MESSAGE_NOT_SENT);
-				break;
-			case 1233:
-				player.sendPacket(SystemMessageId.NEW_MAIL);
-				break;
-			case 1234:
-				player.sendPacket(SystemMessageId.MAIL_STORED_IN_MAILBOX);
-				break;
-			case 1238:
-				player.sendPacket(SystemMessageId.TEMP_MAILBOX_FULL);
-				break;
-			case 1370:
-				try
-				{
-					SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CANNOT_MAIL_GM_C1);
-					final String name = super.readS();
-					sm.addString(name);
-					player.sendPacket(sm);
-				}
-				catch (Exception e)
-				{
-					_log.info("Incorrect packet from CBserver!");
-				}
-				break;
-			default:
-				_log.info("error: Unknown message request from CB server: " + type);
-		}
-	}
-}

+ 0 - 150
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/readpackets/RequestWorldInfo.java

@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.readpackets;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.Statement;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.netcon.BaseReadPacket;
-
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.gameserver.datatables.ClanTable;
-import com.l2jserver.gameserver.model.L2Clan;
-import com.l2jserver.gameserver.model.L2World;
-import com.l2jserver.gameserver.model.StatsSet;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
-import com.l2jserver.gameserver.network.communityserver.writepackets.InitWorldInfo;
-import com.l2jserver.gameserver.network.communityserver.writepackets.WorldInfo;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class RequestWorldInfo extends BaseReadPacket
-{
-	public static final byte SERVER_LOAD = 0;
-	public static final byte PLAYER_DATA_UPDATE = 1;
-	public static final byte CLAN_DATA_UPDATE = 2;
-	private static Logger _log = Logger.getLogger(WorldInfo.class.getName());
-	private final CommunityServerThread _cst;
-	private static final int MAX_ARRAY = 10; // set this with caution, 8192 is the max packet size!!!
-	private final int _type;
-	
-	public RequestWorldInfo(final byte[] data, final CommunityServerThread cst, final int type)
-	{
-		super(data);
-		_cst = cst;
-		_type = type;
-	}
-	
-	@Override
-	public final void run()
-	{
-		switch (_type)
-		{
-			case SERVER_LOAD:
-				// clans data
-				L2Clan[] clans = new L2Clan[MAX_ARRAY];
-				int i = 0;
-				int j = 0;
-				for (L2Clan c : ClanTable.getInstance().getClans())
-				{
-					clans[i++] = c;
-					if (i >= MAX_ARRAY)
-					{
-						i = 0;
-						j++;
-						_cst.sendPacket(new InitWorldInfo(null, clans, InitWorldInfo.TYPE_CLAN, -1), false);
-					}
-				}
-				if (i != 0)
-				{
-					j++;
-					_cst.sendPacket(new InitWorldInfo(null, clans, InitWorldInfo.TYPE_CLAN, i), false);
-				}
-				_log.info("Transfering " + ClanTable.getInstance().getClans().length + " Clan data to CB server.");
-				
-				// players data
-				StatsSet[] charDatList = new StatsSet[MAX_ARRAY];
-				try (Connection con = L2DatabaseFactory.getInstance().getConnection();
-					Statement statement = con.createStatement();
-					ResultSet charList = statement.executeQuery("SELECT account_name, charId, char_name, level, clanid, accesslevel, online FROM characters"))
-				{
-					i = 0;
-					int charNumber = 0;
-					while (charList.next())
-					{
-						charNumber++;
-						StatsSet charDat = new StatsSet();
-						charDat.set("account_name", charList.getString("account_name"));
-						charDat.set("charId", charList.getInt("charId"));
-						charDat.set("char_name", charList.getString("char_name"));
-						charDat.set("level", charList.getInt("level"));
-						charDat.set("clanid", charList.getInt("clanid"));
-						charDat.set("accesslevel", charList.getInt("accesslevel"));
-						charDat.set("online", charList.getInt("online"));
-						charDatList[i++] = charDat;
-						if (i >= MAX_ARRAY)
-						{
-							i = 0;
-							j++;
-							_cst.sendPacket(new InitWorldInfo(charDatList, null, InitWorldInfo.TYPE_PLAYER, -1), false);
-						}
-					}
-					if (i != 0)
-					{
-						j++;
-						_cst.sendPacket(new InitWorldInfo(charDatList, null, InitWorldInfo.TYPE_PLAYER, i), false);
-					}
-					_log.info("Transfering " + charNumber + " character data to CB server.");
-				}
-				catch (Exception e)
-				{
-					_log.log(Level.WARNING, "Could not restore char info: " + e.getMessage(), e);
-				}
-				
-				// Castles data
-				j++;
-				_cst.sendPacket(new InitWorldInfo(null, null, InitWorldInfo.TYPE_CASTLE, j), false);
-				
-				j++;
-				_cst.sendPacket(new InitWorldInfo(null, null, InitWorldInfo.TYPE_INFO, j), false);
-				break;
-			case PLAYER_DATA_UPDATE:
-				int playerObjId = super.readD();
-				L2PcInstance player = L2World.getInstance().getPlayer(playerObjId);
-				if (player != null)
-				{
-					_cst.sendPacket(new WorldInfo(player, null, WorldInfo.TYPE_UPDATE_PLAYER_DATA));
-				}
-				break;
-			case CLAN_DATA_UPDATE:
-				int clanObjId = super.readD();
-				L2Clan clan = ClanTable.getInstance().getClan(clanObjId);
-				if (clan != null)
-				{
-					_cst.sendPacket(new WorldInfo(null, clan, WorldInfo.TYPE_UPDATE_CLAN_DATA));
-				}
-				break;
-		}
-	}
-}

+ 0 - 35
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/BlowFishKey.java

@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.writepackets;
-
-import org.netcon.BaseWritePacket;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class BlowFishKey extends BaseWritePacket
-{
-	public BlowFishKey(final byte[] tempKey)
-	{
-		super.writeC(0x00);
-		super.writeC(0x00);
-		super.writeD(tempKey.length);
-		super.writeB(tempKey);
-	}
-}

+ 0 - 157
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/InitWorldInfo.java

@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.writepackets;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javolution.util.FastList;
-
-import org.netcon.BaseWritePacket;
-
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.gameserver.datatables.ClanTable;
-import com.l2jserver.gameserver.instancemanager.CastleManager;
-import com.l2jserver.gameserver.model.L2Clan;
-import com.l2jserver.gameserver.model.StatsSet;
-import com.l2jserver.gameserver.model.entity.Castle;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class InitWorldInfo extends BaseWritePacket
-{
-	public static final byte TYPE_INFO = 0;
-	public static final byte TYPE_PLAYER = 1;
-	public static final byte TYPE_CLAN = 2;
-	public static final byte TYPE_CASTLE = 3;
-	private static Logger _log = Logger.getLogger(InitWorldInfo.class.getName());
-	
-	public InitWorldInfo(StatsSet[] players, L2Clan[] clans, final byte type, int info)
-	{
-		super.writeC(0x01);
-		super.writeC(0x00);
-		super.writeD(type);
-		
-		int i;
-		switch (type)
-		{
-			case TYPE_INFO:
-				super.writeD(info);
-				break;
-			case TYPE_CLAN:
-				super.writeD(info != -1 ? info : clans.length);
-				i = 0;
-				for (L2Clan c : clans)
-				{
-					if (c == null)
-					{
-						continue;
-					}
-					if (i++ == info)
-					{
-						break;
-					}
-					super.writeD(c.getId());
-					super.writeS(c.getName());
-					super.writeD(c.getLevel());
-					if (c.getLeader() == null)
-					{
-						writeD(0);
-						writeS("");
-						_log.info("Clan Id: " + c.getId() + " has null clan leader!");
-					}
-					else
-					{
-						super.writeD(c.getLeader().getObjectId());
-						super.writeS(c.getLeader().getName());
-					}
-					super.writeD(c.getMembersCount());
-					super.writeC((c.isNoticeEnabled() ? 1 : 0));
-					// Alliance info:
-					super.writeS(c.getAllyName());
-					final List<L2Clan> clanAllies = ClanTable.getInstance().getClanAllies(c.getAllyId());
-					super.writeD(clanAllies.size());
-					for (L2Clan allies : clanAllies)
-					{
-						super.writeD(allies.getId());
-					}
-				}
-				break;
-			case TYPE_PLAYER:
-				super.writeD(info != -1 ? info : players.length);
-				i = 0;
-				for (StatsSet p : players)
-				{
-					if (i++ == info)
-					{
-						break;
-					}
-					super.writeD(p.getInt("charId"));
-					super.writeS(p.getString("char_name"));
-					super.writeS(p.getString("account_name"));
-					super.writeD(p.getInt("level"));
-					super.writeD(p.getInt("clanid"));
-					super.writeD(p.getInt("accesslevel"));
-					super.writeC(p.getInt("online"));
-					FastList<Integer> list = FastList.newInstance();
-					try (Connection con = L2DatabaseFactory.getInstance().getConnection();
-						PreparedStatement statement = con.prepareStatement("SELECT friendId FROM character_friends WHERE charId=?"))
-					{
-						statement.setInt(1, p.getInt("charId"));
-						try (ResultSet rset = statement.executeQuery())
-						{
-							while (rset.next())
-							{
-								list.add(rset.getInt("friendId"));
-							}
-						}
-					}
-					catch (Exception e)
-					{
-						_log.log(Level.SEVERE, "Error restoring friend data for Community Board transfer.", e);
-					}
-					super.writeD(list.size());
-					for (int j : list)
-					{
-						super.writeD(j);
-					}
-					FastList.recycle(list);
-				}
-				break;
-			case TYPE_CASTLE:
-				List<Castle> castles = CastleManager.getInstance().getCastles();
-				writeD(castles.size());
-				_log.info("Transfering " + castles.size() + " castles data to CB server.");
-				for (Castle castle : castles)
-				{
-					writeD(castle.getResidenceId());
-					writeS(castle.getName());
-					writeD(castle.getOwnerId());
-					writeD(castle.getTaxPercent());
-					writeD((int) (castle.getSiege().getSiegeDate().getTimeInMillis() / 1000));
-				}
-				break;
-		}
-	}
-}

+ 0 - 40
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/RequestCommunityBoardWrite.java

@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.writepackets;
-
-import org.netcon.BaseWritePacket;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class RequestCommunityBoardWrite extends BaseWritePacket
-{
-	public RequestCommunityBoardWrite(final int playerObjId, final String url, final String arg1, final String arg2, final String arg3, final String arg4, final String arg5)
-	{
-		super.writeC(0x02);
-		super.writeC(0x01);
-		super.writeD(playerObjId);
-		super.writeS(url);
-		super.writeS(arg1);
-		super.writeS(arg2);
-		super.writeS(arg3);
-		super.writeS(arg4);
-		super.writeS(arg5);
-	}
-}

+ 0 - 35
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/RequestShowCommunityBoard.java

@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.writepackets;
-
-import org.netcon.BaseWritePacket;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class RequestShowCommunityBoard extends BaseWritePacket
-{
-	public RequestShowCommunityBoard(final int playerObjId, final String cmd)
-	{
-		super.writeC(0x02);
-		super.writeC(0x00);
-		super.writeD(playerObjId);
-		super.writeS(cmd);
-	}
-}

+ 0 - 118
L2J_Server/java/com/l2jserver/gameserver/network/communityserver/writepackets/WorldInfo.java

@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package com.l2jserver.gameserver.network.communityserver.writepackets;
-
-import java.util.List;
-
-import javolution.util.FastList;
-
-import org.netcon.BaseWritePacket;
-
-import com.l2jserver.gameserver.datatables.ClanTable;
-import com.l2jserver.gameserver.model.L2Clan;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-
-/**
- * @authors Forsaiken, Gigiikun
- */
-public final class WorldInfo extends BaseWritePacket
-{
-	public static final byte TYPE_INIT_PACKET = 0;
-	public static final byte TYPE_UPDATE_PLAYER_DATA = 1;
-	public static final byte TYPE_UPDATE_PLAYER_STATUS = 2;
-	public static final byte TYPE_UPDATE_CLAN_DATA = 3;
-	public static final byte TYPE_SEND_CLAN_NOTICE = 4;
-	
-	public WorldInfo(L2PcInstance player, L2Clan clan, final byte type)
-	{
-		super.writeC(0x01);
-		
-		switch (type)
-		{
-			case TYPE_INIT_PACKET:
-			{
-				// this should never happen
-				super.writeC(0x00);
-				break;
-			}
-			
-			case TYPE_UPDATE_PLAYER_DATA:
-			{
-				super.writeC(0x01);
-				super.writeC(0x00);
-				super.writeD(player.getObjectId());
-				super.writeS(player.getName());
-				super.writeS(player.getAccountName());
-				super.writeD(player.getLevel());
-				super.writeD(player.getClanId());
-				super.writeD(player.getAccessLevel().getLevel());
-				super.writeC(player.isOnlineInt());
-				List<Integer> list = player.getFriendList();
-				super.writeD(list.size());
-				for (int j : list)
-				{
-					super.writeD(j);
-				}
-				break;
-			}
-			
-			case TYPE_UPDATE_PLAYER_STATUS:
-			{
-				super.writeC(0x01);
-				super.writeC(0x01);
-				super.writeD(player.getObjectId());
-				super.writeC(player.isOnlineInt());
-				break;
-			}
-			
-			case TYPE_UPDATE_CLAN_DATA:
-			{
-				super.writeC(0x02);
-				super.writeD(clan.getId());
-				super.writeS(clan.getName());
-				super.writeD(clan.getLevel());
-				super.writeD(clan.getLeader().getObjectId());
-				super.writeS(clan.getLeader().getName());
-				super.writeD(clan.getMembersCount());
-				super.writeC((clan.isNoticeEnabled() ? 1 : 0));
-				super.writeS(clan.getAllyName());
-				FastList<Integer> allyClanIdList = FastList.newInstance();
-				if (clan.getAllyId() != 0)
-				{
-					for (L2Clan c : ClanTable.getInstance().getClanAllies(clan.getAllyId()))
-					{
-						allyClanIdList.add(c.getId());
-					}
-				}
-				super.writeD(allyClanIdList.size());
-				for (int k : allyClanIdList)
-				{
-					super.writeD(k);
-				}
-				FastList.recycle(allyClanIdList);
-				break;
-			}
-			case TYPE_SEND_CLAN_NOTICE:
-				super.writeC(0x03);
-				super.writeD(clan.getId());
-				super.writeS(clan.getNotice());
-				break;
-		}
-	}
-}

+ 1 - 1
L2J_Server/java/com/l2jserver/gameserver/util/Util.java

@@ -631,7 +631,7 @@ public final class Util
 	 */
 	public static void sendCBHtml(L2PcInstance activeChar, String html, String fillMultiEdit, boolean buildActionCache)
 	{
-		if (activeChar == null)
+		if ((activeChar == null) || (html == null))
 		{
 			return;
 		}

Some files were not shown because too many files changed in this diff