Compare commits

...

19 Commits

Author SHA1 Message Date
dependabot[bot]
ac38ec249b chore(deps): bump libraries/hl2sdk-cs2 from a658a0f to a26ca82 (#739)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-15 23:45:00 +10:00
Roflmuffin
cff24f4321 Revert "Make NetworkedVector support Vector and QAngle (#728)"
This reverts commit bd1105d752.
2025-01-14 00:18:56 +10:00
Michael Wilson
f05cc5e043 fix: NetworkedVector throwing error 2025-01-09 11:07:40 +10:00
Yarukon
bd1105d752 Make NetworkedVector support Vector and QAngle (#728) 2025-01-09 09:14:56 +10:00
Michael Wilson
9b4ee727c7 Fix RemoveMapChangeTimers (#720) 2024-12-24 23:30:44 +10:00
Michael Wilson
38d248defe [no ci] chore: use ninja in linux build (#722) 2024-12-24 16:14:59 +10:00
Michael Wilson
6b4306948b Update Schema to Latest (#721) 2024-12-24 16:01:10 +10:00
Michael Wilson
3fee00e8c4 [no ci] Update getting-started.md 2024-12-24 16:00:36 +10:00
Michael Wilson
d22af142cb [no ci] chore: upgrade to cxx20 (#719) 2024-12-24 15:34:12 +10:00
dependabot[bot]
c1176a3192 [no ci] chore(deps): bump libraries/hl2sdk-cs2 from 14e77af to a658a0f (#718)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 15:32:38 +10:00
dependabot[bot]
3c321be5a0 [no ci] chore(deps): bump libraries/Protobufs from 76e070d to b46090a (#717)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 15:32:20 +10:00
Michael Wilson
466da1b193 chore: back to using hl2sdk 2024-12-20 23:34:21 +00:00
Michael Wilson
ba860a92d2 fix: temporary patch hl2sdk entity listeners 2024-12-20 12:37:50 +00:00
Ian Lucas
461fc0ea67 Fix GiveNamedItem and CanAcquire signatures (#713) 2024-12-20 22:12:14 +10:00
Michael Wilson
6349c11d07 fix: revert base entity teleport changes, add warning to player controller (#688) 2024-11-27 21:25:12 +10:00
ZoNiCaL
b2046b21c4 [no ci] Shuffle player documentation, add to game event documentation (#685) 2024-11-25 10:48:25 +10:00
Michael Wilson
3c6be481c5 [no ci] Update publish-docs.yml 2024-11-25 10:48:05 +10:00
Michael Wilson
0a6fe0946d [no ci] Allow manual publish-docs.yml 2024-11-25 10:47:01 +10:00
schwarper
79297511e3 Added hitgroup to CTakeDamageInfo (#665)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-11-23 10:55:22 +00:00
34 changed files with 761 additions and 187 deletions

View File

@@ -107,7 +107,7 @@ jobs:
run: | run: |
mkdir -p build mkdir -p build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} .. cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ..
cmake --build . --config ${{env.BUILD_TYPE}} -- -j16 cmake --build . --config ${{env.BUILD_TYPE}} -- -j16
- name: Clean build directory - name: Clean build directory

View File

@@ -2,6 +2,7 @@ on:
push: push:
branches: branches:
- main - main
workflow_dispatch:
permissions: permissions:
contents: read contents: read

View File

@@ -57,7 +57,7 @@
"signatures": { "signatures": {
"library": "server", "library": "server",
"windows": "48 89 5C 24 ? 48 89 74 24 ? 55 57 41 ? 41 ? 41 ? 48 ? ? ? ? 48 ? ? ? ? ? ? 4D ? ? 48", "windows": "48 89 5C 24 ? 48 89 74 24 ? 55 57 41 ? 41 ? 41 ? 48 ? ? ? ? 48 ? ? ? ? ? ? 4D ? ? 48",
"linux": "55 48 89 E5 41 57 41 56 49 89 D6 41 55 49 89 CD 41 54 49 89 F4 53 48 89 FB 48 8D 3D" "linux": "55 48 89 E5 41 57 41 56 4D 89 C6 41 55 49 89 D5 41 54 49 89 F4"
} }
}, },
"UTIL_Remove": { "UTIL_Remove": {
@@ -91,7 +91,7 @@
"CCSPlayer_ItemServices_CanAcquire": { "CCSPlayer_ItemServices_CanAcquire": {
"signatures": { "signatures": {
"library": "server", "library": "server",
"windows": "48 8B C4 44 89 40 ? 48 89 50 ? 48 89 48", "windows": "44 89 44 24 ? 48 89 54 24 ? 48 89 4C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8B EC",
"linux": "55 48 89 E5 41 57 41 56 41 55 49 89 CD 41 54 53 48 83 EC" "linux": "55 48 89 E5 41 57 41 56 41 55 49 89 CD 41 54 53 48 83 EC"
} }
}, },

View File

@@ -54,6 +54,9 @@ The specific subclass of `GameEvent` will provide strongly typed parameters from
These event properties are mutable so you can update them as normal and they will update in the event instance. These event properties are mutable so you can update them as normal and they will update in the event instance.
> [!CAUTION]
> `GameEvent` instances and their properties will cease to exist after the event listener function is called, which means that you will encounter errors when accessing properties in timers and functions like `Server.NextFrame()`. You should store the value of properties in variables before calling functions like `Server.NextFrame()` so you can read the data safely.
## Preventing Broadcast ## Preventing Broadcast
You can modify a game event so that it does not get broadcast to clients by modifying the `bool info.DontBroadcast` property. e.g. You can modify a game event so that it does not get broadcast to clients by modifying the `bool info.DontBroadcast` property. e.g.

View File

@@ -10,7 +10,7 @@ In this guide you will learn how to install CounterStrikeSharp onto your vanilla
If you're more of a visual person, here is a <a href="https://www.youtube.com/watch?v=FlsKzStHJuY" target="_blank">Youtube video</a> that covers everything. If you're more of a visual person, here is a <a href="https://www.youtube.com/watch?v=FlsKzStHJuY" target="_blank">Youtube video</a> that covers everything.
## Prerequisites ## Prerequisites
- <a href="https://www.sourcemm.net/downloads.php/?branch=master" target="_blank">Metamod: Source 2.X Dev Build</a> - <a href="https://www.metamodsource.net/downloads.php/?branch=master" target="_blank">Metamod: Source 2.X Dev Build</a>
- <a href="https://github.com/roflmuffin/CounterStrikeSharp/releases" target="_blank">CounterStrikeSharp With Runtime</a> - <a href="https://github.com/roflmuffin/CounterStrikeSharp/releases" target="_blank">CounterStrikeSharp With Runtime</a>
## Installing Metamod ## Installing Metamod

View File

@@ -6,3 +6,6 @@
- name: Dependency Injection - name: Dependency Injection
href: dependency-injection.md href: dependency-injection.md
- name: Referencing Players
href: referencing-players.md

View File

@@ -1,5 +1,2 @@
- name: Core Configuration - name: Core Configuration
href: core-configuration.md href: core-configuration.md
- name: Referencing Players
href: referencing-players.md

View File

@@ -11,7 +11,7 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
FORCE FORCE
) )
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 20)
if(LINUX) if(LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

View File

@@ -12,21 +12,17 @@ public partial class CBaseEntity
public void Teleport(Vector? position = null, QAngle? angles = null, Vector? velocity = null) public void Teleport(Vector? position = null, QAngle? angles = null, Vector? velocity = null)
{ {
Guard.IsValidEntity(this); Guard.IsValidEntity(this);
if (position == null && angles == null && velocity == null) if (position == null && angles == null && velocity == null)
throw new ArgumentNullException("No valid argument"); throw new ArgumentNullException("No valid argument");
nint _position = position?.Handle ?? 0; nint _position = position?.Handle ?? 0;
nint _angles = angles?.Handle ?? 0; nint _angles = angles?.Handle ?? 0;
nint _velocity = velocity?.Handle ?? 0; nint _velocity = velocity?.Handle ?? 0;
nint _handle = Handle; nint _handle = Handle;
if (this is CCSPlayerController player && player.PlayerPawn.Value is CCSPlayerPawn playerPawn) VirtualFunction.CreateVoid<IntPtr, IntPtr, IntPtr, IntPtr>(_handle, GameData.GetOffset("CBaseEntity_Teleport"))(_handle, _position,
{ _angles, _velocity);
_handle = playerPawn.Handle;
}
VirtualFunction.CreateVoid<IntPtr, IntPtr, IntPtr, IntPtr>(_handle, GameData.GetOffset("CBaseEntity_Teleport"))(_handle, _position, _angles, _velocity);
} }
/// <exception cref="InvalidOperationException">Entity is not valid</exception> /// <exception cref="InvalidOperationException">Entity is not valid</exception>

View File

@@ -340,4 +340,11 @@ public partial class CCSPlayerController
NativeAPI.SetClientVoiceFlags(Handle, (Byte)value); NativeAPI.SetClientVoiceFlags(Handle, (Byte)value);
} }
} }
[Obsolete(
"You are trying to call Teleport on a non-physical player. Maybe you mean Pawn? (See: https://docs.cssharp.dev/docs/guides/referencing-players.html#controllers--pawns)")]
public new void Teleport(Vector? position = null, QAngle? angles = null, Vector? velocity = null)
{
base.Teleport(position, angles, velocity);
}
} }

View File

@@ -0,0 +1,32 @@
using System.Runtime.InteropServices;
namespace CounterStrikeSharp.API.Core;
public partial class CTakeDamageInfo
{
/// <summary>
/// Retrieves the hitgroup
/// </summary>
/// <returns>
/// Returns a <see cref="HitGroup_t"/> enumeration representing the player's current hit group,
/// or <see cref="HitGroup_t.HITGROUP_INVALID"/> if the hit group cannot be determined.
/// </returns>
public HitGroup_t GetHitGroup()
{
IntPtr v4 = Marshal.ReadIntPtr(Handle, 0x78);
if (v4 == nint.Zero)
{
return HitGroup_t.HITGROUP_INVALID;
}
IntPtr v1 = Marshal.ReadIntPtr(v4, 16);
if (v1 == nint.Zero)
{
return HitGroup_t.HITGROUP_GENERIC;
}
return (HitGroup_t)Marshal.ReadInt32(v1, 56);
}
}

View File

@@ -17,7 +17,7 @@ public partial class NetworkedVector<T> : NativeObject, IReadOnlyCollection<T>
} }
public unsafe uint Size => Unsafe.Read<uint>((void*)Handle); public unsafe uint Size => Unsafe.Read<uint>((void*)Handle);
public unsafe int Count => NativeAPI.GetNetworkVectorSize(Handle); public unsafe int Count => NativeAPI.GetNetworkVectorSize(Handle);
public T this[int index] public T this[int index]
@@ -28,7 +28,7 @@ public partial class NetworkedVector<T> : NativeObject, IReadOnlyCollection<T>
{ {
throw new NotSupportedException("Networked vectors currently only support CHandle<T>"); throw new NotSupportedException("Networked vectors currently only support CHandle<T>");
} }
return (T)Activator.CreateInstance(typeof(T), NativeAPI.GetNetworkVectorElementAt(Handle, index)); return (T)Activator.CreateInstance(typeof(T), NativeAPI.GetNetworkVectorElementAt(Handle, index));
} }
} }
@@ -50,4 +50,4 @@ public partial class NetworkedVector<T> : NativeObject, IReadOnlyCollection<T>
{ {
return GetEnumerator(); return GetEnumerator();
} }
} }

View File

@@ -58,4 +58,8 @@ public partial class CBaseAnimGraph : CBaseModelEntity
[SchemaMember("CBaseAnimGraph", "m_bRagdollClientSide")] [SchemaMember("CBaseAnimGraph", "m_bRagdollClientSide")]
public ref bool RagdollClientSide => ref Schema.GetRef<bool>(this.Handle, "CBaseAnimGraph", "m_bRagdollClientSide"); public ref bool RagdollClientSide => ref Schema.GetRef<bool>(this.Handle, "CBaseAnimGraph", "m_bRagdollClientSide");
// m_nLastDestructiblePartDestroyedAnimgraphSetTick
[SchemaMember("CBaseAnimGraph", "m_nLastDestructiblePartDestroyedAnimgraphSetTick")]
public ref Int32 LastDestructiblePartDestroyedAnimgraphSetTick => ref Schema.GetRef<Int32>(this.Handle, "CBaseAnimGraph", "m_nLastDestructiblePartDestroyedAnimgraphSetTick");
} }

View File

@@ -78,12 +78,8 @@ public partial class CBaseCSGrenadeProjectile : CBaseGrenade
[SchemaMember("CBaseCSGrenadeProjectile", "m_nTicksAtZeroVelocity")] [SchemaMember("CBaseCSGrenadeProjectile", "m_nTicksAtZeroVelocity")]
public ref Int32 TicksAtZeroVelocity => ref Schema.GetRef<Int32>(this.Handle, "CBaseCSGrenadeProjectile", "m_nTicksAtZeroVelocity"); public ref Int32 TicksAtZeroVelocity => ref Schema.GetRef<Int32>(this.Handle, "CBaseCSGrenadeProjectile", "m_nTicksAtZeroVelocity");
// m_bHasEverHitPlayer // m_bHasEverHitEnemy
[SchemaMember("CBaseCSGrenadeProjectile", "m_bHasEverHitPlayer")] [SchemaMember("CBaseCSGrenadeProjectile", "m_bHasEverHitEnemy")]
public ref bool HasEverHitPlayer => ref Schema.GetRef<bool>(this.Handle, "CBaseCSGrenadeProjectile", "m_bHasEverHitPlayer"); public ref bool HasEverHitEnemy => ref Schema.GetRef<bool>(this.Handle, "CBaseCSGrenadeProjectile", "m_bHasEverHitEnemy");
// m_bClearFromPlayers
[SchemaMember("CBaseCSGrenadeProjectile", "m_bClearFromPlayers")]
public ref bool ClearFromPlayers => ref Schema.GetRef<bool>(this.Handle, "CBaseCSGrenadeProjectile", "m_bClearFromPlayers");
} }

View File

@@ -30,10 +30,6 @@ public partial class CBaseCombatCharacter : CBaseFlex
[SchemaMember("CBaseCombatCharacter", "m_impactEnergyScale")] [SchemaMember("CBaseCombatCharacter", "m_impactEnergyScale")]
public ref float ImpactEnergyScale => ref Schema.GetRef<float>(this.Handle, "CBaseCombatCharacter", "m_impactEnergyScale"); public ref float ImpactEnergyScale => ref Schema.GetRef<float>(this.Handle, "CBaseCombatCharacter", "m_impactEnergyScale");
// m_LastHitGroup
[SchemaMember("CBaseCombatCharacter", "m_LastHitGroup")]
public ref HitGroup_t LastHitGroup => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseCombatCharacter", "m_LastHitGroup");
// m_bApplyStressDamage // m_bApplyStressDamage
[SchemaMember("CBaseCombatCharacter", "m_bApplyStressDamage")] [SchemaMember("CBaseCombatCharacter", "m_bApplyStressDamage")]
public ref bool ApplyStressDamage => ref Schema.GetRef<bool>(this.Handle, "CBaseCombatCharacter", "m_bApplyStressDamage"); public ref bool ApplyStressDamage => ref Schema.GetRef<bool>(this.Handle, "CBaseCombatCharacter", "m_bApplyStressDamage");

View File

@@ -26,6 +26,34 @@ public partial class CBaseModelEntity : CBaseEntity
[SchemaMember("CBaseModelEntity", "m_CHitboxComponent")] [SchemaMember("CBaseModelEntity", "m_CHitboxComponent")]
public CHitboxComponent CHitboxComponent => Schema.GetDeclaredClass<CHitboxComponent>(this.Handle, "CBaseModelEntity", "m_CHitboxComponent"); public CHitboxComponent CHitboxComponent => Schema.GetDeclaredClass<CHitboxComponent>(this.Handle, "CBaseModelEntity", "m_CHitboxComponent");
// m_nDestructiblePartInitialStateDestructed0
[SchemaMember("CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed0")]
public ref HitGroup_t DestructiblePartInitialStateDestructed0 => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed0");
// m_nDestructiblePartInitialStateDestructed1
[SchemaMember("CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed1")]
public ref HitGroup_t DestructiblePartInitialStateDestructed1 => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed1");
// m_nDestructiblePartInitialStateDestructed2
[SchemaMember("CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed2")]
public ref HitGroup_t DestructiblePartInitialStateDestructed2 => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed2");
// m_nDestructiblePartInitialStateDestructed3
[SchemaMember("CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed3")]
public ref HitGroup_t DestructiblePartInitialStateDestructed3 => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed3");
// m_nDestructiblePartInitialStateDestructed4
[SchemaMember("CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed4")]
public ref HitGroup_t DestructiblePartInitialStateDestructed4 => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseModelEntity", "m_nDestructiblePartInitialStateDestructed4");
// m_nLastHitDestructiblePartIndex
[SchemaMember("CBaseModelEntity", "m_nLastHitDestructiblePartIndex")]
public ref Int32 LastHitDestructiblePartIndex => ref Schema.GetRef<Int32>(this.Handle, "CBaseModelEntity", "m_nLastHitDestructiblePartIndex");
// m_LastHitGroup
[SchemaMember("CBaseModelEntity", "m_LastHitGroup")]
public ref HitGroup_t LastHitGroup => ref Schema.GetRef<HitGroup_t>(this.Handle, "CBaseModelEntity", "m_LastHitGroup");
// m_flDissolveStartTime // m_flDissolveStartTime
[SchemaMember("CBaseModelEntity", "m_flDissolveStartTime")] [SchemaMember("CBaseModelEntity", "m_flDissolveStartTime")]
public ref float DissolveStartTime => ref Schema.GetRef<float>(this.Handle, "CBaseModelEntity", "m_flDissolveStartTime"); public ref float DissolveStartTime => ref Schema.GetRef<float>(this.Handle, "CBaseModelEntity", "m_flDissolveStartTime");

