one painful merge later
This commit is contained in:
@@ -3,6 +3,7 @@ package io.anuke.mindustry.server;
|
||||
import com.badlogic.gdx.ApplicationLogger;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.IntMap;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.game.Difficulty;
|
||||
@@ -16,6 +17,9 @@ import io.anuke.mindustry.net.Administration.PlayerInfo;
|
||||
import io.anuke.mindustry.net.Packets.ChatPacket;
|
||||
import io.anuke.mindustry.net.Packets.KickReason;
|
||||
import io.anuke.mindustry.ui.fragments.DebugFragment;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.io.Map;
|
||||
import io.anuke.mindustry.world.Build;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.modules.Module;
|
||||
@@ -715,6 +719,28 @@ public class ServerControl extends Module {
|
||||
info("Nobody with that name could be found.");
|
||||
}
|
||||
});
|
||||
|
||||
handler.register("rollback", "<amount>", "Rollback the block edits in the world", arg -> {
|
||||
if(!state.is(State.playing)) {
|
||||
err("Open the server first.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!Strings.canParsePostiveInt(arg[0])) {
|
||||
err("Please input a valid, positive, number of times to rollback");
|
||||
return;
|
||||
}
|
||||
|
||||
int rollbackTimes = Integer.valueOf(arg[0]);
|
||||
IntMap<Array<EditLog>> editLogs = netServer.admins.getEditLogs();
|
||||
if(editLogs.size == 0){
|
||||
err("Nothing to rollback!");
|
||||
return;
|
||||
}
|
||||
|
||||
netServer.admins.rollbackWorld(rollbackTimes);
|
||||
info("Rollback done!");
|
||||
});
|
||||
}
|
||||
|
||||
private void readCommands(){
|
||||
|
||||
Reference in New Issue
Block a user