forked from MagicBane/Server
interest management
This commit is contained in:
@@ -567,4 +567,14 @@ public enum InterestManager implements Runnable {
|
||||
playerCharacter.setDirtyLoad(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshLoadedObjects(PlayerCharacter pc){
|
||||
try {
|
||||
pc.getLoadedObjects().clear();
|
||||
updateStaticList(pc, pc.getClientConnection());
|
||||
updateMobileList(pc, pc.getClientConnection());
|
||||
}catch(Exception e){
|
||||
Logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5236,8 +5236,10 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
if(!this.timestamps.containsKey("nextReload")){
|
||||
this.timestamps.put("nextReload",System.currentTimeMillis() + 5000L);
|
||||
}else{
|
||||
if(this.timestamps.get("nextReload") > System.currentTimeMillis())
|
||||
if(this.timestamps.get("nextReload") > System.currentTimeMillis()) {
|
||||
this.setDirtyLoad(true);
|
||||
InterestManager.INTERESTMANAGER.RefreshLoadedObjects(this);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user