Browse Source

Handler created for RefineScreenMsg

combat-2
MagicBot 8 months ago
parent
commit
bf712accf9
  1. 3
      src/engine/net/client/ClientMessagePump.java
  2. 2
      src/engine/net/client/Protocol.java
  3. 51
      src/engine/net/client/handlers/RefinerScreenMsgHandler.java
  4. 13
      src/engine/server/world/WorldServer.java

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

@ -126,9 +126,6 @@ public class ClientMessagePump implements NetMsgHandler {
case TRAINERLIST: case TRAINERLIST:
WorldServer.trainerInfo((TrainerInfoMsg) msg, origin); WorldServer.trainerInfo((TrainerInfoMsg) msg, origin);
break; break;
case ARCUNTRAINLIST:
WorldServer.refinerScreen((RefinerScreenMsg) msg, origin);
break;
case POWERTARGNAME: case POWERTARGNAME:
PowersManager.summon((SendSummonsRequestMsg) msg, origin); PowersManager.summon((SendSummonsRequestMsg) msg, origin);
break; break;

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

@ -48,7 +48,7 @@ public enum Protocol {
ARCTRACKINGLIST(0xC89CF08B, TrackWindowMsg.class, null), //Request/Send Track window ARCTRACKINGLIST(0xC89CF08B, TrackWindowMsg.class, null), //Request/Send Track window
ARCTRACKOBJECT(0x609B6BA2, TrackArrowMsg.class, null), //Send Track Arrow ARCTRACKOBJECT(0x609B6BA2, TrackArrowMsg.class, null), //Send Track Arrow
ARCUNTRAINABILITY(0x548DBF83, RefineMsg.class, RefineMsgHandler.class), //Refine ARCUNTRAINABILITY(0x548DBF83, RefineMsg.class, RefineMsgHandler.class), //Refine
ARCUNTRAINLIST(0x38879E90, RefinerScreenMsg.class, null), //Refiner screen ARCUNTRAINLIST(0x38879E90, RefinerScreenMsg.class, RefinerScreenMsgHandler.class), //Refiner screen
ARCVIEWASSETTRANSACTIONS(0xBFA476E4, ArcViewAssetTransactionsMsg.class, ArcViewAssetTransactionsMsgHandler.class), ARCVIEWASSETTRANSACTIONS(0xBFA476E4, ArcViewAssetTransactionsMsg.class, ArcViewAssetTransactionsMsgHandler.class),
ASSETSUPPORT(0xc481f89D, AssetSupportMsg.class, AssetSupportMsgHandler.class), ASSETSUPPORT(0xc481f89D, AssetSupportMsg.class, AssetSupportMsgHandler.class),
BANISHMEMBER(0x31AA3368, BanishUnbanishMsg.class, BanishUnbanishHandler.class), // Banish/Unbanish BANISHMEMBER(0x31AA3368, BanishUnbanishMsg.class, BanishUnbanishHandler.class), // Banish/Unbanish

51
src/engine/net/client/handlers/RefinerScreenMsgHandler.java

@ -0,0 +1,51 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// 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.RefinerScreenMsg;
import engine.objects.NPC;
import engine.objects.PlayerCharacter;
public class RefinerScreenMsgHandler extends AbstractClientMsgHandler {
public RefinerScreenMsgHandler() {
super(RefinerScreenMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
PlayerCharacter playerCharacter = origin.getPlayerCharacter();
// Member variable declaration
RefinerScreenMsg msg;
// Member variable assignment
msg = (RefinerScreenMsg) baseMsg;
NPC npc = NPC.getFromCache(msg.getNpcID());
if (npc != null)
msg.setUnknown02(0); //cost to refine?
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
return true;
}
}

13
src/engine/server/world/WorldServer.java

@ -33,7 +33,6 @@ import engine.net.client.ClientConnection;
import engine.net.client.ClientConnectionManager; import engine.net.client.ClientConnectionManager;
import engine.net.client.ClientMessagePump; import engine.net.client.ClientMessagePump;
import engine.net.client.Protocol; import engine.net.client.Protocol;
import engine.net.client.msg.RefinerScreenMsg;
import engine.net.client.msg.TrainerInfoMsg; import engine.net.client.msg.TrainerInfoMsg;
import engine.net.client.msg.UpdateStateMsg; import engine.net.client.msg.UpdateStateMsg;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
@ -143,18 +142,6 @@ public class WorldServer {
} }
public static void refinerScreen(RefinerScreenMsg msg, ClientConnection origin)
throws MsgSendException {
NPC npc = NPC.getFromCache(msg.getNpcID());
if (npc != null)
msg.setUnknown02(0); //cost to refine?
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
}
public static String getUptimeString() { public static String getUptimeString() {
String outString = null; String outString = null;

Loading…
Cancel
Save