Added ConnectionEvent
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user