|
|
@ -28,6 +28,7 @@ import engine.server.MBServerStatics; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.HashSet; |
|
|
|
|
|
|
|
|
|
|
|
import static engine.math.FastMath.sqr; |
|
|
|
import static engine.math.FastMath.sqr; |
|
|
@ -37,6 +38,7 @@ public enum InterestManager implements Runnable { |
|
|
|
INTERESTMANAGER; |
|
|
|
INTERESTMANAGER; |
|
|
|
|
|
|
|
|
|
|
|
private static long lastTime; |
|
|
|
private static long lastTime; |
|
|
|
|
|
|
|
public static HashMap<String,ArrayList<PlayerCharacter>> playersByMachine = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
InterestManager() { |
|
|
|
InterestManager() { |
|
|
|
Logger.info(" Interest Management thread is running."); |
|
|
|
Logger.info(" Interest Management thread is running."); |
|
|
@ -522,12 +524,24 @@ public enum InterestManager implements Runnable { |
|
|
|
if (origin == null) |
|
|
|
if (origin == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(playersByMachine.containsKey(origin.machineID)){ |
|
|
|
|
|
|
|
if(playersByMachine.get(origin.machineID) == null){ |
|
|
|
|
|
|
|
ArrayList<PlayerCharacter> newList = new ArrayList<>(); |
|
|
|
|
|
|
|
newList.add(player); |
|
|
|
|
|
|
|
playersByMachine.put(origin.machineID,newList); |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
if(playersByMachine.get(origin.machineID).size() >= 3){ |
|
|
|
|
|
|
|
origin.disconnect(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
playersByMachine.get(origin.machineID).add(player); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// Update loaded upbjects lists
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
|
|
|
|
|
|
|
|
player.setDirtyLoad(true); |
|
|
|
player.setDirtyLoad(true); |
|
|
|
updateStaticList(player, origin); |
|
|
|
updateStaticList(player, origin); |
|
|
|
updateMobileList(player, origin); |
|
|
|
updateMobileList(player, origin); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) { |
|
|
|
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) { |
|
|
|