Rename and clean up MapleMatchCheckerCoordinator
This commit is contained in:
@@ -30,25 +30,24 @@ import java.util.Map.Entry;
|
|||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Ronan
|
* @author Ronan
|
||||||
*/
|
*/
|
||||||
public class MapleMatchCheckerCoordinator {
|
public class MatchCheckerCoordinator {
|
||||||
|
|
||||||
private final Map<Integer, MapleMatchCheckingElement> matchEntries = new HashMap<>();
|
private final Map<Integer, MapleMatchCheckingElement> matchEntries = new HashMap<>();
|
||||||
|
|
||||||
private final Set<Integer> pooledCids = new HashSet<>();
|
private final Set<Integer> pooledCids = new HashSet<>();
|
||||||
private final Semaphore semaphorePool = new Semaphore(7);
|
private final Semaphore semaphorePool = new Semaphore(7);
|
||||||
|
|
||||||
private class MapleMatchCheckingEntry {
|
private class MatchCheckingEntry {
|
||||||
private boolean accepted;
|
private boolean accepted;
|
||||||
private int cid;
|
private final int cid;
|
||||||
|
|
||||||
private MapleMatchCheckingEntry(int cid) {
|
private MatchCheckingEntry(int cid) {
|
||||||
this.cid = cid;
|
this.cid = cid;
|
||||||
this.accepted = false;
|
this.accepted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean setAccept() {
|
private boolean setAccept() {
|
||||||
if (!this.accepted) {
|
if (!this.accepted) {
|
||||||
this.accepted = true;
|
this.accepted = true;
|
||||||
@@ -57,25 +56,25 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getAccept() {
|
private boolean getAccept() {
|
||||||
return this.accepted;
|
return this.accepted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MapleMatchCheckingElement {
|
private class MapleMatchCheckingElement {
|
||||||
private int leaderCid;
|
private final int leaderCid;
|
||||||
private int world;
|
private final int world;
|
||||||
|
|
||||||
private MatchCheckerType matchType;
|
private final MatchCheckerType matchType;
|
||||||
private AbstractMatchCheckerListener listener;
|
private final AbstractMatchCheckerListener listener;
|
||||||
|
|
||||||
private Map<Integer, MapleMatchCheckingEntry> confirmingMembers = new HashMap<>();
|
private final Map<Integer, MatchCheckingEntry> confirmingMembers = new HashMap<>();
|
||||||
private int confirmCount;
|
private int confirmCount;
|
||||||
private boolean active = true;
|
private boolean active = true;
|
||||||
|
|
||||||
private String message;
|
private final String message;
|
||||||
|
|
||||||
private MapleMatchCheckingElement(MatchCheckerType matchType, int leaderCid, int world, AbstractMatchCheckerListener leaderListener, Set<Integer> matchPlayers, String message) {
|
private MapleMatchCheckingElement(MatchCheckerType matchType, int leaderCid, int world, AbstractMatchCheckerListener leaderListener, Set<Integer> matchPlayers, String message) {
|
||||||
this.leaderCid = leaderCid;
|
this.leaderCid = leaderCid;
|
||||||
this.world = world;
|
this.world = world;
|
||||||
@@ -83,59 +82,57 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
this.confirmCount = 0;
|
this.confirmCount = 0;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.matchType = matchType;
|
this.matchType = matchType;
|
||||||
|
|
||||||
for (Integer cid : matchPlayers) {
|
for (Integer cid : matchPlayers) {
|
||||||
MapleMatchCheckingEntry mmcEntry = new MapleMatchCheckingEntry(cid);
|
MatchCheckingEntry mmcEntry = new MatchCheckingEntry(cid);
|
||||||
confirmingMembers.put(cid, mmcEntry);
|
confirmingMembers.put(cid, mmcEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean acceptEntry(int cid) {
|
private boolean acceptEntry(int cid) {
|
||||||
MapleMatchCheckingEntry mmcEntry = confirmingMembers.get(cid);
|
MatchCheckingEntry mmcEntry = confirmingMembers.get(cid);
|
||||||
if (mmcEntry != null) {
|
if (mmcEntry != null) {
|
||||||
if (mmcEntry.setAccept()) {
|
if (mmcEntry.setAccept()) {
|
||||||
this.confirmCount++;
|
this.confirmCount++;
|
||||||
|
|
||||||
if (this.confirmCount == this.confirmingMembers.size()) {
|
return this.confirmCount == this.confirmingMembers.size();
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isMatchActive() {
|
private boolean isMatchActive() {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMatchActive(boolean a) {
|
private void setMatchActive(boolean a) {
|
||||||
active = a;
|
active = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Integer> getMatchPlayers() {
|
private Set<Integer> getMatchPlayers() {
|
||||||
return confirmingMembers.keySet();
|
return confirmingMembers.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Integer> getAcceptedMatchPlayers() {
|
private Set<Integer> getAcceptedMatchPlayers() {
|
||||||
Set<Integer> s = new HashSet<>();
|
Set<Integer> s = new HashSet<>();
|
||||||
|
|
||||||
for (Entry<Integer, MapleMatchCheckingEntry> e : confirmingMembers.entrySet()) {
|
for (Entry<Integer, MatchCheckingEntry> e : confirmingMembers.entrySet()) {
|
||||||
if (e.getValue().getAccept()) {
|
if (e.getValue().getAccept()) {
|
||||||
s.add(e.getKey());
|
s.add(e.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Character> getMatchCharacters() {
|
private Set<Character> getMatchCharacters() {
|
||||||
Set<Character> players = new HashSet<>();
|
Set<Character> players = new HashSet<>();
|
||||||
|
|
||||||
World wserv = Server.getInstance().getWorld(world);
|
World wserv = Server.getInstance().getWorld(world);
|
||||||
if (wserv != null) {
|
if (wserv != null) {
|
||||||
PlayerStorage ps = wserv.getPlayerStorage();
|
PlayerStorage ps = wserv.getPlayerStorage();
|
||||||
|
|
||||||
for (Integer cid : getMatchPlayers()) {
|
for (Integer cid : getMatchPlayers()) {
|
||||||
Character chr = ps.getCharacterById(cid);
|
Character chr = ps.getCharacterById(cid);
|
||||||
if (chr != null) {
|
if (chr != null) {
|
||||||
@@ -143,25 +140,25 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchMatchCreated() {
|
private void dispatchMatchCreated() {
|
||||||
Set<Character> nonLeaderMatchPlayers = getMatchCharacters();
|
Set<Character> nonLeaderMatchPlayers = getMatchCharacters();
|
||||||
Character leader = null;
|
Character leader = null;
|
||||||
|
|
||||||
for (Character chr : nonLeaderMatchPlayers) {
|
for (Character chr : nonLeaderMatchPlayers) {
|
||||||
if (chr.getId() == leaderCid) {
|
if (chr.getId() == leaderCid) {
|
||||||
leader = chr;
|
leader = chr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nonLeaderMatchPlayers.remove(leader);
|
nonLeaderMatchPlayers.remove(leader);
|
||||||
listener.onMatchCreated(leader, nonLeaderMatchPlayers, message);
|
listener.onMatchCreated(leader, nonLeaderMatchPlayers, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchMatchResult(boolean accept) {
|
private void dispatchMatchResult(boolean accept) {
|
||||||
if (accept) {
|
if (accept) {
|
||||||
listener.onMatchAccepted(leaderCid, getMatchCharacters(), message);
|
listener.onMatchAccepted(leaderCid, getMatchCharacters(), message);
|
||||||
@@ -169,29 +166,29 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
listener.onMatchDeclined(leaderCid, getMatchCharacters(), message);
|
listener.onMatchDeclined(leaderCid, getMatchCharacters(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchMatchDismissed() {
|
private void dispatchMatchDismissed() {
|
||||||
listener.onMatchDismissed(leaderCid, getMatchCharacters(), message);
|
listener.onMatchDismissed(leaderCid, getMatchCharacters(), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unpoolMatchPlayer(Integer cid) {
|
private void unpoolMatchPlayer(Integer cid) {
|
||||||
unpoolMatchPlayers(Collections.singleton(cid));
|
unpoolMatchPlayers(Collections.singleton(cid));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unpoolMatchPlayers(Set<Integer> matchPlayers) {
|
private void unpoolMatchPlayers(Set<Integer> matchPlayers) {
|
||||||
for (Integer cid : matchPlayers) {
|
for (Integer cid : matchPlayers) {
|
||||||
pooledCids.remove(cid);
|
pooledCids.remove(cid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean poolMatchPlayer(Integer cid) {
|
private boolean poolMatchPlayer(Integer cid) {
|
||||||
return poolMatchPlayers(Collections.singleton(cid));
|
return poolMatchPlayers(Collections.singleton(cid));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean poolMatchPlayers(Set<Integer> matchPlayers) {
|
private boolean poolMatchPlayers(Set<Integer> matchPlayers) {
|
||||||
Set<Integer> pooledPlayers = new HashSet<>();
|
Set<Integer> pooledPlayers = new HashSet<>();
|
||||||
|
|
||||||
for (Integer cid : matchPlayers) {
|
for (Integer cid : matchPlayers) {
|
||||||
if (!pooledCids.add(cid)) {
|
if (!pooledCids.add(cid)) {
|
||||||
unpoolMatchPlayers(pooledPlayers);
|
unpoolMatchPlayers(pooledPlayers);
|
||||||
@@ -200,24 +197,24 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
pooledPlayers.add(cid);
|
pooledPlayers.add(cid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isMatchingAvailable(Set<Integer> matchPlayers) {
|
private boolean isMatchingAvailable(Set<Integer> matchPlayers) {
|
||||||
for (Integer cid : matchPlayers) {
|
for (Integer cid : matchPlayers) {
|
||||||
if (matchEntries.containsKey(cid)) {
|
if (matchEntries.containsKey(cid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reenablePlayerMatching(Set<Integer> matchPlayers) {
|
private void reenablePlayerMatching(Set<Integer> matchPlayers) {
|
||||||
for (Integer cid : matchPlayers) {
|
for (Integer cid : matchPlayers) {
|
||||||
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
||||||
|
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
synchronized (mmce) {
|
synchronized (mmce) {
|
||||||
if (!mmce.isMatchActive()) {
|
if (!mmce.isMatchActive()) {
|
||||||
@@ -227,7 +224,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMatchConfirmationLeaderid(int cid) {
|
public int getMatchConfirmationLeaderid(int cid) {
|
||||||
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
@@ -236,7 +233,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MatchCheckerType getMatchConfirmationType(int cid) {
|
public MatchCheckerType getMatchConfirmationType(int cid) {
|
||||||
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
@@ -245,7 +242,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMatchConfirmationActive(int cid) {
|
public boolean isMatchConfirmationActive(int cid) {
|
||||||
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
MapleMatchCheckingElement mmce = matchEntries.get(cid);
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
@@ -254,18 +251,18 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private MapleMatchCheckingElement createMatchConfirmationInternal(MatchCheckerType matchType, int world, int leaderCid, AbstractMatchCheckerListener leaderListener, Set<Integer> players, String message) {
|
private MapleMatchCheckingElement createMatchConfirmationInternal(MatchCheckerType matchType, int world, int leaderCid, AbstractMatchCheckerListener leaderListener, Set<Integer> players, String message) {
|
||||||
MapleMatchCheckingElement mmce = new MapleMatchCheckingElement(matchType, leaderCid, world, leaderListener, players, message);
|
MapleMatchCheckingElement mmce = new MapleMatchCheckingElement(matchType, leaderCid, world, leaderListener, players, message);
|
||||||
|
|
||||||
for (Integer cid : players) {
|
for (Integer cid : players) {
|
||||||
matchEntries.put(cid, mmce);
|
matchEntries.put(cid, mmce);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptMatchElement(mmce, leaderCid);
|
acceptMatchElement(mmce, leaderCid);
|
||||||
return mmce;
|
return mmce;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean createMatchConfirmation(MatchCheckerType matchType, int world, int leaderCid, Set<Integer> players, String message) {
|
public boolean createMatchConfirmation(MatchCheckerType matchType, int world, int leaderCid, Set<Integer> players, String message) {
|
||||||
MapleMatchCheckingElement mmce = null;
|
MapleMatchCheckingElement mmce = null;
|
||||||
try {
|
try {
|
||||||
@@ -289,7 +286,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
ie.printStackTrace();
|
ie.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
mmce.dispatchMatchCreated();
|
mmce.dispatchMatchCreated();
|
||||||
return true;
|
return true;
|
||||||
@@ -297,15 +294,16 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disposeMatchElement(MapleMatchCheckingElement mmce) {
|
private void disposeMatchElement(MapleMatchCheckingElement mmce) {
|
||||||
Set<Integer> matchPlayers = mmce.getMatchPlayers(); // thanks Ai for noticing players getting match-stuck on certain cases
|
Set<Integer> matchPlayers = mmce.getMatchPlayers(); // thanks Ai for noticing players getting match-stuck on certain cases
|
||||||
while (!poolMatchPlayers(matchPlayers)) {
|
while (!poolMatchPlayers(matchPlayers)) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} catch (InterruptedException ie) {}
|
} catch (InterruptedException ie) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (Integer cid : matchPlayers) {
|
for (Integer cid : matchPlayers) {
|
||||||
matchEntries.remove(cid);
|
matchEntries.remove(cid);
|
||||||
@@ -314,30 +312,30 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
unpoolMatchPlayers(matchPlayers);
|
unpoolMatchPlayers(matchPlayers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean acceptMatchElement(MapleMatchCheckingElement mmce, int cid) {
|
private boolean acceptMatchElement(MapleMatchCheckingElement mmce, int cid) {
|
||||||
if (mmce.acceptEntry(cid)) {
|
if (mmce.acceptEntry(cid)) {
|
||||||
unpoolMatchPlayer(cid);
|
unpoolMatchPlayer(cid);
|
||||||
disposeMatchElement(mmce);
|
disposeMatchElement(mmce);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void denyMatchElement(MapleMatchCheckingElement mmce, int cid) {
|
private void denyMatchElement(MapleMatchCheckingElement mmce, int cid) {
|
||||||
unpoolMatchPlayer(cid);
|
unpoolMatchPlayer(cid);
|
||||||
disposeMatchElement(mmce);
|
disposeMatchElement(mmce);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dismissMatchElement(MapleMatchCheckingElement mmce, int cid) {
|
private void dismissMatchElement(MapleMatchCheckingElement mmce, int cid) {
|
||||||
mmce.setMatchActive(false);
|
mmce.setMatchActive(false);
|
||||||
|
|
||||||
unpoolMatchPlayer(cid);
|
unpoolMatchPlayer(cid);
|
||||||
disposeMatchElement(mmce);
|
disposeMatchElement(mmce);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean answerMatchConfirmation(int cid, boolean accept) {
|
public boolean answerMatchConfirmation(int cid, boolean accept) {
|
||||||
MapleMatchCheckingElement mmce = null;
|
MapleMatchCheckingElement mmce = null;
|
||||||
try {
|
try {
|
||||||
@@ -347,7 +345,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
if (poolMatchPlayer(cid)) {
|
if (poolMatchPlayer(cid)) {
|
||||||
try {
|
try {
|
||||||
mmce = matchEntries.get(cid);
|
mmce = matchEntries.get(cid);
|
||||||
|
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
synchronized (mmce) {
|
synchronized (mmce) {
|
||||||
if (!mmce.isMatchActive()) { // thanks Alex (Alex-0000) for noticing that exploiters could stall on match checking
|
if (!mmce.isMatchActive()) { // thanks Alex (Alex-0000) for noticing that exploiters could stall on match checking
|
||||||
@@ -358,7 +356,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
if (!acceptMatchElement(mmce, cid)) {
|
if (!acceptMatchElement(mmce, cid)) {
|
||||||
mmce = null;
|
mmce = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
break; // thanks Rohenn for noticing loop scenario here
|
break; // thanks Rohenn for noticing loop scenario here
|
||||||
} else {
|
} else {
|
||||||
denyMatchElement(mmce, cid);
|
denyMatchElement(mmce, cid);
|
||||||
@@ -378,14 +376,14 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
ie.printStackTrace();
|
ie.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
mmce.dispatchMatchResult(accept);
|
mmce.dispatchMatchResult(accept);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean dismissMatchConfirmation(int cid) {
|
public boolean dismissMatchConfirmation(int cid) {
|
||||||
MapleMatchCheckingElement mmce = null;
|
MapleMatchCheckingElement mmce = null;
|
||||||
try {
|
try {
|
||||||
@@ -416,7 +414,7 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
ie.printStackTrace();
|
ie.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmce != null) {
|
if (mmce != null) {
|
||||||
mmce.dispatchMatchDismissed();
|
mmce.dispatchMatchDismissed();
|
||||||
return true;
|
return true;
|
||||||
@@ -424,5 +422,5 @@ public class MapleMatchCheckerCoordinator {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ import net.server.Server;
|
|||||||
import net.server.audit.locks.MonitoredLockType;
|
import net.server.audit.locks.MonitoredLockType;
|
||||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||||
import net.server.channel.Channel;
|
import net.server.channel.Channel;
|
||||||
import net.server.coordinator.matchchecker.MapleMatchCheckerCoordinator;
|
import net.server.coordinator.matchchecker.MatchCheckerCoordinator;
|
||||||
import net.server.coordinator.world.MapleInviteCoordinator;
|
import net.server.coordinator.world.MapleInviteCoordinator;
|
||||||
import net.server.coordinator.world.MapleInviteCoordinator.InviteType;
|
import net.server.coordinator.world.MapleInviteCoordinator.InviteType;
|
||||||
import net.server.coordinator.world.MapleInviteCoordinator.MapleInviteResult;
|
import net.server.coordinator.world.MapleInviteCoordinator.MapleInviteResult;
|
||||||
@@ -752,7 +752,7 @@ public class MapleGuild {
|
|||||||
Set<Character> guildMembers = new HashSet<>();
|
Set<Character> guildMembers = new HashSet<>();
|
||||||
guildMembers.add(guildLeader);
|
guildMembers.add(guildLeader);
|
||||||
|
|
||||||
MapleMatchCheckerCoordinator mmce = guildLeader.getWorldServer().getMatchCheckerCoordinator();
|
MatchCheckerCoordinator mmce = guildLeader.getWorldServer().getMatchCheckerCoordinator();
|
||||||
for (Character chr : guildLeader.getMap().getAllPlayers()) {
|
for (Character chr : guildLeader.getMap().getAllPlayers()) {
|
||||||
if (chr.getParty() == null && chr.getGuild() == null && mmce.getMatchConfirmationLeaderid(chr.getId()) == -1) {
|
if (chr.getParty() == null && chr.getGuild() == null && mmce.getMatchConfirmationLeaderid(chr.getId()) == -1) {
|
||||||
guildMembers.add(chr);
|
guildMembers.add(chr);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import net.server.audit.LockCollector;
|
|||||||
import net.server.audit.locks.MonitoredLockType;
|
import net.server.audit.locks.MonitoredLockType;
|
||||||
import net.server.audit.locks.MonitoredReentrantLock;
|
import net.server.audit.locks.MonitoredReentrantLock;
|
||||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||||
import net.server.coordinator.matchchecker.MapleMatchCheckerCoordinator;
|
import net.server.coordinator.matchchecker.MatchCheckerCoordinator;
|
||||||
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
|
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
|
||||||
import scripting.event.EventInstanceManager;
|
import scripting.event.EventInstanceManager;
|
||||||
import server.maps.MapleDoor;
|
import server.maps.MapleDoor;
|
||||||
@@ -436,7 +436,7 @@ public class MapleParty {
|
|||||||
|
|
||||||
player.setParty(null);
|
player.setParty(null);
|
||||||
|
|
||||||
MapleMatchCheckerCoordinator mmce = c.getWorldServer().getMatchCheckerCoordinator();
|
MatchCheckerCoordinator mmce = c.getWorldServer().getMatchCheckerCoordinator();
|
||||||
if (mmce.getMatchConfirmationLeaderid(player.getId()) == player.getId() && mmce.getMatchConfirmationType(player.getId()) == MatchCheckerType.GUILD_CREATION) {
|
if (mmce.getMatchConfirmationLeaderid(player.getId()) == player.getId() && mmce.getMatchConfirmationType(player.getId()) == MatchCheckerType.GUILD_CREATION) {
|
||||||
mmce.dismissMatchConfirmation(player.getId());
|
mmce.dismissMatchConfirmation(player.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
|||||||
import net.server.audit.locks.factory.MonitoredWriteLockFactory;
|
import net.server.audit.locks.factory.MonitoredWriteLockFactory;
|
||||||
import net.server.channel.Channel;
|
import net.server.channel.Channel;
|
||||||
import net.server.channel.CharacterIdChannelPair;
|
import net.server.channel.CharacterIdChannelPair;
|
||||||
import net.server.coordinator.matchchecker.MapleMatchCheckerCoordinator;
|
import net.server.coordinator.matchchecker.MatchCheckerCoordinator;
|
||||||
import net.server.coordinator.partysearch.MaplePartySearchCoordinator;
|
import net.server.coordinator.partysearch.MaplePartySearchCoordinator;
|
||||||
import net.server.coordinator.world.MapleInviteCoordinator;
|
import net.server.coordinator.world.MapleInviteCoordinator;
|
||||||
import net.server.coordinator.world.MapleInviteCoordinator.InviteResult;
|
import net.server.coordinator.world.MapleInviteCoordinator.InviteResult;
|
||||||
@@ -88,7 +88,7 @@ public class World {
|
|||||||
private Map<Integer, MapleGuildSummary> gsStore = new HashMap<>();
|
private Map<Integer, MapleGuildSummary> gsStore = new HashMap<>();
|
||||||
private PlayerStorage players = new PlayerStorage();
|
private PlayerStorage players = new PlayerStorage();
|
||||||
private ServicesManager services = new ServicesManager(WorldServices.SAVE_CHARACTER);
|
private ServicesManager services = new ServicesManager(WorldServices.SAVE_CHARACTER);
|
||||||
private MapleMatchCheckerCoordinator matchChecker = new MapleMatchCheckerCoordinator();
|
private MatchCheckerCoordinator matchChecker = new MatchCheckerCoordinator();
|
||||||
private MaplePartySearchCoordinator partySearch = new MaplePartySearchCoordinator();
|
private MaplePartySearchCoordinator partySearch = new MaplePartySearchCoordinator();
|
||||||
|
|
||||||
private final MonitoredReentrantReadWriteLock chnLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.WORLD_CHANNELS, true);
|
private final MonitoredReentrantReadWriteLock chnLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.WORLD_CHANNELS, true);
|
||||||
@@ -513,7 +513,7 @@ public class World {
|
|||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleMatchCheckerCoordinator getMatchCheckerCoordinator() {
|
public MatchCheckerCoordinator getMatchCheckerCoordinator() {
|
||||||
return matchChecker;
|
return matchChecker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user