Browse Source

Class requirements refactored to enumset.

combat-2
MagicBot 9 months ago
parent
commit
b3b6a9a913
  1. 147
      src/engine/Enum.java
  2. 2
      src/engine/db/archive/GuildRecord.java
  3. 2
      src/engine/net/client/handlers/ChangeGuildLeaderHandler.java
  4. 2
      src/engine/net/client/handlers/ChangeRankHandler.java
  5. 4
      src/engine/net/client/handlers/GuildCreationFinalizeHandler.java
  6. 4
      src/engine/net/client/handlers/InviteToGuildHandler.java
  7. 2
      src/engine/net/client/msg/guild/GuildListMsg.java
  8. 6
      src/engine/objects/Guild.java

147
src/engine/Enum.java

@ -2318,8 +2318,10 @@ public class Enum {
} }
} }
public enum GuildType { public enum GuildCharterType {
NONE("None", new String[][]{{"None"}}, new String[]{"Thearchy", "Common Rule", "Theocracy", "Republic Rule"}), NONE("None", new String[][]{{"None"}}, new String[]{"Thearchy", "Common Rule", "Theocracy", "Republic Rule"},
EnumSet.noneOf(PromoteType.class)),
CATHEDRAL("Church of the All-Father", new String[][]{ CATHEDRAL("Church of the All-Father", new String[][]{
{"Acolyte", "Acolyte"}, {"Acolyte", "Acolyte"},
{"Catechist"}, {"Catechist"},
@ -2329,7 +2331,9 @@ public class Enum {
{"Bishop", "Bishop"}, {"Bishop", "Bishop"},
{"Lord Cardinal", "Lady Cardinal"}, {"Lord Cardinal", "Lady Cardinal"},
{"Patriarch", "Matriarch"}}, {"Patriarch", "Matriarch"}},
new String[]{"Thearchy", "Common Rule", "Theocracy", "Republic Rule"}), new String[]{"Thearchy", "Common Rule", "Theocracy", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
MILITARY("Military", new String[][]{ MILITARY("Military", new String[][]{
{"Recruit"}, {"Recruit"},
{"Footman"}, {"Footman"},
@ -2339,7 +2343,9 @@ public class Enum {
{"Captain"}, {"Captain"},
{"General"}, {"General"},
{"Lord Marshall", "Lady Marshall"}}, {"Lord Marshall", "Lady Marshall"}},
new String[]{"Autocracy", "Common Rule", "Council Rule", "Militocracy"}), new String[]{"Autocracy", "Common Rule", "Council Rule", "Militocracy"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
TEMPLE("Temple of the Cleansing Flame", new String[][]{ TEMPLE("Temple of the Cleansing Flame", new String[][]{
{"Aspirant"}, {"Aspirant"},
{"Novice"}, {"Novice"},
@ -2350,7 +2356,9 @@ public class Enum {
{"Lictor"}, {"Lictor"},
{"Justiciar"}, {"Justiciar"},
{"Pontifex", "Pontifectrix"}}, {"Pontifex", "Pontifectrix"}},
new String[]{"Despot Rule", "Common Rule", "Protectorship", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Protectorship", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
BARBARIAN("Barbarian Clan", new String[][]{ BARBARIAN("Barbarian Clan", new String[][]{
{"Barbarian"}, {"Barbarian"},
{"Skald"}, {"Skald"},
@ -2359,7 +2367,9 @@ public class Enum {
{"Jarl"}, {"Jarl"},
{"Chieftain"}, {"Chieftain"},
{"Thane"}}, {"Thane"}},
new String[]{"Chiefdom", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Chiefdom", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
RANGER("Ranger's Brotherhood", new String[][]{ RANGER("Ranger's Brotherhood", new String[][]{
{"Yeoman"}, {"Yeoman"},
{"Pathfinder"}, {"Pathfinder"},
@ -2368,7 +2378,9 @@ public class Enum {
{"Protector"}, {"Protector"},
{"Guardian"}, {"Guardian"},
{"Lord Protector", "Lady Protector"}}, {"Lord Protector", "Lady Protector"}},
new String[]{"Despot Rule", "Collectivism", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Collectivism", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
AMAZON("Amazon Temple", new String[][]{ AMAZON("Amazon Temple", new String[][]{
{"Amazon Thrall", "Amazon"}, {"Amazon Thrall", "Amazon"},
{"Amazon Slave", "Amazon Warrior"}, {"Amazon Slave", "Amazon Warrior"},
@ -2376,7 +2388,9 @@ public class Enum {
{"Amazon Consort", "Amazon Princess"}, {"Amazon Consort", "Amazon Princess"},
{"Amazon Seneschal", "Majestrix"}, {"Amazon Seneschal", "Majestrix"},
{"Amazon Regent", "Imperatrix"}}, {"Amazon Regent", "Imperatrix"}},
new String[]{"Despot Rule", "Common Rule", "Gynarchy", "Gynocracy"}), new String[]{"Despot Rule", "Common Rule", "Gynarchy", "Gynocracy"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
NOBLE("Noble House", new String[][]{ NOBLE("Noble House", new String[][]{
{"Serf"}, {"Serf"},
{"Vassal"}, {"Vassal"},
@ -2387,7 +2401,9 @@ public class Enum {
{"Duke", "Duchess"}, {"Duke", "Duchess"},
{"King", "Queen"}, {"King", "Queen"},
{"Emperor", "Empress"}}, {"Emperor", "Empress"}},
new String[]{"Monarchy", "Common Rule", "Feodality", "Republic"}), new String[]{"Monarchy", "Common Rule", "Feodality", "Republic"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
WIZARD("Wizard's Conclave", new String[][]{ WIZARD("Wizard's Conclave", new String[][]{
{"Apprentice"}, {"Apprentice"},
{"Neophyte"}, {"Neophyte"},
@ -2396,7 +2412,9 @@ public class Enum {
{"Magus"}, {"Magus"},
{"High Magus"}, {"High Magus"},
{"Archmagus"}}, {"Archmagus"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Magocracy"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Magocracy"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
MERCENARY("Mercenary Company", new String[][]{ MERCENARY("Mercenary Company", new String[][]{
{"Soldier"}, {"Soldier"},
{"Man-at-Arms"}, {"Man-at-Arms"},
@ -2406,7 +2424,9 @@ public class Enum {
{"Commander"}, {"Commander"},
{"High Commander"}, {"High Commander"},
{"Warlord"}}, {"Warlord"}},
new String[]{"Magistrature", "Mob Law", "Council Rule", "Republic Rule"}), new String[]{"Magistrature", "Mob Law", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
THIEVES("Thieve's Den", new String[][]{ THIEVES("Thieve's Den", new String[][]{
{"Urchin"}, {"Urchin"},
{"Footpad"}, {"Footpad"},
@ -2417,7 +2437,9 @@ public class Enum {
{"Treasurer"}, {"Treasurer"},
{"Grandmaster Thief"}, {"Grandmaster Thief"},
{"Grandfather"}}, {"Grandfather"}},
new String[]{"Despot Rule", "Common Rule", "Oligarchy", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Oligarchy", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
DWARF("Dwarf Hold", new String[][]{ DWARF("Dwarf Hold", new String[][]{
{"Citizen"}, {"Citizen"},
{"Master"}, {"Master"},
@ -2425,7 +2447,9 @@ public class Enum {
{"Thane"}, {"Thane"},
{"Great Thane"}, {"Great Thane"},
{"High Thane"}}, {"High Thane"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
HIGHCOURT("High Court", new String[][]{ HIGHCOURT("High Court", new String[][]{
{"Eccekebe"}, {"Eccekebe"},
{"Saedulor"}, {"Saedulor"},
@ -2436,7 +2460,9 @@ public class Enum {
{"Dar Thaelostor", "Dar Thaelostril"}, {"Dar Thaelostor", "Dar Thaelostril"},
{"Aglaeron"}, {"Aglaeron"},
{"Ellestor", "Elestril"}}, {"Ellestor", "Elestril"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
VIRAKT("Virakt", new String[][]{ VIRAKT("Virakt", new String[][]{
{"Jov'uus"}, {"Jov'uus"},
{"Urikhan"}, {"Urikhan"},
@ -2446,7 +2472,9 @@ public class Enum {
{"Khal'uvho"}, {"Khal'uvho"},
{"Khar'uus"}, {"Khar'uus"},
{"Kryqh'khalin"}}, {"Kryqh'khalin"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
BRIALIA("Coven of Brialia", new String[][]{ // Unknown Rank names BRIALIA("Coven of Brialia", new String[][]{ // Unknown Rank names
{"Devotee"}, {"Devotee"},
{"Initiated"}, {"Initiated"},
@ -2456,7 +2484,9 @@ public class Enum {
{"Elder"}, {"Elder"},
{"Hierophant"}, {"Hierophant"},
{"Witch King", "Witch Queen"}}, {"Witch King", "Witch Queen"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
UNHOLY("Unholy Legion", new String[][]{ // Unknown Rank names UNHOLY("Unholy Legion", new String[][]{ // Unknown Rank names
{"Footman"}, {"Footman"},
{"Fell Legionaire"}, {"Fell Legionaire"},
@ -2466,14 +2496,18 @@ public class Enum {
{"Dark Master", "Dark Mistress"}, {"Dark Master", "Dark Mistress"},
{"Dread Master", "Dread Mistress"}, {"Dread Master", "Dread Mistress"},
{"Dread Lord", "Dread Lady"}}, {"Dread Lord", "Dread Lady"}},
new String[]{"Despot Rule", "Despot Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Despot Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
SCOURGE("Cult of the Scourge", new String[][]{ SCOURGE("Cult of the Scourge", new String[][]{
{"Thrall"}, {"Thrall"},
{"Mudir"}, {"Mudir"},
{"Dark Brother", "Dark Sister"}, {"Dark Brother", "Dark Sister"},
{"Hand of the Dark"}, {"Hand of the Dark"},
{"Dark Father", "Dark Mother"}}, {"Dark Father", "Dark Mother"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
PIRATE("Pirate Crew", new String[][]{ PIRATE("Pirate Crew", new String[][]{
{"Midshipman", "Midshipwoman"}, {"Midshipman", "Midshipwoman"},
{"Sailor"}, {"Sailor"},
@ -2481,7 +2515,9 @@ public class Enum {
{"Second Mat"}, {"Second Mat"},
{"First Mate"}, {"First Mate"},
{"Captain"}}, {"Captain"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
HERALD("Academy of Heralds", new String[][]{ HERALD("Academy of Heralds", new String[][]{
{"Pupil"}, {"Pupil"},
{"Scribe"}, {"Scribe"},
@ -2491,7 +2527,9 @@ public class Enum {
{"Scholar"}, {"Scholar"},
{"Archivist"}, {"Archivist"},
{"Loremaster"}}, {"Loremaster"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
CENTAUR("Centaur Cohort", new String[][]{ CENTAUR("Centaur Cohort", new String[][]{
{"Hoplite"}, {"Hoplite"},
{"Peltast"}, {"Peltast"},
@ -2501,7 +2539,9 @@ public class Enum {
{"Septenrion"}, {"Septenrion"},
{"Praetorian"}, {"Praetorian"},
{"Paragon"}}, {"Paragon"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}), new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout)),
KHREE("Aracoix Kh'ree", new String[][]{ KHREE("Aracoix Kh'ree", new String[][]{
{"Duriacor"}, {"Duriacor"},
{"Exarch"}, {"Exarch"},
@ -2513,107 +2553,104 @@ public class Enum {
{"Erentar"}, {"Erentar"},
{"Araceos"}, {"Araceos"},
{"Hierarch"}}, {"Hierarch"}},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"},
new String[]{"Despot Rule", "Common Rule", "Council Rule", "Republic Rule"}); EnumSet.of(PromoteType.Bard, PromoteType.Channeler, PromoteType.Crusader, PromoteType.Nightstalker,
PromoteType.Prelate, PromoteType.Priest, PromoteType.Sentinel, PromoteType.Scout));
private final String name; private final String name;
private final String[][] ranks; //Stored Rank#->Gender(M,F) private final String[][] ranks; //Stored Rank#->Gender(M,F)
private final String[] leadershipTypes; private final String[] leadershipTypes;
public final ArrayList<PromoteType> requiredClasses; public final EnumSet<PromoteType> requiredClasses;
public final ArrayList<MonsterType> requiredRaces; public final ArrayList<MonsterType> requiredRaces;
public final SexType sexRequired; public final SexType sexRequired;
GuildType(String name, String[][] ranks, String[] leadershipTypes) { GuildCharterType(String name, String[][] ranks, String[] leadershipTypes, EnumSet<PromoteType> requiredClasses) {
this.name = name; this.name = name;
this.ranks = ranks; this.ranks = ranks;
this.leadershipTypes = leadershipTypes; this.leadershipTypes = leadershipTypes;
this.requiredClasses = DbManager.GuildQueries.LOAD_CHARTER_CLASS_RESTRICTIONS(this.name); this.requiredClasses = requiredClasses;
this.requiredRaces = DbManager.GuildQueries.LOAD_CHARTER_RACE_RESTRICTIONS(this.name); this.requiredRaces = DbManager.GuildQueries.LOAD_CHARTER_RACE_RESTRICTIONS(this.name);
this.sexRequired = DbManager.GuildQueries.LOAD_CHARTER_SEX_RESTRICTIONS(this.name); this.sexRequired = DbManager.GuildQueries.LOAD_CHARTER_SEX_RESTRICTIONS(this.name);
} }
public static GuildType getGuildTypeFromCharter(ItemBase itemBase) { public static GuildCharterType getGuildTypeFromCharter(ItemBase itemBase) {
GuildType charterType; GuildCharterType charterType;
// Must be a valid charter object // Must be a valid charter object
if (itemBase.getType().equals(ItemType.GUILDCHARTER) == false) if (itemBase.getType().equals(ItemType.GUILDCHARTER) == false)
return GuildType.NONE; //No guild Type return GuildCharterType.NONE; //No guild Type
// No switches on long in java. Cast to int
// when refactor to long uuid's. Loss won't matter
// with values this small.
switch (itemBase.getUUID()) { switch (itemBase.getUUID()) {
case 559: case 559:
charterType = GuildType.CATHEDRAL; charterType = GuildCharterType.CATHEDRAL;
break; break;
case 560: case 560:
charterType = GuildType.MILITARY; charterType = GuildCharterType.MILITARY;
break; break;
case 561: case 561:
charterType = GuildType.TEMPLE; charterType = GuildCharterType.TEMPLE;
break; break;
case 562: case 562:
charterType = GuildType.BARBARIAN; charterType = GuildCharterType.BARBARIAN;
break; break;
case 563: case 563:
charterType = GuildType.RANGER; charterType = GuildCharterType.RANGER;
break; break;
case 564: case 564:
charterType = GuildType.AMAZON; charterType = GuildCharterType.AMAZON;
break; break;
case 565: case 565:
charterType = GuildType.NOBLE; charterType = GuildCharterType.NOBLE;
break; break;
case 566: case 566:
charterType = GuildType.WIZARD; charterType = GuildCharterType.WIZARD;
break; break;
case 567: case 567:
charterType = GuildType.MERCENARY; charterType = GuildCharterType.MERCENARY;
break; break;
case 568: case 568:
charterType = GuildType.THIEVES; charterType = GuildCharterType.THIEVES;
break; break;
case 569: case 569:
charterType = GuildType.DWARF; charterType = GuildCharterType.DWARF;
break; break;
case 570: case 570:
charterType = GuildType.HIGHCOURT; charterType = GuildCharterType.HIGHCOURT;
break; break;
case 571: case 571:
charterType = GuildType.VIRAKT; charterType = GuildCharterType.VIRAKT;
break; break;
case 572: case 572:
charterType = GuildType.SCOURGE; charterType = GuildCharterType.SCOURGE;
break; break;
case 573: case 573:
charterType = GuildType.KHREE; charterType = GuildCharterType.KHREE;
break; break;
case 574: case 574:
charterType = GuildType.CENTAUR; charterType = GuildCharterType.CENTAUR;
break; break;
case 575: case 575:
charterType = GuildType.UNHOLY; charterType = GuildCharterType.UNHOLY;
break; break;
case 576: case 576:
charterType = GuildType.PIRATE; charterType = GuildCharterType.PIRATE;
break; break;
case 577: case 577:
charterType = GuildType.BRIALIA; charterType = GuildCharterType.BRIALIA;
break; break;
default: default:
charterType = GuildType.HERALD; charterType = GuildCharterType.HERALD;
} }
return charterType; return charterType;
} }
public static GuildType getGuildTypeFromInt(int i) { public static GuildCharterType getGuildTypeFromInt(int i) {
return GuildType.values()[i]; return GuildCharterType.values()[i];
} }
public String getCharterName() { public String getCharterName() {

2
src/engine/db/archive/GuildRecord.java

@ -89,7 +89,7 @@ public class GuildRecord extends DataRecord {
guildRecord.guildHash = guildRecord.guild.getHash(); guildRecord.guildHash = guildRecord.guild.getHash();
guildRecord.guildID = guildRecord.guild.getObjectUUID(); guildRecord.guildID = guildRecord.guild.getObjectUUID();
guildRecord.guildName = guildRecord.guild.getName(); guildRecord.guildName = guildRecord.guild.getName();
guildRecord.charterName = Enum.GuildType.getGuildTypeFromInt(guildRecord.guild.getCharter()).getCharterName(); guildRecord.charterName = Enum.GuildCharterType.getGuildTypeFromInt(guildRecord.guild.getCharter()).getCharterName();
guildRecord.GLHash = DataWarehouse.hasher.encrypt(guildRecord.guild.getGuildLeaderUUID()); guildRecord.GLHash = DataWarehouse.hasher.encrypt(guildRecord.guild.getGuildLeaderUUID());

2
src/engine/net/client/handlers/ChangeGuildLeaderHandler.java

@ -76,7 +76,7 @@ public class ChangeGuildLeaderHandler extends AbstractClientMsgHandler {
boolean isMale = true; boolean isMale = true;
boolean updateTarget; boolean updateTarget;
Enum.GuildType t = Enum.GuildType.getGuildTypeFromInt(sourcePlayer.getGuild().getCharter()); Enum.GuildCharterType t = Enum.GuildCharterType.getGuildTypeFromInt(sourcePlayer.getGuild().getCharter());
if (!DbManager.GuildQueries.SET_GUILD_LEADER(targetPlayer.getObjectUUID(), glGuild.getObjectUUID())) { if (!DbManager.GuildQueries.SET_GUILD_LEADER(targetPlayer.getObjectUUID(), glGuild.getObjectUUID())) {

2
src/engine/net/client/handlers/ChangeRankHandler.java

@ -60,7 +60,7 @@ public class ChangeRankHandler extends AbstractClientMsgHandler {
boolean isMale; boolean isMale;
if (msg.getPreviousRank() != msg.getNewRank()) { if (msg.getPreviousRank() != msg.getNewRank()) {
Enum.GuildType t = Enum.GuildType.getGuildTypeFromInt(sourcePlayer.getGuild().getCharter()); Enum.GuildCharterType t = Enum.GuildCharterType.getGuildTypeFromInt(sourcePlayer.getGuild().getCharter());
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.setGuildTitle(msg.getNewRank()); targetPlayer.setGuildTitle(msg.getNewRank());

4
src/engine/net/client/handlers/GuildCreationFinalizeHandler.java

@ -43,7 +43,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
PlayerCharacter player; PlayerCharacter player;
GuildCreationFinalizeMsg msg; GuildCreationFinalizeMsg msg;
Enum.GuildType charterType; Enum.GuildCharterType charterType;
Guild newGuild; Guild newGuild;
Guild playerGuild; Guild playerGuild;
ItemBase itemBase; ItemBase itemBase;
@ -78,7 +78,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
return true; return true;
} }
charterType = Enum.GuildType.getGuildTypeFromCharter(itemBase); charterType = Enum.GuildCharterType.getGuildTypeFromCharter(itemBase);
if (charterType == null) { if (charterType == null) {
ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND); ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND);

4
src/engine/net/client/handlers/InviteToGuildHandler.java

@ -84,9 +84,9 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler {
return true; return true;
} }
Enum.GuildType guildType = Enum.GuildType.values()[sourcePlayer.getGuild().getCharter()]; Enum.GuildCharterType guildCharterType = Enum.GuildCharterType.values()[sourcePlayer.getGuild().getCharter()];
if (guildType == null) { if (guildCharterType == null) {
ErrorPopupMsg.sendErrorPopup(sourcePlayer, GuildManager.NO_CHARTER_FOUND); ErrorPopupMsg.sendErrorPopup(sourcePlayer, GuildManager.NO_CHARTER_FOUND);
return true; return true;
} }

2
src/engine/net/client/msg/guild/GuildListMsg.java

@ -125,7 +125,7 @@ class GuildListMessageType1 extends GuildListMessageType {
@Override @Override
void _serialize(ByteBufferWriter writer) { void _serialize(ByteBufferWriter writer) {
Enum.GuildType gt = Enum.GuildType.getGuildTypeFromInt(g.getCharter()); Enum.GuildCharterType gt = Enum.GuildCharterType.getGuildTypeFromInt(g.getCharter());
writer.putInt(1); writer.putInt(1);
writer.putInt(gt.ordinal()); //Charter Type writer.putInt(gt.ordinal()); //Charter Type

6
src/engine/objects/Guild.java

@ -965,12 +965,12 @@ public class Guild extends AbstractWorldObject {
DataWarehouse.writeHash(Enum.DataRecordType.GUILD, this.getObjectUUID()); DataWarehouse.writeHash(Enum.DataRecordType.GUILD, this.getObjectUUID());
} }
public Enum.GuildType getGuildType() { public GuildCharterType getGuildType() {
try { try {
return Enum.GuildType.values()[this.charter]; return GuildCharterType.values()[this.charter];
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
return Enum.GuildType.NONE; return GuildCharterType.NONE;
} }
} }

Loading…
Cancel
Save