View File

@@ -98,6 +98,10 @@ public partial class CCSPlayerController : CBasePlayerController
[SchemaMember("CCSPlayerController", "m_bRemoveAllItemsOnNextRoundReset")] [SchemaMember("CCSPlayerController", "m_bRemoveAllItemsOnNextRoundReset")]
public ref bool RemoveAllItemsOnNextRoundReset => ref Schema.GetRef<bool>(this.Handle, "CCSPlayerController", "m_bRemoveAllItemsOnNextRoundReset"); public ref bool RemoveAllItemsOnNextRoundReset => ref Schema.GetRef<bool>(this.Handle, "CCSPlayerController", "m_bRemoveAllItemsOnNextRoundReset");
// m_flLastJoinTeamTime
[SchemaMember("CCSPlayerController", "m_flLastJoinTeamTime")]
public ref float LastJoinTeamTime => ref Schema.GetRef<float>(this.Handle, "CCSPlayerController", "m_flLastJoinTeamTime");
// m_szClan // m_szClan
[SchemaMember("CCSPlayerController", "m_szClan")] [SchemaMember("CCSPlayerController", "m_szClan")]
public string Clan public string Clan
@@ -290,9 +294,17 @@ public partial class CCSPlayerController : CBasePlayerController
[SchemaMember("CCSPlayerController", "m_iRoundsWon")] [SchemaMember("CCSPlayerController", "m_iRoundsWon")]
public ref Int32 RoundsWon => ref Schema.GetRef<Int32>(this.Handle, "CCSPlayerController", "m_iRoundsWon"); public ref Int32 RoundsWon => ref Schema.GetRef<Int32>(this.Handle, "CCSPlayerController", "m_iRoundsWon");
// m_vecKills // m_recentKillQueue
[SchemaMember("CCSPlayerController", "m_vecKills")] [SchemaMember("CCSPlayerController", "m_recentKillQueue")]
public NetworkedVector<EKillTypes_t> Kills => Schema.GetDeclaredClass<NetworkedVector<EKillTypes_t>>(this.Handle, "CCSPlayerController", "m_vecKills"); public Span<byte> RecentKillQueue => Schema.GetFixedArray<byte>(this.Handle, "CCSPlayerController", "m_recentKillQueue", 8);
// m_nFirstKill
[SchemaMember("CCSPlayerController", "m_nFirstKill")]
public ref byte FirstKill => ref Schema.GetRef<byte>(this.Handle, "CCSPlayerController", "m_nFirstKill");
// m_nKillCount
[SchemaMember("CCSPlayerController", "m_nKillCount")]
public ref byte KillCount => ref Schema.GetRef<byte>(this.Handle, "CCSPlayerController", "m_nKillCount");
// m_bMvpNoMusic // m_bMvpNoMusic
[SchemaMember("CCSPlayerController", "m_bMvpNoMusic")] [SchemaMember("CCSPlayerController", "m_bMvpNoMusic")]
@@ -370,4 +382,8 @@ public partial class CCSPlayerController : CBasePlayerController
[SchemaMember("CCSPlayerController", "m_nNonSuspiciousHitStreak")] [SchemaMember("CCSPlayerController", "m_nNonSuspiciousHitStreak")]
public ref UInt32 NonSuspiciousHitStreak => ref Schema.GetRef<UInt32>(this.Handle, "CCSPlayerController", "m_nNonSuspiciousHitStreak"); public ref UInt32 NonSuspiciousHitStreak => ref Schema.GetRef<UInt32>(this.Handle, "CCSPlayerController", "m_nNonSuspiciousHitStreak");
// m_bFireBulletsSeedSynchronized
[SchemaMember("CCSPlayerController", "m_bFireBulletsSeedSynchronized")]
public ref bool FireBulletsSeedSynchronized => ref Schema.GetRef<bool>(this.Handle, "CCSPlayerController", "m_bFireBulletsSeedSynchronized");
} }

View File

@@ -18,10 +18,6 @@ public partial class CCSPlayer_MovementServices : CPlayer_MovementServices_Human
{ {
public CCSPlayer_MovementServices (IntPtr pointer) : base(pointer) {} public CCSPlayer_MovementServices (IntPtr pointer) : base(pointer) {}
// m_flMaxFallVelocity
[SchemaMember("CCSPlayer_MovementServices", "m_flMaxFallVelocity")]
public ref float MaxFallVelocity => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flMaxFallVelocity");
// m_vecLadderNormal // m_vecLadderNormal
[SchemaMember("CCSPlayer_MovementServices", "m_vecLadderNormal")] [SchemaMember("CCSPlayer_MovementServices", "m_vecLadderNormal")]
public Vector LadderNormal => Schema.GetDeclaredClass<Vector>(this.Handle, "CCSPlayer_MovementServices", "m_vecLadderNormal"); public Vector LadderNormal => Schema.GetDeclaredClass<Vector>(this.Handle, "CCSPlayer_MovementServices", "m_vecLadderNormal");
@@ -142,14 +138,6 @@ public partial class CCSPlayer_MovementServices : CPlayer_MovementServices_Human
[SchemaMember("CCSPlayer_MovementServices", "m_flJumpPressedTime")] [SchemaMember("CCSPlayer_MovementServices", "m_flJumpPressedTime")]
public ref float JumpPressedTime => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flJumpPressedTime"); public ref float JumpPressedTime => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flJumpPressedTime");
// m_flJumpUntil
[SchemaMember("CCSPlayer_MovementServices", "m_flJumpUntil")]
public ref float JumpUntil => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flJumpUntil");
// m_flJumpVel
[SchemaMember("CCSPlayer_MovementServices", "m_flJumpVel")]
public ref float JumpVel => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flJumpVel");
// m_fStashGrenadeParameterWhen // m_fStashGrenadeParameterWhen
[SchemaMember("CCSPlayer_MovementServices", "m_fStashGrenadeParameterWhen")] [SchemaMember("CCSPlayer_MovementServices", "m_fStashGrenadeParameterWhen")]
public ref float StashGrenadeParameterWhen => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_fStashGrenadeParameterWhen"); public ref float StashGrenadeParameterWhen => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_fStashGrenadeParameterWhen");
@@ -182,4 +170,12 @@ public partial class CCSPlayer_MovementServices : CPlayer_MovementServices_Human
[SchemaMember("CCSPlayer_MovementServices", "m_flMaxJumpHeightLastJump")] [SchemaMember("CCSPlayer_MovementServices", "m_flMaxJumpHeightLastJump")]
public ref float MaxJumpHeightLastJump => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flMaxJumpHeightLastJump"); public ref float MaxJumpHeightLastJump => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flMaxJumpHeightLastJump");
// m_flStaminaAtJumpStart
[SchemaMember("CCSPlayer_MovementServices", "m_flStaminaAtJumpStart")]
public ref float StaminaAtJumpStart => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flStaminaAtJumpStart");
// m_flAccumulatedJumpError
[SchemaMember("CCSPlayer_MovementServices", "m_flAccumulatedJumpError")]
public ref float AccumulatedJumpError => ref Schema.GetRef<float>(this.Handle, "CCSPlayer_MovementServices", "m_flAccumulatedJumpError");
} }

View File

@@ -222,6 +222,10 @@ public partial class CCSWeaponBase : CBasePlayerWeapon
[SchemaMember("CCSWeaponBase", "m_nextPrevOwnerTouchTime")] [SchemaMember("CCSWeaponBase", "m_nextPrevOwnerTouchTime")]
public ref float NextPrevOwnerTouchTime => ref Schema.GetRef<float>(this.Handle, "CCSWeaponBase", "m_nextPrevOwnerTouchTime"); public ref float NextPrevOwnerTouchTime => ref Schema.GetRef<float>(this.Handle, "CCSWeaponBase", "m_nextPrevOwnerTouchTime");
// m_nextPrevOwnerUseTime
[SchemaMember("CCSWeaponBase", "m_nextPrevOwnerUseTime")]
public ref float NextPrevOwnerUseTime => ref Schema.GetRef<float>(this.Handle, "CCSWeaponBase", "m_nextPrevOwnerUseTime");
// m_hPrevOwner // m_hPrevOwner
[SchemaMember("CCSWeaponBase", "m_hPrevOwner")] [SchemaMember("CCSWeaponBase", "m_hPrevOwner")]
public CHandle<CCSPlayerPawn> PrevOwner => Schema.GetDeclaredClass<CHandle<CCSPlayerPawn>>(this.Handle, "CCSWeaponBase", "m_hPrevOwner"); public CHandle<CCSPlayerPawn> PrevOwner => Schema.GetDeclaredClass<CHandle<CCSPlayerPawn>>(this.Handle, "CCSWeaponBase", "m_hPrevOwner");

