Add event PlayerConnectionConfirmed (#6274)
This commit is contained in:
committed by
GitHub
parent
1a6d2e9dd6
commit
d16739f86a
@@ -757,6 +757,8 @@ public class NetServer implements ApplicationListener{
|
|||||||
|
|
||||||
player.add();
|
player.add();
|
||||||
|
|
||||||
|
Events.fire(new PlayerConnectionConfirmed(player));
|
||||||
|
|
||||||
if(player.con == null || player.con.hasConnected) return;
|
if(player.con == null || player.con.hasConnected) return;
|
||||||
|
|
||||||
player.con.hasConnected = true;
|
player.con.hasConnected = true;
|
||||||
|
|||||||
@@ -480,7 +480,19 @@ public class EventType{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called after connecting; when a player receives world data and is ready to play.*/
|
/**
|
||||||
|
* Called after player confirmed it has received world data and is ready to play.
|
||||||
|
* Note that if this is the first world receival, then player.con.hasConnected is false.
|
||||||
|
*/
|
||||||
|
public static class PlayerConnectionConfirmed{
|
||||||
|
public final Player player;
|
||||||
|
|
||||||
|
public PlayerConnectionConfirmed(Player player){
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called after connecting; when a player receives world data and is ready to play. Fired only once, after initial connection. */
|
||||||
public static class PlayerJoin{
|
public static class PlayerJoin{
|
||||||
public final Player player;
|
public final Player player;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user