Compare commits
3 commits
0a60484f17
...
27c2450f41
Author | SHA1 | Date | |
---|---|---|---|
27c2450f41 | |||
2e96d585a3 | |||
aa541e3bf9 |
3 changed files with 8 additions and 4 deletions
|
@ -4,7 +4,7 @@ description = "Stubs for creating a TES3MP server plugin"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = ["tes3mp", "morrowind"]
|
keywords = ["tes3mp", "morrowind"]
|
||||||
homepage = "https://git.cijber.net/teamnwah/tes3mp-rs"
|
homepage = "https://git.cijber.net/teamnwah/tes3mp-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["eater <=@eater.me>"]
|
authors = ["eater <=@eater.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
|
@ -11,7 +11,7 @@ cd crate-dir
|
||||||
git status || git init
|
git status || git init
|
||||||
mkdir extern
|
mkdir extern
|
||||||
git submodule add https://git.cijber.net/teamnwah/tes3mp-rs.git extern/tes3mp-rs
|
git submodule add https://git.cijber.net/teamnwah/tes3mp-rs.git extern/tes3mp-rs
|
||||||
ln -s extern/tes3mp-rs/tes3mp-plugin/src/plugin src/plugin
|
ln -s ../extern/tes3mp-rs/tes3mp-plugin/src/plugin src/plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
This will make the `plugin` like it's part of your crate, which allows us to export the C symbols
|
This will make the `plugin` like it's part of your crate, which allows us to export the C symbols
|
||||||
|
@ -47,4 +47,4 @@ impl Events for Server {
|
||||||
use_events!(Server);
|
use_events!(Server);
|
||||||
```
|
```
|
||||||
|
|
||||||
the `Events` trait has all the events that exist for the server, implement as needed
|
the `Events` trait has all the events that exist for the server, implement as needed
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::plugin::Events;
|
use crate::plugin::{Events, LOG_INFO};
|
||||||
|
|
||||||
mod plugin;
|
mod plugin;
|
||||||
|
|
||||||
|
@ -9,6 +9,10 @@ impl Events for Server {
|
||||||
Server
|
Server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_any(&self, event: &str) {
|
||||||
|
plugin::log_message(LOG_INFO, format!("Event triggered: {}", event).as_str());
|
||||||
|
}
|
||||||
|
|
||||||
fn on_server_init(&self) {
|
fn on_server_init(&self) {
|
||||||
plugin::log_message(plugin::LOG_WARN, "Hello from Rust :3");
|
plugin::log_message(plugin::LOG_WARN, "Hello from Rust :3");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue