Implemented standalone server, fixed breaking bugs

This commit is contained in:
Anuken
2018-01-28 01:21:33 -05:00
parent 35b6b41f24
commit 5cba3050b9
17 changed files with 218 additions and 32 deletions

View File

@@ -15,6 +15,9 @@ import io.anuke.ucore.function.Consumer;
import java.io.IOException;
import static io.anuke.mindustry.Vars.headless;
import static io.anuke.mindustry.Vars.ui;
public class Net{
public static final int version = 13;
@@ -29,6 +32,15 @@ public class Net{
private static IntMap<StreamBuilder> streams = new IntMap<>();
/**Display a network error.*/
public static void showError(String text){
if(!headless){
ui.showError(text);
}else{
UCore.log(text);
}
}
/**Sets the client loaded status, or whether it will recieve normal packets from the server.*/
public static void setClientLoaded(boolean loaded){
clientLoaded = loaded;

View File

@@ -266,7 +266,7 @@ public class NetworkIO {
world.loadMap(world.maps().getMap(mapid), seed);
renderer.clearTiles();
player.set(world.getCore().worldx(), world.getCore().worldy());
player.set(world.getSpawnX(), world.getSpawnY());
for(int x = 0; x < world.width(); x ++){
for(int y = 0; y < world.height(); y ++){