Files
BattleBane/src/engine/net/client/handlers/RequestGuildListHandler.java
T

55 lines
2.1 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.handlers;
import engine.exception.MsgSendException;
2024-05-12 13:36:47 -04:00
import engine.gameManager.DispatchManager;
2022-04-30 09:41:17 -04:00
import engine.gameManager.SessionManager;
2024-05-12 11:55:12 -04:00
import engine.mbEnums;
2022-04-30 09:41:17 -04:00
import engine.net.Dispatch;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.guild.SendGuildEntryMsg;
import engine.objects.GuildStatusController;
import engine.objects.PlayerCharacter;
public class RequestGuildListHandler extends AbstractClientMsgHandler {
2023-07-15 09:23:48 -04:00
public RequestGuildListHandler() {
2024-05-12 11:55:12 -04:00
super();
2023-07-15 09:23:48 -04:00
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) throws MsgSendException {
2022-04-30 09:41:17 -04:00
Dispatch dispatch;
2023-07-15 09:23:48 -04:00
// get PlayerCharacter of person accepting invite
PlayerCharacter pc = SessionManager.getPlayerCharacter(
origin);
if (pc == null)
return true;
if (GuildStatusController.isGuildLeader(pc.getGuildStatus()) == false) {
ErrorPopupMsg.sendErrorMsg(pc, "You do not have such authority!");
}
SendGuildEntryMsg msg = new SendGuildEntryMsg(pc);
2022-04-30 09:41:17 -04:00
dispatch = Dispatch.borrow(pc, msg);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
return true;
}
2022-04-30 09:41:17 -04:00
}