Auto-play server sectors / Difficulty decrease / Improved d/c messages
This commit is contained in:
@@ -10,6 +10,8 @@ import com.badlogic.gdx.utils.IntMap;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.net.Packets.KickReason;
|
||||
import io.anuke.mindustry.net.Packets.StreamBegin;
|
||||
import io.anuke.mindustry.net.Packets.StreamChunk;
|
||||
import io.anuke.mindustry.net.Streamable.StreamBuilder;
|
||||
@@ -88,7 +90,7 @@ public class Net{
|
||||
}
|
||||
|
||||
/**
|
||||
* Host a server at an address
|
||||
* Host a server at an address.
|
||||
*/
|
||||
public static void host(int port) throws IOException{
|
||||
serverProvider.host(port);
|
||||
@@ -102,6 +104,10 @@ public class Net{
|
||||
* Closes the server.
|
||||
*/
|
||||
public static void closeServer(){
|
||||
for(NetConnection con : getConnections()){
|
||||
Call.onKick(con.id, KickReason.serverClose);
|
||||
}
|
||||
|
||||
serverProvider.close();
|
||||
server = false;
|
||||
active = false;
|
||||
|
||||
@@ -10,6 +10,7 @@ import io.anuke.mindustry.game.Version;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.io.IOUtils;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -22,16 +23,27 @@ import static io.anuke.mindustry.Vars.world;
|
||||
public class Packets{
|
||||
|
||||
public enum KickReason{
|
||||
kick, invalidPassword, clientOutdated, serverOutdated, banned, gameover(true), recentKick, nameInUse, idInUse, fastShoot, nameEmpty, customClient, sectorComplete(true);
|
||||
kick, clientOutdated, serverOutdated, banned, gameover(true), recentKick,
|
||||
nameInUse, idInUse, nameEmpty, customClient, sectorComplete, serverClose;
|
||||
|
||||
public final boolean quiet;
|
||||
|
||||
KickReason(){
|
||||
quiet = false;
|
||||
this(false);
|
||||
}
|
||||
|
||||
KickReason(boolean quiet){
|
||||
this.quiet = quiet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return Bundles.get("text.server.kicked." + name());
|
||||
}
|
||||
|
||||
public String extraText(){
|
||||
return Bundles.getOrNull("text.server.kicked." + name() + ".text");
|
||||
}
|
||||
}
|
||||
|
||||
public enum AdminAction{
|
||||
|
||||
Reference in New Issue
Block a user