use bevy::prelude::*;
use lightyear::prelude::ClientConnectEvent;

pub struct MyClientPlugin;

impl Plugin for MyClientPlugin {
    fn build(&self, app: &mut App) {
        app.add_systems(Update, handle_events);
    }
}

pub fn handle_events(
    mut er_client_events: EventReader<ClientConnectEvent>,
    // mut er_server_events: EventReader<ServerConnectEvent>,
) {
    for client_connect in er_client_events.read() {
        println!("Client Connect: {:?}", client_connect.client_id());
    }
    // for server_connect in er_server_events.read() {
    // println!("Server Connect: {:?}", server_connect);
    // }
}
