aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-12-25 07:27:09 +0000
committermat <git@matdoes.dev>2024-12-25 07:27:09 +0000
commit8f0d0d92808286e92b7c8aea704be3c00f5afce4 (patch)
treefd3809cff3ae64f96fc75f54addb38306fbe77af /azalea-client/src
parent04eaa5c3d01a8f3a599a3a1abf7205eed80df4a2 (diff)
downloadazalea-drasl-8f0d0d92808286e92b7c8aea704be3c00f5afce4.tar.xz
close tcp connection on bot disconnect and add swarms to testbot cli
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/disconnect.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/azalea-client/src/disconnect.rs b/azalea-client/src/disconnect.rs
index ea8479d3..37bb37dd 100644
--- a/azalea-client/src/disconnect.rs
+++ b/azalea-client/src/disconnect.rs
@@ -48,8 +48,12 @@ pub fn remove_components_from_disconnected_players(
commands
.entity(*entity)
.remove::<JoinedClientBundle>()
+ // this makes it close the tcp connection
+ .remove::<RawConnection>()
// swarm detects when this tx gets dropped to fire SwarmEvent::Disconnect
.remove::<LocalPlayerEvents>();
+ // note that we don't remove the client from the ECS, so if they decide
+ // to reconnect they'll keep their state
}
}