Browse Source

Handler created for InvalidTradeRequestMsg

combat-2
MagicBot 8 months ago
parent
commit
019c254ac1
  1. 13
      src/engine/gameManager/TradeManager.java
  2. 5
      src/engine/net/client/ClientMessagePump.java
  3. 2
      src/engine/net/client/Protocol.java
  4. 47
      src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java

13
src/engine/gameManager/TradeManager.java

@ -8,22 +8,9 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.msg.InvalidTradeRequestMsg;
import engine.objects.PlayerCharacter;
public enum TradeManager { public enum TradeManager {
TRADEMANAGER; TRADEMANAGER;
public static void invalidTradeRequest(InvalidTradeRequestMsg msg) {
PlayerCharacter requester = PlayerCharacter.getFromCache(msg.getRequesterID());
Dispatch dispatch;
dispatch = Dispatch.borrow(requester, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
}
} }

5
src/engine/net/client/ClientMessagePump.java

@ -10,11 +10,9 @@
package engine.net.client; package engine.net.client;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.gameManager.TradeManager;
import engine.net.NetMsgHandler; import engine.net.NetMsgHandler;
import engine.net.client.handlers.AbstractClientMsgHandler; import engine.net.client.handlers.AbstractClientMsgHandler;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.InvalidTradeRequestMsg;
import engine.server.world.WorldServer; import engine.server.world.WorldServer;
import engine.session.Session; import engine.session.Session;
import engine.util.StringUtils; import engine.util.StringUtils;
@ -74,9 +72,6 @@ public class ClientMessagePump implements NetMsgHandler {
break; break;
case OPENVAULT: case OPENVAULT:
break; break;
case ARCREQUESTTRADEBUSY:
TradeManager.invalidTradeRequest((InvalidTradeRequestMsg) msg);
break;
case CHANNELMUTE: case CHANNELMUTE:
break; break;
case KEEPALIVESERVERCLIENT: case KEEPALIVESERVERCLIENT:

2
src/engine/net/client/Protocol.java

@ -41,7 +41,7 @@ public enum Protocol {
ARCPETCMD(0x4E80E001, PetCmdMsg.class, PetCmdMsgHandler.class), // Stop ArcPetAttack, Toggle Assist, Toggle Rest ARCPETCMD(0x4E80E001, PetCmdMsg.class, PetCmdMsgHandler.class), // Stop ArcPetAttack, Toggle Assist, Toggle Rest
ARCPOWERPROJECTILE(0xA2312D3B, null, null), ARCPOWERPROJECTILE(0xA2312D3B, null, null),
ARCPROMPTRECALL(0xE3196B6E, PromptRecallMsg.class, PromptRecallMsgHandler.class), //Recall Prompt ARCPROMPTRECALL(0xE3196B6E, PromptRecallMsg.class, PromptRecallMsgHandler.class), //Recall Prompt
ARCREQUESTTRADEBUSY(0xD4BAB4DF, InvalidTradeRequestMsg.class, null), // Attempt trade with someone who is already trading ARCREQUESTTRADEBUSY(0xD4BAB4DF, InvalidTradeRequestMsg.class, InvalidTradeRequestMsgHandler.class), // Attempt trade with someone who is already trading
ARCSERVERSTATUS(0x87BA4462, null, null), //Update Server Status ARCSERVERSTATUS(0x87BA4462, null, null), //Update Server Status
ARCSIEGESPIRE(0x36A49BC6, ArcSiegeSpireMsg.class, ArcSiegeSpireMsgHandler.class), // Activate/Deactivate Spires ARCSIEGESPIRE(0x36A49BC6, ArcSiegeSpireMsg.class, ArcSiegeSpireMsgHandler.class), // Activate/Deactivate Spires
ARCSUMMON(0xFD816A0A, RecvSummonsMsg.class, RecvSummonsMsgHandler.class), // Suspect Recv Summons Request ARCSUMMON(0xFD816A0A, RecvSummonsMsg.class, RecvSummonsMsgHandler.class), // Suspect Recv Summons Request

47
src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java

@ -0,0 +1,47 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.handlers;
import engine.Enum;
import engine.exception.MsgSendException;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.InvalidTradeRequestMsg;
import engine.objects.PlayerCharacter;
public class InvalidTradeRequestMsgHandler extends AbstractClientMsgHandler {
public InvalidTradeRequestMsgHandler() {
super(InvalidTradeRequestMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
PlayerCharacter playerCharacter = origin.getPlayerCharacter();
// Member variable declaration
InvalidTradeRequestMsg msg;
// Member variable assignment
msg = (InvalidTradeRequestMsg) baseMsg;
Dispatch dispatch;
dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
return true;
}
}
Loading…
Cancel
Save