From e51dbbb7ce3e28b8956e3a8ab87ace3a61f92d97 Mon Sep 17 00:00:00 2001 From: Allusive <154700875+AllusiveWheat@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:52:26 -0700 Subject: [PATCH 1/4] fix szServerName and szClientName --- src/bindings/class_types/client.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bindings/class_types/client.rs b/src/bindings/class_types/client.rs index 9c86202..a6a6953 100644 --- a/src/bindings/class_types/client.rs +++ b/src/bindings/class_types/client.rs @@ -11,11 +11,8 @@ pub struct CClient { pub vftable2: *const c_void, pub m_nUserID: u32, pub m_nHandle: u16, - pub m_szServerName: [c_char; 64], - pub m_nReputation: i64, - pub pad_0014: [c_char; 182], - pub m_szClientName: [c_char; 64], - pub pad_0015: [c_char; 252], + pub m_szServerName: [c_char; 256], + pub m_szClientName: [c_char; 256], pub m_ConVars: *mut c_void, // TODO: add keyvalues pub pad_0368: [c_char; 8], pub m_pServer: *mut c_void, // TODO: add server From 3348e5b8be0c8a0c097bce8638495edef04cbf88 Mon Sep 17 00:00:00 2001 From: Allusive <154700875+AllusiveWheat@users.noreply.github.com> Date: Sun, 29 Mar 2026 16:56:39 -0700 Subject: [PATCH 2/4] Update client.rs --- src/bindings/class_types/client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/class_types/client.rs b/src/bindings/class_types/client.rs index a6a6953..924065f 100644 --- a/src/bindings/class_types/client.rs +++ b/src/bindings/class_types/client.rs @@ -11,8 +11,8 @@ pub struct CClient { pub vftable2: *const c_void, pub m_nUserID: u32, pub m_nHandle: u16, - pub m_szServerName: [c_char; 256], - pub m_szClientName: [c_char; 256], + pub m_szServerName: [c_char; 255], + pub m_szClientName: [c_char; 255], pub m_ConVars: *mut c_void, // TODO: add keyvalues pub pad_0368: [c_char; 8], pub m_pServer: *mut c_void, // TODO: add server From 22281fb02d0840a2c3d4d60ac966626ef9cb297a Mon Sep 17 00:00:00 2001 From: Allusive <154700875+AllusiveWheat@users.noreply.github.com> Date: Sun, 29 Mar 2026 17:15:14 -0700 Subject: [PATCH 3/4] fix client --- src/bindings/class_types/client.rs | 35 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/bindings/class_types/client.rs b/src/bindings/class_types/client.rs index 924065f..3d8f164 100644 --- a/src/bindings/class_types/client.rs +++ b/src/bindings/class_types/client.rs @@ -1,8 +1,8 @@ -use std::ffi::{c_char, c_void}; +use std::ffi::{ c_char, c_void }; -use crate::{field_assert, size_assert}; +use crate::{ field_assert, size_assert }; -const PERSISTENCE_MAX_SIZE: usize = 0xDDCD; +const PERSISTENCE_MAX_SIZE: usize = 0xddcd; #[allow(non_camel_case_types, non_snake_case)] #[repr(C)] @@ -11,8 +11,17 @@ pub struct CClient { pub vftable2: *const c_void, pub m_nUserID: u32, pub m_nHandle: u16, - pub m_szServerName: [c_char; 255], - pub m_szClientName: [c_char; 255], + pub m_szServerName: [c_char; 256], + pub m_szClientName: [c_char; 256], + pub pad_0210: [c_char; 2], + pub m_nCommandTick: i32, + pub m_bUsePersistence: bool, + pub pad_0221: [c_char; 7], + pub m_flInitialConnectTime: f32, + pub m_flLastConnectTime: f32, + pub pad_022C: [c_char; 36], + pub m_iTeamNum: i32, + pub pad_0254: [c_char; 4], pub m_ConVars: *mut c_void, // TODO: add keyvalues pub pad_0368: [c_char; 8], pub m_pServer: *mut c_void, // TODO: add server @@ -37,7 +46,7 @@ pub struct CClient { pub m_PersistenceBuffer: [c_char; PERSISTENCE_MAX_SIZE], pub pad: [c_char; 4665], pub m_UID: [c_char; 32], - pub pad0: [c_char; 0x1E208], + pub pad0: [c_char; 0x1e208], } size_assert!(SIZE_CLIENT where CClient == 0x2D728); @@ -55,14 +64,14 @@ field_assert!(M_UID where CClient, m_UID == 0xF500); pub enum SignonState { #[default] NONE = 0, // no state yet; about to connect - CHALLENGE = 1, // client challenging server; all OOB packets - CONNECTED = 2, // client is connected to server; netchans ready - NEW = 3, // just got serverinfo and string tables - PRESPAWN = 4, // received signon buffers + CHALLENGE = 1, // client challenging server; all OOB packets + CONNECTED = 2, // client is connected to server; netchans ready + NEW = 3, // just got serverinfo and string tables + PRESPAWN = 4, // received signon buffers GETTINGDATA = 5, // respawn-defined signonstate, assumedly this is for persistence - SPAWN = 6, // ready to receive entity packets - FIRSTSNAP = 7, // another respawn-defined one - FULL = 8, // we are fully connected; first non-delta packet received + SPAWN = 6, // ready to receive entity packets + FIRSTSNAP = 7, // another respawn-defined one + FULL = 8, // we are fully connected; first non-delta packet received CHANGELEVEL = 9, // server is changing level; please wait } From f980d9679a15dc49ad648630d2e5fe4a66084900 Mon Sep 17 00:00:00 2001 From: catornot <41955154+catornot@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:12:52 -0400 Subject: [PATCH 4/4] fmt --- src/bindings/class_types/client.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bindings/class_types/client.rs b/src/bindings/class_types/client.rs index 3d8f164..64e1d16 100644 --- a/src/bindings/class_types/client.rs +++ b/src/bindings/class_types/client.rs @@ -1,6 +1,6 @@ -use std::ffi::{ c_char, c_void }; +use std::ffi::{c_char, c_void}; -use crate::{ field_assert, size_assert }; +use crate::{field_assert, size_assert}; const PERSISTENCE_MAX_SIZE: usize = 0xddcd; @@ -64,14 +64,14 @@ field_assert!(M_UID where CClient, m_UID == 0xF500); pub enum SignonState { #[default] NONE = 0, // no state yet; about to connect - CHALLENGE = 1, // client challenging server; all OOB packets - CONNECTED = 2, // client is connected to server; netchans ready - NEW = 3, // just got serverinfo and string tables - PRESPAWN = 4, // received signon buffers + CHALLENGE = 1, // client challenging server; all OOB packets + CONNECTED = 2, // client is connected to server; netchans ready + NEW = 3, // just got serverinfo and string tables + PRESPAWN = 4, // received signon buffers GETTINGDATA = 5, // respawn-defined signonstate, assumedly this is for persistence - SPAWN = 6, // ready to receive entity packets - FIRSTSNAP = 7, // another respawn-defined one - FULL = 8, // we are fully connected; first non-delta packet received + SPAWN = 6, // ready to receive entity packets + FIRSTSNAP = 7, // another respawn-defined one + FULL = 8, // we are fully connected; first non-delta packet received CHANGELEVEL = 9, // server is changing level; please wait }