Handler created for GuildTreeStatusMSg
This commit is contained in:
@@ -631,32 +631,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
DispatchMessage.dispatchMsgToInterestArea(source, msg, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, true);
|
DispatchMessage.dispatchMsgToInterestArea(source, msg, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//returns true if looted item is goldItem and is split. Otherwise returns false
|
|
||||||
|
|
||||||
private static void GuildTreeStatusMsg(GuildTreeStatusMsg msg, ClientConnection origin) throws SQLException {
|
|
||||||
|
|
||||||
PlayerCharacter player = SessionManager.getPlayerCharacter(origin);
|
|
||||||
Dispatch dispatch;
|
|
||||||
|
|
||||||
if (player == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (origin.guildtreespam > System.currentTimeMillis()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
origin.guildtreespam = System.currentTimeMillis() + 5000;
|
|
||||||
|
|
||||||
Building b = BuildingManager.getBuildingFromCache(msg.getTargetID());
|
|
||||||
if (b == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GuildTreeStatusMsg gtsm = new GuildTreeStatusMsg(b, player);
|
|
||||||
gtsm.configure();
|
|
||||||
|
|
||||||
dispatch = Dispatch.borrow(player, gtsm);
|
|
||||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static void petAttack(PetAttackMsg msg, ClientConnection conn) throws MsgSendException {
|
protected static void petAttack(PetAttackMsg msg, ClientConnection conn) throws MsgSendException {
|
||||||
|
|
||||||
PlayerCharacter pc = SessionManager.getPlayerCharacter(conn);
|
PlayerCharacter pc = SessionManager.getPlayerCharacter(conn);
|
||||||
@@ -819,9 +793,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
ToggleSitStandMsg tssm = (ToggleSitStandMsg) msg;
|
ToggleSitStandMsg tssm = (ToggleSitStandMsg) msg;
|
||||||
toggleSitStand(tssm, origin);
|
toggleSitStand(tssm, origin);
|
||||||
break;
|
break;
|
||||||
case GUILDTREESTATUS:
|
|
||||||
GuildTreeStatusMsg((GuildTreeStatusMsg) msg, origin);
|
|
||||||
break;
|
|
||||||
case IGNORE:
|
case IGNORE:
|
||||||
((IgnoreMsg) msg).handleRequest(origin);
|
((IgnoreMsg) msg).handleRequest(origin);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public enum Protocol {
|
|||||||
GROUPTREASURE(0x01041C66, ToggleGroupSplitMsg.class, ToggleGroupSplitHandler.class), // Toggle Group Split
|
GROUPTREASURE(0x01041C66, ToggleGroupSplitMsg.class, ToggleGroupSplitHandler.class), // Toggle Group Split
|
||||||
GUILDMEMBERONLINE(0x7B79EB3A, GuildEnterWorldMsg.class, null), // Send Enter World Message to Guild
|
GUILDMEMBERONLINE(0x7B79EB3A, GuildEnterWorldMsg.class, null), // Send Enter World Message to Guild
|
||||||
GUILDRANKCHANGE(0x0DEFB21F, ChangeRankMsg.class, ChangeRankHandler.class), // Change Rank
|
GUILDRANKCHANGE(0x0DEFB21F, ChangeRankMsg.class, ChangeRankHandler.class), // Change Rank
|
||||||
GUILDTREESTATUS(0x4B95FB85, GuildTreeStatusMsg.class, null),
|
GUILDTREESTATUS(0x4B95FB85, GuildTreeStatusMsg.class, GuildTreeStatusMsgHandler.class),
|
||||||
HIRELINGSERVICE(0xD3D93322, HirelingServiceMsg.class, HirelingServiceMsgHandler.class),
|
HIRELINGSERVICE(0xD3D93322, HirelingServiceMsg.class, HirelingServiceMsgHandler.class),
|
||||||
IGNORE(0xBD8881EE, IgnoreMsg.class, null), //client sent /ignore command
|
IGNORE(0xBD8881EE, IgnoreMsg.class, null), //client sent /ignore command
|
||||||
INITIATETRADEHUDS(0x667D29D8, OpenTradeWindowMsg.class, null), // Open Trade Window
|
INITIATETRADEHUDS(0x667D29D8, OpenTradeWindowMsg.class, null), // Open Trade Window
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.net.client.handlers;
|
||||||
|
|
||||||
|
import engine.Enum.DispatchChannel;
|
||||||
|
import engine.exception.MsgSendException;
|
||||||
|
import engine.gameManager.BuildingManager;
|
||||||
|
import engine.gameManager.SessionManager;
|
||||||
|
import engine.net.Dispatch;
|
||||||
|
import engine.net.DispatchMessage;
|
||||||
|
import engine.net.client.ClientConnection;
|
||||||
|
import engine.net.client.msg.ClientNetMsg;
|
||||||
|
import engine.net.client.msg.GuildTreeStatusMsg;
|
||||||
|
import engine.objects.Building;
|
||||||
|
import engine.objects.PlayerCharacter;
|
||||||
|
|
||||||
|
public class GuildTreeStatusMsgHandler extends AbstractClientMsgHandler {
|
||||||
|
|
||||||
|
public GuildTreeStatusMsgHandler() {
|
||||||
|
super(GuildTreeStatusMsg.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
|
||||||
|
|
||||||
|
GuildTreeStatusMsg msg = (GuildTreeStatusMsg) baseMsg;
|
||||||
|
|
||||||
|
PlayerCharacter player = SessionManager.getPlayerCharacter(origin);
|
||||||
|
|
||||||
|
Dispatch dispatch;
|
||||||
|
|
||||||
|
if (player == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (origin.guildtreespam > System.currentTimeMillis())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
origin.guildtreespam = System.currentTimeMillis() + 5000;
|
||||||
|
|
||||||
|
Building building = BuildingManager.getBuildingFromCache(msg.getTargetID());
|
||||||
|
|
||||||
|
if (building == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
GuildTreeStatusMsg guildTreeStatusMsg = new GuildTreeStatusMsg(building, player);
|
||||||
|
guildTreeStatusMsg.configure();
|
||||||
|
|
||||||
|
dispatch = Dispatch.borrow(player, guildTreeStatusMsg);
|
||||||
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user