|
|
@ -7,9 +7,6 @@ |
|
|
|
// www.magicbane.com
|
|
|
|
// www.magicbane.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
|
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
|
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
|
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
|
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
|
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
|
@ -43,7 +40,6 @@ import java.sql.SQLException; |
|
|
|
import java.sql.Timestamp; |
|
|
|
import java.sql.Timestamp; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
|
|
|
@ -77,14 +73,14 @@ public class Guild extends AbstractWorldObject { |
|
|
|
private ArrayList<Guild> subGuildList; |
|
|
|
private ArrayList<Guild> subGuildList; |
|
|
|
private int nationUUID = 0; |
|
|
|
private int nationUUID = 0; |
|
|
|
private GuildState guildState = GuildState.Errant; |
|
|
|
private GuildState guildState = GuildState.Errant; |
|
|
|
private ConcurrentHashMap<Integer,Condemned> guildCondemned = new ConcurrentHashMap<>(); |
|
|
|
private final ConcurrentHashMap<Integer, Condemned> guildCondemned = new ConcurrentHashMap<>(); |
|
|
|
private String hash; |
|
|
|
private String hash; |
|
|
|
private boolean ownerIsNPC; |
|
|
|
private boolean ownerIsNPC; |
|
|
|
|
|
|
|
|
|
|
|
private static Guild errantGuild; |
|
|
|
private static Guild errantGuild; |
|
|
|
private static Guild errantNation; |
|
|
|
private static Guild errantNation; |
|
|
|
|
|
|
|
|
|
|
|
public LocalDateTime lastWooEditTime; |
|
|
|
public boolean wooWasModified; |
|
|
|
public HashMap<Integer, GuildAlliances> guildAlliances = new HashMap<>(); |
|
|
|
public HashMap<Integer, GuildAlliances> guildAlliances = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -182,11 +178,7 @@ public class Guild extends AbstractWorldObject { |
|
|
|
this.teleportMax = rs.getInt("teleportMax"); |
|
|
|
this.teleportMax = rs.getInt("teleportMax"); |
|
|
|
|
|
|
|
|
|
|
|
this.mineTime = rs.getInt("mineTime"); |
|
|
|
this.mineTime = rs.getInt("mineTime"); |
|
|
|
|
|
|
|
this.wooWasModified = false; |
|
|
|
Timestamp lastWooRequest = rs.getTimestamp("lastWooEditTime"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (lastWooRequest != null) |
|
|
|
|
|
|
|
this.lastWooEditTime = lastWooRequest.toLocalDateTime(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.hash = rs.getString("hash"); |
|
|
|
this.hash = rs.getString("hash"); |
|
|
|
} |
|
|
|
} |
|
|
@ -411,9 +403,8 @@ public class Guild extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
public boolean isErrant() { |
|
|
|
public boolean isErrant() { |
|
|
|
return this.getObjectUUID() == Guild.errantGuild.getObjectUUID(); |
|
|
|
return this.getObjectUUID() == Guild.errantGuild.getObjectUUID(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean sameGuild(Guild a, Guild b) { |
|
|
|
public static boolean sameGuild(Guild a, Guild b) { |
|
|
|
if (a == null || b == null) |
|
|
|
if (a == null || b == null) |
|
|
@ -937,8 +928,7 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
|
|
|
|
|
|
|
|
if (subGuild.getOwnedCity() == null) { |
|
|
|
if (subGuild.getOwnedCity() == null) { |
|
|
|
subGuild.nation = null; |
|
|
|
subGuild.nation = null; |
|
|
|
} |
|
|
|
} else { |
|
|
|
else { |
|
|
|
|
|
|
|
subGuild.nation = subGuild; |
|
|
|
subGuild.nation = subGuild; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1034,10 +1024,6 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (allianceType) { |
|
|
|
switch (allianceType) { |
|
|
|
case RecommendedAlly: |
|
|
|
case RecommendedAlly: |
|
|
|
if (recommendList.size() == 10) { |
|
|
|
if (recommendList.size() == 10) { |
|
|
@ -1068,7 +1054,6 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
this.recommendList.add(toGuild); |
|
|
|
this.recommendList.add(toGuild); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
case RecommendedEnemy: |
|
|
|
case RecommendedEnemy: |
|
|
@ -1199,21 +1184,17 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean removeGuildFromAlliance(Guild toRemove) { |
|
|
|
public synchronized boolean removeGuildFromAlliance(Guild toRemove) { |
|
|
|
if (this.allyList.contains(toRemove)){ |
|
|
|
|
|
|
|
this.allyList.remove(toRemove); |
|
|
|
this.allyList.remove(toRemove); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean removeGuildFromEnemy(Guild toRemove) { |
|
|
|
public synchronized boolean removeGuildFromEnemy(Guild toRemove) { |
|
|
|
if (this.enemyList.contains(toRemove)){ |
|
|
|
|
|
|
|
this.enemyList.remove(toRemove); |
|
|
|
this.enemyList.remove(toRemove); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized boolean removeGuildFromRecommended(Guild toRemove) { |
|
|
|
public synchronized boolean removeGuildFromRecommended(Guild toRemove) { |
|
|
|
if (this.recommendList.contains(toRemove)){ |
|
|
|
|
|
|
|
this.recommendList.remove(toRemove); |
|
|
|
this.recommendList.remove(toRemove); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1227,7 +1208,6 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.guildAlliances.remove(toRemove.getObjectUUID()); |
|
|
|
this.guildAlliances.remove(toRemove.getObjectUUID()); |
|
|
|
|
|
|
|
|
|
|
|
this.removeGuildFromAlliance(toRemove); |
|
|
|
this.removeGuildFromAlliance(toRemove); |
|
|
@ -1245,7 +1225,6 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(toUpdate); |
|
|
|
UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(toUpdate); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) { |
|
|
|
for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) { |
|
|
|
|
|
|
|
|
|
|
|
if (Guild.sameGuild(player.getGuild(), toUpdate)) { |
|
|
|
if (Guild.sameGuild(player.getGuild(), toUpdate)) { |
|
|
@ -1295,5 +1274,4 @@ Guild.serializeForClientMsg(guild,writer, null, false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|