Browse Source

PVE flag

lakebane
FatBoy-DOTC 4 weeks ago
parent
commit
fed9ba4240
  1. 4
      src/engine/InterestManagement/InterestManager.java
  2. 2
      src/engine/devcmd/cmds/SetAdminRuneCmd.java
  3. 2
      src/engine/devcmd/cmds/SetBaseClassCmd.java
  4. 2
      src/engine/devcmd/cmds/SetLevelCmd.java
  5. 2
      src/engine/devcmd/cmds/SetPromotionClassCmd.java
  6. 2
      src/engine/devcmd/cmds/SetRuneCmd.java
  7. 23
      src/engine/objects/PlayerCharacter.java

4
src/engine/InterestManagement/InterestManager.java

@ -106,7 +106,7 @@ public enum InterestManager implements Runnable {
origin.sendMsg(moveMsg); origin.sendMsg(moveMsg);
} }
public static void reloadCharacter(AbstractCharacter absChar) { public static void reloadCharacter(AbstractCharacter absChar, boolean fromBox) {
UnloadObjectsMsg uom = new UnloadObjectsMsg(); UnloadObjectsMsg uom = new UnloadObjectsMsg();
uom.addObject(absChar); uom.addObject(absChar);
@ -132,7 +132,7 @@ public enum InterestManager implements Runnable {
if (cc == null) if (cc == null)
continue; continue;
if (pcc.getObjectUUID() == absChar.getObjectUUID()) if (!fromBox && pcc.getObjectUUID() == absChar.getObjectUUID())
continue; continue;
else { else {

2
src/engine/devcmd/cmds/SetAdminRuneCmd.java

@ -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); InterestManager.reloadCharacter(pcSender, false);
} else } else
throwbackError(pcSender, "Failed to remove the rune of type " throwbackError(pcSender, "Failed to remove the rune of type "
+ runeID); + runeID);

2
src/engine/devcmd/cmds/SetBaseClassCmd.java

@ -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); InterestManager.reloadCharacter(pc, false);
} }

2
src/engine/devcmd/cmds/SetLevelCmd.java

@ -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); InterestManager.reloadCharacter(tar, false);
} }
@Override @Override

2
src/engine/devcmd/cmds/SetPromotionClassCmd.java

@ -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); InterestManager.reloadCharacter(pc, false);
this.setTarget(pc); //for logging this.setTarget(pc); //for logging

2
src/engine/devcmd/cmds/SetRuneCmd.java

@ -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); InterestManager.reloadCharacter(pcSender, false);
} else } else
throwbackError(pcSender, "Failed to remove the rune of type " throwbackError(pcSender, "Failed to remove the rune of type "
+ runeID); + runeID);

23
src/engine/objects/PlayerCharacter.java

@ -41,7 +41,6 @@ import engine.server.MBServerStatics;
import engine.server.login.LoginServer; import engine.server.login.LoginServer;
import engine.server.login.LoginServerMsgHandler; import engine.server.login.LoginServerMsgHandler;
import engine.server.world.WorldServer; import engine.server.world.WorldServer;
import engine.util.KeyCloneAudit;
import engine.util.MiscUtils; import engine.util.MiscUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -5202,12 +5201,14 @@ public class PlayerCharacter extends AbstractCharacter {
//PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); //PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
if(!this.title.equals(CharacterTitle.PVE)){ if(!this.title.equals(CharacterTitle.PVE)){
this.title = CharacterTitle.PVE; this.title = CharacterTitle.PVE;
InterestManager.forceLoad(this); InterestManager.setObjectDirty(this);
InterestManager.reloadCharacter(this, false);
} }
}else { }else {
if (!this.title.equals(CharacterTitle.NONE)) { if (!this.title.equals(CharacterTitle.NONE)) {
this.title = CharacterTitle.NONE; this.title = CharacterTitle.NONE;
InterestManager.forceLoad(this); InterestManager.setObjectDirty(this);
InterestManager.reloadCharacter(this, false);
} }
} }
} }
@ -5258,10 +5259,22 @@ public class PlayerCharacter extends AbstractCharacter {
valid = false; valid = false;
} }
if(valid) { if(valid) {
for (PlayerCharacter pc : sameMachine) for (PlayerCharacter pc : sameMachine) {
pc.isBoxed = true; pc.isBoxed = true;
if (!pc.title.equals(CharacterTitle.PVE)) {
pc.title = CharacterTitle.PVE;
InterestManager.setObjectDirty(pc);
InterestManager.reloadCharacter(pc, true);
pc.setDirtyLoad(true);
}
}
player.isBoxed = false; player.isBoxed = false;
if (!player.title.equals(CharacterTitle.NONE)) {
player.title = CharacterTitle.NONE;
InterestManager.setObjectDirty(player);
InterestManager.reloadCharacter(player, true);
player.setDirtyLoad(true);
}
if (player.containsEffect(1672601862)) { if (player.containsEffect(1672601862)) {
player.removeEffectBySource(EffectSourceType.DeathShroud, 41, false); player.removeEffectBySource(EffectSourceType.DeathShroud, 41, false);
} }

Loading…
Cancel
Save