2024-12-05 11:16:40 -05:00
|
|
|
#![deny(clippy::unwrap_in_result)]
|
2024-12-01 20:50:11 -05:00
|
|
|
use anyhow::Result;
|
2024-12-05 01:33:44 -06:00
|
|
|
use log::LevelFilter;
|
2024-12-06 15:54:31 -05:00
|
|
|
use plugin_api::plugin_imports::*;
|
|
|
|
use plugin_api::{get_plugin, PluginManager};
|
2024-12-01 16:02:06 -05:00
|
|
|
|
|
|
|
pub mod core;
|
2024-12-02 11:51:39 -06:00
|
|
|
pub mod utils;
|
2024-12-01 16:02:06 -05:00
|
|
|
|
2024-12-02 11:51:39 -06:00
|
|
|
use utils::{logger::LOGGER, splash::print_splash};
|
|
|
|
|
2024-12-01 16:02:06 -05:00
|
|
|
#[tokio::main]
|
2024-12-01 20:50:11 -05:00
|
|
|
async fn main() -> Result<()> {
|
2024-12-06 15:54:31 -05:00
|
|
|
// Load all plugins
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-05 11:16:40 -05:00
|
|
|
log::set_logger(&*LOGGER).ok();
|
2024-12-06 15:54:31 -05:00
|
|
|
log::set_max_level(LevelFilter::Off);
|
2024-12-01 16:02:06 -05:00
|
|
|
|
2024-12-01 23:52:12 -06:00
|
|
|
print_splash();
|
2024-12-06 15:54:31 -05:00
|
|
|
let mut plugin_manager = PluginManager::new();
|
|
|
|
let plugins = plugin_manager.load_all();
|
|
|
|
println!("Plugins loaded: {:?}", plugins);
|
|
|
|
|
|
|
|
// Get the player plugin
|
|
|
|
let player_lib = get_plugin!(player_lib, plugins);
|
|
|
|
player_lib.test();
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-05 01:33:44 -06:00
|
|
|
LOGGER.write_to_stdout();
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-06 16:57:52 -05:00
|
|
|
let shell_thread = tokio::task::spawn(async { core::repl::exec::handle_repl().await });
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-05 01:33:44 -06:00
|
|
|
core::init_renderer()?;
|
2024-12-06 16:57:52 -05:00
|
|
|
shell_thread.await??;
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2024-12-01 16:02:06 -05:00
|
|
|
Ok(())
|
|
|
|
}
|