mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-16 06:12:19 -08:00
Fixed ghost connections
This commit is contained in:
parent
e40e5e6a99
commit
f474d2c834
2 changed files with 9 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue