mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Implement vehicle validation before match
This commit is contained in:
1 parent
5d4123026d
commit
3d2b7078e4
27 files changed
+468
-54
No files matched your search
@@ -29,3 +29,4 @@ pub mod quest;
|
||||
pub mod score_multipliers;
|
||||
//pub use oj_rc_core::data::campaign;
|
||||
pub use oj_rc_core::data::crf;
|
||||
pub mod vehicle_validation;
|
||||
@@ -0,0 +1,22 @@
|
||||
// possible codes
|
||||
#[allow(dead_code)]
|
||||
#[repr(u8)]
|
||||
pub enum ValidateMachineResult {
|
||||
Invalid = 0,
|
||||
Ok = 1,
|
||||
NoWeapon = 2,
|
||||
NoMovement = 3,
|
||||
Sanctioned = 4,
|
||||
}
|
||||
|
||||
impl ValidateMachineResult {
|
||||
pub fn from_plugin(code: oj_rc_plugins::vehicle_validation::ValidationResultCode) -> Self {
|
||||
match code {
|
||||
oj_rc_plugins::vehicle_validation::ValidationResultCode::Invalid => Self::Invalid,
|
||||
oj_rc_plugins::vehicle_validation::ValidationResultCode::Ok => Self::Ok,
|
||||
oj_rc_plugins::vehicle_validation::ValidationResultCode::NoWeapon => Self::NoWeapon,
|
||||
oj_rc_plugins::vehicle_validation::ValidationResultCode::NoMovement => Self::NoMovement,
|
||||
oj_rc_plugins::vehicle_validation::ValidationResultCode::Sanctioned => Self::Sanctioned,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user