From f85299668bb19ef16778a5677dbf607fdbe35500 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 30 Sep 2017 14:09:55 +0000 Subject: [PATCH] Addition of RequestClanAskJoinByName. --- .../gameserver/network/ExIncomingPackets.java | 2 +- .../RequestClanAskJoinByName.java | 62 +++++++++++++++++++ .../gameserver/network/ExIncomingPackets.java | 2 +- .../RequestClanAskJoinByName.java | 62 +++++++++++++++++++ .../gameserver/network/ExIncomingPackets.java | 2 +- .../RequestClanAskJoinByName.java | 62 +++++++++++++++++++ .../gameserver/network/ExIncomingPackets.java | 2 +- .../RequestClanAskJoinByName.java | 62 +++++++++++++++++++ 8 files changed, 252 insertions(+), 4 deletions(-) create mode 100644 L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java create mode 100644 L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java index d9472c226c..1d55d89ef1 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -268,7 +268,7 @@ public enum ExIncomingPackets implements IIncomingPackets REQUEST_MENTOR_LIST(0xB6, RequestMentorList::new, ConnectionState.IN_GAME), REQUEST_MENTEE_ADD(0xB7, RequestMenteeAdd::new, ConnectionState.IN_GAME), REQUEST_MENTEE_WAITING_LIST(0xB8, RequestMenteeWaitingList::new, ConnectionState.IN_GAME), - REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, null, ConnectionState.IN_GAME), + REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, RequestClanAskJoinByName::new, ConnectionState.IN_GAME), REQUEST_IN_ZONE_WAITING_TIME(0xBA, RequestInzoneWaitingTime::new, ConnectionState.IN_GAME), REQUEST_JOIN_CURIOUS_HOUSE(0xBB, RequestJoinCuriousHouse::new, ConnectionState.IN_GAME), REQUEST_CANCEL_CURIOUS_HOUSE(0xBC, RequestCancelCuriousHouse::new, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java new file mode 100644 index 0000000000..859e3b1947 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java @@ -0,0 +1,62 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.clientpackets; + +import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.L2GameClient; +import com.l2jmobius.gameserver.network.serverpackets.AskJoinPledge; + +/** + * @author Mobius + */ +public class RequestClanAskJoinByName implements IClientIncomingPacket +{ + private String _playerName; + private int _pledgeType; + + @Override + public boolean read(L2GameClient client, PacketReader packet) + { + _playerName = packet.readS(); + _pledgeType = packet.readD(); + return true; + } + + @Override + public void run(L2GameClient client) + { + final L2PcInstance activeChar = client.getActiveChar(); + if ((activeChar == null) || (activeChar.getClan() == null)) + { + return; + } + + final L2PcInstance invitedPlayer = L2World.getInstance().getPlayer(_playerName); + if (!activeChar.getClan().checkClanJoinCondition(activeChar, invitedPlayer, _pledgeType)) + { + return; + } + if (!activeChar.getRequest().setRequest(invitedPlayer, this)) + { + return; + } + + invitedPlayer.sendPacket(new AskJoinPledge(activeChar.getObjectId(), activeChar.getClan().getSubPledge(_pledgeType) != null ? activeChar.getClan().getSubPledge(_pledgeType).getName() : null, _pledgeType, activeChar.getClan().getName())); + } +} \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java index 6f4e937025..ad049074d6 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -274,7 +274,7 @@ public enum ExIncomingPackets implements IIncomingPackets REQUEST_MENTOR_LIST(0xB6, RequestMentorList::new, ConnectionState.IN_GAME), REQUEST_MENTEE_ADD(0xB7, RequestMenteeAdd::new, ConnectionState.IN_GAME), REQUEST_MENTEE_WAITING_LIST(0xB8, RequestMenteeWaitingList::new, ConnectionState.IN_GAME), - REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, null, ConnectionState.IN_GAME), + REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, RequestClanAskJoinByName::new, ConnectionState.IN_GAME), REQUEST_IN_ZONE_WAITING_TIME(0xBA, RequestInzoneWaitingTime::new, ConnectionState.IN_GAME), REQUEST_JOIN_CURIOUS_HOUSE(0xBB, RequestJoinCuriousHouse::new, ConnectionState.IN_GAME), REQUEST_CANCEL_CURIOUS_HOUSE(0xBC, RequestCancelCuriousHouse::new, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java new file mode 100644 index 0000000000..859e3b1947 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java @@ -0,0 +1,62 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.clientpackets; + +import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.L2GameClient; +import com.l2jmobius.gameserver.network.serverpackets.AskJoinPledge; + +/** + * @author Mobius + */ +public class RequestClanAskJoinByName implements IClientIncomingPacket +{ + private String _playerName; + private int _pledgeType; + + @Override + public boolean read(L2GameClient client, PacketReader packet) + { + _playerName = packet.readS(); + _pledgeType = packet.readD(); + return true; + } + + @Override + public void run(L2GameClient client) + { + final L2PcInstance activeChar = client.getActiveChar(); + if ((activeChar == null) || (activeChar.getClan() == null)) + { + return; + } + + final L2PcInstance invitedPlayer = L2World.getInstance().getPlayer(_playerName); + if (!activeChar.getClan().checkClanJoinCondition(activeChar, invitedPlayer, _pledgeType)) + { + return; + } + if (!activeChar.getRequest().setRequest(invitedPlayer, this)) + { + return; + } + + invitedPlayer.sendPacket(new AskJoinPledge(activeChar.getObjectId(), activeChar.getClan().getSubPledge(_pledgeType) != null ? activeChar.getClan().getSubPledge(_pledgeType).getName() : null, _pledgeType, activeChar.getClan().getName())); + } +} \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java index d2f29fc0af..5222c231a7 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -275,7 +275,7 @@ public enum ExIncomingPackets implements IIncomingPackets REQUEST_MENTOR_LIST(0xB6, RequestMentorList::new, ConnectionState.IN_GAME), REQUEST_MENTEE_ADD(0xB7, RequestMenteeAdd::new, ConnectionState.IN_GAME), REQUEST_MENTEE_WAITING_LIST(0xB8, RequestMenteeWaitingList::new, ConnectionState.IN_GAME), - REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, null, ConnectionState.IN_GAME), + REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, RequestClanAskJoinByName::new, ConnectionState.IN_GAME), REQUEST_IN_ZONE_WAITING_TIME(0xBA, RequestInzoneWaitingTime::new, ConnectionState.IN_GAME), REQUEST_JOIN_CURIOUS_HOUSE(0xBB, RequestJoinCuriousHouse::new, ConnectionState.IN_GAME), REQUEST_CANCEL_CURIOUS_HOUSE(0xBC, RequestCancelCuriousHouse::new, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java new file mode 100644 index 0000000000..859e3b1947 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java @@ -0,0 +1,62 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.clientpackets; + +import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.L2GameClient; +import com.l2jmobius.gameserver.network.serverpackets.AskJoinPledge; + +/** + * @author Mobius + */ +public class RequestClanAskJoinByName implements IClientIncomingPacket +{ + private String _playerName; + private int _pledgeType; + + @Override + public boolean read(L2GameClient client, PacketReader packet) + { + _playerName = packet.readS(); + _pledgeType = packet.readD(); + return true; + } + + @Override + public void run(L2GameClient client) + { + final L2PcInstance activeChar = client.getActiveChar(); + if ((activeChar == null) || (activeChar.getClan() == null)) + { + return; + } + + final L2PcInstance invitedPlayer = L2World.getInstance().getPlayer(_playerName); + if (!activeChar.getClan().checkClanJoinCondition(activeChar, invitedPlayer, _pledgeType)) + { + return; + } + if (!activeChar.getRequest().setRequest(invitedPlayer, this)) + { + return; + } + + invitedPlayer.sendPacket(new AskJoinPledge(activeChar.getObjectId(), activeChar.getClan().getSubPledge(_pledgeType) != null ? activeChar.getClan().getSubPledge(_pledgeType).getName() : null, _pledgeType, activeChar.getClan().getName())); + } +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java index c00a32ad43..9c44987c48 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -275,7 +275,7 @@ public enum ExIncomingPackets implements IIncomingPackets REQUEST_MENTOR_LIST(0xB6, RequestMentorList::new, ConnectionState.IN_GAME), REQUEST_MENTEE_ADD(0xB7, RequestMenteeAdd::new, ConnectionState.IN_GAME), REQUEST_MENTEE_WAITING_LIST(0xB8, RequestMenteeWaitingList::new, ConnectionState.IN_GAME), - REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, null, ConnectionState.IN_GAME), + REQUEST_CLAN_ASK_JOIN_BY_NAME(0xB9, RequestClanAskJoinByName::new, ConnectionState.IN_GAME), REQUEST_IN_ZONE_WAITING_TIME(0xBA, RequestInzoneWaitingTime::new, ConnectionState.IN_GAME), REQUEST_JOIN_CURIOUS_HOUSE(0xBB, RequestJoinCuriousHouse::new, ConnectionState.IN_GAME), REQUEST_CANCEL_CURIOUS_HOUSE(0xBC, RequestCancelCuriousHouse::new, ConnectionState.IN_GAME), diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java new file mode 100644 index 0000000000..859e3b1947 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestClanAskJoinByName.java @@ -0,0 +1,62 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.clientpackets; + +import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.model.L2World; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.network.L2GameClient; +import com.l2jmobius.gameserver.network.serverpackets.AskJoinPledge; + +/** + * @author Mobius + */ +public class RequestClanAskJoinByName implements IClientIncomingPacket +{ + private String _playerName; + private int _pledgeType; + + @Override + public boolean read(L2GameClient client, PacketReader packet) + { + _playerName = packet.readS(); + _pledgeType = packet.readD(); + return true; + } + + @Override + public void run(L2GameClient client) + { + final L2PcInstance activeChar = client.getActiveChar(); + if ((activeChar == null) || (activeChar.getClan() == null)) + { + return; + } + + final L2PcInstance invitedPlayer = L2World.getInstance().getPlayer(_playerName); + if (!activeChar.getClan().checkClanJoinCondition(activeChar, invitedPlayer, _pledgeType)) + { + return; + } + if (!activeChar.getRequest().setRequest(invitedPlayer, this)) + { + return; + } + + invitedPlayer.sendPacket(new AskJoinPledge(activeChar.getObjectId(), activeChar.getClan().getSubPledge(_pledgeType) != null ? activeChar.getClan().getSubPledge(_pledgeType).getName() : null, _pledgeType, activeChar.getClan().getName())); + } +} \ No newline at end of file