View File

@@ -58,6 +58,10 @@ public partial class CDamageRecord : NativeObject
[SchemaMember("CDamageRecord", "m_RecipientXuid")] [SchemaMember("CDamageRecord", "m_RecipientXuid")]
public ref UInt64 RecipientXuid => ref Schema.GetRef<UInt64>(this.Handle, "CDamageRecord", "m_RecipientXuid"); public ref UInt64 RecipientXuid => ref Schema.GetRef<UInt64>(this.Handle, "CDamageRecord", "m_RecipientXuid");
// m_iBulletsDamage
[SchemaMember("CDamageRecord", "m_iBulletsDamage")]
public ref Int32 BulletsDamage => ref Schema.GetRef<Int32>(this.Handle, "CDamageRecord", "m_iBulletsDamage");
// m_iDamage // m_iDamage
[SchemaMember("CDamageRecord", "m_iDamage")] [SchemaMember("CDamageRecord", "m_iDamage")]
public ref Int32 Damage => ref Schema.GetRef<Int32>(this.Handle, "CDamageRecord", "m_iDamage"); public ref Int32 Damage => ref Schema.GetRef<Int32>(this.Handle, "CDamageRecord", "m_iDamage");

View File

@@ -14,7 +14,7 @@ using CounterStrikeSharp.API.Core.Attributes;
namespace CounterStrikeSharp.API.Core; namespace CounterStrikeSharp.API.Core;
public partial class CEnvSoundscape : CServerOnlyEntity public partial class CEnvSoundscape : CBaseEntity
{ {
public CEnvSoundscape (IntPtr pointer) : base(pointer) {} public CEnvSoundscape (IntPtr pointer) : base(pointer) {}
@@ -26,14 +26,6 @@ public partial class CEnvSoundscape : CServerOnlyEntity
[SchemaMember("CEnvSoundscape", "m_flRadius")] [SchemaMember("CEnvSoundscape", "m_flRadius")]
public ref float Radius => ref Schema.GetRef<float>(this.Handle, "CEnvSoundscape", "m_flRadius"); public ref float Radius => ref Schema.GetRef<float>(this.Handle, "CEnvSoundscape", "m_flRadius");
// m_soundscapeName
[SchemaMember("CEnvSoundscape", "m_soundscapeName")]
public string SoundscapeName
{
get { return Schema.GetUtf8String(this.Handle, "CEnvSoundscape", "m_soundscapeName"); }
set { Schema.SetString(this.Handle, "CEnvSoundscape", "m_soundscapeName", value); }
}
// m_soundEventName // m_soundEventName
[SchemaMember("CEnvSoundscape", "m_soundEventName")] [SchemaMember("CEnvSoundscape", "m_soundEventName")]
public string SoundEventName public string SoundEventName
@@ -54,10 +46,6 @@ public partial class CEnvSoundscape : CServerOnlyEntity
[SchemaMember("CEnvSoundscape", "m_soundscapeEntityListId")] [SchemaMember("CEnvSoundscape", "m_soundscapeEntityListId")]
public ref Int32 SoundscapeEntityListId => ref Schema.GetRef<Int32>(this.Handle, "CEnvSoundscape", "m_soundscapeEntityListId"); public ref Int32 SoundscapeEntityListId => ref Schema.GetRef<Int32>(this.Handle, "CEnvSoundscape", "m_soundscapeEntityListId");
// m_soundEventHash
[SchemaMember("CEnvSoundscape", "m_soundEventHash")]
public ref UInt32 SoundEventHash => ref Schema.GetRef<UInt32>(this.Handle, "CEnvSoundscape", "m_soundEventHash");
// m_positionNames // m_positionNames
[SchemaMember("CEnvSoundscape", "m_positionNames")] [SchemaMember("CEnvSoundscape", "m_positionNames")]
public Span<string> PositionNames => Schema.GetFixedArray<string>(this.Handle, "CEnvSoundscape", "m_positionNames", 8); public Span<string> PositionNames => Schema.GetFixedArray<string>(this.Handle, "CEnvSoundscape", "m_positionNames", 8);
@@ -70,4 +58,16 @@ public partial class CEnvSoundscape : CServerOnlyEntity
[SchemaMember("CEnvSoundscape", "m_bDisabled")] [SchemaMember("CEnvSoundscape", "m_bDisabled")]
public ref bool Disabled => ref Schema.GetRef<bool>(this.Handle, "CEnvSoundscape", "m_bDisabled"); public ref bool Disabled => ref Schema.GetRef<bool>(this.Handle, "CEnvSoundscape", "m_bDisabled");
// m_soundscapeName
[SchemaMember("CEnvSoundscape", "m_soundscapeName")]
public string SoundscapeName
{
get { return Schema.GetUtf8String(this.Handle, "CEnvSoundscape", "m_soundscapeName"); }
set { Schema.SetString(this.Handle, "CEnvSoundscape", "m_soundscapeName", value); }
}
// m_soundEventHash
[SchemaMember("CEnvSoundscape", "m_soundEventHash")]
public ref UInt32 SoundEventHash => ref Schema.GetRef<UInt32>(this.Handle, "CEnvSoundscape", "m_soundEventHash");
} }

View File

@@ -50,4 +50,8 @@ public partial class CMapInfo : CPointEntity
[SchemaMember("CMapInfo", "m_bFadePlayerVisibilityFarZ")] [SchemaMember("CMapInfo", "m_bFadePlayerVisibilityFarZ")]
public ref bool FadePlayerVisibilityFarZ => ref Schema.GetRef<bool>(this.Handle, "CMapInfo", "m_bFadePlayerVisibilityFarZ"); public ref bool FadePlayerVisibilityFarZ => ref Schema.GetRef<bool>(this.Handle, "CMapInfo", "m_bFadePlayerVisibilityFarZ");
// m_bRainTraceToSkyEnabled
[SchemaMember("CMapInfo", "m_bRainTraceToSkyEnabled")]
public ref bool RainTraceToSkyEnabled => ref Schema.GetRef<bool>(this.Handle, "CMapInfo", "m_bRainTraceToSkyEnabled");
} }

View File

@@ -34,6 +34,14 @@ public partial class CPointWorldText : CModelPointEntity
set { Schema.SetStringBytes(this.Handle, "CPointWorldText", "m_FontName", value, 64); } set { Schema.SetStringBytes(this.Handle, "CPointWorldText", "m_FontName", value, 64); }
} }
// m_BackgroundMaterialName
[SchemaMember("CPointWorldText", "m_BackgroundMaterialName")]
public string BackgroundMaterialName
{
get { return Schema.GetString(this.Handle, "CPointWorldText", "m_BackgroundMaterialName"); }
set { Schema.SetStringBytes(this.Handle, "CPointWorldText", "m_BackgroundMaterialName", value, 64); }
}
// m_bEnabled // m_bEnabled
[SchemaMember("CPointWorldText", "m_bEnabled")] [SchemaMember("CPointWorldText", "m_bEnabled")]
public ref bool Enabled => ref Schema.GetRef<bool>(this.Handle, "CPointWorldText", "m_bEnabled"); public ref bool Enabled => ref Schema.GetRef<bool>(this.Handle, "CPointWorldText", "m_bEnabled");
@@ -54,6 +62,22 @@ public partial class CPointWorldText : CModelPointEntity
[SchemaMember("CPointWorldText", "m_flDepthOffset")] [SchemaMember("CPointWorldText", "m_flDepthOffset")]
public ref float DepthOffset => ref Schema.GetRef<float>(this.Handle, "CPointWorldText", "m_flDepthOffset"); public ref float DepthOffset => ref Schema.GetRef<float>(this.Handle, "CPointWorldText", "m_flDepthOffset");
// m_bDrawBackground
[SchemaMember("CPointWorldText", "m_bDrawBackground")]
public ref bool DrawBackground => ref Schema.GetRef<bool>(this.Handle, "CPointWorldText", "m_bDrawBackground");
// m_flBackgroundBorderWidth
[SchemaMember("CPointWorldText", "m_flBackgroundBorderWidth")]
public ref float BackgroundBorderWidth => ref Schema.GetRef<float>(this.Handle, "CPointWorldText", "m_flBackgroundBorderWidth");
// m_flBackgroundBorderHeight
[SchemaMember("CPointWorldText", "m_flBackgroundBorderHeight")]
public ref float BackgroundBorderHeight => ref Schema.GetRef<float>(this.Handle, "CPointWorldText", "m_flBackgroundBorderHeight");
// m_flBackgroundWorldToUV
[SchemaMember("CPointWorldText", "m_flBackgroundWorldToUV")]
public ref float BackgroundWorldToUV => ref Schema.GetRef<float>(this.Handle, "CPointWorldText", "m_flBackgroundWorldToUV");
// m_Color // m_Color
[SchemaMember("CPointWorldText", "m_Color")] [SchemaMember("CPointWorldText", "m_Color")]
public Color Color public Color Color

