You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
510 B
Rust

use crate::plugin::{Events, LOG_INFO};
mod plugin;
struct Server;
impl Events for Server {
fn new() -> Self {
Server
}
fn on_any(&mut self, event: &str) {
plugin::log_message(LOG_INFO, format!("Event triggered: {}", event).as_str());
}
fn on_server_init(&mut self) {
plugin::log_message(plugin::LOG_WARN, "Hello from Rust :3");
}
fn on_server_post_init(&mut self) {
plugin::log_message(plugin::LOG_FATAL, "Hi!?");
}
}
use_events!(Server);