Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rolleander committed Oct 17, 2023
1 parent 116fc2b commit 7d57be9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/broll/networklib/server/GameServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ public void connected(Connection c) {
public void disconnected(Connection c) {
Log.info(c + " disconnected from server");
NetworkConnection connection = (NetworkConnection) c;
connection.setActive(false);
passAllSites(connection, sites -> sites.forEach(site -> site.onDisconnect(connection)));
if(connection.isActive()){
connection.setActive(false);
passAllSites(connection, sites -> sites.forEach(site -> site.onDisconnect(connection)));
}
discardConnection(connection);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class NetworkConnection extends Connection {

private Player player;

private boolean active = true;
private boolean active = false;

public void setPlayer(Player player) {
this.player = player;
Expand Down

0 comments on commit 7d57be9

Please sign in to comment.