- add: utils library
- add: packet-service to handle game client packets - fix: health check for database-service - fix: health check for auth-service
This commit is contained in:
38
packet-service/src/types.rs
Normal file
38
packet-service/src/types.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
use std::time::{Duration};
|
||||
use bincode::{Encode, Decode};
|
||||
|
||||
// `HotbarItem` structure converted to Rust.
|
||||
#[derive(Clone, Copy)]
|
||||
struct HotbarItem {
|
||||
data: HotbarItemData,
|
||||
}
|
||||
|
||||
// Definition for `data` union in `HotbarItem`.
|
||||
#[derive(Clone, Copy)]
|
||||
union HotbarItemData {
|
||||
item: u16,
|
||||
components: HotbarItemComponents,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode)]
|
||||
#[repr(C)]
|
||||
struct HotbarItemComponents {
|
||||
type_: u8,
|
||||
slot_id: u16,
|
||||
}
|
||||
|
||||
// `Skill` structure converted to Rust.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode)]
|
||||
struct Skill {
|
||||
id: u16,
|
||||
level: u8,
|
||||
}
|
||||
|
||||
// `StatusEffect` structure converted to Rust.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Encode, Decode)]
|
||||
struct StatusEffect {
|
||||
expired: Duration,
|
||||
value: u16,
|
||||
unknown: u16,
|
||||
dt: Duration,
|
||||
}
|
||||
Reference in New Issue
Block a user