new box flag system
parent
9032565220
commit
0f402ac0cc
|
|
@ -538,7 +538,7 @@ 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(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);
|
||||||
|
|
|
||||||
|
|
@ -5211,7 +5211,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if(this.timestamps.get("nextBoxCheck") < System.currentTimeMillis()) {
|
if(this.timestamps.get("nextBoxCheck") < System.currentTimeMillis()) {
|
||||||
updateBoxStatus(this.isBoxed,checkIfBoxed(this));
|
updateBoxStatus(checkIfBoxed(this));
|
||||||
this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000);
|
this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5270,22 +5270,21 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateBoxStatus(boolean oldValue, boolean newValue) {
|
public void updateBoxStatus(boolean newValue) {
|
||||||
if ((oldValue && newValue) || (!oldValue && !newValue))
|
|
||||||
return; // Status has not changed, no need to proceed
|
|
||||||
|
|
||||||
this.isBoxed = newValue; // Update the isBoxed status
|
this.isBoxed = newValue; // Update the isBoxed status
|
||||||
|
|
||||||
if (newValue) {
|
if(this.isBoxed) {
|
||||||
// Change from not boxed to boxed
|
if(!this.title.equals(CharacterTitle.PVE)){
|
||||||
this.title = CharacterTitle.PVE;//replace with effect bit or other visual system eventually
|
this.title = CharacterTitle.PVE;
|
||||||
} else {
|
this.getClientConnection().forceDisconnect();
|
||||||
// Change from boxed to not boxed
|
}
|
||||||
this.title = CharacterTitle.NONE;//replace with removing effect bit or other visual system eventually
|
}else{
|
||||||
|
if(!this.title.equals(CharacterTitle.NONE)){
|
||||||
|
this.title = CharacterTitle.NONE;
|
||||||
|
this.getClientConnection().forceDisconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//remove this after new visual system implemented
|
|
||||||
this.getClientConnection().forceDisconnect();
|
|
||||||
}
|
}
|
||||||
public static void unboxPlayer(PlayerCharacter player) {
|
public static void unboxPlayer(PlayerCharacter player) {
|
||||||
String machineID = player.getClientConnection().machineID;
|
String machineID = player.getClientConnection().machineID;
|
||||||
|
|
@ -5299,9 +5298,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||||
if(pc.equals(player))
|
if(pc.equals(player))
|
||||||
continue;
|
continue;
|
||||||
//pc.isBoxed = true;
|
//pc.isBoxed = true;
|
||||||
pc.updateBoxStatus(pc.isBoxed,true);
|
pc.updateBoxStatus(true);
|
||||||
}
|
}
|
||||||
player.updateBoxStatus(player.isBoxed,true);
|
player.updateBoxStatus(false);
|
||||||
}
|
}
|
||||||
public static boolean checkIfBoxed(PlayerCharacter player){
|
public static boolean checkIfBoxed(PlayerCharacter player){
|
||||||
if(ConfigManager.MB_WORLD_BOXLIMIT.getValue().equals("false")) {
|
if(ConfigManager.MB_WORLD_BOXLIMIT.getValue().equals("false")) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue