Addition of RequestPledgeSignInForOpenJoiningMethod.
This commit is contained in:
parent
98a3e5e187
commit
4812c878dc
@ -35,6 +35,7 @@ import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
|
||||
import com.l2jmobius.gameserver.enums.UserInfoType;
|
||||
import com.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import com.l2jmobius.gameserver.instancemanager.ClanEntryManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortSiegeManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||
@ -217,6 +218,9 @@ public class ClanTable
|
||||
}
|
||||
|
||||
clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_HAS_DISPERSED));
|
||||
|
||||
ClanEntryManager.getInstance().removeFromClanList(clan.getId());
|
||||
|
||||
final int castleId = clan.getCastleId();
|
||||
if (castleId == 0)
|
||||
{
|
||||
|
@ -356,7 +356,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
||||
EX_REQUEST_VIP_INFO(0x10E, null, ConnectionState.IN_GAME),
|
||||
REQUEST_CAPTCHA_ANSWER(0x10F, null, ConnectionState.IN_GAME),
|
||||
REQUEST_REFRESH_CAPTCHA_IMAGE(0x110, null, ConnectionState.IN_GAME),
|
||||
REQUEST_PLEDGE_SIGN_IN_FOR_OPEN_JOINING_METHOD(0x111, null, ConnectionState.IN_GAME),
|
||||
REQUEST_PLEDGE_SIGN_IN_FOR_OPEN_JOINING_METHOD(0x111, RequestPledgeSignInForOpenJoiningMethod::new, ConnectionState.IN_GAME),
|
||||
EX_REQUEST_MATCH_ARENA(0x112, null, ConnectionState.IN_GAME),
|
||||
EX_CONFIRM_MATCH_ARENA(0x113, null, ConnectionState.IN_GAME),
|
||||
EX_CANCEL_MATCH_ARENA(0x114, null, ConnectionState.IN_GAME),
|
||||
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.instancemanager.ClanEntryManager;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.clan.entry.PledgeRecruitInfo;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.JoinPledge;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingPacket
|
||||
{
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
_clanId = packet.readD();
|
||||
packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
final L2PcInstance activeChar = client.getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final PledgeRecruitInfo pledgeRecruitInfo = ClanEntryManager.getInstance().getClanById(_clanId);
|
||||
if (pledgeRecruitInfo.getRecruitType() == 1)
|
||||
{
|
||||
pledgeRecruitInfo.getClan().addClanMember(activeChar);
|
||||
activeChar.sendPacket(new JoinPledge(_clanId));
|
||||
activeChar.sendPacket(new UserInfo(activeChar));
|
||||
activeChar.broadcastInfo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -35,6 +35,7 @@ import com.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClanHallData;
|
||||
import com.l2jmobius.gameserver.enums.UserInfoType;
|
||||
import com.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import com.l2jmobius.gameserver.instancemanager.ClanEntryManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.FortSiegeManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||
@ -217,6 +218,9 @@ public class ClanTable
|
||||
}
|
||||
|
||||
clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_HAS_DISPERSED));
|
||||
|
||||
ClanEntryManager.getInstance().removeFromClanList(clan.getId());
|
||||
|
||||
final int castleId = clan.getCastleId();
|
||||
if (castleId == 0)
|
||||
{
|
||||
|
@ -356,7 +356,7 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
|
||||
EX_REQUEST_VIP_INFO(0x10E, null, ConnectionState.IN_GAME),
|
||||
REQUEST_CAPTCHA_ANSWER(0x10F, null, ConnectionState.IN_GAME),
|
||||
REQUEST_REFRESH_CAPTCHA_IMAGE(0x110, null, ConnectionState.IN_GAME),
|
||||
REQUEST_PLEDGE_SIGN_IN_FOR_OPEN_JOINING_METHOD(0x111, null, ConnectionState.IN_GAME),
|
||||
REQUEST_PLEDGE_SIGN_IN_FOR_OPEN_JOINING_METHOD(0x111, RequestPledgeSignInForOpenJoiningMethod::new, ConnectionState.IN_GAME),
|
||||
EX_REQUEST_MATCH_ARENA(0x112, null, ConnectionState.IN_GAME),
|
||||
EX_CONFIRM_MATCH_ARENA(0x113, null, ConnectionState.IN_GAME),
|
||||
EX_CANCEL_MATCH_ARENA(0x114, null, ConnectionState.IN_GAME),
|
||||
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.instancemanager.ClanEntryManager;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.clan.entry.PledgeRecruitInfo;
|
||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.JoinPledge;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.UserInfo;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class RequestPledgeSignInForOpenJoiningMethod implements IClientIncomingPacket
|
||||
{
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
{
|
||||
_clanId = packet.readD();
|
||||
packet.readD();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(L2GameClient client)
|
||||
{
|
||||
final L2PcInstance activeChar = client.getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final PledgeRecruitInfo pledgeRecruitInfo = ClanEntryManager.getInstance().getClanById(_clanId);
|
||||
if (pledgeRecruitInfo.getRecruitType() == 1)
|
||||
{
|
||||
pledgeRecruitInfo.getClan().addClanMember(activeChar);
|
||||
activeChar.sendPacket(new JoinPledge(_clanId));
|
||||
activeChar.sendPacket(new UserInfo(activeChar));
|
||||
activeChar.broadcastInfo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user