View File

@@ -30,4 +30,8 @@ public partial class CRagdollManager : CBaseEntity
[SchemaMember("CRagdollManager", "m_bSaveImportant")] [SchemaMember("CRagdollManager", "m_bSaveImportant")]
public ref bool SaveImportant => ref Schema.GetRef<bool>(this.Handle, "CRagdollManager", "m_bSaveImportant"); public ref bool SaveImportant => ref Schema.GetRef<bool>(this.Handle, "CRagdollManager", "m_bSaveImportant");
// m_bCanTakeDamage
[SchemaMember("CRagdollManager", "m_bCanTakeDamage")]
public ref bool CanTakeDamage => ref Schema.GetRef<bool>(this.Handle, "CRagdollManager", "m_bCanTakeDamage");
} }

View File

@@ -42,6 +42,14 @@ public partial class CSmokeGrenadeProjectile : CBaseCSGrenadeProjectile
[SchemaMember("CSmokeGrenadeProjectile", "m_VoxelFrameData")] [SchemaMember("CSmokeGrenadeProjectile", "m_VoxelFrameData")]
public NetworkedVector<byte> VoxelFrameData => Schema.GetDeclaredClass<NetworkedVector<byte>>(this.Handle, "CSmokeGrenadeProjectile", "m_VoxelFrameData"); public NetworkedVector<byte> VoxelFrameData => Schema.GetDeclaredClass<NetworkedVector<byte>>(this.Handle, "CSmokeGrenadeProjectile", "m_VoxelFrameData");
// m_nVoxelFrameDataSize
[SchemaMember("CSmokeGrenadeProjectile", "m_nVoxelFrameDataSize")]
public ref Int32 VoxelFrameDataSize => ref Schema.GetRef<Int32>(this.Handle, "CSmokeGrenadeProjectile", "m_nVoxelFrameDataSize");
// m_nVoxelUpdate
[SchemaMember("CSmokeGrenadeProjectile", "m_nVoxelUpdate")]
public ref Int32 VoxelUpdate => ref Schema.GetRef<Int32>(this.Handle, "CSmokeGrenadeProjectile", "m_nVoxelUpdate");
// m_flLastBounce // m_flLastBounce
[SchemaMember("CSmokeGrenadeProjectile", "m_flLastBounce")] [SchemaMember("CSmokeGrenadeProjectile", "m_flLastBounce")]
public ref float LastBounce => ref Schema.GetRef<float>(this.Handle, "CSmokeGrenadeProjectile", "m_flLastBounce"); public ref float LastBounce => ref Schema.GetRef<float>(this.Handle, "CSmokeGrenadeProjectile", "m_flLastBounce");

View File

@@ -0,0 +1,14 @@
// <auto-generated />
#nullable enable
#pragma warning disable CS1591
using System;
namespace CounterStrikeSharp.API.Core;
public enum EContributionScoreFlag_t : byte
{
k_EContributionScoreFlag_Default = 0x0,
k_EContributionScoreFlag_Objective = 0x1,
k_EContributionScoreFlag_Bullets = 0x2,
}

View File

@@ -0,0 +1,13 @@
// <auto-generated />
#nullable enable
#pragma warning disable CS1591
using System;
namespace CounterStrikeSharp.API.Core;
public enum EDestructiblePartDamagePassThroughType : uint
{
Normal = 0x0,
Absorb = 0x1,
}

View File

@@ -0,0 +1,16 @@
// <auto-generated />
#nullable enable
#pragma warning disable CS1591
using System;
namespace CounterStrikeSharp.API.Core;
public enum EIKEndEffectorRotationFixUpMode : uint
{
None = 0x0,
MatchTargetOrientation = 0x1,
LookAtTargetForward = 0x2,
MaintainParentOrientation = 0x3,
Count = 0x4,
}

View File

