Browse Source

Handler created for ArcOwnedMinesListHandler.

master
MagicBot 2 years ago
parent
commit
36cb532b20
  1. 19
      src/engine/net/client/ClientMessagePump.java
  2. 2
      src/engine/net/client/Protocol.java
  3. 2
      src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java
  4. 45
      src/engine/net/client/handlers/ArcOwnedMinesListHandler.java

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

@ -262,9 +262,6 @@ public class ClientMessagePump implements NetMsgHandler {
case VENDORDIALOG: case VENDORDIALOG:
VendorDialogMsg.replyDialog((VendorDialogMsg) msg, origin); VendorDialogMsg.replyDialog((VendorDialogMsg) msg, origin);
break; break;
case ARCOWNEDMINESLIST:
ListOwnedMines((ArcOwnedMinesListMsg) msg, origin);
break;
case ARCMINECHANGEPRODUCTION: case ARCMINECHANGEPRODUCTION:
changeMineProduction((ArcMineChangeProductionMsg) msg, origin); changeMineProduction((ArcMineChangeProductionMsg) msg, origin);
break; break;
@ -1423,22 +1420,6 @@ boolean updateCity = false;
} }
private static void ListOwnedMines(ArcOwnedMinesListMsg msg, ClientConnection origin) {
PlayerCharacter pc = SessionManager.getPlayerCharacter(origin);
if (pc == null)
return;
//TODO verify this against the warehouse?
if (GuildStatusController.isInnerCouncil(pc.getGuildStatus()) == false)// is this only GL?
return;
msg.setMineList(Mine.getMinesForGuild(pc.getGuild().getObjectUUID()));
Dispatch dispatch = Dispatch.borrow(pc, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
}
private static void changeMineProduction(ArcMineChangeProductionMsg msg, ClientConnection origin) { private static void changeMineProduction(ArcMineChangeProductionMsg msg, ClientConnection origin) {
PlayerCharacter sourcePlayer = SessionManager.getPlayerCharacter(origin); PlayerCharacter sourcePlayer = SessionManager.getPlayerCharacter(origin);

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

@ -37,7 +37,7 @@ public enum Protocol {
ARCMINETOWERCRESTUPDATE(0x34164D0D, null, null), ARCMINETOWERCRESTUPDATE(0x34164D0D, null, null),
ARCMINEWINDOWAVAILABLETIME(0x6C909DE7, ArcMineWindowAvailableTimeMsg.class, ArcMineWindowAvailableTimeHandler.class), ARCMINEWINDOWAVAILABLETIME(0x6C909DE7, ArcMineWindowAvailableTimeMsg.class, ArcMineWindowAvailableTimeHandler.class),
ARCMINEWINDOWCHANGE(0x92B2148A, ArcMineWindowChangeMsg.class, MineWindowChangeHandler.class), ARCMINEWINDOWCHANGE(0x92B2148A, ArcMineWindowChangeMsg.class, MineWindowChangeHandler.class),
ARCOWNEDMINESLIST(0x59184455, ArcOwnedMinesListMsg.class, null), ARCOWNEDMINESLIST(0x59184455, ArcOwnedMinesListMsg.class, ArcOwnedMinesListHandler.class),
ARCPETATTACK(0x18CD61AD, PetAttackMsg.class, null), // Pet Attack ARCPETATTACK(0x18CD61AD, PetAttackMsg.class, null), // Pet Attack
ARCPETCMD(0x4E80E001, PetCmdMsg.class, null), // Stop ArcPetAttack, Toggle Assist, Toggle Rest ARCPETCMD(0x4E80E001, PetCmdMsg.class, null), // Stop ArcPetAttack, Toggle Assist, Toggle Rest
ARCPOWERPROJECTILE(0xA2312D3B, null, null), ARCPOWERPROJECTILE(0xA2312D3B, null, null),

2
src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java

@ -24,7 +24,7 @@ import engine.objects.PlayerCharacter;
public class ArcMineWindowAvailableTimeHandler extends AbstractClientMsgHandler { public class ArcMineWindowAvailableTimeHandler extends AbstractClientMsgHandler {
public ArcMineWindowAvailableTimeHandler() { public ArcMineWindowAvailableTimeHandler() {
super(KeepAliveServerClientMsg.class); super(ArcMineWindowAvailableTimeMsg.class);
} }
@Override @Override

45
src/engine/net/client/handlers/ArcOwnedMinesListHandler.java

@ -0,0 +1,45 @@
package engine.net.client.handlers;
import engine.Enum.DispatchChannel;
import engine.exception.MsgSendException;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ArcOwnedMinesListMsg;
import engine.net.client.msg.ClientNetMsg;
import engine.objects.GuildStatusController;
import engine.objects.Mine;
import engine.objects.PlayerCharacter;
/*
* @Author:
* @Summary: Processes application protocol message which keeps
* client's tcp connection open.
*/
public class ArcOwnedMinesListHandler extends AbstractClientMsgHandler {
public ArcOwnedMinesListHandler() {
super(ArcOwnedMinesListMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
PlayerCharacter playerCharacter = origin.getPlayerCharacter();
ArcOwnedMinesListMsg msg = (ArcOwnedMinesListMsg) baseMsg;
if (playerCharacter == null)
return true;
if (GuildStatusController.isInnerCouncil(playerCharacter.getGuildStatus()) == false)// is this only GL?
return true;
msg.setMineList(Mine.getMinesForGuild(playerCharacter.getGuild().getObjectUUID()));
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true;
}
}
Loading…
Cancel
Save