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);
|
||||
|
||||
Reference in New Issue
Block a user