mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
dont save full serverclass in entity, only store classid
This commit is contained in:
parent
b6f7ebb15a
commit
91e5b82f2f
5 changed files with 64 additions and 48 deletions
|
|
@ -13,7 +13,7 @@ use std::ops::Deref;
|
|||
use std::rc::Rc;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(BitRead, Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
|
||||
#[derive(BitRead, Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd, Display)]
|
||||
pub struct ClassId(u16);
|
||||
|
||||
impl FromStr for ClassId {
|
||||
|
|
@ -30,6 +30,12 @@ impl From<u16> for ClassId {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<ClassId> for usize {
|
||||
fn from(class: ClassId) -> Self {
|
||||
class.0 as usize
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(BitRead, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, Clone, Display)]
|
||||
pub struct ServerClassName(Rc<String>);
|
||||
|
||||
|
|
@ -196,7 +202,7 @@ pub struct SendTable {
|
|||
pub struct DataTablePacket {
|
||||
pub tick: u32,
|
||||
pub tables: Vec<SendTable>,
|
||||
pub server_classes: Vec<Rc<ServerClass>>,
|
||||
pub server_classes: Vec<ServerClass>,
|
||||
}
|
||||
|
||||
impl Parse for DataTablePacket {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue