Fixed player join clan with penalty from clan entry application.
Contributed by Enryu.
This commit is contained in:
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_WILL_BE_ABLE_TO_JOIN_YOUR_CLAN_IN_24_H_AFTER_LEAVING_THE_PREVIOUS_ONE);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_WILL_BE_ABLE_TO_JOIN_YOUR_CLAN_IN_24_H_AFTER_LEAVING_THE_PREVIOUS_ONE);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_THE_CLAN_BECAUSE_ONE_DAY_HAS_NOT_YET_PASSED_SINCE_THEY_LEFT_ANOTHER_CLAN);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -106,12 +114,19 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
target.setClanJoinExpiryTime(0);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_WILL_BE_ABLE_TO_JOIN_YOUR_CLAN_IN_24_H_AFTER_LEAVING_THE_PREVIOUS_ONE);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -104,15 +112,22 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
// This activates the clan tab on the new member.
|
||||
PledgeShowMemberListAll.sendAllTo(target);
|
||||
target.setClanJoinExpiryTime(0);
|
||||
player.setClanJoinTime(System.currentTimeMillis());
|
||||
player.setClanJoinTime(currentTime);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_WILL_BE_ABLE_TO_JOIN_YOUR_CLAN_IN_24_H_AFTER_LEAVING_THE_PREVIOUS_ONE);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -104,15 +112,22 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
// This activates the clan tab on the new member.
|
||||
PledgeShowMemberListAll.sendAllTo(target);
|
||||
target.setClanJoinExpiryTime(0);
|
||||
player.setClanJoinTime(System.currentTimeMillis());
|
||||
player.setClanJoinTime(currentTime);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_WILL_BE_ABLE_TO_JOIN_YOUR_CLAN_IN_24_H_AFTER_LEAVING_THE_PREVIOUS_ONE);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,14 +41,13 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
{
|
||||
private boolean _acceptRequest;
|
||||
private int _playerId;
|
||||
private int _clanId;
|
||||
|
||||
@Override
|
||||
public boolean read(GameClient client, PacketReader packet)
|
||||
{
|
||||
_acceptRequest = packet.readD() == 1;
|
||||
_playerId = packet.readD();
|
||||
_clanId = packet.readD();
|
||||
packet.readD(); // Clan Id.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,16 +55,25 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
public void run(GameClient client)
|
||||
{
|
||||
final Player player = client.getPlayer();
|
||||
if ((player == null) || (player.getClan() == null))
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
if (clan == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int clanId = clan.getId();
|
||||
if (_acceptRequest)
|
||||
{
|
||||
final Player target = World.getInstance().getPlayer(_playerId);
|
||||
final Clan clan = player.getClan();
|
||||
if ((target != null) && (target.getClan() == null) && (clan != null))
|
||||
if (target != null)
|
||||
{
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
if ((target.getClan() == null) && (target.getClanJoinExpiryTime() < currentTime))
|
||||
{
|
||||
target.sendPacket(new JoinPledge(clan.getId()));
|
||||
|
||||
@@ -104,15 +112,22 @@ public class RequestPledgeWaitingUserAccept implements IClientIncomingPacket
|
||||
// This activates the clan tab on the new member.
|
||||
PledgeShowMemberListAll.sendAllTo(target);
|
||||
target.setClanJoinExpiryTime(0);
|
||||
player.setClanJoinTime(System.currentTimeMillis());
|
||||
player.setClanJoinTime(currentTime);
|
||||
target.broadcastUserInfo();
|
||||
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
else if (target.getClanJoinExpiryTime() > currentTime)
|
||||
{
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_WILL_BE_ABLE_TO_JOIN_YOUR_CLAN_IN_24_H_AFTER_LEAVING_THE_PREVIOUS_ONE);
|
||||
sm.addString(target.getName());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClanEntryManager.getInstance().removePlayerApplication(_clanId, _playerId);
|
||||
ClanEntryManager.getInstance().removePlayerApplication(clanId, _playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user