Added ConnectionEvent
This commit is contained in:
@@ -63,7 +63,7 @@ public class RemoteProcess extends BaseProcessor{
|
|||||||
classes = new Seq<>();
|
classes = new Seq<>();
|
||||||
|
|
||||||
Seq<Smethod> orderedElements = elements.copy();
|
Seq<Smethod> orderedElements = elements.copy();
|
||||||
orderedElements.sortComparing(Object::toString);
|
orderedElements.sort((a, b) -> -a.toString().compareTo(b.toString()));
|
||||||
|
|
||||||
//create methods
|
//create methods
|
||||||
for(Smethod element : orderedElements){
|
for(Smethod element : orderedElements){
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ public class NetServer implements ApplicationListener{
|
|||||||
public NetServer(){
|
public NetServer(){
|
||||||
|
|
||||||
net.handleServer(Connect.class, (con, connect) -> {
|
net.handleServer(Connect.class, (con, connect) -> {
|
||||||
|
Events.fire(new ConnectionEvent(con));
|
||||||
|
|
||||||
if(admins.isIPBanned(connect.addressTCP) || admins.isSubnetBanned(connect.addressTCP)){
|
if(admins.isIPBanned(connect.addressTCP) || admins.isSubnetBanned(connect.addressTCP)){
|
||||||
con.kick(KickReason.banned);
|
con.kick(KickReason.banned);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.*/
|
/** Called after connecting; when a player receives world data and is ready to play.*/
|
||||||
public static class PlayerJoin{
|
public static class PlayerJoin{
|
||||||
public final Player player;
|
public final Player player;
|
||||||
|
|||||||
Reference in New Issue
Block a user