Fixed Guild Creation
Fixed a bug on guild creation process where the leadership would not be assigned instantly to the guild leader (would need to change channels or reconnect to take effect).
This commit is contained in:
@@ -499,11 +499,8 @@ public class Server implements Runnable {
|
||||
}
|
||||
|
||||
if(mc != null) {
|
||||
MapleGuildCharacter mgc = mc.getMGC();
|
||||
if (mgc != null) {
|
||||
g.setOnline(mgc.getId(), true, mgc.getChannel());
|
||||
mc.setMGC(g.getMGC(mc.getId())); // i really REALLY must make player MGC the same as the guild MGC
|
||||
}
|
||||
g.addGuildMember(mc.getMGC()); // i really REALLY must make player MGC the same as the guild MGC
|
||||
g.setOnline(mc.getId(), true, mc.getClient().getChannel());
|
||||
}
|
||||
|
||||
guilds.put(id, g);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import net.server.guild.MapleGuildResponse;
|
||||
import net.server.guild.MapleGuildCharacter;
|
||||
import net.server.guild.MapleGuild;
|
||||
import client.MapleClient;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
@@ -30,7 +31,6 @@ import java.util.Iterator;
|
||||
import tools.MaplePacketCreator;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import net.server.guild.MapleAlliance;
|
||||
|
||||
public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||
private boolean isGuildNameAcceptable(String name) {
|
||||
@@ -123,16 +123,13 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler {
|
||||
return;
|
||||
}
|
||||
mc.gainMeso(-MapleGuild.CREATE_GUILD_COST, true, false, true);
|
||||
mc.setGuildId(gid);
|
||||
mc.setGuildRank(1);
|
||||
mc.setAllianceRank(5);
|
||||
|
||||
MapleGuild guild = Server.getInstance().getGuild(mc.getGuildId(), c.getWorld(), mc); // initialize guild structure
|
||||
guild.getMGC(guild.getLeaderId()).setCharacter(mc);
|
||||
Server.getInstance().getWorld(mc.getWorld()).setGuildAndRank(mc.getId(), gid, 1);
|
||||
Server.getInstance().setGuildMemberOnline(mc, true, mc.getClient().getChannel());
|
||||
|
||||
c.announce(MaplePacketCreator.showGuildInfo(mc));
|
||||
|
||||
c.getPlayer().dropMessage(1, "You have successfully created a Guild.");
|
||||
respawnPlayer(mc);
|
||||
break;
|
||||
case 0x05:
|
||||
if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MapleGuild {
|
||||
private enum BCOp {
|
||||
NONE, DISBAND, EMBLEMCHANGE
|
||||
}
|
||||
private List<MapleGuildCharacter> members;
|
||||
private final List<MapleGuildCharacter> members;
|
||||
private String rankTitles[] = new String[5]; // 1 = master, 2 = jr, 5 = lowest member
|
||||
private String name, notice;
|
||||
private int id, gp, logo, logoColor, leader, capacity, logoBG, logoBGColor, signature, allianceId;
|
||||
|
||||
@@ -112,13 +112,23 @@ public class MapleGuildCharacter {
|
||||
public void setGuildId(int gid) {
|
||||
guildid = gid;
|
||||
}
|
||||
|
||||
public int getGuildRank() {
|
||||
return guildrank;
|
||||
}
|
||||
|
||||
public void setGuildRank(int rank) {
|
||||
guildrank = rank;
|
||||
if(character != null) character.setGuildRank(rank);
|
||||
}
|
||||
|
||||
public int getGuildRank() {
|
||||
return guildrank;
|
||||
|
||||
public int getAllianceRank() {
|
||||
return allianceRank;
|
||||
}
|
||||
|
||||
public void setAllianceRank(int rank) {
|
||||
allianceRank = rank;
|
||||
if(character != null) character.setAllianceRank(rank);
|
||||
}
|
||||
|
||||
public boolean isOnline() {
|
||||
@@ -133,15 +143,6 @@ public class MapleGuildCharacter {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setAllianceRank(int rank) {
|
||||
allianceRank = rank;
|
||||
if(character != null) character.setAllianceRank(rank);
|
||||
}
|
||||
|
||||
public int getAllianceRank() {
|
||||
return allianceRank;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (!(other instanceof MapleGuildCharacter)) {
|
||||
|
||||
@@ -266,7 +266,13 @@ public class World {
|
||||
} else {
|
||||
bDifferentGuild = guildid != mc.getGuildId();
|
||||
mc.setGuildId(guildid);
|
||||
mc.setGuildRank(rank);
|
||||
|
||||
MapleGuildCharacter mgc = mc.getMGC();
|
||||
if(mgc != null) {
|
||||
mgc.setGuildRank(rank);
|
||||
if(bDifferentGuild) mgc.setAllianceRank(5);
|
||||
}
|
||||
|
||||
mc.saveGuildStatus();
|
||||
}
|
||||
if (bDifferentGuild) {
|
||||
|
||||
Reference in New Issue
Block a user