|
|
@ -189,22 +189,6 @@ public class Guild extends AbstractWorldObject { |
|
|
|
return a.getObjectUUID() == b.getObjectUUID(); |
|
|
|
return a.getObjectUUID() == b.getObjectUUID(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean sameGuildExcludeErrant(Guild a, Guild b) { |
|
|
|
|
|
|
|
if (a == null || b == null) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
if (a.isEmptyGuild() || b.isEmptyGuild()) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
return a.getObjectUUID() == b.getObjectUUID(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean sameGuildIncludeErrant(Guild a, Guild b) { |
|
|
|
|
|
|
|
if (a == null || b == null) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
if (a.isEmptyGuild() || b.isEmptyGuild()) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
return a.getObjectUUID() == b.getObjectUUID(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean sameNation(Guild a, Guild b) { |
|
|
|
public static boolean sameNation(Guild a, Guild b) { |
|
|
|
if (a == null || b == null) |
|
|
|
if (a == null || b == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -225,11 +209,6 @@ public class Guild extends AbstractWorldObject { |
|
|
|
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild(); |
|
|
|
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean isTaxCollector(int uuid) { |
|
|
|
|
|
|
|
//TODO add the handling for this later
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean canSwearIn(Guild toSub) { |
|
|
|
public static boolean canSwearIn(Guild toSub) { |
|
|
|
|
|
|
|
|
|
|
|
boolean canSwear = false; |
|
|
|
boolean canSwear = false; |
|
|
@ -393,7 +372,9 @@ public class Guild extends AbstractWorldObject { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static ArrayList<PlayerCharacter> GuildRoster(Guild guild) { |
|
|
|
public static ArrayList<PlayerCharacter> GuildRoster(Guild guild) { |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<PlayerCharacter> roster = new ArrayList<>(); |
|
|
|
ArrayList<PlayerCharacter> roster = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (guild == null) |
|
|
|
if (guild == null) |
|
|
|
return roster; |
|
|
|
return roster; |
|
|
|
|
|
|
|
|
|
|
@ -402,6 +383,7 @@ public class Guild extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
if (DbManager.getList(GameObjectType.PlayerCharacter) == null) |
|
|
|
if (DbManager.getList(GameObjectType.PlayerCharacter) == null) |
|
|
|
return roster; |
|
|
|
return roster; |
|
|
|
|
|
|
|
|
|
|
|
for (AbstractGameObject ago : DbManager.getList(GameObjectType.PlayerCharacter)) { |
|
|
|
for (AbstractGameObject ago : DbManager.getList(GameObjectType.PlayerCharacter)) { |
|
|
|
PlayerCharacter toAdd = (PlayerCharacter) ago; |
|
|
|
PlayerCharacter toAdd = (PlayerCharacter) ago; |
|
|
|
|
|
|
|
|
|
|
@ -462,14 +444,6 @@ public class Guild extends AbstractWorldObject { |
|
|
|
return banishList; |
|
|
|
return banishList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<PlayerCharacter> getCharacterKOSList() { |
|
|
|
|
|
|
|
return characterKOSList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<Guild> getGuildKOSList() { |
|
|
|
|
|
|
|
return guildKOSList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<Guild> getAllyList() { |
|
|
|
public ArrayList<Guild> getAllyList() { |
|
|
|
return allyList; |
|
|
|
return allyList; |
|
|
|
} |
|
|
|
} |
|
|
@ -560,9 +534,12 @@ public class Guild extends AbstractWorldObject { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean setGuildLeader(AbstractCharacter ac) { |
|
|
|
public boolean setGuildLeader(AbstractCharacter ac) { |
|
|
|
|
|
|
|
|
|
|
|
if (ac == null) |
|
|
|
if (ac == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// errant guilds cant be guild leader.
|
|
|
|
// errant guilds cant be guild leader.
|
|
|
|
|
|
|
|
|
|
|
|
if (this.isEmptyGuild()) |
|
|
|
if (this.isEmptyGuild()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
@ -575,6 +552,7 @@ public class Guild extends AbstractWorldObject { |
|
|
|
PlayerCharacter oldGuildLeader = PlayerCharacter.getFromCache(this.guildLeaderUUID); |
|
|
|
PlayerCharacter oldGuildLeader = PlayerCharacter.getFromCache(this.guildLeaderUUID); |
|
|
|
|
|
|
|
|
|
|
|
//old guildLeader no longer has guildLeadership stauts.
|
|
|
|
//old guildLeader no longer has guildLeadership stauts.
|
|
|
|
|
|
|
|
|
|
|
|
if (oldGuildLeader != null) |
|
|
|
if (oldGuildLeader != null) |
|
|
|
oldGuildLeader.setGuildLeader(false); |
|
|
|
oldGuildLeader.setGuildLeader(false); |
|
|
|
|
|
|
|
|
|
|
@ -586,9 +564,12 @@ public class Guild extends AbstractWorldObject { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean setGuildLeaderForCreate(AbstractCharacter ac) { |
|
|
|
public boolean setGuildLeaderForCreate(AbstractCharacter ac) { |
|
|
|
|
|
|
|
|
|
|
|
if (ac == null) |
|
|
|
if (ac == null) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
// errant guilds cant be guild leader.
|
|
|
|
// errant guilds cant be guild leader.
|
|
|
|
|
|
|
|
|
|
|
|
if (this.isEmptyGuild()) |
|
|
|
if (this.isEmptyGuild()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
@ -824,17 +805,6 @@ public class Guild extends AbstractWorldObject { |
|
|
|
Logger.error("Failed to find Object Type for owner " + this.guildLeaderUUID); |
|
|
|
Logger.error("Failed to find Object Type for owner " + this.guildLeaderUUID); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//LOad Owners in Cache so we do not have to continuely look in the db for owner.
|
|
|
|
|
|
|
|
if (this.ownerIsNPC) { |
|
|
|
|
|
|
|
if (NPC.getNPC(this.guildLeaderUUID) == null) |
|
|
|
|
|
|
|
Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load NPC Owner with ID " + this.guildLeaderUUID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.guildLeaderUUID != 0) { |
|
|
|
|
|
|
|
if (PlayerCharacter.getPlayerCharacter(this.guildLeaderUUID) == null) |
|
|
|
|
|
|
|
Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load Player Owner with ID " + this.guildLeaderUUID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If loading this guild for the first time write it's character record to disk
|
|
|
|
// If loading this guild for the first time write it's character record to disk
|
|
|
|
|
|
|
|
|
|
|
|
if (ConfigManager.serverType.equals(ServerType.WORLDSERVER) |
|
|
|
if (ConfigManager.serverType.equals(ServerType.WORLDSERVER) |
|
|
@ -859,7 +829,9 @@ public class Guild extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
if (this.nation == null) |
|
|
|
if (this.nation == null) |
|
|
|
this.nation = Guild.getErrantGuild(); |
|
|
|
this.nation = Guild.getErrantGuild(); |
|
|
|
|
|
|
|
|
|
|
|
//Get guild states.
|
|
|
|
//Get guild states.
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
this.subGuildList = DbManager.GuildQueries.GET_SUB_GUILDS(this.getObjectUUID()); |
|
|
|
this.subGuildList = DbManager.GuildQueries.GET_SUB_GUILDS(this.getObjectUUID()); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -882,7 +854,6 @@ public class Guild extends AbstractWorldObject { |
|
|
|
if (this.cityUUID == 0) |
|
|
|
if (this.cityUUID == 0) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate number of realms this guild controls
|
|
|
|
// Calculate number of realms this guild controls
|
|
|
|
// Only do this on the game server to avoid loading a TOL/City/Zone needlessly
|
|
|
|
// Only do this on the game server to avoid loading a TOL/City/Zone needlessly
|
|
|
|
|
|
|
|
|
|
|
@ -898,6 +869,7 @@ public class Guild extends AbstractWorldObject { |
|
|
|
|
|
|
|
|
|
|
|
//add alliance list, clear all lists as there seems to be a bug where alliances are doubled, need to find where.
|
|
|
|
//add alliance list, clear all lists as there seems to be a bug where alliances are doubled, need to find where.
|
|
|
|
//possible runAfterLoad being called twice?!?!
|
|
|
|
//possible runAfterLoad being called twice?!?!
|
|
|
|
|
|
|
|
|
|
|
|
this.banishList = dbGuildHandler.GET_GUILD_BANISHED(this.getObjectUUID()); |
|
|
|
this.banishList = dbGuildHandler.GET_GUILD_BANISHED(this.getObjectUUID()); |
|
|
|
this.characterKOSList = DbManager.GuildQueries.GET_GUILD_KOS_CHARACTER(this.getObjectUUID()); |
|
|
|
this.characterKOSList = DbManager.GuildQueries.GET_GUILD_KOS_CHARACTER(this.getObjectUUID()); |
|
|
|
this.guildKOSList = DbManager.GuildQueries.GET_GUILD_KOS_GUILD(this.getObjectUUID()); |
|
|
|
this.guildKOSList = DbManager.GuildQueries.GET_GUILD_KOS_GUILD(this.getObjectUUID()); |
|
|
|