Added unit tests

This commit is contained in:
Anuken
2018-10-03 20:58:35 -04:00
parent 34715b1e06
commit c82fd9ead5
11 changed files with 233 additions and 88 deletions

View File

@@ -1,7 +1,6 @@
package io.anuke.mindustry.net;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.IntMap;
import com.badlogic.gdx.utils.ObjectMap;
import io.anuke.annotations.Annotations.Serialize;
import io.anuke.ucore.core.Settings;
@@ -16,8 +15,6 @@ public class Administration{
private ObjectMap<String, PlayerInfo> playerInfo = new ObjectMap<>();
/**Maps UUIDs to trace infos. This is wiped when a player logs off.*/
private ObjectMap<String, TraceInfo> traceInfo = new ObjectMap<>();
/** Maps packed coordinates to logs for that coordinate*/
private IntMap<Array<EditLog>> editLogs = new IntMap<>();
private Array<String> bannedIPs = new Array<>();
public Administration(){
@@ -46,16 +43,6 @@ public class Administration{
Settings.save();
}
public void setAntiGriefParams(int maxBreak, int cooldown){
Settings.putInt("antigrief-max", maxBreak);
Settings.putInt("antigrief-cooldown", cooldown);
Settings.save();
}
public IntMap<Array<EditLog>> getEditLogs(){
return editLogs;
}
/**
* Call when a player joins to update their information here.
*/

View File

@@ -1,21 +0,0 @@
package io.anuke.mindustry.net;
import io.anuke.mindustry.world.Block;
public class EditLog{
public String playername;
public Block block;
public int rotation;
public EditAction action;
EditLog(String playername, Block block, int rotation, EditAction action){
this.playername = playername;
this.block = block;
this.rotation = rotation;
this.action = action;
}
public enum EditAction{
PLACE, BREAK
}
}