File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
azalea-client/src/plugins/packet/game Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,18 @@ impl SendPacketEvent {
63
63
64
64
pub fn handle_outgoing_packets (
65
65
mut send_packet_events : EventReader < SendPacketEvent > ,
66
- mut query : Query < & mut RawConnection > ,
66
+ mut query : Query < ( & mut RawConnection , Option < & InGameState > ) > ,
67
67
) {
68
68
for event in send_packet_events. read ( ) {
69
- if let Ok ( raw_connection) = query. get_mut ( event. sent_by ) {
69
+ if let Ok ( ( raw_connection, in_game_state) ) = query. get_mut ( event. sent_by ) {
70
+ if in_game_state. is_none ( ) {
71
+ error ! (
72
+ "Tried to send a game packet {:?} while not in game state" ,
73
+ event. packet
74
+ ) ;
75
+ continue ;
76
+ }
77
+
70
78
// debug!("Sending packet: {:?}", event.packet);
71
79
if let Err ( e) = raw_connection. write_packet ( event. packet . clone ( ) ) {
72
80
error ! ( "Failed to send packet: {e}" ) ;
Original file line number Diff line number Diff line change @@ -1503,10 +1503,12 @@ impl GamePacketHandler<'_> {
1503
1503
}
1504
1504
1505
1505
pub fn start_configuration ( & mut self , _p : & ClientboundStartConfiguration ) {
1506
+ debug ! ( "Got start configuration packet" ) ;
1507
+
1506
1508
as_system :: < ( Commands , EventWriter < _ > ) > ( self . ecs , |( mut commands, mut events) | {
1507
1509
events. send ( SendPacketEvent :: new (
1508
1510
self . player ,
1509
- ServerboundConfigurationAcknowledged { } ,
1511
+ ServerboundConfigurationAcknowledged ,
1510
1512
) ) ;
1511
1513
1512
1514
commands
You can’t perform that action at this time.
0 commit comments