box flag checker
This commit is contained in:
@@ -21,22 +21,23 @@ import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class BoxFlagThread implements Runnable {
|
||||
|
||||
public final static int THREAD_DELAY = 5000;
|
||||
public final static int THREAD_DELAY_SECONDS = 10;
|
||||
public BoxFlagThread() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long nextPulse = System.currentTimeMillis();
|
||||
LocalDateTime nextPulse = LocalDateTime.now();
|
||||
while(true){
|
||||
if(System.currentTimeMillis() > nextPulse) {
|
||||
if(LocalDateTime.now().isAfter(nextPulse)) {
|
||||
for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){
|
||||
if(pc.isEnteredWorld() && pc.isActive()){
|
||||
|
||||
@@ -58,7 +59,7 @@ public class BoxFlagThread implements Runnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
nextPulse += THREAD_DELAY;
|
||||
nextPulse = nextPulse.plusSeconds(THREAD_DELAY_SECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user