From 490a1bd8e5a8fe11815151523538d388754b0cd6 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 13 Aug 2023 13:45:07 -0500 Subject: [PATCH] structure for petition received handler --- src/engine/net/client/Protocol.java | 2 +- .../handlers/PetitionReceivedMsgHandler.java | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/engine/net/client/handlers/PetitionReceivedMsgHandler.java diff --git a/src/engine/net/client/Protocol.java b/src/engine/net/client/Protocol.java index 700d55b2..87960fa9 100644 --- a/src/engine/net/client/Protocol.java +++ b/src/engine/net/client/Protocol.java @@ -85,7 +85,7 @@ public enum Protocol { COSTTOOPENBANK(0x135BE5E8, AckBankWindowOpenedMsg.class, null), // ACK Bank Window Opened CREATECHAR(0x5D18B5C8, CommitNewCharacterMsg.class, null), // Commit New Character, CREATEPETITION(0xD489CFED, GuildCreationFinalizeMsg.class, GuildCreationFinalizeHandler.class), //Confirm guild creation - CUSTOMERPETITION(0x7F9D7D6D, PetitionReceivedMsg.class, null), + CUSTOMERPETITION(0x7F9D7D6D, PetitionReceivedMsg.class, PetitionReceivedMsgHandler.class), DELETEOBJECT(0x57F069D8, DeleteItemMsg.class, null), //Delete Item from Inventory DESTROYBUILDING(0x3CB6FAD3, DestroyBuildingMsg.class, DestroyBuildingHandler.class), // Destroy Building DISBANDGUILD(0x77AABD64, DisbandGuildMsg.class, DisbandGuildHandler.class), //Disband Guild diff --git a/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java b/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java new file mode 100644 index 00000000..11fd68e8 --- /dev/null +++ b/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java @@ -0,0 +1,81 @@ +package engine.net.client.handlers; + +import engine.exception.MsgSendException; +import engine.net.client.ClientConnection; +import engine.net.client.msg.ClientNetMsg; +import engine.net.client.msg.PetitionReceivedMsg; + +public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler { + + public PetitionReceivedMsgHandler(Class handler) { + super(handler); + } + + @Override + protected boolean _handleNetMsg(ClientNetMsg msg, ClientConnection origin) throws MsgSendException { + switch(((PetitionReceivedMsg) msg).getType()){ + case 1: // TYPE_GENERAL_HELP + + break; + case 2: // TYPE_FEEDBACK + + break; + case 3: // TYPE_STUCK + + break; + case 4: // TYPE_HARASSMENT + + break; + case 5: // TYPE_EXPLOIT + + break; + case 6: // TYPE_BUG + + break; + case 7: // TYPE_GAME_STOPPER + + break; + case 8: // TYPE_TECH_SUPPORT + + break; + default: // INVALID_TYPE cannot process this + return false; + } + switch (((PetitionReceivedMsg)msg).getSubType()) { + case 1: // SUBTYPE_EXPLOIT_DUPE + + break; + case 2: // SUBTYPE_EXPLOIT_LEVELING + + break; + case 3: // SUBTYPE_EXPLOIT_SKILL_GAIN + + break; + case 4: // SUBTYPE_EXPLOIT_KILLING + + break; + case 5: // SUBTYPE_EXPLOIT_POLICY + + break; + case 6: // SUBTYPE_EXPLOIT_OTHER + + break; + case 7: // SUBTYPE_TECH_VIDEO + + break; + case 8: // SUBTYPE_TECH_SOUND + + break; + case 9: // SUBTYPE_TECH_NETWORK + + break; + case 10: // SUBTYPE_TECH_OTHER + + break; + default: // INVALID_SUB_TYPE + + break; + } + return true; + } +}