File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
azalea-client/src/packet_handling Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -251,11 +251,18 @@ impl SendConfigurationEvent {
251251
252252pub fn handle_send_packet_event (
253253 mut send_packet_events : EventReader < SendConfigurationEvent > ,
254- mut query : Query < & mut RawConnection > ,
254+ mut query : Query < ( & mut RawConnection , Option < & InConfigurationState > ) > ,
255255) {
256256 for event in send_packet_events. read ( ) {
257- if let Ok ( raw_conn) = query. get_mut ( event. sent_by ) {
258- // debug!("Sending packet: {:?}", event.packet);
257+ if let Ok ( ( raw_conn, in_configuration_state) ) = query. get_mut ( event. sent_by ) {
258+ if in_configuration_state. is_none ( ) {
259+ error ! (
260+ "Tried to send a configuration packet {:?} while not in configuration state" ,
261+ event. packet
262+ ) ;
263+ continue ;
264+ }
265+ debug ! ( "Sending packet: {:?}" , event. packet) ;
259266 if let Err ( e) = raw_conn. write_packet ( event. packet . clone ( ) ) {
260267 error ! ( "Failed to send packet: {e}" ) ;
261268 }
You can’t perform that action at this time.
0 commit comments