Skip to content

Commit

Permalink
remove main from Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
catornot committed Oct 13, 2023
1 parent c3a74b8 commit 61ea5ba
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions rrplug_template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ impl Plugin for ExamplePlugin {
plugin_data.register_sq_functions(info_example);
}

fn main(&self) {}

fn on_engine_load(&self, engine: &EngineLoadType) {
let engine = match engine {
EngineLoadType::Engine(engine) => engine,
Expand Down Expand Up @@ -87,8 +85,6 @@ impl Plugin for BasicPlugin {
fn initialize(&mut self, plugin_data: &PluginData) {
log::info!("yay logging :D");
}

fn main(&self) {}
}

entry!(BasicPlugin);
Expand Down
6 changes: 0 additions & 6 deletions src/macros/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
/// fn new(_plugin_data: &PluginData) -> Self {
/// Self {}
/// }
///
/// fn main(&self) {}
/// }
///
/// entry!(BasicPlugin);
Expand Down Expand Up @@ -67,8 +65,6 @@ macro_rules! entry {
}

log::info!( "plugin static initialized : {}", PLUGIN.get().is_some() );

std::thread::spawn(move || PLUGIN.wait().main());
}

#[no_mangle]
Expand Down Expand Up @@ -250,8 +246,6 @@ mod test_entry {
fn new(_plugin_data: &PluginData) -> Self {
Self {}
}

fn main(&self) {}
}

entry!(Test);
Expand Down
5 changes: 0 additions & 5 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@ use crate::{

/// Trait for defining the callbacks and entry point of the plugin
///
/// also provides a thread to run code on (the main function)
///
/// it is unsafe to run any titanfall engine functions on it
pub trait Plugin: Any + Sync {
/// init function
///
/// [`PluginData`] can be used to register sqfunctions and get the northstar version
fn new(plugin_data: &PluginData) -> Self;

/// provided separate thread
fn main(&self);

/// called when a dll is loaded with winapi functions by the game (full paths are not provided)
///
/// only calls once for each unique dll
Expand Down

0 comments on commit 61ea5ba

Please sign in to comment.