interest management
This commit is contained in:
@@ -46,7 +46,6 @@ public enum InterestManager implements Runnable {
|
|||||||
LoadCharacterMsg lcm;
|
LoadCharacterMsg lcm;
|
||||||
NPC npc;
|
NPC npc;
|
||||||
Corpse corpse;
|
Corpse corpse;
|
||||||
PlayerCharacter pc;
|
|
||||||
HashSet<AbstractWorldObject> toUpdate;
|
HashSet<AbstractWorldObject> toUpdate;
|
||||||
|
|
||||||
switch (awo.getObjectType()) {
|
switch (awo.getObjectType()) {
|
||||||
@@ -65,11 +64,6 @@ public enum InterestManager implements Runnable {
|
|||||||
lcm = new LoadCharacterMsg(npc, false);
|
lcm = new LoadCharacterMsg(npc, false);
|
||||||
msg = lcm;
|
msg = lcm;
|
||||||
break;
|
break;
|
||||||
case PlayerCharacter:
|
|
||||||
pc = (PlayerCharacter) awo;
|
|
||||||
lcm = new LoadCharacterMsg(pc, false);
|
|
||||||
msg = lcm;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -112,7 +106,7 @@ public enum InterestManager implements Runnable {
|
|||||||
origin.sendMsg(moveMsg);
|
origin.sendMsg(moveMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reloadCharacter(AbstractCharacter absChar, boolean fromBox) {
|
public static void reloadCharacter(AbstractCharacter absChar) {
|
||||||
|
|
||||||
UnloadObjectsMsg uom = new UnloadObjectsMsg();
|
UnloadObjectsMsg uom = new UnloadObjectsMsg();
|
||||||
uom.addObject(absChar);
|
uom.addObject(absChar);
|
||||||
@@ -138,9 +132,8 @@ public enum InterestManager implements Runnable {
|
|||||||
if (cc == null)
|
if (cc == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pcc.getObjectUUID() == absChar.getObjectUUID()) {
|
if (pcc.getObjectUUID() == absChar.getObjectUUID())
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (pc != null)
|
if (pc != null)
|
||||||
@@ -538,7 +531,6 @@ public enum InterestManager implements Runnable {
|
|||||||
// Update loaded upbjects lists
|
// Update loaded upbjects lists
|
||||||
|
|
||||||
player.isBoxed = PlayerCharacter.checkIfBoxed(player);
|
player.isBoxed = PlayerCharacter.checkIfBoxed(player);
|
||||||
//player.updateBoxStatus(PlayerCharacter.checkIfBoxed(player));
|
|
||||||
player.setDirtyLoad(true);
|
player.setDirtyLoad(true);
|
||||||
updateStaticList(player, origin);
|
updateStaticList(player, origin);
|
||||||
updateMobileList(player, origin);
|
updateMobileList(player, origin);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class SetAdminRuneCmd extends AbstractDevCmd {
|
|||||||
if (worked) {
|
if (worked) {
|
||||||
ChatManager.chatSayInfo(pcSender,
|
ChatManager.chatSayInfo(pcSender,
|
||||||
"rune of ID " + runeID + " removed");
|
"rune of ID " + runeID + " removed");
|
||||||
InterestManager.reloadCharacter(pcSender, false);
|
InterestManager.reloadCharacter(pcSender);
|
||||||
} else
|
} else
|
||||||
throwbackError(pcSender, "Failed to remove the rune of type "
|
throwbackError(pcSender, "Failed to remove the rune of type "
|
||||||
+ runeID);
|
+ runeID);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class SetBaseClassCmd extends AbstractDevCmd {
|
|||||||
this.setTarget(pc); //for logging
|
this.setTarget(pc); //for logging
|
||||||
ChatManager.chatSayInfo(pc,
|
ChatManager.chatSayInfo(pc,
|
||||||
"BaseClass changed to " + classID);
|
"BaseClass changed to " + classID);
|
||||||
InterestManager.reloadCharacter(pc, false);
|
InterestManager.reloadCharacter(pc);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class SetLevelCmd extends AbstractDevCmd {
|
|||||||
tar.setLevel((short) level);
|
tar.setLevel((short) level);
|
||||||
this.setTarget(tar); //for logging
|
this.setTarget(tar); //for logging
|
||||||
ChatManager.chatSayInfo(pc, tar.getFirstName() + " level changed to " + level);
|
ChatManager.chatSayInfo(pc, tar.getFirstName() + " level changed to " + level);
|
||||||
InterestManager.reloadCharacter(tar, false);
|
InterestManager.reloadCharacter(tar);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class SetPromotionClassCmd extends AbstractDevCmd {
|
|||||||
pc.setPromotionClass(classID);
|
pc.setPromotionClass(classID);
|
||||||
ChatManager.chatSayInfo(pc,
|
ChatManager.chatSayInfo(pc,
|
||||||
"PromotionClass changed to " + classID);
|
"PromotionClass changed to " + classID);
|
||||||
InterestManager.reloadCharacter(pc, false);
|
InterestManager.reloadCharacter(pc);
|
||||||
this.setTarget(pc); //for logging
|
this.setTarget(pc); //for logging
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class SetRuneCmd extends AbstractDevCmd {
|
|||||||
if (worked) {
|
if (worked) {
|
||||||
ChatManager.chatSayInfo(pcSender,
|
ChatManager.chatSayInfo(pcSender,
|
||||||
"rune of ID " + runeID + " removed");
|
"rune of ID " + runeID + " removed");
|
||||||
InterestManager.reloadCharacter(pcSender, false);
|
InterestManager.reloadCharacter(pcSender);
|
||||||
} else
|
} else
|
||||||
throwbackError(pcSender, "Failed to remove the rune of type "
|
throwbackError(pcSender, "Failed to remove the rune of type "
|
||||||
+ runeID);
|
+ runeID);
|
||||||
|
|||||||
@@ -5270,14 +5270,11 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
public static void updateLoadedPlayers(PlayerCharacter pc){
|
public static void updateLoadedPlayers(PlayerCharacter pc){
|
||||||
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(pc.loc,MBServerStatics.CHARACTER_LOAD_RANGE,MBServerStatics.MASK_PLAYER);
|
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(pc.loc,MBServerStatics.CHARACTER_LOAD_RANGE,MBServerStatics.MASK_PLAYER);
|
||||||
for(AbstractWorldObject awo : inRange){
|
for(AbstractWorldObject awo : inRange){
|
||||||
if(pc.loadedObjects.contains(awo))
|
|
||||||
continue;
|
|
||||||
PlayerCharacter toLoad = (PlayerCharacter)awo;
|
PlayerCharacter toLoad = (PlayerCharacter)awo;
|
||||||
if(toLoad.hidden > pc.seeInvis)
|
if(toLoad.hidden > pc.seeInvis)
|
||||||
continue;
|
continue;
|
||||||
LoadCharacterMsg lcm = new LoadCharacterMsg(toLoad, PlayerCharacter.hideNonAscii());
|
LoadCharacterMsg lcm = new LoadCharacterMsg(toLoad, PlayerCharacter.hideNonAscii());
|
||||||
pc.getClientConnection().sendMsg(lcm);
|
pc.getClientConnection().sendMsg(lcm);
|
||||||
pc.loadedObjects.add(toLoad);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static boolean checkIfBoxed(PlayerCharacter player){
|
public static boolean checkIfBoxed(PlayerCharacter player){
|
||||||
|
|||||||
Reference in New Issue
Block a user