Rename and clean up MapleGuildSummary

This commit is contained in:
P0nk
2021-09-09 21:35:58 +02:00
parent f8b5f713f3
commit 82c2d14430
4 changed files with 19 additions and 19 deletions

View File

@@ -333,7 +333,7 @@ public class Guild {
if (bcop == BCOp.DISBAND) {
Server.getInstance().getWorld(world).setGuildAndRank(notifications.get(b), 0, 5, exceptionId);
} else if (bcop == BCOp.EMBLEMCHANGE) {
Server.getInstance().getWorld(world).changeEmblem(this.id, notifications.get(b), new MapleGuildSummary(this));
Server.getInstance().getWorld(world).changeEmblem(this.id, notifications.get(b), new GuildSummary(this));
} else {
Server.getInstance().getWorld(world).sendPacket(notifications.get(b), packet, exceptionId);
}

View File

@@ -21,15 +21,15 @@
*/
package net.server.guild;
public class MapleGuildSummary {
private String name;
private short logoBG;
private byte logoBGColor;
private short logo;
private byte logoColor;
private int allianceId;
public class GuildSummary {
private final String name;
private final short logoBG;
private final byte logoBGColor;
private final short logo;
private final byte logoColor;
private final int allianceId;
public MapleGuildSummary(Guild g) {
public GuildSummary(Guild g) {
this.name = g.getName();
this.logoBG = (short) g.getLogoBG();
this.logoBGColor = (byte) g.getLogoBGColor();

View File

@@ -47,7 +47,7 @@ import net.server.coordinator.world.InviteCoordinator.InviteType;
import net.server.guild.Guild;
import net.server.guild.GuildCharacter;
import net.server.guild.GuildPackets;
import net.server.guild.MapleGuildSummary;
import net.server.guild.GuildSummary;
import net.server.services.BaseService;
import net.server.services.ServicesManager;
import net.server.services.type.WorldServices;
@@ -85,7 +85,7 @@ public class World {
private Map<Integer, Family> families = new LinkedHashMap<>();
private Map<Integer, Integer> relationships = new HashMap<>();
private Map<Integer, Pair<Integer, Integer>> relationshipCouples = new HashMap<>();
private Map<Integer, MapleGuildSummary> gsStore = new HashMap<>();
private Map<Integer, GuildSummary> gsStore = new HashMap<>();
private PlayerStorage players = new PlayerStorage();
private ServicesManager services = new ServicesManager(WorldServices.SAVE_CHARACTER);
private MatchCheckerCoordinator matchChecker = new MatchCheckerCoordinator();
@@ -582,7 +582,7 @@ public class World {
int gid = mgc.getGuildId();
Guild g = Server.getInstance().getGuild(gid, mgc.getWorld(), mgc.getCharacter());
if (gsStore.get(gid) == null) {
gsStore.put(gid, new MapleGuildSummary(g));
gsStore.put(gid, new GuildSummary(g));
}
return g;
}
@@ -607,19 +607,19 @@ public class World {
return status;
}
public MapleGuildSummary getGuildSummary(int gid, int wid) {
public GuildSummary getGuildSummary(int gid, int wid) {
if (gsStore.containsKey(gid)) {
return gsStore.get(gid);
} else {
Guild g = Server.getInstance().getGuild(gid, wid, null);
if (g != null) {
gsStore.put(gid, new MapleGuildSummary(g));
gsStore.put(gid, new GuildSummary(g));
}
return gsStore.get(gid);
}
}
public void updateGuildSummary(int gid, MapleGuildSummary mgs) {
public void updateGuildSummary(int gid, GuildSummary mgs) {
gsStore.put(gid, mgs);
}
@@ -629,7 +629,7 @@ public class World {
for (int i : gsStore.keySet()) {
g = server.getGuild(i, getId(), null);
if (g != null) {
gsStore.put(i, new MapleGuildSummary(g));
gsStore.put(i, new GuildSummary(g));
} else {
gsStore.remove(i);
}
@@ -686,7 +686,7 @@ public class World {
}
}
public void changeEmblem(int gid, List<Integer> affectedPlayers, MapleGuildSummary mgs) {
public void changeEmblem(int gid, List<Integer> affectedPlayers, GuildSummary mgs) {
updateGuildSummary(gid, mgs);
sendPacket(affectedPlayers, GuildPackets.guildEmblemChange(gid, mgs.getLogoBG(), mgs.getLogoBGColor(), mgs.getLogo(), mgs.getLogoColor()), -1);
setGuildAndRank(affectedPlayers, -1, -1, -1); //respawn player

View File

@@ -51,7 +51,7 @@ import net.server.channel.handlers.SummonDamageHandler.SummonAttackEntry;
import net.server.channel.handlers.WhisperHandler;
import net.server.guild.Alliance;
import net.server.guild.Guild;
import net.server.guild.MapleGuildSummary;
import net.server.guild.GuildSummary;
import net.server.world.MapleParty;
import net.server.world.MaplePartyCharacter;
import net.server.world.PartyOperation;
@@ -1897,7 +1897,7 @@ public class PacketCreator {
p.writeString("");
p.writeBytes(new byte[6]);
} else {
MapleGuildSummary gs = chr.getClient().getWorldServer().getGuildSummary(chr.getGuildId(), chr.getWorld());
GuildSummary gs = chr.getClient().getWorldServer().getGuildSummary(chr.getGuildId(), chr.getWorld());
if (gs != null) {
p.writeString(gs.getName());
p.writeShort(gs.getLogoBG());