forked from MagicBane/Server
/zerg command
This commit is contained in:
@@ -89,7 +89,7 @@ public enum ChatManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(msg.getMessage().equalsIgnoreCase("/zerg")){
|
if(msg.getMessage().equalsIgnoreCase("./zerg")){
|
||||||
ZergManager.PrintDetailsToClient(pc);
|
ZergManager.PrintDetailsToClient(pc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import engine.InterestManagement.WorldGrid;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class ZergManager {
|
public class ZergManager {
|
||||||
|
|
||||||
public static float getCurrentMultiplier(int count, int maxCount){
|
public static float getCurrentMultiplier(int count, int maxCount){
|
||||||
@@ -210,8 +212,8 @@ public class ZergManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void PrintDetailsToClient(PlayerCharacter pc){
|
public static void PrintDetailsToClient(PlayerCharacter pc){
|
||||||
String outstring = "ZERG MANAGER DETAILS FOR: " + pc.getFirstName();
|
|
||||||
String newline = "\r\n ";
|
String newline = "\r\n ";
|
||||||
|
String outstring = newline + "ZERG MANAGER DETAILS FOR: " + pc.getFirstName() + newline;
|
||||||
Mine attended = null;
|
Mine attended = null;
|
||||||
for(Mine mine : Mine.getMines()){
|
for(Mine mine : Mine.getMines()){
|
||||||
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
|
Building tower = BuildingManager.getBuilding(mine.getBuildingID());
|
||||||
@@ -225,24 +227,47 @@ public class ZergManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(attended != null){
|
if(attended != null){
|
||||||
outstring += "Mine Cap: " + attended.capSize;
|
outstring += "Mine Cap: " + attended.capSize + newline;
|
||||||
Building tower = BuildingManager.getBuilding(attended.getBuildingID());
|
Building tower = BuildingManager.getBuilding(attended.getBuildingID());
|
||||||
if(tower == null)
|
if(tower == null)
|
||||||
return;
|
return;
|
||||||
int count = 1;
|
|
||||||
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(tower.loc,MBServerStatics.CHARACTER_LOAD_RANGE * 3,MBServerStatics.MASK_PLAYER)){
|
int count = 0;
|
||||||
PlayerCharacter player = (PlayerCharacter)awo;
|
ArrayList<PlayerCharacter> stillPresent = new ArrayList<>();
|
||||||
if(player.equals(pc))
|
ArrayList<PlayerCharacter> gonePlayers = new ArrayList<>();
|
||||||
continue;
|
for(Integer countedID : attended.mineAttendees.keySet()){
|
||||||
if(player.guild.getNation().equals(pc.guild.getNation()))
|
PlayerCharacter counted = PlayerCharacter.getFromCache(countedID);
|
||||||
|
if(counted != null){
|
||||||
|
if(counted.guild.getNation().equals(pc.guild.getNation())) {
|
||||||
|
Long timeGone = System.currentTimeMillis() - attended.mineAttendees.get(countedID);
|
||||||
|
if(timeGone > 5000){
|
||||||
|
//outstring += counted.getFirstName() + " GONE FOR: " + timeGone/1000 + " SECONDS" + newline;
|
||||||
|
gonePlayers.add(counted);
|
||||||
|
}else{
|
||||||
|
//outstring += counted.getFirstName() + " STILL PRESENT" + newline;
|
||||||
|
stillPresent.add(counted);
|
||||||
|
}
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
outstring += "Nation Members Present " + count;
|
}
|
||||||
|
}
|
||||||
|
outstring += newline + "TOTAL NATION MEMBERS COUNTED: " + count + newline;
|
||||||
|
outstring += newline + "PLAYERS PRESENT:" + newline;
|
||||||
|
for(PlayerCharacter present : stillPresent){
|
||||||
|
outstring += present.getFirstName() + newline;
|
||||||
|
}
|
||||||
|
outstring += newline + "PLAYERS GONE:" + newline;
|
||||||
|
for(PlayerCharacter gone : gonePlayers){
|
||||||
|
Long timeGone = System.currentTimeMillis() - attended.mineAttendees.get(gone.getObjectUUID());
|
||||||
|
if(timeGone > 5000) {
|
||||||
|
outstring += gone.getFirstName() + " GONE FOR: " + timeGone / 1000 + " SECONDS" + newline;
|
||||||
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
outstring += "Mine: Not Within Mine Distance";
|
outstring += "Mine: Not Within Mine Distance" + newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
outstring += "Zerg Multiplier: " + pc.ZergMultiplier;
|
outstring += newline + "Zerg Multiplier: " + pc.ZergMultiplier + newline;
|
||||||
|
|
||||||
ChatManager.chatSystemInfo(pc, outstring);
|
ChatManager.chatSystemInfo(pc, outstring);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user