mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 23:07:33 +07:00
Fixed ghost connections
This commit is contained in:
@ -79,7 +79,9 @@ public class NetServer extends Module{
|
||||
|
||||
public NetServer(){
|
||||
Events.on(WorldLoadEvent.class, event -> {
|
||||
connections.clear();
|
||||
if(!headless){
|
||||
connections.clear();
|
||||
}
|
||||
});
|
||||
|
||||
Net.handleServer(Connect.class, (id, connect) -> {
|
||||
@ -596,6 +598,12 @@ public class NetServer extends Module{
|
||||
}
|
||||
|
||||
void sync(){
|
||||
for(Player player : playerGroup.all()){
|
||||
if(player.con == null || connections.get(player.con.id) == null){
|
||||
onDisconnect(player);
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
//iterate through each player
|
||||
|
@ -71,7 +71,6 @@ public class KryoServer implements ServerProvider {
|
||||
@Override
|
||||
public void disconnected (Connection connection) {
|
||||
KryoConnection k = getByKryoID(connection.getID());
|
||||
Log.info("&bLost kryonet connection {0}", connection.getID());
|
||||
if(k == null) return;
|
||||
|
||||
Disconnect c = new Disconnect();
|
||||
|
Reference in New Issue
Block a user