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