Fixed RequestClanAskJoinByName not working.
This commit is contained in:
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -71,15 +71,24 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge))
|
if (!((requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge) || (requestor.getRequest().getRequestPacket() instanceof RequestClanAskJoinByName)))
|
||||||
{
|
{
|
||||||
return; // hax
|
return; // hax
|
||||||
}
|
}
|
||||||
|
|
||||||
final RequestJoinPledge requestPacket = (RequestJoinPledge) requestor.getRequest().getRequestPacket();
|
final int pledgeType;
|
||||||
|
if (requestor.getRequest().getRequestPacket() instanceof RequestJoinPledge)
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestJoinPledge) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pledgeType = ((RequestClanAskJoinByName) requestor.getRequest().getRequestPacket()).getPledgeType();
|
||||||
|
}
|
||||||
|
|
||||||
final L2Clan clan = requestor.getClan();
|
final L2Clan clan = requestor.getClan();
|
||||||
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
// we must double check this cause during response time conditions can be changed, i.e. another player could join clan
|
||||||
if (clan.checkClanJoinCondition(requestor, activeChar, requestPacket.getPledgeType()))
|
if (clan.checkClanJoinCondition(requestor, activeChar, pledgeType))
|
||||||
{
|
{
|
||||||
if (activeChar.getClan() != null)
|
if (activeChar.getClan() != null)
|
||||||
{
|
{
|
||||||
@@ -88,8 +97,8 @@ public final class RequestAnswerJoinPledge implements IClientIncomingPacket
|
|||||||
|
|
||||||
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
activeChar.sendPacket(new JoinPledge(requestor.getClanId()));
|
||||||
|
|
||||||
activeChar.setPledgeType(requestPacket.getPledgeType());
|
activeChar.setPledgeType(pledgeType);
|
||||||
if (requestPacket.getPledgeType() == L2Clan.SUBUNIT_ACADEMY)
|
if (pledgeType == L2Clan.SUBUNIT_ACADEMY)
|
||||||
{
|
{
|
||||||
activeChar.setPowerGrade(9); // academy
|
activeChar.setPowerGrade(9); // academy
|
||||||
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
activeChar.setLvlJoinedAcademy(activeChar.getLevel());
|
||||||
|
@@ -59,4 +59,9 @@ public class RequestClanAskJoinByName implements IClientIncomingPacket
|
|||||||
|
|
||||||
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
invitedPlayer.sendPacket(new AskJoinPledge(activeChar, _pledgeType, activeChar.getClan().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPledgeType()
|
||||||
|
{
|
||||||
|
return _pledgeType;
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user