diff --git a/Cargo.lock b/Cargo.lock index 009647e..d21a594 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,7 +271,6 @@ version = "0.1.0" dependencies = [ "anyhow", "assert-json-diff", - "byteorder", "cs2-demo", "csgo-demo", "protobuf", diff --git a/cs2-demo/proto/cs_gameevents.proto b/cs2-demo/proto/cs_gameevents.proto new file mode 100644 index 0000000..f55736c --- /dev/null +++ b/cs2-demo/proto/cs_gameevents.proto @@ -0,0 +1,5 @@ +enum ECsgoGameEvents { + GE_PlayerAnimEventId = 450; + GE_RadioIconEventId = 451; + GE_FireBulletsId = 452; +} diff --git a/cs2-demo/proto/cstrike15_usermessages.proto b/cs2-demo/proto/cstrike15_usermessages.proto new file mode 100644 index 0000000..7387019 --- /dev/null +++ b/cs2-demo/proto/cstrike15_usermessages.proto @@ -0,0 +1,78 @@ +enum ECstrike15UserMessages { + CS_UM_VGUIMenu = 301; + CS_UM_Geiger = 302; + CS_UM_Train = 303; + CS_UM_HudText = 304; + CS_UM_SayText = 305; + CS_UM_SayText2 = 306; + CS_UM_TextMsg = 307; + CS_UM_HudMsg = 308; + CS_UM_ResetHud = 309; + CS_UM_GameTitle = 310; + CS_UM_Shake = 312; + CS_UM_Fade = 313; + CS_UM_Rumble = 314; + CS_UM_CloseCaption = 315; + CS_UM_CloseCaptionDirect = 316; + CS_UM_SendAudio = 317; + CS_UM_RawAudio = 318; + CS_UM_VoiceMask = 319; + CS_UM_RequestState = 320; + CS_UM_Damage = 321; + CS_UM_RadioText = 322; + CS_UM_HintText = 323; + CS_UM_KeyHintText = 324; + CS_UM_ProcessSpottedEntityUpdate = 325; + CS_UM_ReloadEffect = 326; + CS_UM_AdjustMoney = 327; + CS_UM_UpdateTeamMoney = 328; + CS_UM_StopSpectatorMode = 329; + CS_UM_KillCam = 330; + CS_UM_DesiredTimescale = 331; + CS_UM_CurrentTimescale = 332; + CS_UM_AchievementEvent = 333; + CS_UM_MatchEndConditions = 334; + CS_UM_DisconnectToLobby = 335; + CS_UM_PlayerStatsUpdate = 336; + CS_UM_WarmupHasEnded = 338; + CS_UM_ClientInfo = 339; + CS_UM_XRankGet = 340; + CS_UM_XRankUpd = 341; + CS_UM_CallVoteFailed = 345; + CS_UM_VoteStart = 346; + CS_UM_VotePass = 347; + CS_UM_VoteFailed = 348; + CS_UM_VoteSetup = 349; + CS_UM_ServerRankRevealAll = 350; + CS_UM_SendLastKillerDamageToClient = 351; + CS_UM_ServerRankUpdate = 352; + CS_UM_ItemPickup = 353; + CS_UM_ShowMenu = 354; + CS_UM_BarTime = 355; + CS_UM_AmmoDenied = 356; + CS_UM_MarkAchievement = 357; + CS_UM_MatchStatsUpdate = 358; + CS_UM_ItemDrop = 359; + CS_UM_GlowPropTurnOff = 360; + CS_UM_SendPlayerItemDrops = 361; + CS_UM_RoundBackupFilenames = 362; + CS_UM_SendPlayerItemFound = 363; + CS_UM_ReportHit = 364; + CS_UM_XpUpdate = 365; + CS_UM_QuestProgress = 366; + CS_UM_ScoreLeaderboardData = 367; + CS_UM_PlayerDecalDigitalSignature = 368; + CS_UM_WeaponSound = 369; + CS_UM_UpdateScreenHealthBar = 370; + CS_UM_EntityOutlineHighlight = 371; + CS_UM_SSUI = 372; + CS_UM_SurvivalStats = 373; + CS_UM_DisconnectToLobby2 = 374; + CS_UM_EndOfMatchAllPlayersData = 375; + CS_UM_PostRoundDamageReport = 376; + CS_UM_RoundEndReportData = 379; + CS_UM_CurrentRoundOdds = 380; + CS_UM_DeepStats = 381; + CS_UM_UtilMsg = 382; + CS_UM_ShootInfo = 383; +} \ No newline at end of file diff --git a/cs2-demo/proto/te.proto b/cs2-demo/proto/te.proto new file mode 100644 index 0000000..3ae884c --- /dev/null +++ b/cs2-demo/proto/te.proto @@ -0,0 +1,28 @@ +enum ETEProtobufIds { + TE_EffectDispatchId = 400; + TE_ArmorRicochetId = 401; + TE_BeamEntPointId = 402; + TE_BeamEntsId = 403; + TE_BeamPointsId = 404; + TE_BeamRingId = 405; + TE_BSPDecalId = 407; + TE_BubblesId = 408; + TE_BubbleTrailId = 409; + TE_DecalId = 410; + TE_WorldDecalId = 411; + TE_EnergySplashId = 412; + TE_FizzId = 413; + TE_ShatterSurfaceId = 414; + TE_GlowSpriteId = 415; + TE_ImpactId = 416; + TE_MuzzleFlashId = 417; + TE_BloodStreamId = 418; + TE_ExplosionId = 419; + TE_DustId = 420; + TE_LargeFunnelId = 421; + TE_SparksId = 422; + TE_PhysicsPropId = 423; + TE_PlayerDecalId = 424; + TE_ProjectedDecalId = 425; + TE_SmokeId = 426; +} diff --git a/cs2-demo/proto/usermessages.proto b/cs2-demo/proto/usermessages.proto new file mode 100644 index 0000000..5a5a3f4 --- /dev/null +++ b/cs2-demo/proto/usermessages.proto @@ -0,0 +1,59 @@ +enum EBaseUserMessages { + UM_AchievementEvent = 101; + UM_CloseCaption = 102; + UM_CloseCaptionDirect = 103; + UM_CurrentTimescale = 104; + UM_DesiredTimescale = 105; + UM_Fade = 106; + UM_GameTitle = 107; + UM_HudMsg = 110; + UM_HudText = 111; + UM_ColoredText = 113; + UM_RequestState = 114; + UM_ResetHUD = 115; + UM_Rumble = 116; + UM_SayText = 117; + UM_SayText2 = 118; + UM_SayTextChannel = 119; + UM_Shake = 120; + UM_ShakeDir = 121; + UM_TextMsg = 124; + UM_ScreenTilt = 125; + UM_VoiceMask = 128; + UM_SendAudio = 130; + UM_ItemPickup = 131; + UM_AmmoDenied = 132; + UM_ShowMenu = 134; + UM_CreditsMsg = 135; + UM_CloseCaptionPlaceholder = 142; + UM_CameraTransition = 143; + UM_AudioParameter = 144; + UM_ParticleManager = 145; + UM_HudError = 146; + UM_CustomGameEvent = 148; + UM_AnimGraphUpdate = 149; + UM_HapticsManagerPulse = 150; + UM_HapticsManagerEffect = 151; + UM_CommandQueueState = 152; + UM_UpdateCssClasses = 153; + UM_ServerFrameTime = 154; + UM_LagCompensationError = 155; + UM_RequestDllStatus = 156; + UM_RequestUtilAction = 157; + UM_UtilActionResponse = 158; + UM_DllStatusResponse = 159; + UM_RequestInventory = 160; + UM_InventoryResponse = 161; + UM_RequestDiagnostic = 162; + UM_DiagnosticResponse = 163; + UM_MAX_BASE = 200; +} + +enum EBaseEntityMessages { + EM_PlayJingle = 136; + EM_ScreenOverlay = 137; + EM_RemoveAllDecals = 138; + EM_PropagateForce = 139; + EM_DoSpark = 140; + EM_FixAngle = 141; +} diff --git a/cs2-demo/src/demo_command.rs b/cs2-demo/src/demo_command.rs index a2ece64..a4c1920 100644 --- a/cs2-demo/src/demo_command.rs +++ b/cs2-demo/src/demo_command.rs @@ -68,7 +68,9 @@ impl DemoCommand { impl fmt::Display for DemoCommand { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - DemoCommand::FileHeader(m) => write!(f, "FileHeader {}", m), + DemoCommand::FileHeader(m) => write!(f, "FileHeader {m}"), + DemoCommand::ClassInfo(m) => write!(f, "ClassInfo {m}"), + DemoCommand::FullPacket(st, p) => write!(f, "FullPacket {st}, {p:?}"), DemoCommand::SendTables(_) => write!(f, "SendTables"), _ => write!(f, "{:?}", self), } diff --git a/cs2-demo/src/message.rs b/cs2-demo/src/message.rs index 67cbc59..f2b178e 100644 --- a/cs2-demo/src/message.rs +++ b/cs2-demo/src/message.rs @@ -8,6 +8,10 @@ use protobuf::Message as protobuf_Message; use crate::proto::gameevents::*; use crate::proto::netmessages::*; use crate::proto::networkbasetypes::*; +use crate::proto::cstrike15_usermessages::ECstrike15UserMessages; +use crate::proto::usermessages::{EBaseUserMessages, EBaseEntityMessages}; +use crate::proto::te::ETEProtobufIds; +use crate::proto::cs_gameevents::ECsgoGameEvents; use crate::read::ValveBitReader; use crate::Result; @@ -73,6 +77,11 @@ macro_rules! create_message_impl { } create_message_impl! { + (EBaseUserMessages, UM_, CUserMessage) => [], + (EBaseEntityMessages, EM_, CEntityMessage) => [], + (ECstrike15UserMessages, CS_UM_, CCSUsrMsg_) => [], + (ETEProtobufIds, TE_, CMsgTE) => [], + (ECsgoGameEvents, GE_, CMsgTE) => [], (NET_Messages, net_, CNETMsg_) => [], (SVC_Messages, svc_, CSVCMsg_) => [ ClearAllStringTables, diff --git a/csdemoparser/Cargo.toml b/csdemoparser/Cargo.toml index 1a586a9..ab1fabb 100644 --- a/csdemoparser/Cargo.toml +++ b/csdemoparser/Cargo.toml @@ -10,7 +10,6 @@ tracing = ["dep:tracing-subscriber"] [dependencies] anyhow = { version = "1.0", features = ["backtrace"] } -byteorder = "1.4" csgo-demo = { path = "../csgo-demo" } cs2-demo = { path = "../cs2-demo" } serde = { version = "1.0", features = ["derive"] }