Browse Source

HZ related stuff

lakebane
FatBoy-DOTC 3 weeks ago
parent
commit
873e56f076
  1. 11
      src/engine/gameManager/HotzoneManager.java

11
src/engine/gameManager/HotzoneManager.java

@ -2,6 +2,7 @@ package engine.gameManager;
import engine.Enum; import engine.Enum;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.math.Vector3fImmutable;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.HotzoneChangeMsg; import engine.net.client.msg.HotzoneChangeMsg;
@ -183,16 +184,14 @@ public class HotzoneManager {
Guild nation = pc.guild.getNation(); Guild nation = pc.guild.getNation();
if(HotzoneManager.playersPresent.containsKey(nation)){ if(HotzoneManager.playersPresent.containsKey(nation)){
//nation already here, add to list //nation already here, add to list
if(!HotzoneManager.playersPresent.get(nation).contains(pc)){ if(HotzoneManager.playersPresent.get(nation).size() >= 5 && !HotzoneManager.playersPresent.get(nation).contains(pc)){
if(HotzoneManager.playersPresent.get(nation).size() >= 5){
//more than 5, boot player out //more than 5, boot player out
pc.setLoc(pc.bindLoc); MovementManager.translocate(pc, Vector3fImmutable.getRandomPointOnCircle(ZoneManager.getZoneByUUID(656).getLoc(),30f),Regions.GetRegionForTeleport(ZoneManager.getZoneByUUID(656).getLoc()));
pc.teleport(pc.bindLoc); }
}else { if(!HotzoneManager.playersPresent.get(nation).contains(pc)){
//less than 5, allow player in //less than 5, allow player in
HotzoneManager.playersPresent.get(nation).add(pc); HotzoneManager.playersPresent.get(nation).add(pc);
} }
}
}else{ }else{
ArrayList<PlayerCharacter> newList = new ArrayList<>(); ArrayList<PlayerCharacter> newList = new ArrayList<>();
newList.add(pc); newList.add(pc);

Loading…
Cancel
Save