|
|
@ -35,26 +35,35 @@ public class BoxFlagThread implements Runnable { |
|
|
|
LocalDateTime nextPulse = LocalDateTime.now().minusMinutes(1); |
|
|
|
LocalDateTime nextPulse = LocalDateTime.now().minusMinutes(1); |
|
|
|
while(true){ |
|
|
|
while(true){ |
|
|
|
if(LocalDateTime.now().isAfter(nextPulse)) { |
|
|
|
if(LocalDateTime.now().isAfter(nextPulse)) { |
|
|
|
|
|
|
|
HashMap<String,ArrayList<PlayerCharacter>> PlayersByMachineID = new HashMap<>(); |
|
|
|
for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){ |
|
|
|
for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){ |
|
|
|
if(pc.isEnteredWorld() && pc.isActive()){ |
|
|
|
if(PlayersByMachineID.containsKey(pc.getClientConnection().machineID)){ |
|
|
|
ChatManager.chatSystemInfo(pc, " You Are Being Box Checked"); |
|
|
|
if(PlayersByMachineID.get(pc.getClientConnection().machineID).contains(pc) == false) |
|
|
|
pc.isBoxed = PlayerCharacter.checkIfBoxed(pc); |
|
|
|
PlayersByMachineID.get(pc.getClientConnection().machineID).add(pc); |
|
|
|
if(pc.isBoxed) { |
|
|
|
}else{ |
|
|
|
if(pc.title.equals(CharacterTitle.BOX) == false) { |
|
|
|
ArrayList<PlayerCharacter> newList = new ArrayList<>(); |
|
|
|
pc.title = CharacterTitle.BOX; |
|
|
|
newList.add(pc); |
|
|
|
//InterestManager.reloadCharacter(pc);
|
|
|
|
PlayersByMachineID.put(pc.getClientConnection().machineID,newList); |
|
|
|
InterestManager.setObjectDirty(pc); |
|
|
|
|
|
|
|
if (pc.containsEffect(1672601862) == false) {//Deathshroud
|
|
|
|
|
|
|
|
PowersManager.applyPower(pc, pc, Vector3fImmutable.ZERO, 1672601862, 40, false); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
|
|
|
|
if(pc.title.equals(CharacterTitle.NONE) == false) { |
|
|
|
for(String key : PlayersByMachineID.keySet()){ |
|
|
|
pc.title = CharacterTitle.NONE; |
|
|
|
ArrayList<PlayerCharacter> machinePlayers = PlayersByMachineID.get(key); |
|
|
|
//InterestManager.reloadCharacter(pc);
|
|
|
|
if(machinePlayers.size() > 1){ |
|
|
|
InterestManager.setObjectDirty(pc); |
|
|
|
int unboxedCount = 0; |
|
|
|
|
|
|
|
for(PlayerCharacter pc : machinePlayers){ |
|
|
|
|
|
|
|
if(!pc.isBoxed) |
|
|
|
|
|
|
|
unboxedCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(unboxedCount > 1){ |
|
|
|
|
|
|
|
for(PlayerCharacter pc : machinePlayers){ |
|
|
|
|
|
|
|
pc.isBoxed = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
machinePlayers.get(0).isBoxed = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
machinePlayers.get(0).isBoxed = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
nextPulse = nextPulse.plusSeconds(THREAD_DELAY_SECONDS); |
|
|
|
nextPulse = nextPulse.plusSeconds(THREAD_DELAY_SECONDS); |
|
|
|