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

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