Change invalid message in examples and cleanup

Updated changelog + Removed hello plugin from plugins folder
This commit is contained in:
ccgauche 2021-02-17 14:05:05 +01:00 committed by Marcel Märtens
parent 6c991cc2cd
commit 387daf8aea
6 changed files with 4 additions and 34 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Plugin can now retrieve data from ECS
- Added chat commands for inviting, kicking, leaving, and promoting in groups
- Aura system
- Campfire resting heal

Binary file not shown.

BIN
assets/plugins/plugin1.plugin.tar (Stored with Git LFS)

Binary file not shown.

View File

@ -76,8 +76,8 @@ pub use self::{
misc::Object,
ori::Ori,
phys::{
Collider, ForceUpdate, Gravity, Mass, PhysicsState, Pos, PreviousVelDtCache, Scale,
Sticky, Vel,
Collider, ForceUpdate, Gravity, Mass, PhysicsState, Pos, PreviousVelDtCache, Scale, Sticky,
Vel,
},
player::Player,
poise::{Poise, PoiseChange, PoiseSource, PoiseState},

View File

@ -1,28 +0,0 @@
fn raw_retreive_action(env: &EmitActionEnv, ptr: u32, len: u32) -> (u32, i32) {
let memory: &Memory = if let Some(e) = env.memory.get_ref() {
e
} else {
// This should not be possible but I prefer be safer!
tracing::error!("Can't get memory from: `{}` plugin", env.name);
return ();
};
let memory: MemoryView<u8> = memory.view();
let str_slice = &memory[ptr as usize..(ptr + len) as usize];
let bytes: Vec<u8> = str_slice.iter().map(|x| x.get()).collect();
let r = env.ecs.load(std::sync::atomic::Ordering::SeqCst);
if r == i32::MAX {
println!("No ECS availible 1");
return;
}
unsafe {
if let Some(t) = (r as *const World).as_ref() {
println!("We have a pointer there");
} else {
println!("No ECS availible 2");
}
}
}

View File

@ -24,7 +24,7 @@ pub fn on_command_testplugin(command: ChatCommandEvent) -> Result<Vec<String>, S
command
.player
.get_entity_health()
.expect("Can't get player name"),
.expect("Can't get player health"),
command.command_args
)])
}