now with waifus

This commit is contained in:
Anuken 2018-08-30 21:39:27 -04:00
parent d4435f980c
commit dda3afe9fa
5 changed files with 14 additions and 16 deletions

View File

@ -229,6 +229,7 @@ project(":kryonet") {
dependencies {
compile project(":core")
compile 'com.github.crykn:kryonet:2.22.1'
compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893'
}
}

View File

@ -351,7 +351,7 @@ public class Control extends Module{
throw new RuntimeException(error);
}
if(debug && Inputs.keyTap("console")){
if(debug && Inputs.keyTap(io.anuke.ucore.input.Input.GRAVE)){
console = !console;
}

View File

@ -38,8 +38,7 @@ public class DefaultKeybinds{
"chat", Input.ENTER,
"chat_history_prev", Input.UP,
"chat_history_next", Input.DOWN,
"chat_scroll", new Axis(Input.SCROLL),
"console", Input.GRAVE
"chat_scroll", new Axis(Input.SCROLL)
);
KeyBinds.defaultSection(section, DeviceType.controller,

View File

@ -2,12 +2,14 @@ package io.anuke.kryonet;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.utils.Array;
import com.dosse.upnp.UPnP;
import com.esotericsoftware.kryonet.Connection;
import com.esotericsoftware.kryonet.FrameworkMessage;
import com.esotericsoftware.kryonet.Listener;
import com.esotericsoftware.kryonet.Listener.LagListener;
import com.esotericsoftware.kryonet.Server;
import com.esotericsoftware.kryonet.util.InputStreamSender;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.Net.SendMode;
import io.anuke.mindustry.net.Net.ServerProvider;
@ -129,6 +131,15 @@ public class KryoServer implements ServerProvider {
@Override
public void host(int port) throws IOException {
//attempt to open default ports if they're not already open
//this only opens the default port due to security concerns (?)
if(port == Vars.port){
async(() -> {
if(!UPnP.isMappedTCP(port)) UPnP.openPortTCP(port);
if(!UPnP.isMappedUDP(port)) UPnP.openPortUDP(port);
});
}
lastconnection = 0;
connections.clear();
missing.clear();

View File

@ -326,19 +326,6 @@ public class ServerControl extends Module{
info("Core filled.");
});
handler.register("friendlyfire", "<on/off>", "Enable or disable friendly fire.", arg -> {
String s = arg[0];
if(s.equalsIgnoreCase("on")){
state.friendlyFire = true;
info("Friendly fire enabled.");
}else if(s.equalsIgnoreCase("off")){
state.friendlyFire = false;
info("Friendly fire disabled.");
}else{
err("Incorrect command usage.");
}
});
handler.register("crashreport", "<on/off>", "Disables or enables automatic crash reporting", arg -> {
boolean value = arg[0].equalsIgnoreCase("on");
Settings.putBool("crashreport", value);