forked from MagicBane/Server
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.2 KiB
58 lines
2.2 KiB
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . |
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· |
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ |
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ |
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ |
|
// Magicbane Emulator Project © 2013 - 2022 |
|
// www.magicbane.com |
|
|
|
package engine.net.client.handlers; |
|
|
|
import engine.gameManager.DispatchManager; |
|
import engine.mbEnums.DispatchChannel; |
|
import engine.net.client.ClientConnection; |
|
import engine.net.client.msg.ClientNetMsg; |
|
import engine.net.client.msg.ToggleLfgRecruitingMsg; |
|
import engine.net.client.msg.UpdateStateMsg; |
|
import engine.objects.PlayerCharacter; |
|
import engine.server.MBServerStatics; |
|
|
|
public class ToggleLfgRecruitingMsgHandler extends AbstractClientMsgHandler { |
|
|
|
public ToggleLfgRecruitingMsgHandler() { |
|
super(); |
|
} |
|
|
|
@Override |
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) { |
|
|
|
PlayerCharacter playerCharacter = origin.getPlayerCharacter(); |
|
|
|
// Member variable declaration |
|
|
|
ToggleLfgRecruitingMsg msg; |
|
|
|
// Member variable assignment |
|
|
|
msg = (ToggleLfgRecruitingMsg) baseMsg; |
|
|
|
if (playerCharacter == null) |
|
return true; |
|
|
|
int num = msg.toggleLfgRecruiting(); |
|
|
|
if (num == 1) |
|
playerCharacter.toggleLFGroup(); |
|
else if (num == 2) |
|
playerCharacter.toggleLFGuild(); |
|
else if (num == 3) |
|
playerCharacter.toggleRecruiting(); |
|
|
|
UpdateStateMsg rwss = new UpdateStateMsg(); |
|
rwss.setPlayer(playerCharacter); |
|
DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); |
|
|
|
return true; |
|
} |
|
|
|
} |