Эх сурвалжийг харах

BETA: Updating admin packet forge command.
* Notes:
* With this patch you only specify op codes and the format after the op codes once.
* When you click on next, you can type in the values. When you send the packet, the same html opens again.
* Patch by: FBIagent

Rumen Nikiforov 11 жил өмнө
parent
commit
1fd8ad2b21

+ 2 - 2
L2J_DataPack_BETA/dist/game/config/adminCommands.xml

@@ -427,8 +427,8 @@
 
 	<!-- ADMIN P FORGE -->
 	<admin command="admin_forge" accessLevel="7" />
-	<admin command="admin_forge2" accessLevel="7" />
-	<admin command="admin_forge3" accessLevel="7" />
+	<admin command="admin_forge_values" accessLevel="7" />
+	<admin command="admin_forge_send" accessLevel="7" />
 
 	<!-- ADMIN PLEDGE -->
 	<admin command="admin_pledge" accessLevel="7" />

+ 1 - 0
L2J_DataPack_BETA/dist/game/data/html/admin/pforge/inc/editor.htm

@@ -0,0 +1 @@
+<tr><td width=20 height=25><center>%format%</center></td><td width=160><edit width=160 var=v%editor_index%></td></tr>

+ 27 - 0
L2J_DataPack_BETA/dist/game/data/html/admin/pforge/main.htm

@@ -0,0 +1,27 @@
+<html><body>
+<table width=270 cellspacing=0 cellpadding=0>
+	<tr>
+		<td width=45><button value="Main" action="bypass -h admin_admin" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+		<td width=180><center>Packet Forge Panel</center></td>
+		<td width=45><button value="Back" action="bypass -h admin_admin4" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+	</tr>
+</table><br><br>
+
+<center>
+	<table width=180 cellspacing=0 cellpadding=0>
+		<tr>
+			<td><center>First OP</center></td><td><center>Second OP</center></td><td><center>Third OP</center></td>
+		</tr>
+		<tr>
+			<td><edit width=60 var=opcode1></td><td><edit width=60 var=opcode2></td><td><edit width=60 var=opcode3></td>
+		</tr>
+	</table><br>
+
+	<table width=180 cellspacing=0 cellpadding=0>
+		<tr><td><center>Format (b,x,c,h,d,q,f,s)</center></td></tr>
+		<tr><td><edit width=180 var=format></td></tr>
+	</table><br>
+
+	<button value="Next >>" action="bypass -h admin_forge_values $opcode1 $opcode2 $opcode3 ; $format" width=180 height=23 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
+</center>
+</body></html>

+ 26 - 0
L2J_DataPack_BETA/dist/game/data/html/admin/pforge/values.htm

@@ -0,0 +1,26 @@
+<html><body>
+<table width=270 cellspacing=0 cellpadding=0>
+	<tr>
+		<td width=45><button value="Main" action="bypass -h admin_admin" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+		<td width=180><center>Packet Forge Panel</center></td>
+		<td width=45><button value="Back" action="bypass -h admin_forge" width=45 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+	</tr>
+</table><br><br>
+
+<center>
+	OP Codes: %opcodes%<br1>
+	Format: %opformat% %format%<br>
+
+	<table width=180 cellspacing=0 cellpadding=0>
+		%editors%
+	</table><br>
+
+	<table width=180 cellspacing=0 cellpadding=0>
+		<tr>
+			<td><button value="To Client" action="bypass -h admin_forge_send sc %send_bypass%" width=60 height=23 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+			<td><button value="Broadcast" action="bypass -h admin_forge_send sb %send_bypass%" width=60 height=23 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+			<td><button value="To Server" action="bypass -h admin_forge_send cs %send_bypass%" width=60 height=23 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+		</tr>
+	</table>
+</center>
+</body></html>

+ 0 - 9
L2J_DataPack_BETA/dist/game/data/html/admin/pforge1.htm

@@ -1,9 +0,0 @@
-<html><title>L2J Forge Panel 1</title><body>
-<table width=260><tr>
-<td width=40><button value="Back" action="bypass -h admin_admin4" width=40 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
-<td width=220><center>Long live KenM & Wooden</center></td>
-</tr></table>
-Format:<edit var="format" width=100><br>
-<button value="Step 2" action="bypass -h admin_forge2 $format" width=55 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
-Only c h d f s b or x work
-</body></html>

