More testing

This commit is contained in:
Anuken
2019-09-25 16:23:37 -04:00
parent 289ab44ed5
commit 48bf88f99d
2 changed files with 9 additions and 6 deletions

View File

@ -72,6 +72,11 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
private Vector2 movement = new Vector2();
private boolean moved;
{
RuntimeException e = new RuntimeException("player " + name);
Core.app.post(e::printStackTrace);
}
//endregion
//region unit and event overrides, utility methods
@ -254,7 +259,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
@Override
public String toString(){
return "Player{" + id + ", mech=" + mech.name + ", local=" + isLocal + ", " + x + ", " + y + "}";
return "Player{" + name + ", mech=" + mech.name + ", id=" + id + ", local=" + isLocal + ", " + x + ", " + y + "}";
}
@Override

View File

@ -799,13 +799,13 @@ public class ServerControl implements ApplicationListener{
private void play(boolean wait, Runnable run){
inExtraRound = true;
Runnable r = () -> {
Array<Player> players = new Array<>();
Log.info("Players: " + playerGroup.all());
for(Player p : playerGroup.all()){
players.add(p);
p.setDead(true);
}
Log.info("Group contents:\n{0}\n{1}\n\n", players, playerGroup.all());
logic.reset();
@ -814,11 +814,9 @@ public class ServerControl implements ApplicationListener{
logic.play();
state.rules = world.getMap().applyRules(lastMode);
Log.info("Player array: " + players);
Log.info("Group contents post:\n{0}\n{1}\n\n", players, playerGroup.all());
for(Player p : players){
Log.info("Iterate thorugh: " + p);
p.reset();
if(state.rules.pvp){
p.setTeam(netServer.assignTeam(p, new ArrayIterable<>(players)));