|
|
@ -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); |
|
|
|