+ 0 - 15
L2J_DataPack_BETA/dist/game/data/html/admin/pforge2.htm

@@ -1,15 +0,0 @@
-<html><title>L2J Forge Panel 2</title><body>
-<table width=260><tr>
-<td width=40><button value="Back" action="bypass -h admin_admin4" width=40 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
-<td width=220><center>Worship teh might of us</center></td>
-</tr></table><br>
-Format: %format%<br>
-No spaces in values please ;)<br>
-Decimal values for c h d; float (with point) for f; string for s and for x/b its hex value<br>
-Values:<br>
-%valueditors%
-<table width=200>
-<tr><td><button value="Send" action="bypass -h admin_forge3 %format% %send%" width=90 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
-<td><button value="Broadcast" action="bypass -h admin_forge3 broadcast %format% %send%" width=90 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
-<td><button value="From client" action="bypass -h admin_forge3 client %format% %send%" width=90 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
-</tr></table></body></html>

+ 0 - 9
L2J_DataPack_BETA/dist/game/data/html/admin/pforge3.htm

@@ -1,9 +0,0 @@
-<html><title>L2J Forge Panel 3</title><body>
-<table width=260><tr>
-<td width=40><button value="Back" action="bypass -h admin_admin4" width=40 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
-<td width=220><center>You advanced in the path to the eternal bliss.</center></td>
-</tr></table><br>
-GG !! If you can see this, there was no critical :)<br>
-and packet (%format%) was sent<br><br>
-<button value="Try again ?" action="bypass -h admin_forge" width=100 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"><br>
-<br>Debug: cmd string : %command%</body></html>

+ 478 - 141
L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminPForge.java

@@ -20,32 +20,252 @@ package handlers.admincommandhandlers;
 
 import java.math.BigInteger;
 import java.nio.ByteBuffer;
+import java.util.Collection;
+import java.util.LinkedList;
 import java.util.StringTokenizer;
 
 import org.mmocore.network.NioNetStringBuffer;
 
 import com.l2jserver.gameserver.GameServer;
 import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.cache.HtmCache;
 import com.l2jserver.gameserver.handler.IAdminCommandHandler;
+import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.L2Playable;
+import com.l2jserver.gameserver.model.actor.instance.L2BoatInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket;
 import com.l2jserver.gameserver.network.serverpackets.AdminForgePacket;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jserver.util.StringUtil;
 
 /**
  * This class handles commands for gm to forge packets
- * @author Maktakien
+ * @author Maktakien, FBIagent
  */