@@ -2497,7 +2497,36 @@
] ]
}, },
"CAnimGraphControllerBase": { "CAnimGraphControllerBase": {
"fields": [] "fields": [
{
"name": "m_sDestructiblePartDestroyedHitGroup",
"type": {
"atomic": 1,
"category": 4,
"inner": {
"category": 1,
"inner": {
"category": 0,
"name": "char"
},
"name": "char*"
},
"name": "CAnimGraphParamOptionalRef< char* >"
}
},
{
"name": "m_nDestructiblePartDestroyedPartIndex",
"type": {
"atomic": 1,
"category": 4,
"inner": {
"category": 0,
"name": "int32"
},
"name": "CAnimGraphParamOptionalRef< int32 >"
}
}
]
}, },
"CAnimGraphDebugReplay": { "CAnimGraphDebugReplay": {
"fields": [ "fields": [
@@ -5153,6 +5182,13 @@
"category": 0, "category": 0,
"name": "bool" "name": "bool"
} }
},
{
"name": "m_nLastDestructiblePartDestroyedAnimgraphSetTick",
"type": {
"category": 0,
"name": "int32"
}
} }
], ],
"parent": "CBaseModelEntity" "parent": "CBaseModelEntity"
@@ -5685,14 +5721,7 @@
} }
}, },
{ {
"name": "m_bHasEverHitPlayer", "name": "m_bHasEverHitEnemy",
"type": {
"category": 0,
"name": "bool"
}
},
{
"name": "m_bClearFromPlayers",
"type": { "type": {
"category": 0, "category": 0,
"name": "bool" "name": "bool"
@@ -5840,13 +5869,6 @@
"name": "float32" "name": "float32"
} }
}, },
{
"name": "m_LastHitGroup",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{ {
"name": "m_bApplyStressDamage", "name": "m_bApplyStressDamage",
"type": { "type": {
@@ -7084,6 +7106,55 @@
"name": "CHitboxComponent" "name": "CHitboxComponent"
} }
}, },
{
"name": "m_nDestructiblePartInitialStateDestructed0",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{
"name": "m_nDestructiblePartInitialStateDestructed1",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{
"name": "m_nDestructiblePartInitialStateDestructed2",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{
"name": "m_nDestructiblePartInitialStateDestructed3",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{
"name": "m_nDestructiblePartInitialStateDestructed4",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{
"name": "m_nLastHitDestructiblePartIndex",
"type": {
"category": 0,
"name": "int32"
}
},
{
"name": "m_LastHitGroup",
"type": {
"category": 6,
"name": "HitGroup_t"
}
},
{ {
"name": "m_flDissolveStartTime", "name": "m_flDissolveStartTime",
"type": { "type": {
@@ -14451,6 +14522,13 @@
"name": "bool" "name": "bool"
} }
}, },
{
"name": "m_flLastJoinTeamTime",
"type": {
"category": 5,
"name": "GameTime_t"
}
},
{ {
"name": "m_szClan", "name": "m_szClan",
"type": { "type": {
@@ -14805,15 +14883,28 @@
} }
}, },
{ {
"name": "m_vecKills", "name": "m_recentKillQueue",
"type": { "type": {
"atomic": 2, "category": 3,
"category": 4,
"inner": { "inner": {
"category": 6, "category": 0,
"name": "EKillTypes_t" "name": "uint8"
}, },
"name": "CNetworkUtlVectorBase< EKillTypes_t >" "name": "uint8[8]"
}
},
{
"name": "m_nFirstKill",
"type": {
"category": 0,
"name": "uint8"
}
},
{
"name": "m_nKillCount",
"type": {
"category": 0,
"name": "uint8"
} }
}, },
{ {
@@ -14948,6 +15039,13 @@
"category": 0, "category": 0,
"name": "uint32" "name": "uint32"
} }
},
{
"name": "m_bFireBulletsSeedSynchronized",
"type": {
"category": 0,
"name": "bool"
}
} }
], ],
"parent": "CBasePlayerController" "parent": "CBasePlayerController"
@@ -16486,13 +16584,6 @@
}, },
"CCSPlayer_MovementServices": { "CCSPlayer_MovementServices": {
"fields": [ "fields": [
{
"name": "m_flMaxFallVelocity",
"type": {
"category": 0,
"name": "float32"
}
},
{ {
"name": "m_vecLadderNormal", "name": "m_vecLadderNormal",
"type": { "type": {
@@ -16716,20 +16807,6 @@
"name": "float32" "name": "float32"
} }
}, },
{
"name": "m_flJumpUntil",
"type": {
"category": 0,
"name": "float32"
}
},
{
"name": "m_flJumpVel",
"type": {
"category": 0,
"name": "float32"
}
},
{ {
"name": "m_fStashGrenadeParameterWhen", "name": "m_fStashGrenadeParameterWhen",
"type": { "type": {
@@ -16785,6 +16862,20 @@
"category": 0, "category": 0,
"name": "float32" "name": "float32"
} }
},
{
"name": "m_flStaminaAtJumpStart",
"type": {
"category": 0,
"name": "float32"
}
},
{
"name": "m_flAccumulatedJumpError",
"type": {
"category": 0,
"name": "float32"
}
} }
], ],
"parent": "CPlayer_MovementServices_Humanoid" "parent": "CPlayer_MovementServices_Humanoid"
@@ -17616,6 +17707,13 @@
"name": "GameTime_t" "name": "GameTime_t"
} }
}, },
{
"name": "m_nextPrevOwnerUseTime",
"type": {
"category": 5,
"name": "GameTime_t"
}
},
{ {
"name": "m_hPrevOwner", "name": "m_hPrevOwner",
"type": { "type": {
@@ -20347,6 +20445,13 @@
"name": "uint64" "name": "uint64"
} }
}, },
{
"name": "m_iBulletsDamage",
"type": {
"category": 0,
"name": "int32"
}
},
{ {
"name": "m_iDamage", "name": "m_iDamage",
"type": { "type": {
@@ -20548,6 +20653,156 @@
], ],
"parent": "CAnimComponentUpdater" "parent": "CAnimComponentUpdater"
}, },
"CDestructiblePartRuntimeData": {
"fields": [
{
"name": "m_nHealthRemaining",
"type": {
"category": 0,
"name": "int32"
}
}
]
},
"CDestructiblePartRuntimeDataVector": {
"fields": [
{
"name": "m_DestructiblePartsRuntimeData",
"type": {
"atomic": 2,
"category": 4,
"inner": {
"category": 5,
"name": "CDestructiblePartRuntimeData"
},
"name": "CUtlVector< CDestructiblePartRuntimeData >"
}
}
]
},
"CDestructiblePartsSystemData": {
"fields": [
{
"name": "m_DestructiblePartsDataByHitGroup",
"type": {
"atomic": 3,
"category": 4,
"name": "CUtlOrderedMap< HitGroup_t, CDestructiblePartsSystemData_HitGroupInfoAndPartData >"
}
}
]
},
"CDestructiblePartsSystemData_HitGroupInfoAndPartData": {
"fields": [
{
"name": "m_sName",
"type": {
"atomic": 0,
"category": 4,
"name": "CUtlString"
}
},
{
"name": "m_DestructiblePartsData",
"type": {
"atomic": 2,
"category": 4,
"inner": {
"category": 5,
"name": "CDestructiblePartsSystemData_PartData"
},
"name": "CUtlVector< CDestructiblePartsSystemData_PartData >"
}
},
{
"name": "m_bDisableHitGroupWhenDestroyed",
"type": {
"category": 0,
"name": "bool"
}
}
]
},
"CDestructiblePartsSystemData_PartData": {
"fields": [
{
"name": "m_sName",
"type": {
"atomic": 0,
"category": 4,
"name": "CUtlString"
}
},
{
"name": "m_sBreakablePieceName",
"type": {
"atomic": 0,
"category": 4,
"name": "CGlobalSymbol"
}
},
{
"name": "m_sBodyGroupName",
"type": {
"atomic": 0,
"category": 4,
"name": "CGlobalSymbol"
}
},
{
"name": "m_nBodyGroupValue",
"type": {
"category": 0,
"name": "int32"
}
},
{
"name": "m_sAnimGraphParamName_PartDestroyed",
"type": {
"atomic": 0,
"category": 4,
"name": "CGlobalSymbol"
}
},
{
"name": "m_sAnimGraphParamName_PartNormalizedHealth",
"type": {
"atomic": 0,
"category": 4,
"name": "CGlobalSymbol"
}
},
{
"name": "m_nHealth",
"type": {
"category": 5,
"name": "CSkillInt"
}
},
{
"name": "m_nDamagePassthroughType",
"type": {
"category": 6,
"name": "EDestructiblePartDamagePassThroughType"
}
},
{
"name": "m_bKillNPCOnDestruction",
"type": {
"category": 0,
"name": "bool"
}
},
{
"name": "m_sCustomDeathHandshake",
"type": {
"atomic": 0,
"category": 4,
"name": "CGlobalSymbol"
}
}
]
},
"CDirectPlaybackTagData": { "CDirectPlaybackTagData": {
"fields": [ "fields": [
{ {
@@ -24209,14 +24464,6 @@
"name": "float32" "name": "float32"
} }
}, },
{
"name": "m_soundscapeName",
"type": {
"atomic": 0,
"category": 4,
"name": "CUtlSymbolLarge"
}
},
{ {
"name": "m_soundEventName", "name": "m_soundEventName",
"type": { "type": {
@@ -24246,13 +24493,6 @@
"name": "int32" "name": "int32"
} }
}, },
{
"name": "m_soundEventHash",
"type": {
"category": 0,
"name": "uint32"
}
},
{ {
"name": "m_positionNames", "name": "m_positionNames",
"type": { "type": {
@@ -24283,9 +24523,24 @@
"category": 0, "category": 0,
"name": "bool" "name": "bool"
} }
},
{
"name": "m_soundscapeName",
"type": {
"atomic": 0,
"category": 4,
"name": "CUtlSymbolLarge"
}
},
{
"name": "m_soundEventHash",
"type": {
"category": 0,
"name": "uint32"
}
} }
], ],
"parent": "CServerOnlyEntity" "parent": "CBaseEntity"
}, },
"CEnvSoundscapeAlias_snd_soundscape": { "CEnvSoundscapeAlias_snd_soundscape": {
"fields": [], "fields": [],
@@ -34850,6 +35105,13 @@
"category": 0, "category": 0,
"name": "bool" "name": "bool"
} }
},
{
"name": "m_bRainTraceToSkyEnabled",
"type": {
"category": 0,
"name": "bool"
}
} }
], ],
"parent": "CPointEntity" "parent": "CPointEntity"
@@ -48678,6 +48940,17 @@
"name": "char[64]" "name": "char[64]"
} }
}, },
{
"name": "m_BackgroundMaterialName",
"type": {
"category": 3,
"inner": {
"category": 0,
"name": "char"
},
"name": "char[64]"
}
},
{ {
"name": "m_bEnabled", "name": "m_bEnabled",
"type": { "type": {
@@ -48713,6 +48986,34 @@
"name": "float32" "name": "float32"
} }
}, },
{
"name": "m_bDrawBackground",
"type": {
"category": 0,
"name": "bool"
}
},
{
"name": "m_flBackgroundBorderWidth",
"type": {
"category": 0,
"name": "float32"
}
},
{
"name": "m_flBackgroundBorderHeight",
"type": {
"category": 0,
"name": "float32"
}
},
{
"name": "m_flBackgroundWorldToUV",
"type": {
"category": 0,
"name": "float32"
}
},
{ {
"name": "m_Color", "name": "m_Color",
"type": { "type": {
@@ -51818,6 +52119,13 @@
"category": 0, "category": 0,
"name": "bool" "name": "bool"
} }
},
{
"name": "m_bCanTakeDamage",
"type": {
"category": 0,
"name": "bool"
}
} }
], ],
"parent": "CBaseEntity" "parent": "CBaseEntity"
@@ -57267,7 +57575,21 @@
"category": 0, "category": 0,
"name": "uint8" "name": "uint8"
}, },
"name": "CUtlVector< uint8 >" "name": "CNetworkUtlVectorBase< uint8 >"
}
},
{
"name": "m_nVoxelFrameDataSize",
"type": {
"category": 0,
"name": "int32"
}
},
{
"name": "m_nVoxelUpdate",
"type": {
"category": 0,
"name": "int32"
} }
}, },
{ {
@@ -87420,6 +87742,13 @@
"category": 0, "category": 0,
"name": "int32" "name": "int32"
} }
},
{
"name": "m_EndEffectorRotationFixUpMode",
"type": {
"category": 6,
"name": "EIKEndEffectorRotationFixUpMode"
}
} }
] ]
}, },
@@ -92093,6 +92422,13 @@
"category": 0, "category": 0,
"name": "bool" "name": "bool"
} }
},
{
"name": "m_nHealthToGrant",
"type": {
"category": 0,
"name": "int32"
}
} }
] ]
}, },
@@ -94126,13 +94462,6 @@
}, },
"name": "CUtlVector< ChainToSolveData_t >" "name": "CUtlVector< ChainToSolveData_t >"
} }
},
{
"name": "m_bMatchTargetOrientation",
"type": {
"category": 0,
"name": "bool"
}
} }
] ]
}, },
@@ -101062,6 +101391,23 @@
} }
] ]
}, },
"EContributionScoreFlag_t": {
"align": 1,
"items": [
{
"name": "k_EContributionScoreFlag_Default",
"value": 0
},
{
"name": "k_EContributionScoreFlag_Objective",
"value": 1
},
{
"name": "k_EContributionScoreFlag_Bullets",
"value": 2
}
]
},
"EDemoBoneSelectionMode": { "EDemoBoneSelectionMode": {
"align": 4, "align": 4,
"items": [ "items": [
@@ -101075,6 +101421,44 @@
} }
] ]
}, },
"EDestructiblePartDamagePassThroughType": {
"align": 4,
"items": [
{
"name": "Normal",
"value": 0
},
{
"name": "Absorb",
"value": 1
}
]
},
"EIKEndEffectorRotationFixUpMode": {
"align": 4,
"items": [
{
"name": "None",
"value": 0
},
{
"name": "MatchTargetOrientation",
"value": 1
},
{
"name": "LookAtTargetForward",
"value": 2
},
{
"name": "MaintainParentOrientation",
"value": 3
},
{
"name": "Count",
"value": 4
}
]
},
"EInButtonState": { "EInButtonState": {
"align": 4, "align": 4,
"items": [ "items": [

View File

@@ -30,14 +30,15 @@
*/ */
#include "core/timer_system.h" #include "core/timer_system.h"
#include <algorithm>
#include <public/eiface.h> #include <public/eiface.h>
#include <algorithm>
#include "core/globals.h" #include "core/globals.h"
#include "core/log.h" #include "core/log.h"
#include "scripting/callback_manager.h"
#include "core/managers/player_manager.h" #include "core/managers/player_manager.h"
#include "scripting/callback_manager.h"
namespace counterstrikesharp { namespace counterstrikesharp {
namespace timers { namespace timers {
@@ -46,8 +47,7 @@ double timer_next_think = 0.0f;
} // namespace timers } // namespace timers
timers::Timer::Timer(float interval, float exec_time, CallbackT callback, int flags) timers::Timer::Timer(float interval, float exec_time, CallbackT callback, int flags)
: m_interval(interval), m_exec_time(exec_time), m_flags(flags), m_kill_me(false), : m_interval(interval), m_exec_time(exec_time), m_flags(flags), m_kill_me(false), m_in_exec(false)
m_in_exec(false)
{ {
m_callback = globals::callbackManager.CreateCallback("Timer"); m_callback = globals::callbackManager.CreateCallback("Timer");
m_callback->AddListener(callback); m_callback->AddListener(callback);
@@ -76,7 +76,8 @@ void TimerSystem::OnShutdown()
void TimerSystem::OnLevelEnd() void TimerSystem::OnLevelEnd()
{ {
if (on_map_end_callback && on_map_end_callback->GetFunctionCount()) { if (on_map_end_callback && on_map_end_callback->GetFunctionCount())
{
on_map_end_callback->ScriptContext().Reset(); on_map_end_callback->ScriptContext().Reset();
on_map_end_callback->Execute(); on_map_end_callback->Execute();
} }
@@ -89,7 +90,8 @@ void TimerSystem::OnLevelEnd()
void TimerSystem::OnStartupServer() void TimerSystem::OnStartupServer()
{ {
if (m_has_map_ticked) { if (m_has_map_ticked)
{
CALL_GLOBAL_LISTENER(OnLevelEnd()); CALL_GLOBAL_LISTENER(OnLevelEnd());
CSSHARP_CORE_TRACE("name={0}", "LevelShutdown"); CSSHARP_CORE_TRACE("name={0}", "LevelShutdown");
@@ -101,12 +103,16 @@ void TimerSystem::OnStartupServer()
void TimerSystem::OnGameFrame(bool simulating) void TimerSystem::OnGameFrame(bool simulating)
{ {
if (simulating && m_has_map_ticked) { if (simulating && m_has_map_ticked)
{
timers::universal_time += globals::getGlobalVars()->curtime - m_last_ticked_time; timers::universal_time += globals::getGlobalVars()->curtime - m_last_ticked_time;
if (!m_has_map_simulated) { if (!m_has_map_simulated)
{
m_has_map_simulated = true; m_has_map_simulated = true;
} }
} else { }
else
{
timers::universal_time += globals::engine_fixed_tick_interval; timers::universal_time += globals::engine_fixed_tick_interval;
} }
@@ -114,13 +120,15 @@ void TimerSystem::OnGameFrame(bool simulating)
m_has_map_ticked = true; m_has_map_ticked = true;
// Handle timer tick // Handle timer tick
if (timers::universal_time >= timers::timer_next_think) { if (timers::universal_time >= timers::timer_next_think)
{
RunFrame(); RunFrame();
timers::timer_next_think = CalculateNextThink(timers::timer_next_think, 0.1f); timers::timer_next_think = CalculateNextThink(timers::timer_next_think, 0.1f);
} }
if (m_on_tick_callback_->GetFunctionCount()) { if (m_on_tick_callback_->GetFunctionCount())
{
m_on_tick_callback_->ScriptContext().Reset(); m_on_tick_callback_->ScriptContext().Reset();
m_on_tick_callback_->Execute(); m_on_tick_callback_->Execute();
} }
@@ -130,18 +138,23 @@ void TimerSystem::OnGameFrame(bool simulating)
double TimerSystem::CalculateNextThink(double last_think_time, float interval) double TimerSystem::CalculateNextThink(double last_think_time, float interval)
{ {
if (timers::universal_time - last_think_time - interval <= 0.1) { if (timers::universal_time - last_think_time - interval <= 0.1)
{
return last_think_time + interval; return last_think_time + interval;
} else { }
else
{
return timers::universal_time + interval; return timers::universal_time + interval;
} }
} }
void TimerSystem::RunFrame() void TimerSystem::RunFrame()
{ {
for (int i = m_once_off_timers.size() - 1; i >= 0; i--) { for (int i = m_once_off_timers.size() - 1; i >= 0; i--)
{
auto timer = m_once_off_timers[i]; auto timer = m_once_off_timers[i];
if (timers::universal_time >= timer->m_exec_time) { if (timers::universal_time >= timer->m_exec_time)
{
timer->m_in_exec = true; timer->m_in_exec = true;
timer->m_callback->ScriptContext().Reset(); timer->m_callback->ScriptContext().Reset();
timer->m_callback->Execute(); timer->m_callback->Execute();
@@ -151,14 +164,17 @@ void TimerSystem::RunFrame()
} }
} }
for (int i = m_repeat_timers.size() - 1; i >= 0; i--) { for (int i = m_repeat_timers.size() - 1; i >= 0; i--)
{
auto timer = m_repeat_timers[i]; auto timer = m_repeat_timers[i];
if (timers::universal_time >= timer->m_exec_time) { if (timers::universal_time >= timer->m_exec_time)
{
timer->m_in_exec = true; timer->m_in_exec = true;
timer->m_callback->ScriptContext().Reset(); timer->m_callback->ScriptContext().Reset();
timer->m_callback->Execute(); timer->m_callback->Execute();
if (timer->m_kill_me) { if (timer->m_kill_me)
{
m_repeat_timers.erase(m_repeat_timers.begin() + i); m_repeat_timers.erase(m_repeat_timers.begin() + i);
delete timer; delete timer;
continue; continue;
@@ -172,17 +188,17 @@ void TimerSystem::RunFrame()
void TimerSystem::RemoveMapChangeTimers() void TimerSystem::RemoveMapChangeTimers()
{ {
for (auto timer : m_once_off_timers) { auto isMapChangeTimer = [](timers::Timer* timer) {
if (timer->m_flags & TIMER_FLAG_NO_MAPCHANGE) { bool shouldRemove = timer->m_flags & TIMER_FLAG_NO_MAPCHANGE;
KillTimer(timer); if (shouldRemove)
{
delete timer;
} }
} return shouldRemove;
};
for (auto timer : m_repeat_timers) { std::erase_if(m_once_off_timers, isMapChangeTimer);
if (timer->m_flags & TIMER_FLAG_NO_MAPCHANGE) { std::erase_if(m_repeat_timers, isMapChangeTimer);
KillTimer(timer);
}
}
} }
timers::Timer* TimerSystem::CreateTimer(float interval, CallbackT callback, int flags) timers::Timer* TimerSystem::CreateTimer(float interval, CallbackT callback, int flags)
@@ -191,7 +207,8 @@ timers::Timer* TimerSystem::CreateTimer(float interval, CallbackT callback, int
auto timer = new timers::Timer(interval, exec_time, callback, flags); auto timer = new timers::Timer(interval, exec_time, callback, flags);
if (flags & TIMER_FLAG_REPEAT) { if (flags & TIMER_FLAG_REPEAT)
{
m_repeat_timers.push_back(timer); m_repeat_timers.push_back(timer);
return timer; return timer;
} }
@@ -202,39 +219,41 @@ timers::Timer* TimerSystem::CreateTimer(float interval, CallbackT callback, int
void TimerSystem::KillTimer(timers::Timer* timer) void TimerSystem::KillTimer(timers::Timer* timer)
{ {
if (!timer) if (!timer) return;
return;
if (std::find(m_repeat_timers.begin(), m_repeat_timers.end(), timer) == m_repeat_timers.end() && if (std::find(m_repeat_timers.begin(), m_repeat_timers.end(), timer) == m_repeat_timers.end() &&
std::find(m_once_off_timers.begin(), m_once_off_timers.end(), timer) == std::find(m_once_off_timers.begin(), m_once_off_timers.end(), timer) == m_once_off_timers.end())
m_once_off_timers.end()) { {
return; return;
} }
if (timer->m_kill_me) if (timer->m_kill_me) return;
return;
// If were executing, make sure it doesn't run again next time. // If were executing, make sure it doesn't run again next time.
if (timer->m_in_exec) { if (timer->m_in_exec)
{
timer->m_kill_me = true; timer->m_kill_me = true;
return; return;
} }
if (timer->m_flags & TIMER_FLAG_REPEAT) { if (timer->m_flags & TIMER_FLAG_REPEAT)
auto it = std::remove_if(m_repeat_timers.begin(), m_repeat_timers.end(), {
[timer](timers::Timer* i) { return timer == i; }); auto it = std::remove_if(m_repeat_timers.begin(), m_repeat_timers.end(), [timer](timers::Timer* i) {
return timer == i;
});
bool success; bool success;
if ((success = it != m_repeat_timers.end())) if ((success = it != m_repeat_timers.end())) m_repeat_timers.erase(it, m_repeat_timers.end());
m_repeat_timers.erase(it, m_repeat_timers.end());
delete timer; delete timer;
} else { }
auto it = std::remove_if(m_once_off_timers.begin(), m_once_off_timers.end(), else
[timer](timers::Timer* i) { return timer == i; }); {
auto it = std::remove_if(m_once_off_timers.begin(), m_once_off_timers.end(), [timer](timers::Timer* i) {
return timer == i;
});
bool success; bool success;
if ((success = it != m_once_off_timers.end())) if ((success = it != m_once_off_timers.end())) m_once_off_timers.erase(it, m_once_off_timers.end());
m_once_off_timers.erase(it, m_once_off_timers.end());
delete timer; delete timer;
} }
} }

View File

@@ -17,11 +17,11 @@
#include <ios> #include <ios>
#include <sstream> #include <sstream>
#include "scripting/autonative.h"
#include "core/function.h" #include "core/function.h"
#include "scripting/script_engine.h"
#include "core/memory.h"
#include "core/log.h" #include "core/log.h"
#include "core/memory.h"
#include "scripting/autonative.h"
#include "scripting/script_engine.h"
namespace counterstrikesharp { namespace counterstrikesharp {
std::vector<ValveFunction*> m_managed_ptrs; std::vector<ValveFunction*> m_managed_ptrs;
@@ -44,21 +44,22 @@ ValveFunction* CreateVirtualFunctionBySignature(ScriptContext& script_context)
auto* function_addr = FindSignature(binary_name, signature_hex_string); auto* function_addr = FindSignature(binary_name, signature_hex_string);
if (function_addr == nullptr) { if (function_addr == nullptr)
{
script_context.ThrowNativeError("Could not find signature %s", signature_hex_string); script_context.ThrowNativeError("Could not find signature %s", signature_hex_string);
return nullptr; return nullptr;
} }
auto args = std::vector<DataType_t>(); auto args = std::vector<DataType_t>();
for (int i = 0; i < num_arguments; i++) { for (int i = 0; i < num_arguments; i++)
{
args.push_back(script_context.GetArgument<DataType_t>(5 + i)); args.push_back(script_context.GetArgument<DataType_t>(5 + i));
} }
auto function = new ValveFunction(function_addr, CONV_CDECL, args, return_type); auto function = new ValveFunction(function_addr, CONV_CDECL, args, return_type);
function->SetSignature(signature_hex_string); function->SetSignature(signature_hex_string);
CSSHARP_CORE_TRACE("Created virtual function, pointer found at {}, signature {}", function_addr, CSSHARP_CORE_TRACE("Created virtual function, pointer found at {}, signature {}", function_addr, signature_hex_string);
signature_hex_string);
m_managed_ptrs.push_back(function); m_managed_ptrs.push_back(function);
return function; return function;
@@ -72,7 +73,8 @@ ValveFunction* CreateVirtualFunction(ScriptContext& script_context)
auto return_type = script_context.GetArgument<DataType_t>(3); auto return_type = script_context.GetArgument<DataType_t>(3);
void** vtable = *(void***)ptr; void** vtable = *(void***)ptr;
if (!vtable) { if (!vtable)
{
script_context.ThrowNativeError("Failed to get the virtual function table."); script_context.ThrowNativeError("Failed to get the virtual function table.");
return nullptr; return nullptr;
} }
@@ -80,7 +82,8 @@ ValveFunction* CreateVirtualFunction(ScriptContext& script_context)
auto function_addr = (void*)vtable[vtable_offset]; auto function_addr = (void*)vtable[vtable_offset];
auto args = std::vector<DataType_t>(); auto args = std::vector<DataType_t>();
for (int i = 0; i < num_arguments; i++) { for (int i = 0; i < num_arguments; i++)
{
args.push_back(script_context.GetArgument<DataType_t>(4 + i)); args.push_back(script_context.GetArgument<DataType_t>(4 + i));
} }
@@ -97,7 +100,8 @@ void HookFunction(ScriptContext& script_context)
auto callback = script_context.GetArgument<CallbackT>(1); auto callback = script_context.GetArgument<CallbackT>(1);
auto post = script_context.GetArgument<bool>(2); auto post = script_context.GetArgument<bool>(2);
if (!function) { if (!function)
{
script_context.ThrowNativeError("Invalid function pointer"); script_context.ThrowNativeError("Invalid function pointer");
return; return;
} }
@@ -111,7 +115,8 @@ void UnhookFunction(ScriptContext& script_context)
auto callback = script_context.GetArgument<CallbackT>(1); auto callback = script_context.GetArgument<CallbackT>(1);
auto post = script_context.GetArgument<bool>(2); auto post = script_context.GetArgument<bool>(2);
if (!function) { if (!function)
{
script_context.ThrowNativeError("Invalid function pointer"); script_context.ThrowNativeError("Invalid function pointer");
return; return;
} }
@@ -123,7 +128,8 @@ void ExecuteVirtualFunction(ScriptContext& script_context)
{ {
auto function = script_context.GetArgument<ValveFunction*>(0); auto function = script_context.GetArgument<ValveFunction*>(0);
if (!function) { if (!function)
{
script_context.ThrowNativeError("Invalid function pointer"); script_context.ThrowNativeError("Invalid function pointer");
return; return;
} }
@@ -155,8 +161,7 @@ void RemoveAllNetworkVectorElements(ScriptContext& script_context)
REGISTER_NATIVES(memory, { REGISTER_NATIVES(memory, {
ScriptEngine::RegisterNativeHandler("CREATE_VIRTUAL_FUNCTION", CreateVirtualFunction); ScriptEngine::RegisterNativeHandler("CREATE_VIRTUAL_FUNCTION", CreateVirtualFunction);
ScriptEngine::RegisterNativeHandler("CREATE_VIRTUAL_FUNCTION_BY_SIGNATURE", ScriptEngine::RegisterNativeHandler("CREATE_VIRTUAL_FUNCTION_BY_SIGNATURE", CreateVirtualFunctionBySignature);
CreateVirtualFunctionBySignature);
ScriptEngine::RegisterNativeHandler("EXECUTE_VIRTUAL_FUNCTION", ExecuteVirtualFunction); ScriptEngine::RegisterNativeHandler("EXECUTE_VIRTUAL_FUNCTION", ExecuteVirtualFunction);
ScriptEngine::RegisterNativeHandler("HOOK_FUNCTION", HookFunction); ScriptEngine::RegisterNativeHandler("HOOK_FUNCTION", HookFunction);
ScriptEngine::RegisterNativeHandler("UNHOOK_FUNCTION", UnhookFunction); ScriptEngine::RegisterNativeHandler("UNHOOK_FUNCTION", UnhookFunction);