diff --git a/annotations/src/main/java/mindustry/annotations/remote/RemoteProcess.java b/annotations/src/main/java/mindustry/annotations/remote/RemoteProcess.java index 6be9c9c2d2..916bb3f278 100644 --- a/annotations/src/main/java/mindustry/annotations/remote/RemoteProcess.java +++ b/annotations/src/main/java/mindustry/annotations/remote/RemoteProcess.java @@ -63,7 +63,7 @@ public class RemoteProcess extends BaseProcessor{ classes = new Seq<>(); Seq orderedElements = elements.copy(); - orderedElements.sortComparing(Object::toString); + orderedElements.sort((a, b) -> -a.toString().compareTo(b.toString())); //create methods for(Smethod element : orderedElements){ diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 8747e8f00c..565134b9a9 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -81,6 +81,8 @@ public class NetServer implements ApplicationListener{ public NetServer(){ net.handleServer(Connect.class, (con, connect) -> { + Events.fire(new ConnectionEvent(con)); + if(admins.isIPBanned(connect.addressTCP) || admins.isSubnetBanned(connect.addressTCP)){ con.kick(KickReason.banned); } diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 73590f3679..46729b1baf 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -383,6 +383,15 @@ public class EventType{ } } + /** Called when a connection is established to a client. */ + public static class ConnectionEvent{ + public final NetConnection connection; + + public ConnectionEvent(NetConnection connection){ + this.connection = connection; + } + } + /** Called after connecting; when a player receives world data and is ready to play.*/ public static class PlayerJoin{ public final Player player;