-public class AdminPForge implements IAdminCommandHandler
+public final class AdminPForge implements IAdminCommandHandler
 {
 	private static final String[] ADMIN_COMMANDS =
 	{
 		"admin_forge",
-		"admin_forge2",
-		"admin_forge3"
+		"admin_forge_values",
+		"admin_forge_send"
 	};
 	
+	private String[] getOpCodes(StringTokenizer st)
+	{
+		Collection<String> opCodes = null;
+		while (st.hasMoreTokens())
+		{
+			String token = st.nextToken();
+			if (";".equals(token))
+			{
+				break;
+			}
+			
+			if (opCodes == null)
+			{
+				opCodes = new LinkedList<>();
+			}
+			opCodes.add(token);
+		}
+		
+		if (opCodes == null)
+		{
+			return null;
+		}
+		
+		return opCodes.toArray(new String[opCodes.size()]);
+	}
+	
+	private boolean validateOpCodes(String[] opCodes)
+	{
+		if ((opCodes == null) || (opCodes.length == 0) || (opCodes.length > 3))
+		{
+			return false;
+		}
+		
+		for (int i = 0; i < opCodes.length; ++i)
+		{
+			final String opCode = opCodes[i];
+			long opCodeLong;
+			try
+			{
+				opCodeLong = Long.parseLong(opCode);
+			}
+			catch (Exception e)
+			{
+				if (i > 0)
+				{
+					return true;
+				}
+				
+				return false;
+			}
+			
+			if (opCodeLong < 0)
+			{
+				return false;
+			}
+			
+			if ((i == 0) && (opCodeLong > 255))
+			{
+				return false;
+			}
+			else if ((i == 1) && (opCodeLong > 65535))
+			{
+				return false;
+			}
+			else if ((i == 2) && (opCodeLong > 4294967295L))
+			{
+				return false;
+			}
+		}
+		
+		return true;
+	}
+	
+	private boolean validateFormat(String format)
+	{
+		for (int chIdx = 0; chIdx < format.length(); ++chIdx)
+		{
+			switch (format.charAt(chIdx))
+			{
+				case 'b':
+				case 'B':
+				case 'x':
+				case 'X':
+					// array
+					break;
+				case 'c':
+				case 'C':
+					// byte
+					break;
+				case 'h':
+				case 'H':
+					// word
+					break;
+				case 'd':
+				case 'D':
+					// dword
+					break;
+				case 'q':
+				case 'Q':
+					// qword
+					break;
+				case 'f':
+				case 'F':
+					// double
+					break;
+				case 's':
+				case 'S':
+					// string
+					break;
+				default:
+					return false;
+			}
+		}
+		
+		return true;
+	}
+	
+	private boolean validateMethod(String method)
+	{
+		switch (method)
+		{
+			case "sc":
+			case "sb":
+			case "cs":
+				return true;
+		}
+		
+		return false;
+	}
+	
+	private void showValuesUsage(L2PcInstance activeChar)
+	{
+		activeChar.sendMessage("Usage: //forge_values opcode1[ opcode2[ opcode3]] ;[ format]");
+		showMainPage(activeChar);
+	}
+	
+	private void showSendUsage(L2PcInstance activeChar, String[] opCodes, String format)
+	{
+		activeChar.sendMessage("Usage: //forge_send sc|sb|cs opcode1[;opcode2[;opcode3]][ format value1 ... valueN] ");
+		if (opCodes == null)
+		{
+			showMainPage(activeChar);
+		}
+		else
+		{
+			showValuesPage(activeChar, opCodes, format);
+		}
+	}
+	
+	private void showMainPage(L2PcInstance activeChar)
+	{
+		AdminHtml.showAdminHtml(activeChar, "pforge/main.htm");
+	}
+	
+	private void showValuesPage(L2PcInstance activeChar, String[] opCodes, String format)
+	{
+		String sendBypass = null;
+		String valuesHtml = HtmCache.getInstance().getHtmForce(activeChar.getHtmlPrefix(), "data/html/admin/pforge/values.htm");
+		if (opCodes.length == 3)
+		{
+			valuesHtml = valuesHtml.replace("%opformat%", "chd");
+			sendBypass = opCodes[0] + ";" + opCodes[1] + ";" + opCodes[2];
+		}
+		else if (opCodes.length == 2)
+		{
+			valuesHtml = valuesHtml.replace("%opformat%", "ch");
+			sendBypass = opCodes[0] + ";" + opCodes[1];
+		}
+		else
+		{
+			valuesHtml = valuesHtml.replace("%opformat%", "c");
+			sendBypass = opCodes[0];
+		}
+		
+		valuesHtml = valuesHtml.replace("%opcodes%", sendBypass);
+		
+		String editorsHtml = "";
+		
+		if (format == null)
+		{
+			valuesHtml = valuesHtml.replace("%format%", "");
+			editorsHtml = "";
+		}
+		else
+		{
+			valuesHtml = valuesHtml.replace("%format%", format);
+			sendBypass += " " + format;
+			
+			String editorTemplate = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/admin/pforge/inc/editor.htm");
+			
+			if (editorTemplate != null)
+			{
+				StringBuilder singleCharSequence = new StringBuilder(1);
+				singleCharSequence.append(' ');
+				
+				for (int chIdx = 0; chIdx < format.length(); ++chIdx)
+				{
+					char ch = format.charAt(chIdx);
+					singleCharSequence.setCharAt(0, ch);
+					editorsHtml += editorTemplate.replace("%format%", singleCharSequence).replace("%editor_index%", String.valueOf(chIdx));
+					sendBypass += " $v" + chIdx;
+				}
+			}
+			else
+			{
+				editorsHtml = "";
+			}
+		}
+		
+		valuesHtml = valuesHtml.replace("%editors%", editorsHtml);
+		valuesHtml = valuesHtml.replace("%send_bypass%", sendBypass);
+		activeChar.sendPacket(new NpcHtmlMessage(valuesHtml));
+	}
+	
 	@Override
 	public boolean useAdminCommand(String command, L2PcInstance activeChar)
 	{
@@ -53,188 +273,305 @@ public class AdminPForge implements IAdminCommandHandler
 		{
 			showMainPage(activeChar);
 		}
-		else if (command.startsWith("admin_forge2"))
+		else if (command.startsWith("admin_forge_values "))
 		{
 			try
 			{
 				StringTokenizer st = new StringTokenizer(command);
-				st.nextToken();
-				String format = st.nextToken();
-				showPage2(activeChar, format);
+				st.nextToken(); // skip command token
+				
+				if (!st.hasMoreTokens())
+				{
+					showValuesUsage(activeChar);
+					return false;
+				}
+				
+				String[] opCodes = getOpCodes(st);
+				if (!validateOpCodes(opCodes))
+				{
+					activeChar.sendMessage("Invalid op codes!");
+					showValuesUsage(activeChar);
+					return false;
+				}
+				
+				String format = null;
+				if (st.hasMoreTokens())
+				{
+					format = st.nextToken();
+					if (!validateFormat(format))
+					{
+						activeChar.sendMessage("Format invalid!");
+						showValuesUsage(activeChar);
+						return false;
+					}
+				}
+				
+				showValuesPage(activeChar, opCodes, format);
 			}
-			catch (Exception ex)
+			catch (Exception e)
 			{
-				ex.printStackTrace();
-				activeChar.sendMessage("Usage: //forge2 format");
+				e.printStackTrace();
+				showValuesUsage(activeChar);
+				return false;
 			}
 		}
-		else if (command.startsWith("admin_forge3"))
+		else if (command.startsWith("admin_forge_send "))
 		{
 			try
 			{
 				StringTokenizer st = new StringTokenizer(command);
-				st.nextToken();
-				String format = st.nextToken();
-				boolean broadcast = false;
-				boolean client = false;
-				ByteBuffer buf = null;
-				if (format.toLowerCase().equals("broadcast"))
+				st.nextToken(); // skip command token
+				
+				if (!st.hasMoreTokens())
 				{
-					format = st.nextToken();
-					broadcast = true;
+					showSendUsage(activeChar, null, null);
+					return false;
 				}
-				else if (format.toLowerCase().equals("client"))
+				
+				String method = st.nextToken();
+				if (!validateMethod(method))
 				{
-					format = st.nextToken();
-					client = true;
-					buf = ByteBuffer.allocate(65533);
+					activeChar.sendMessage("Invalid method!");
+					showSendUsage(activeChar, null, null);
+					return false;
 				}
-				AdminForgePacket sp = new AdminForgePacket();
-				for (int i = 0; i < format.length(); i++)
+				
+				String[] opCodes = st.nextToken().split(";");
+				if (!validateOpCodes(opCodes))
 				{
-					String val = st.nextToken();
-					if (val.toLowerCase().equals("$objid"))
-					{
-						val = String.valueOf(activeChar.getObjectId());
-					}
-					else if (val.toLowerCase().equals("$tobjid"))
-					{
-						val = String.valueOf(activeChar.getTarget().getObjectId());
-					}
-					else if (val.toLowerCase().equals("$bobjid"))
-					{
-						if (activeChar.getBoat() != null)
-						{
-							val = String.valueOf(activeChar.getBoat().getObjectId());
-						}
-					}
-					else if (val.toLowerCase().equals("$clanid"))
-					{
-						val = String.valueOf(activeChar.getClanId());
-					}
-					else if (val.toLowerCase().equals("$allyid"))
-					{
-						val = String.valueOf(activeChar.getAllyId());
-					}
-					else if (val.toLowerCase().equals("$tclanid"))
-					{
-						val = String.valueOf(((L2PcInstance) activeChar.getTarget()).getClanId());
-					}
-					else if (val.toLowerCase().equals("$tallyid"))
-					{
-						val = String.valueOf(((L2PcInstance) activeChar.getTarget()).getAllyId());
-					}
-					else if (val.toLowerCase().equals("$x"))
-					{
-						val = String.valueOf(activeChar.getX());
-					}
-					else if (val.toLowerCase().equals("$y"))
-					{
-						val = String.valueOf(activeChar.getY());
-					}
-					else if (val.toLowerCase().equals("$z"))
-					{
-						val = String.valueOf(activeChar.getZ());
-					}
-					else if (val.toLowerCase().equals("$heading"))
-					{
-						val = String.valueOf(activeChar.getHeading());
-					}
-					else if (val.toLowerCase().equals("$tx"))
+					activeChar.sendMessage("Invalid op codes!");
+					showSendUsage(activeChar, null, null);
+					return false;
+				}
+				
+				String format = null;
+				if (st.hasMoreTokens())
+				{
+					format = st.nextToken();
+					if (!validateFormat(format))
 					{
-						val = String.valueOf(activeChar.getTarget().getX());
+						activeChar.sendMessage("Format invalid!");
+						showSendUsage(activeChar, null, null);
+						return false;
 					}
-					else if (val.toLowerCase().equals("$ty"))
+				}
+				
+				AdminForgePacket afp = null;
+				ByteBuffer bb = null;
+				for (int i = 0; i < opCodes.length; ++i)
+				{
+					char type;
+					if (i == 0)
 					{
-						val = String.valueOf(activeChar.getTarget().getY());
+						type = 'c';
 					}
-					else if (val.toLowerCase().equals("$tz"))
+					else if (i == 1)
 					{
-						val = String.valueOf(activeChar.getTarget().getZ());
+						type = 'h';
 					}
-					else if (val.toLowerCase().equals("$theading"))
+					else
 					{
-						val = String.valueOf(((L2PcInstance) activeChar.getTarget()).getHeading());
+						type = 'd';
 					}
-					
-					if (!client)
+					if (method.equals("sc") || method.equals("sb"))
 					{
-						sp.addPart(format.getBytes()[i], val);
+						if (afp == null)
+						{
+							afp = new AdminForgePacket();
+						}
+						afp.addPart((byte) type, opCodes[i]);
 					}
 					else
 					{
-						write(format.getBytes()[i], val, buf);
+						if (bb == null)
+						{
+							bb = ByteBuffer.allocate(32767);
+						}
+						write((byte) type, opCodes[i], bb);
 					}
 				}
-				if (broadcast)
+				
+				if (format != null)
 				{
-					activeChar.broadcastPacket(sp);
-				}
-				else if (client)
-				{
-					if (buf != null)
+					for (int i = 0; i < format.length(); ++i)
 					{
-						buf.flip();
-						L2GameClientPacket p = (L2GameClientPacket) GameServer.gameServer.getL2GamePacketHandler().handlePacket(buf, activeChar.getClient());
-						if (p != null)
+						if (!st.hasMoreTokens())
 						{
-							p.setBuffers(buf, activeChar.getClient(), new NioNetStringBuffer(2000));
-							if (p.read())
+							activeChar.sendMessage("Not enough values!");
+							showSendUsage(activeChar, null, null);
+							return false;
+						}
+						
+						L2Object target = null;
+						L2BoatInstance boat = null;
+						String value = st.nextToken();
+						switch (value)
+						{
+							case "$oid":
+								value = String.valueOf(activeChar.getObjectId());
+								break;
+							case "$boid":
+								boat = activeChar.getBoat();
+								if (boat != null)
+								{
+									value = String.valueOf(boat.getObjectId());
+								}
+								else
+								{
+									value = "0";
+								}
+								break;
+							case "$title":
+								value = activeChar.getTitle();
+								break;
+							case "$name":
+								value = activeChar.getName();
+								break;
+							case "$x":
+								value = String.valueOf(activeChar.getX());
+								break;
+							case "$y":
+								value = String.valueOf(activeChar.getY());
+								break;
+							case "$z":
+								value = String.valueOf(activeChar.getZ());
+								break;
+							case "$heading":
+								value = String.valueOf(activeChar.getHeading());
+								break;
+							case "$toid":
+								value = String.valueOf(activeChar.getTargetId());
+								break;
+							case "$tboid":
+								target = activeChar.getTarget();
+								if ((target != null) && (target instanceof L2Playable))
+								{
+									boat = ((L2Playable) target).getActingPlayer().getBoat();
+									if (boat != null)
+									{
+										value = String.valueOf(boat.getObjectId());
+									}
+									else
+									{
+										value = "0";
+									}
+								}
+								break;
+							case "$ttitle":
+								target = activeChar.getTarget();
+								if ((target != null) && (target instanceof L2Character))
+								{
+									value = String.valueOf(((L2Character) target).getTitle());
+								}
+								else
+								{
+									value = "";
+								}
+								break;
+							case "$tname":
+								target = activeChar.getTarget();
+								if (target != null)
+								{
+									value = String.valueOf(target.getName());
+								}
+								else
+								{
+									value = "";
+								}
+								break;
+							case "$tx":
+								target = activeChar.getTarget();
+								if (target != null)
+								{
+									value = String.valueOf(target.getX());
+								}
+								else
+								{
+									value = "0";
+								}
+								break;
+							case "$ty":
+								target = activeChar.getTarget();
+								if (target != null)
+								{
+									value = String.valueOf(target.getY());
+								}
+								else
+								{
+									value = "0";
+								}
+								break;
+							case "$tz":
+								target = activeChar.getTarget();
+								if (target != null)
+								{
+									value = String.valueOf(target.getZ());
+								}
+								else
+								{
+									value = "0";
+								}
+								break;
+							case "$theading":
+								target = activeChar.getTarget();
+								if (target != null)
+								{
+									value = String.valueOf(target.getHeading());
+								}
+								else
+								{
+									value = "0";
+								}
+								break;
+						}
+						
+						if (method.equals("sc") || method.equals("sb"))
+						{
+							if (afp != null)
 							{
-								ThreadPoolManager.getInstance().executePacket(p);
+								afp.addPart((byte) format.charAt(i), value);
 							}
 						}
+						else
+						{
+							write((byte) format.charAt(i), value, bb);
+						}
 					}
 				}
-				else
+				
+				if (method.equals("sc"))
 				{
-					activeChar.sendPacket(sp);
+					activeChar.sendPacket(afp);
+				}
+				else if (method.equals("sb"))
+				{
+					activeChar.broadcastPacket(afp);
+				}
+				else if (bb != null)
+				{
+					bb.flip();
+					L2GameClientPacket p = (L2GameClientPacket) GameServer.gameServer.getL2GamePacketHandler().handlePacket(bb, activeChar.getClient());
+					if (p != null)
+					{
+						p.setBuffers(bb, activeChar.getClient(), new NioNetStringBuffer(2000));
+						if (p.read())
+						{
+							ThreadPoolManager.getInstance().executePacket(p);
+						}
+					}
 				}
-				showPage3(activeChar, format, command);
+				
+				showValuesPage(activeChar, opCodes, format);
 			}
-			catch (Exception ex)
+			catch (Exception e)
 			{
-				ex.printStackTrace();
+				e.printStackTrace();
+				showSendUsage(activeChar, null, null);
+				return false;
 			}
 		}
-		return true;
-	}
-	
-	private void showMainPage(L2PcInstance activeChar)
-	{
-		AdminHtml.showAdminHtml(activeChar, "pforge1.htm");
-	}
-	
-	private void showPage2(L2PcInstance activeChar, String format)
-	{
-		final NpcHtmlMessage adminReply = new NpcHtmlMessage();
-		adminReply.setFile(activeChar.getHtmlPrefix(), "data/html/admin/pforge2.htm");
-		adminReply.replace("%format%", format);
 		
-		final StringBuilder replyMSG = new StringBuilder(format.length() * 40);
-		
-		for (int i = 0; i < format.length(); i++)
-		{
-			StringUtil.append(replyMSG, String.valueOf(format.charAt(i)), " : <edit var=\"v", String.valueOf(i), "\" width=100><br1>");
-		}
-		adminReply.replace("%valueditors%", replyMSG.toString());
-		replyMSG.setLength(0);
-		
-		for (int i = 0; i < format.length(); i++)
-		{
-			replyMSG.append(" $v" + i);
-		}
-		adminReply.replace("%send%", replyMSG.toString());
-		activeChar.sendPacket(adminReply);
-	}
-	
-	private void showPage3(L2PcInstance activeChar, String format, String command)
-	{
-		final NpcHtmlMessage adminReply = new NpcHtmlMessage();
-		adminReply.setFile(activeChar.getHtmlPrefix(), "data/html/admin/pforge3.htm");
-		adminReply.replace("%format%", format);
-		adminReply.replace("%command%", command);
-		activeChar.sendPacket(adminReply);
+		return true;
 	}
 	
 	private boolean write(byte b, String string, ByteBuffer buf)