forked from MagicBane/Server
box limits resolved
This commit is contained in:
@@ -21,6 +21,7 @@ import engine.net.client.ClientConnection;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.util.BoxTracker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
@@ -141,6 +142,7 @@ public class VendorDialogMsg extends ClientNetMsg {
|
||||
playerCharacter.getTimestamps().put("lastBoxChange",System.currentTimeMillis() - 1000);
|
||||
|
||||
if(playerCharacter.getTimeStamp("lastBoxChange") + 30000L > System.currentTimeMillis()) {
|
||||
ChatManager.chatSystemInfo(playerCharacter, "You Must Wait To Promote Again.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,23 +153,12 @@ public class VendorDialogMsg extends ClientNetMsg {
|
||||
|
||||
playerCharacter.getTimestamps().put("lastBoxChange",System.currentTimeMillis());
|
||||
|
||||
playerCharacter.isBoxed = false;
|
||||
playerCharacter.removeEffectBySource(Enum.EffectSourceType.DeathShroud,50,true);
|
||||
ChatManager.chatSystemInfo(playerCharacter, "Promoting To Active Duty");
|
||||
ArrayList<PlayerCharacter> currentBoxes = new ArrayList<>();
|
||||
for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){
|
||||
if(pc.getClientConnection().machineID.equals(playerCharacter.getClientConnection().machineID) && pc.equals(playerCharacter) == false)
|
||||
currentBoxes.add(pc);
|
||||
for(PlayerCharacter newlyBoxed : BoxTracker.getPlayers(playerCharacter.getClientConnection().machineID)){
|
||||
newlyBoxed.isBoxed = true;
|
||||
}
|
||||
playerCharacter.isBoxed = false;
|
||||
playerCharacter.title = CharacterTitle.NONE;
|
||||
InterestManager.setObjectDirty(playerCharacter);
|
||||
playerCharacter.removeEffectBySource(Enum.EffectSourceType.DeathShroud,50,true);
|
||||
for(PlayerCharacter box : currentBoxes) {
|
||||
box.isBoxed = true;
|
||||
box.title = CharacterTitle.BOX;
|
||||
InterestManager.setObjectDirty(box);
|
||||
}
|
||||
}
|
||||
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
|
||||
@@ -4876,7 +4876,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
if (this.isBoxed) {
|
||||
if (this.title.equals(CharacterTitle.BOX) == false) {
|
||||
this.title = CharacterTitle.BOX;
|
||||
InterestManager.setObjectDirty(this);
|
||||
InterestManager.reloadCharacter(this,false);
|
||||
}
|
||||
if (this.containsEffect(1672601862) == false) {//Deathshroud
|
||||
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
||||
@@ -4884,7 +4884,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
} else {
|
||||
if (this.title.equals(CharacterTitle.NONE) == false) {
|
||||
this.title = CharacterTitle.NONE;
|
||||
InterestManager.setObjectDirty(this);
|
||||
InterestManager.reloadCharacter(this,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user