Rename and clean up MapleFamily
This commit is contained in:
@@ -23,7 +23,7 @@ package net.server;
|
||||
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import client.SkillFactory;
|
||||
import client.command.CommandsExecutor;
|
||||
import client.inventory.Item;
|
||||
@@ -857,7 +857,7 @@ public class Server {
|
||||
applyAllWorldTransfers(con);
|
||||
|
||||
if (YamlConfig.config.server.USE_FAMILY_SYSTEM) {
|
||||
MapleFamily.loadAllFamilies(con);
|
||||
Family.loadAllFamilies(con);
|
||||
}
|
||||
} catch (SQLException sqle) {
|
||||
log.error("Failed to run all startup-bound database tasks", sqle);
|
||||
|
||||
@@ -23,7 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -76,7 +76,7 @@ public final class AcceptFamilyHandler extends AbstractPacketHandler {
|
||||
}
|
||||
} else { //absorb target family
|
||||
MapleFamilyEntry targetEntry = chr.getFamilyEntry();
|
||||
MapleFamily targetFamily = targetEntry.getFamily();
|
||||
Family targetFamily = targetEntry.getFamily();
|
||||
if(targetFamily.getLeader() != targetEntry) return;
|
||||
if(inviter.getFamily().getTotalGenerations() + targetFamily.getTotalGenerations() <= YamlConfig.config.server.FAMILY_MAX_GENERATIONS) {
|
||||
targetEntry.join(inviter.getFamilyEntry());
|
||||
@@ -92,7 +92,7 @@ public final class AcceptFamilyHandler extends AbstractPacketHandler {
|
||||
chr.sendPacket(PacketCreator.sendFamilyMessage(76, 0));
|
||||
return;
|
||||
}
|
||||
MapleFamily newFamily = new MapleFamily(-1, c.getWorld());
|
||||
Family newFamily = new Family(-1, c.getWorld());
|
||||
c.getWorldServer().addFamily(newFamily.getID(), newFamily);
|
||||
MapleFamilyEntry inviterEntry = new MapleFamilyEntry(newFamily, inviter.getId(), inviter.getName(), inviter.getLevel(), inviter.getJob());
|
||||
inviterEntry.setCharacter(inviter);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import tools.PacketCreator;
|
||||
@@ -10,7 +10,7 @@ public class FamilyPreceptsHandler extends AbstractPacketHandler {
|
||||
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
MapleFamily family = c.getPlayer().getFamily();
|
||||
Family family = c.getPlayer().getFamily();
|
||||
if(family == null) return;
|
||||
if(family.getLeader().getChr() != c.getPlayer()) return; //only the leader can set the precepts
|
||||
String newPrecepts = p.readString();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -32,7 +32,7 @@ public class FamilySeparateHandler extends AbstractPacketHandler {
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
|
||||
MapleFamily oldFamily = c.getPlayer().getFamily();
|
||||
Family oldFamily = c.getPlayer().getFamily();
|
||||
if(oldFamily == null) return;
|
||||
MapleFamilyEntry forkOn = null;
|
||||
boolean isSenior;
|
||||
|
||||
@@ -247,7 +247,7 @@ public final class PlayerLoggedinHandler extends AbstractPacketHandler {
|
||||
|
||||
c.sendPacket(PacketCreator.loadFamily(player));
|
||||
if (player.getFamilyId() > 0) {
|
||||
MapleFamily f = wserv.getFamily(player.getFamilyId());
|
||||
Family f = wserv.getFamily(player.getFamilyId());
|
||||
if (f != null) {
|
||||
MapleFamilyEntry familyEntry = f.getEntryByID(player.getId());
|
||||
if (familyEntry != null) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package net.server.handlers.login;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
@@ -60,7 +60,7 @@ public final class DeleteCharHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.deleteCharResponse(cid, 0x16));
|
||||
return;
|
||||
} else if (familyId != -1) {
|
||||
MapleFamily family = Server.getInstance().getWorld(world).getFamily(familyId);
|
||||
Family family = Server.getInstance().getWorld(world).getFamily(familyId);
|
||||
if (family != null && family.getTotalMembers() > 1) {
|
||||
c.sendPacket(PacketCreator.deleteCharResponse(cid, 0x1D));
|
||||
return;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package net.server.task;
|
||||
|
||||
import client.Family;
|
||||
import net.server.world.World;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.FilePrinter;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Calendar;
|
||||
|
||||
import client.MapleFamily;
|
||||
import net.server.world.World;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.FilePrinter;
|
||||
|
||||
public class FamilyDailyResetTask implements Runnable {
|
||||
|
||||
private final World world;
|
||||
@@ -21,7 +21,7 @@ public class FamilyDailyResetTask implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
resetEntitlementUsage(world);
|
||||
for(MapleFamily family : world.getFamilies()) {
|
||||
for(Family family : world.getFamilies()) {
|
||||
family.resetDailyReps();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import client.BuddyList.BuddyAddResult;
|
||||
import client.BuddyList.BuddyOperation;
|
||||
import client.BuddylistEntry;
|
||||
import client.Character;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import net.packet.Packet;
|
||||
@@ -82,7 +82,7 @@ public class World {
|
||||
private Map<Integer, Short> pnpcPodium = new HashMap<>();
|
||||
private Map<Integer, MapleMessenger> messengers = new HashMap<>();
|
||||
private AtomicInteger runningMessengerId = new AtomicInteger();
|
||||
private Map<Integer, MapleFamily> families = new LinkedHashMap<>();
|
||||
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<>();
|
||||
@@ -547,7 +547,7 @@ public class World {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void addFamily(int id, MapleFamily f) {
|
||||
public void addFamily(int id, Family f) {
|
||||
synchronized (families) {
|
||||
if (!families.containsKey(id)) {
|
||||
families.put(id, f);
|
||||
@@ -561,7 +561,7 @@ public class World {
|
||||
}
|
||||
}
|
||||
|
||||
public MapleFamily getFamily(int id) {
|
||||
public Family getFamily(int id) {
|
||||
synchronized (families) {
|
||||
if (families.containsKey(id)) {
|
||||
return families.get(id);
|
||||
@@ -570,7 +570,7 @@ public class World {
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<MapleFamily> getFamilies() {
|
||||
public Collection<Family> getFamilies() {
|
||||
synchronized(families) {
|
||||
return Collections.unmodifiableCollection(families.values());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user