From bac31b9190edcb2ab0e9ffdde93ddcb69ee50a8a Mon Sep 17 00:00:00 2001 From: ZoNiCaL Date: Fri, 12 Jan 2024 15:14:38 +1300 Subject: [PATCH] Purge disabled folder (#256) --- .../Modules/Disabled/Cvars/ConVar.cs | 110 ----- .../Disabled/Engine/Trace/ContentMasks.cs | 22 - .../Modules/Disabled/Engine/Trace/RayType.cs | 24 - .../Engine/Trace/SimpleTraceFilter.cs | 166 ------- .../Disabled/Engine/Trace/TraceEngine.cs | 43 -- .../Disabled/Engine/Trace/TraceResult.cs | 63 --- .../Modules/Disabled/Entities/BaseEntity.cs | 449 ------------------ .../Disabled/Entities/Constants/DamageType.cs | 60 --- .../Entities/Constants/EntityFlags.cs | 56 --- .../Disabled/Entities/Constants/HitGroup.cs | 31 -- .../Disabled/Entities/Constants/LifeState.cs | 27 -- .../Disabled/Entities/Constants/MoveType.cs | 39 -- .../Entities/Constants/ObserverMode.cs | 31 -- .../Entities/Constants/PlayerAnimation.cs | 34 -- .../Disabled/Entities/Constants/PropType.cs | 33 -- .../Disabled/Entities/Constants/RenderFx.cs | 48 -- .../Disabled/Entities/Constants/RenderMode.cs | 33 -- .../Disabled/Entities/Constants/SolidFlags.cs | 40 -- .../Disabled/Entities/Constants/SolidType.cs | 30 -- .../Disabled/Entities/Constants/Team.cs | 29 -- .../Disabled/Players/Constants/NetFlow.cs | 24 - .../Modules/Disabled/Players/Player.cs | 150 ------ .../Modules/Disabled/Players/PlayerInfo.cs | 63 --- .../Sound/Constants/SoundAttenuation.cs | 28 -- .../Disabled/Sound/Constants/SoundChannel.cs | 32 -- .../Disabled/Sound/Constants/SoundFlags.cs | 42 -- .../Disabled/Sound/Constants/SoundLevel.cs | 62 --- .../Disabled/Sound/Constants/SoundPitch.cs | 25 - .../Disabled/Sound/Constants/SoundSource.cs | 25 - .../Modules/Disabled/Sound/Sound.cs | 72 --- 30 files changed, 1891 deletions(-) delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Cvars/ConVar.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/ContentMasks.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/RayType.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/SimpleTraceFilter.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceEngine.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceResult.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/BaseEntity.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/DamageType.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/EntityFlags.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/HitGroup.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/LifeState.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/MoveType.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/ObserverMode.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PlayerAnimation.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PropType.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderFx.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderMode.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidFlags.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidType.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/Team.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Players/Constants/NetFlow.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Players/Player.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Players/PlayerInfo.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundAttenuation.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundChannel.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundFlags.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundLevel.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundPitch.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundSource.cs delete mode 100644 managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Sound.cs diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Cvars/ConVar.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Cvars/ConVar.cs deleted file mode 100644 index 5e7cd446b..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Cvars/ConVar.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Listeners; - -namespace CounterStrikeSharp.API.Modules.Cvars -{ - public class ConVar - { - public delegate void ConVarChangedCallback(ConVar convar, string oldValue, string newValue); - - public IntPtr Handle { get; private set; } - - internal ConVar(IntPtr handle) - { - Handle = handle; - } - - public ConVar(string name, string value, string description, ConVarFlags flags, bool hasMinValue, float minValue, bool hasMaxValue, float maxValue) : - this(NativeAPI.CreateConvar(name, value, description, (int)flags, hasMinValue, minValue, hasMaxValue, maxValue)) - { - } - - public ConVar(string name, string value, string description = null, ConVarFlags flags = ConVarFlags.None, float? minValue = null, float? maxValue = null) : - this(name, value, description, flags, minValue.HasValue, minValue?? 0, maxValue.HasValue, maxValue?? 0) - { - - } - - public string Name => NativeAPI.ConvarGetName(Handle); - - public string StringValue - { - get { return NativeAPI.ConvarGetStringValue(Handle); } - set { NativeAPI.ConvarSetStringValue(Handle, value); } - } - - public float FloatValue - { - get { return Convert.ToSingle(NativeAPI.ConvarGetStringValue(Handle)); } - set { NativeAPI.ConvarSetStringValue(Handle, value.ToString("n2")); } - } - - public int IntValue - { - get { return Convert.ToInt32(NativeAPI.ConvarGetStringValue(Handle)); } - set { NativeAPI.ConvarSetStringValue(Handle, value.ToString()); } - } - - public bool BoolValue - { - get { return NativeAPI.ConvarGetStringValue(Handle) == "1"; } - set { NativeAPI.ConvarSetStringValue(Handle, value ? "1" : "0"); } - } - - public ConVarFlags Flags - { - get { return (ConVarFlags) NativeAPI.ConvarGetFlags(Handle); } - set { NativeAPI.ConvarSetFlags(Handle, (int)value); } - } - - public bool Public - { - get { return Flags.HasFlag(ConVarFlags.Notify); } - set - { - if (value) - { - Flags |= ConVarFlags.Notify; - } - else - { - Flags &= ~ConVarFlags.Notify; - } - } - } - - public static ConVar Find(string name) - { - var ptr = NativeAPI.FindConvar(name); - if (ptr == IntPtr.Zero) return null; - - return new ConVar(ptr); - } - - public void Unregister() - { - NativeAPI.ConvarUnregister(Handle); - } - } -} diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/ContentMasks.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/ContentMasks.cs deleted file mode 100644 index f6c78847a..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/ContentMasks.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Engine.Trace -{ - public enum ContentMasks - { - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/RayType.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/RayType.cs deleted file mode 100644 index 903ec1c18..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/RayType.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Engine.Trace -{ - public enum RayType - { - EndPoint, - Infinite - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/SimpleTraceFilter.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/SimpleTraceFilter.cs deleted file mode 100644 index ac42d2f77..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/SimpleTraceFilter.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using System.Runtime.InteropServices; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Entities; -using CounterStrikeSharp.API.Modules.Listeners; - -namespace CounterStrikeSharp.API.Modules.Engine.Trace -{ - public class SimpleTraceFilter : NativeObject - { - public SimpleTraceFilter(IntPtr cPtr) : base(cPtr) - { - } - - public SimpleTraceFilter(int indexToIgnore) : base(NativeAPI.NewSimpleTraceFilter(indexToIgnore)) - { - - } - } - - public class TraceFilterProxy : NativeObject - { - private ITraceFilter _filter; - private FunctionReference.CallbackDelegate getTypeCallback; - private FunctionReference.CallbackDelegate shouldHitCallback; - - public TraceFilterProxy(IntPtr cPtr) : base(cPtr) - { - } - - public TraceFilterProxy(ITraceFilter filter) : base(NativeAPI.NewTraceFilterProxy()) - { - _filter = filter; - - /* - getTypeCallback = Utilities.SafeExecute(intPtr => - { - var marshal = new CMarshalObject(); - marshal.PushInt((int) _filter.GetTraceType()); - return marshal.GetPointer(); - }); - */ - - /*shouldHitCallback = Utilities.SafeExecute(ptr => - { - var marshal = new CMarshalObject(ptr, true); - var entity = marshal.GetValue(); - var contentMask = marshal.GetInt(); - - var isValidEntity = _filter.ShouldHitEntity(entity, contentMask); - - var response = new CMarshalObject(); - response.PushInt(isValidEntity ? 1 : 0); - - return response.GetPointer(); - });*/ - - unsafe - { - getTypeCallback = (fxScriptContext* context) => - { - var scriptContext = new ScriptContext(context); - - scriptContext.Push(_filter.GetTraceType()); - }; - - shouldHitCallback = (fxScriptContext* context) => - { - var scriptContext = new ScriptContext(context); - - var entity = new BaseEntity(scriptContext.GetArgument(0)); - var contentMask = scriptContext.GetArgument(1); - - var isValidEntity = _filter.ShouldHitEntity(entity, contentMask); - - Console.WriteLine($"Returning {isValidEntity} to `ShouldHitEntity`"); - - scriptContext.SetResult(isValidEntity, context); - }; - } - - - NativeAPI.TraceFilterProxySetTraceTypeCallback(Handle, Marshal.GetFunctionPointerForDelegate(getTypeCallback)); - NativeAPI.TraceFilterProxySetShouldHitEntityCallback(Handle, Marshal.GetFunctionPointerForDelegate(shouldHitCallback)); - /*NativeAPI.TraceFilterProxySetTraceTypeCallback(Handle, getTypeCallback); - NativePINVOKE.TraceFilterProxy_SetGetTraceTypeCallback(ptr, getTypeCallback.ToHandle()); - NativePINVOKE.TraceFilterProxy_SetShouldHitEntityCallback(ptr, shouldHitCallback.ToHandle());*/ - } - } - - public enum TraceType - { - Everything = 0, - WorldOnly, // NOTE: This does *not* test static props!!! - EntitiesOnly, // NOTE: This version will *not* test static props - EverythingFilterProps, // NOTE: This version will pass the IHandleEntity for props through the filter, unlike all other filters - }; - - public class CustomTraceFilter : TraceFilter - { - private Func _filter; - - public CustomTraceFilter(Func filter) - { - _filter = filter; - } - public override bool ShouldHitEntity(BaseEntity entity, int contentMask) - { - return _filter.Invoke(entity); - } - - public override TraceType GetTraceType() - { - return TraceType.Everything; - } - } - - public class ExclusionTraceFilter : TraceFilter - { - private int _indexToExclude; - - public ExclusionTraceFilter(int indexToExclude) - { - this._indexToExclude = indexToExclude; - } - public override bool ShouldHitEntity(BaseEntity entity, int contentMask) - { - if (entity.Index == _indexToExclude) return false; - - return true; - } - - public override TraceType GetTraceType() - { - return TraceType.Everything; - } - } - - public abstract class TraceFilter : ITraceFilter - { - public abstract bool ShouldHitEntity(BaseEntity entity, int contentMask); - public abstract TraceType GetTraceType(); - } - - public interface ITraceFilter - { - bool ShouldHitEntity(BaseEntity entity, int contentMask); - TraceType GetTraceType(); - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceEngine.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceEngine.cs deleted file mode 100644 index 2814f4098..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceEngine.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Utils; - -namespace CounterStrikeSharp.API.Modules.Engine.Trace -{ - public class TraceEngine - { - public static IntPtr CreateRay(RayType rayType, Vector vec1, Vector vec2) - { - return NativeAPI.CreateRay1((int) rayType, vec1.Handle, vec2.Handle); - } - - public static IntPtr CreateRay(Vector vec1, Vector vec2, Vector vec3, Vector vec4) - { - return NativeAPI.CreateRay2(vec1.Handle, vec2.Handle, vec3.Handle, vec4.Handle); - } - - public static TraceResult TraceRay(IntPtr ray, uint mask, ITraceFilter filter) - { - var tr = new TraceResult(); - var proxy = new TraceFilterProxy(filter); - NativeAPI.TraceRay(ray, tr.Handle, proxy.Handle, mask); - return tr; - } - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceResult.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceResult.cs deleted file mode 100644 index 61ef860a4..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Engine/Trace/TraceResult.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Entities; -using CounterStrikeSharp.API.Modules.Utils; - -namespace CounterStrikeSharp.API.Modules.Engine.Trace -{ - public class TraceResult : NativeObject - { - public TraceResult(IntPtr cPtr) : base(cPtr) - { - } - - public TraceResult() : base(NativeAPI.NewTraceResult()) - { - } - - public bool DidHit() - { - // return NativeAPI.TraceDidHit(Handle); - return false; - } - - public BaseEntity Entity - { - get - { - var entity = new BaseEntity(NativeAPI.TraceResultEntity(Handle)); - if (entity?.IsNetworked == true) - { - return entity; - } - - return null; - } - } - - /*public TraceSurface Surface => NativePINVOKE.CGameTrace_surface_get(ptr).ToObject(); - public int Hitbox => NativePINVOKE.CGameTrace_hitbox_get(ptr); - public int Hitgroup => NativePINVOKE.CGameTrace_hitgroup_get(ptr); - public float FractionLeftSolid => NativePINVOKE.CGameTrace_fractionleftsolid_get(ptr); - public int PhysicsBone => NativePINVOKE.CGameTrace_physicsbone_get(ptr);*/ - - /*public Vector StartPosition => NativePINVOKE.CBaseTrace_startpos_get(ptr).ToObject(); - public Vector EndPosition => NativePINVOKE.CBaseTrace_endpos_get(ptr).ToObject();*/ - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/BaseEntity.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/BaseEntity.cs deleted file mode 100644 index 5ef8b2263..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/BaseEntity.cs +++ /dev/null @@ -1,449 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using System.Drawing; -using System.Linq; -using System.Numerics; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Entities.Constants; -using CounterStrikeSharp.API.Modules.Utils; -using Vector = CounterStrikeSharp.API.Modules.Utils.Vector; - -namespace CounterStrikeSharp.API.Modules.Entities -{ - public class BaseEntity : NativeObject - { - public BaseEntity(int index) : base(NativeAPI.BaseentityFromIndex(index)) - { - _index = index; - } - - public BaseEntity(IntPtr pointer) : base(pointer) - { - _index = NativeAPI.IndexFromBaseentity(pointer); - } - - public override string ToString() - { - return string.Format("{0}", Index); - } - - #region Props - public int GetProp(PropType type, string name) => NativeAPI.EntityGetPropInt(Index, (int) type, name); - - public T GetProp(PropType type, string name) => (T) (NativeAPI.EntityGetPropInt(Index, (int) type, name) as object); - - public void SetProp(PropType type, string name, int value) => NativeAPI.EntitySetPropInt(Index, (int)type, name, value); - - public void SetProp(PropType type, string name, T value) => NativeAPI.EntitySetPropInt(Index, (int)type, name, (int)(object)value); - - public bool GetPropBool(PropType type, string name) => GetProp(type, name) == 1; - - public void SetPropBool(PropType type, string name, bool value) => SetProp(type, name, value ? 1 : 0); - - public float GetPropFloat(PropType type, string name) => NativeAPI.EntityGetPropFloat(Index, (int) type, name); - - public void SetPropFloat(PropType type, string name, float value) => NativeAPI.EntitySetPropFloat(Index, (int)type, name, value); - - public Vector GetPropVector(PropType type, string name) => new(NativeAPI.EntityGetPropVector(Index, (int) type, name)); - - public void SetPropVector(PropType type, string name, Vector vector) => NativeAPI.EntitySetPropVector(Index, (int) type, name, vector.Handle); - - public string GetPropString(PropType type, string name) => NativeAPI.EntityGetPropString(Index, (int)type, name); - - public void SetPropString(PropType type, string name, string value) => NativeAPI.EntitySetPropString(Index, (int)type, name, value); - - public BaseEntity GetPropEnt(PropType type, string name) - { - var returnVal = NativeAPI.EntityGetPropEnt(Index, (int) type, name); - if (returnVal < 0) return null; - return BaseEntity.FromIndex(returnVal); - } - - public BaseEntity GetPropEntByOffset(int offset) - { - var returnVal = NativeAPI.EntityGetPropEntByOffset(Index, offset); - if (returnVal < 0) return null; - return BaseEntity.FromIndex(returnVal); - } - - public void SetPropEnt(PropType type, string name, int index) => NativeAPI.EntitySetPropEnt(Index, (int) type, name, index); - - #endregion - - #region KeyValues - public string GetKeyValue(string name) => NativeAPI.EntityGetKeyvalue(Index, name); - - public Vector GetKeyValueVector(string name) - { - var values = GetKeyValue(name).Split(new []{" "}, StringSplitOptions.None).Select(float.Parse).ToArray(); - return new Vector(values[0], values[1], values[2]); - } - - public float GetKeyValueFloat(string name) - { - return Convert.ToSingle(GetKeyValue(name)); - } - - public void SetKeyValue(string name, string value) => NativeAPI.EntitySetKeyvalue(Index, name, value); - - public void SetKeyValueFloat(string name, float value) => SetKeyValue(name, value.ToString()); - - public void SetKeyValueVector(string name, Vector vec) - { - string strValue = $"{vec.X} {vec.Y} {vec.Z}"; - NativeAPI.EntitySetKeyvalue(Index, name, strValue); - } - - #endregion - - public bool IsPlayer => NativeAPI.EntityIsPlayer(Index); - public bool IsWeapon => NativeAPI.EntityIsWeapon(Index); - - public bool IsNetworked => NativeAPI.EntityIsNetworked(Index); - public bool IsValid => NativeAPI.EntityIsValid(Index); - - /*public bool IsPlayer => NativePINVOKE.CBaseEntityWrapper_IsPlayer(ptr); - public bool IsWeapon => NativePINVOKE.CBaseEntityWrapper_IsWeapon(ptr); - public bool IsMoving => NativePINVOKE.CBaseEntityWrapper_IsMoving(ptr);*/ - - - public Vector Origin - { - get => GetKeyValueVector("origin"); - set => SetKeyValueVector("origin", value); - } - - - public Vector Maxs - { - get => GetPropVector(PropType.Send, "m_Collision.m_vecMaxs"); - set => SetPropVector(PropType.Send, "m_Collision.m_vecMaxs", value); - } - - public Vector Mins - { - get => GetPropVector(PropType.Send, "m_Collision.m_vecMins"); - set => SetPropVector(PropType.Send, "m_Collision.m_vecMins", value); - } - - public int EntityFlags - { - get => GetProp(PropType.Data, "m_iEFlags"); - set => SetProp(PropType.Data, "m_iEFlags", value); - } - - public SolidType SolidType - { - get => (SolidType)GetProp(PropType.Send, "m_Collision.m_nSolidType"); - set => SetProp(PropType.Send, "m_Collision.m_nSolidType", (int)value); - } - - public SolidFlags SolidFlags - { - get => GetProp(PropType.Send, "m_Collision.m_usSolidFlags"); - set => SetProp(PropType.Send, "m_Collision.m_usSolidFlags", value); - } - - public CollisionGroup CollisionGroup - { - get => GetProp(PropType.Send, "m_CollisionGroup"); - set => SetProp(PropType.Send, "m_CollisionGroup", value); - } - - // TODO: ENTITY RENDER COLOR - public Color Color - { - get - { - int offset = NativeAPI.FindDatamapInfo(Index, "m_clrRender"); - - int r = NativeAPI.EntityGetProp(Index, offset + 0, 8); - int g = NativeAPI.EntityGetProp(Index, offset + 1, 8); - int b = NativeAPI.EntityGetProp(Index, offset + 2, 8); - int a = NativeAPI.EntityGetProp(Index, offset + 3, 8); - return Color.FromArgb(a, r, g, b); - } - set - { - int offset = NativeAPI.FindDatamapInfo(Index, "m_clrRender"); - - NativeAPI.EntitySetProp(Index, offset + 0, 8, value.R); - NativeAPI.EntitySetProp(Index, offset + 1, 8, value.G); - NativeAPI.EntitySetProp(Index, offset + 2, 8, value.B); - NativeAPI.EntitySetProp(Index, offset + 3, 8, value.A); - } - } - - public float Elasticity - { - get => GetPropFloat(PropType.Send, "m_flElasticity"); - set => SetPropFloat(PropType.Send, "m_flElasticity", value); - } - - public BaseEntity GroundEntity - { - get => GetPropEnt(PropType.Data, "m_hGroundEntity"); - set => SetPropEnt(PropType.Data, "m_hGroundEntity", value.Index); - } - - public Team Team - { - get => GetProp(PropType.Send, "m_iTeamNum"); - set => SetProp(PropType.Send, "m_iTeamNum", value); - } - - public RenderFx RenderFx - { - get => (RenderFx)GetProp(PropType.Send, "m_nRenderFX"); - set => SetProp(PropType.Send, "m_nRenderFX", (int)value); - } - - public RenderMode RenderMode - { - get => (RenderMode)GetProp(PropType.Send, "m_nRenderMode"); - set => SetProp(PropType.Send, "m_nRenderMode", (int)value); - } - - public MoveType MoveType - { - get => (MoveType)GetProp(PropType.Send, "movetype"); - set => SetProp(PropType.Send, "movetype", (int)value); - } - - public new IntPtr Handle => NativeAPI.BaseentityFromIndex(Index); - - public int ParentHandle - { - get - { - try - { - return GetProp(PropType.Data, "m_pParent"); - } - catch (Exception) - { - return -1; - } - } - set => SetProp(PropType.Data, "m_pParent", value); - } - - public Vector Angles - { - get => GetKeyValueVector("angles"); - set => SetKeyValueVector("angles", value); - } - - public string TargetName - { - get => GetKeyValue("targetname"); - set => SetKeyValue("targetname", value); - } - - // TODO: Entity Owner Handle - - public Vector AngVelocity - { - get => GetPropVector(PropType.Data, "m_vecAngVelocity"); - set => SetPropVector(PropType.Data, "m_vecAngVelocity", value); - } - - public Vector BaseVelocity - { - get => GetPropVector(PropType.Data, "m_vecBaseVelocity"); - set => SetPropVector(PropType.Data, "m_vecBaseVelocity", value); - } - - public string DamageFilter - { - get => GetKeyValue("damagefilter"); - set => SetKeyValue("damagefilter", value); - } - - public int Effects - { - get => GetProp(PropType.Data, "m_fEffects"); - set => SetProp(PropType.Data, "m_fEffects", value); - } - - public float Friction - { - get => GetPropFloat(PropType.Data, "m_flFriction"); - set => SetPropFloat(PropType.Data, "m_flFriction", value); - } - - public string GlobalName - { - get => GetKeyValue("globalname"); - set => SetKeyValue("globalname", value); - } - - public float Gravity - { - get => GetPropFloat(PropType.Data, "m_flGravity"); - set => SetPropFloat(PropType.Data, "m_flGravity", value); - } - - public int HammerId - { - get => GetProp(PropType.Data, "m_iHammerID"); - set => SetProp(PropType.Data, "m_iHammerID", value); - } - public int Health - { - get => GetProp(PropType.Data, "m_iHealth"); - set => SetProp(PropType.Data, "m_iHealth", value); - } - - public float LocalTime - { - get => GetPropFloat(PropType.Data, "m_flLocalTime"); - set => SetPropFloat(PropType.Data, "m_flLocalTime", value); - } - - public int MaxHealth - { - get => GetProp(PropType.Data, "m_iMaxHealth"); - set => SetProp(PropType.Data, "m_iMaxHealth", value); - } - - public string ParentName - { - get => GetKeyValue("parentname"); - set => SetKeyValue("parentname", value); - } - - public float ShadowCastDistance - { - get => GetPropFloat(PropType.Send, "m_flShadowCastDistance"); - set => SetPropFloat(PropType.Send, "m_flShadowCastDistance", value); - } - public int SpawnFlags - { - get => GetProp(PropType.Data, "m_spawnflags"); - set => SetProp(PropType.Data, "m_spawnflags", value); - } - - public float Speed - { - get - { - try - { - return GetPropFloat(PropType.Data, "m_flLaggedMovementValue"); - } - catch (Exception) - { - return GetKeyValueFloat("speed"); - } - } - - set - { - try - { - SetPropFloat(PropType.Data, "m_flLaggedMovementValue", value); - } - catch (Exception) - { - SetKeyValueFloat("speed", value); - } - } - } - - public string Target - { - get => GetKeyValue("target"); - set => SetKeyValue("target", value); - } - - public Vector Velocity - { - get => GetPropVector(PropType.Data, "m_vecVelocity"); - set => SetPropVector(PropType.Data, "m_vecVelocity", value); - } - - public int WaterLevel - { - get => GetProp(PropType.Data, "m_nWaterLevel"); - set => SetProp(PropType.Data, "m_nWaterLevel", value); - } - - public Vector Rotation - { - get => GetPropVector(PropType.Data, "m_angRotation"); - set => SetPropVector(PropType.Data, "m_angRotation", value); - } - - private int? _index; - public int Index - { - get - { - return _index.Value; - } - } - - public string ClassName => NativeAPI.EntityGetClassname(Index); - - public Vector AbsVelocity - { - get => GetPropVector(PropType.Data, "m_vecAbsVelocity"); - set => SetPropVector(PropType.Data, "m_vecAbsVelocity", value); - } - - public Vector AbsOrigin - { - get => GetPropVector(PropType.Data, "m_vecAbsOrigin"); - set => SetPropVector(PropType.Data, "m_vecAbsOrigin", value); - } - - public void Spawn() => NativeAPI.EntitySpawn(Index); - - public void AcceptInput(string name) => NativeAPI.AcceptInput(Index, name); - - public static BaseEntity Create(string className) - { - var index = NativeAPI.EntityCreateByClassname(className); - if (index < 0) return null; - return new BaseEntity(index); - } - - public static BaseEntity FromIndex(int index) - { - if (index < 0) return null; - var entity = new BaseEntity(index); - if (!entity.IsValid) return null; - return entity; - } - - public static BaseEntity FindByClassname(int startIndex, string className) - { - var index = NativeAPI.EntityFindByClassname(startIndex, className); - if (index < 0) return null; - return new BaseEntity(index); - } - - public static BaseEntity FindByNetClass(int startIndex, string className) - { - var index = NativeAPI.EntityFindByNetclass(startIndex, className); - if (index < 0) return null; - return new BaseEntity(index); - } - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/DamageType.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/DamageType.cs deleted file mode 100644 index e8d3afd2f..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/DamageType.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum DamageType - { - DMG_GENERIC = 0, // generic damage was done - DMG_CRUSH = (1 << 0), // crushed by falling or moving object. - // = NOTE: It's assumed crush damage is occurring as a result of physics collision, so no extra physics force is generated by crush damage. - DMG_BULLET = (1 << 1), // shot - DMG_SLASH = (1 << 2), // cut, clawed, stabbed - DMG_BURN = (1 << 3), // heat burned - DMG_VEHICLE = (1 << 4), // hit by a vehicle - DMG_FALL = (1 << 5), // fell too far - DMG_BLAST = (1 << 6), // explosive blast damage - DMG_CLUB = (1 << 7), // crowbar, punch, headbutt - DMG_SHOCK = (1 << 8), // electric shock - DMG_SONIC = (1 << 9), // sound pulse shockwave - DMG_ENERGYBEAM = (1 << 10), // laser or other high energy beam - DMG_PREVENT_PHYSICS_FORCE = (1 << 11), // Prevent a physics force - DMG_NEVERGIB = (1 << 12), // with this bit OR'd in, no damage type will be able to gib victims upon death - DMG_ALWAYSGIB = (1 << 13), // with this bit OR'd in, any damage type can be made to gib victims upon death. - DMG_DROWN = (1 << 14), // Drowning - - DMG_PARALYZE = (1 << 15), // slows affected creature down - DMG_NERVEGAS = (1 << 16), // nerve toxins, very bad - DMG_POISON = (1 << 17), // blood poisoning - heals over time like drowning damage - DMG_RADIATION = (1 << 18), // radiation exposure - DMG_DROWNRECOVER = (1 << 19), // drowning recovery - DMG_ACID = (1 << 20), // toxic chemicals or acid burns - DMG_SLOWBURN = (1 << 21), // in an oven - - DMG_REMOVENORAGDOLL = (1 << 22), // with this bit OR'd in, no ragdoll will be created, and the target will be quietly removed. - // = use this to kill an entity that you've already got a server-side ragdoll for - - DMG_PHYSGUN = (1 << 23), // Hit by manipulator. Usually doesn't do any damage. - DMG_PLASMA = (1 << 24), // Shot by Cremator - DMG_AIRBOAT = (1 << 25), // Hit by the airboat's gun - - DMG_DISSOLVE = (1 << 26), // Dissolving! - DMG_BLAST_SURFACE = (1 << 27), // A blast on the surface of water that cannot harm things underwater - DMG_DIRECT = (1 << 28), - DMG_BUCKSHOT = (1 << 29), // not quite a bullet. Little, rounder, different. - DMG_HEADSHOT = (1 << 30) - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/EntityFlags.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/EntityFlags.cs deleted file mode 100644 index f4d906749..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/EntityFlags.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - [Flags] - public enum EntityFlags - { - Onground = (1 << 0), // At rest / on the ground - Ducking = (1 << 1), // Player flag -- Player is fully crouched - Waterjump = (1 << 3), // player jumping out of water - Ontrain = (1 << 4), // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. - Inrain = (1 << 5), // Indicates the entity is standing in rain - Frozen = (1 << 6), // Player is frozen for 3rd person camera - Atcontrols = (1 << 7), // Player can't move, but keeps key inputs for controlling another entity - Client = (1 << 8), // Is a player - Fakeclient = (1 << 9), // Fake client, simulated server side; don't send network messages to them - Inwater = (1 << 10), // In water - Fly = (1 << 11), // Changes the SV_Movestep() behavior to not need to be on ground - Swim = (1 << 12), // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) - Conveyor = (1 << 13), - Npc = (1 << 14), - Godmode = (1 << 15), - Notarget = (1 << 16), - Aimtarget = (1 << 17), // set if the crosshair needs to aim onto the entity - Partialground = (1 << 18), // not all corners are valid - Staticprop = (1 << 19), // Eetsa static prop! - Graphed = (1 << 20), // worldgraph has this ent listed as something that blocks a connection - Grenade = (1 << 21), - Stepmovement = (1 << 22), // Changes the SV_Movestep() behavior to not do any processing - Donttouch = (1 << 23), // Doesn't generate touch functions, generates Untouch() for anything it was touching when this flag was set - Basevelocity = (1 << 24), // Base velocity has been applied this frame (used to convert base velocity into momentum) - Worldbrush = (1 << 25), // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) - Object = (1 << 26), // Terrible name. This is an object that NPCs should see. Missiles, for example. - Killme = (1 << 27), // This entity is marked for death -- will be freed by game DLL - Onfire = (1 << 28), // You know... - Dissolving = (1 << 29), // We're dissolving! - Transragdoll = (1 << 30), // In the process of turning into a client side ragdoll. - UnblockableByPlayer = (1 << 31) // pusher that can't be blocked by the player - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/HitGroup.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/HitGroup.cs deleted file mode 100644 index 68bb34cda..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/HitGroup.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum HitGroup - { - HITGROUP_GENERIC = 0, - HITGROUP_HEAD = 1, - HITGROUP_CHEST = 2, - HITGROUP_STOMACH = 3, - HITGROUP_LEFTARM = 4, - HITGROUP_RIGHTARM = 5, - HITGROUP_LEFTLEG = 6, - HITGROUP_RIGHTLEG = 7, - HITGROUP_GEAR = 10, - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/LifeState.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/LifeState.cs deleted file mode 100644 index df372caab..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/LifeState.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum LifeState - { - LIFE_ALIVE = 0, // alive - LIFE_DYING, // playing death animation or still falling off of a ledge waiting to hit ground - LIFE_DEAD, // dead. lying still. - LIFE_RESPAWNABLE, - LIFE_DISCARDBODY, - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/MoveType.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/MoveType.cs deleted file mode 100644 index 80e72d66d..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/MoveType.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum MoveType - { - MOVETYPE_NONE = 0, // never moves - MOVETYPE_ISOMETRIC, // For players -- in TF2 commander view, etc. - MOVETYPE_WALK, // Player only - moving on the ground - MOVETYPE_STEP, // gravity, special edge handling -- monsters use this - MOVETYPE_FLY, // No gravity, but still collides with stuff - MOVETYPE_FLYGRAVITY, // flies through the air + is affected by gravity - MOVETYPE_VPHYSICS, // uses VPHYSICS for simulation - MOVETYPE_PUSH, // no clip to world, push and crush - MOVETYPE_NOCLIP, // No gravity, no collisions, still do velocity/avelocity - MOVETYPE_LADDER, // Used by players only when going onto a ladder - MOVETYPE_OBSERVER, // Observer movement, depends on player's observer mode - MOVETYPE_CUSTOM, // Allows the entity to describe its own physics - - // should always be defined as the last item in the list - MOVETYPE_LAST = MOVETYPE_CUSTOM, - - MOVETYPE_MAX_BITS = 4 - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/ObserverMode.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/ObserverMode.cs deleted file mode 100644 index 824a6d60b..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/ObserverMode.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum ObserverMode - { - OBS_MODE_NONE = 0, // not in spectator mode - OBS_MODE_DEATHCAM, // special mode for death cam animation - OBS_MODE_FREEZECAM, // zooms to a target, and freeze-frames on them - OBS_MODE_FIXED, // view from a fixed camera position - OBS_MODE_IN_EYE, // follow a player in first person view - OBS_MODE_CHASE, // follow a player in third person view - OBS_MODE_ROAMING, // free roaming - - NUM_OBSERVER_MODES, - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PlayerAnimation.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PlayerAnimation.cs deleted file mode 100644 index 82496d6f3..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PlayerAnimation.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - enum PLAYER_ANIM - { - PLAYER_IDLE, - PLAYER_WALK, - PLAYER_JUMP, - PLAYER_SUPERJUMP, - PLAYER_DIE, - PLAYER_ATTACK1, - PLAYER_IN_VEHICLE, - - // TF Player animations - PLAYER_RELOAD, - PLAYER_START_AIMING, - PLAYER_LEAVE_AIMING, - }; -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PropType.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PropType.cs deleted file mode 100644 index 0e40cdf95..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/PropType.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - /// - /// Property types for entity - /// - public enum PropType - { - /// - /// Property is networked - /// - Send, - /// - /// Property is a save data field - /// - Data - } -} diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderFx.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderFx.cs deleted file mode 100644 index add9c940b..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderFx.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum RenderFx - { - RENDERFX_NONE = 0, - RENDERFX_PULSE_SLOW, - RENDERFX_PULSE_FAST, - RENDERFX_PULSE_SLOW_WIDE, - RENDERFX_PULSE_FAST_WIDE, - RENDERFX_FADE_SLOW, - RENDERFX_FADE_FAST, - RENDERFX_SOLID_SLOW, - RENDERFX_SOLID_FAST, - RENDERFX_STROBE_SLOW, - RENDERFX_STROBE_FAST, - RENDERFX_STROBE_FASTER, - RENDERFX_FLICKER_SLOW, - RENDERFX_FLICKER_FAST, - RENDERFX_NO_DISSIPATION, - RENDERFX_DISTORT, /**< Distort/scale/translate flicker */ - RENDERFX_HOLOGRAM, /**< kRenderFxDistort + distance fade */ - RENDERFX_EXPLODE, /**< Scale up really big! */ - RENDERFX_GLOWSHELL, /**< Glowing Shell */ - RENDERFX_CLAMP_MIN_SCALE, /**< Keep this sprite from getting very small (SPRITES only!) */ - RENDERFX_ENV_RAIN, /**< for environmental rendermode, make rain */ - RENDERFX_ENV_SNOW, /**< " " " , make snow */ - RENDERFX_SPOTLIGHT, /**< TEST CODE for experimental spotlight */ - RENDERFX_RAGDOLL, /**< HACKHACK: TEST CODE for signalling death of a ragdoll character */ - RENDERFX_PULSE_FAST_WIDER, - RENDERFX_MAX - }; -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderMode.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderMode.cs deleted file mode 100644 index c113a1a56..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/RenderMode.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum RenderMode - { - RENDER_NORMAL, /**< src */ - RENDER_TRANSCOLOR, /**< c*a+dest*(1-a) */ - RENDER_TRANSTEXTURE, /**< src*a+dest*(1-a) */ - RENDER_GLOW, /**< src*a+dest -- No Z buffer checks -- Fixed size in screen space */ - RENDER_TRANSALPHA, /**< src*srca+dest*(1-srca) */ - RENDER_TRANSADD, /**< src*a+dest */ - RENDER_ENVIRONMENTAL, /**< not drawn, used for environmental effects */ - RENDER_TRANSADDFRAMEBLEND, /**< use a fractional frame value to blend between animation frames */ - RENDER_TRANSALPHAADD, /**< src + dest*(1-a) */ - RENDER_WORLDGLOW, /**< Same as kRenderGlow but not fixed size in screen space */ - RENDER_NONE /**< Don't render. */ - }; -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidFlags.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidFlags.cs deleted file mode 100644 index 6ad72dd53..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidFlags.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - [Flags] - public enum SolidFlags - { - FSOLID_CUSTOMRAYTEST = 0x0001, // Ignore solid type + always call into the entity for ray tests - FSOLID_CUSTOMBOXTEST = 0x0002, // Ignore solid type + always call into the entity for swept box tests - FSOLID_NOT_SOLID = 0x0004, // Are we currently not solid? - FSOLID_TRIGGER = 0x0008, // This is something may be collideable but fires touch functions - // even when it's not collideable (when the FSOLID_NOT_SOLID flag is set) - FSOLID_NOT_STANDABLE = 0x0010, // You can't stand on this - FSOLID_VOLUME_CONTENTS = 0x0020, // Contains volumetric contents (like water) - FSOLID_FORCE_WORLD_ALIGNED = 0x0040, // Forces the collision rep to be world-aligned even if it's SOLID_BSP or SOLID_VPHYSICS - FSOLID_USE_TRIGGER_BOUNDS = 0x0080, // Uses a special trigger bounds separate from the normal OBB - FSOLID_ROOT_PARENT_ALIGNED = 0x0100, // Collisions are defined in root parent's local coordinate space - FSOLID_TRIGGER_TOUCH_DEBRIS = 0x0200, // This trigger will touch debris objects - FSOLID_TRIGGER_TOUCH_PLAYER = 0x0400, // This trigger will touch only players - FSOLID_NOT_MOVEABLE = 0x0800, // Assume this object will not move - - FSOLID_MAX_BITS = 12 - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidType.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidType.cs deleted file mode 100644 index d1e8e11f7..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/SolidType.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum SolidType - { - SOLID_NONE = 0, // no solid model - SOLID_BSP = 1, // a BSP tree - SOLID_BBOX = 2, // an AABB - SOLID_OBB = 3, // an OBB (not implemented yet) - SOLID_OBB_YAW = 4, // an OBB, constrained so that it can only yaw - SOLID_CUSTOM = 5, // Always call into the entity for tests - SOLID_VPHYSICS = 6, // solid vphysics object, get vcollide from the model and collide with that - SOLID_LAST, - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/Team.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/Team.cs deleted file mode 100644 index 5ffc4b5f6..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Entities/Constants/Team.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Entities.Constants -{ - public enum Team - { - TEAM_ANY = -1, - TEAM_INVALID = 1, - TEAM_UNASSIGNED = 0, - TEAM_SPECTATOR = 1, - TEAM_TERRORIST = 2, - TEAM_CT = 3, - TEAM_MAXCOUNT = 4, - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Players/Constants/NetFlow.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Players/Constants/NetFlow.cs deleted file mode 100644 index 2d4e8cff5..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Players/Constants/NetFlow.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Players.Constants -{ - public enum NetFlow - { - FLOW_OUTGOING=0, - FLOW_INCOMING=1 - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Players/Player.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Players/Player.cs deleted file mode 100644 index c41fc4f60..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Players/Player.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using System.Collections.Generic; -using System.Security.Cryptography; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Entities; -using CounterStrikeSharp.API.Modules.Entities.Constants; -using CounterStrikeSharp.API.Modules.Utils; - -namespace CounterStrikeSharp.API.Modules.Players -{ - public class Player : BaseEntity - { - public Player(IntPtr pointer) : base(pointer) - { - } - - public new static Player FromIndex(int index) - { - var playerBaseEntity = BaseEntity.FromIndex(index); - if (playerBaseEntity != null && !NativeAPI.ClientIsInGame(index)) return null; - if (playerBaseEntity == null) return null; - return new Player(playerBaseEntity.Handle); - } - - private PlayerInfo _playerInfo; - - public PlayerInfo PlayerInfo => _playerInfo ??= new PlayerInfo(NativeAPI.PlayerinfoFromIndex(Index)); - public bool IsAlive => LifeState == (int)Entities.Constants.LifeState.LIFE_ALIVE; - - public ObserverMode ObserverMode - { - get => (ObserverMode)GetProp(PropType.Send, "m_iObserverMode"); - set => SetProp(PropType.Send, "m_iObserverMode", (int)value); - } - - public PlayerButtons Buttons => (PlayerButtons)GetProp(PropType.Data, "m_nButtons"); - public IEnumerable SelectedButtons => Buttons.FlagsToList(); - - public string Name - { - get => PlayerInfo.Name; - } - - public Player ObserverTarget - { - get - { - var targetIndex= GetPropEnt(PropType.Send, "m_hObserverTarget")?.Index; - return targetIndex != null ? Player.FromIndex(targetIndex.Value) : null; - } - } - - - public bool IsScoped - { - get => GetPropBool(PropType.Send, "m_bIsScoped"); - set => SetPropBool(PropType.Send, "m_bIsScoped", value); - } - - public EntityFlags Flags - { - get => (EntityFlags)GetProp(PropType.Data, "m_fFlags"); - set => SetProp(PropType.Data, "m_fFlags", (int)value); - } - - public int LifeState - { - get => GetProp(PropType.Send, "m_lifeState"); - set => SetProp(PropType.Send, "m_lifeState", value); - } - - public Vector ViewOffset - { - get => GetPropVector(PropType.Data, "m_vecViewOffset"); - set => SetPropVector(PropType.Data, "m_vecViewOffset", value); - } - - public Vector EyeLocation => Origin + ViewOffset; - - public Angle EyeAngle - { - get - { - try - { - var x = GetPropFloat(PropType.Send, "m_angEyeAngles[0]"); - var y = GetPropFloat(PropType.Send, "m_angEyeAngles[1]"); - return new Angle(x, y, 0); - } - catch (Exception e) - { - Server.PrintToConsole($"Error when retrieving eye angles: {e.Message}, {e.StackTrace}"); - return new Angle(); - } - } - } - - public Vector ViewVector - { - get - { - double yaw = (Math.PI / 180) * EyeAngle.Y; - double pitch = (Math.PI / 180) * EyeAngle.X; - - var sy = Math.Sin(yaw); - var cy = Math.Cos(yaw); - - var sp = Math.Sin(pitch); - var cp = Math.Cos(pitch); - - return new Vector((float)(cp * cy), (float)(cp * sy), (float)-sp); - } - } - - public bool IsFakeClient => NativeAPI.IsFakeClient(Index); - - public BaseEntity ActiveWeapon - { - get => GetPropEnt(PropType.Data, "m_hActiveWeapon"); - set => SetPropEnt(PropType.Data, "m_hActiveWeapon", value.Index); - } - - public static Player FromUserId(int userid) - { - var index = NativeAPI.IndexFromUserid(userid); - if (index <= 0) return null; - return FromIndex(index); - } - - public void PrintToChat(string message) => NativeAPI.PrintToChat(Index, message); - public void PrintToHint(string message) => NativeAPI.PrintToHint(Index, message); - public void PrintToCenter(string message) => NativeAPI.PrintToCenter(Index, message); - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Players/PlayerInfo.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Players/PlayerInfo.cs deleted file mode 100644 index 549c632ba..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Players/PlayerInfo.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Entities.Constants; -using CounterStrikeSharp.API.Modules.Utils; - -namespace CounterStrikeSharp.API.Modules.Players -{ - public class PlayerInfo : NativeObject - { - internal PlayerInfo(IntPtr cHandle) : base(cHandle) - { - } - - public string Name => NativeAPI.PlayerinfoGetName(Handle); - - public int UserId => NativeAPI.PlayerinfoGetUserid(Handle); - public string SteamId => NativeAPI.PlayerinfoGetSteamid(Handle); - - public Team Team - { - get => (Team)NativeAPI.PlayerinfoGetTeam(Handle); - set => NativeAPI.PlayerinfoSetTeam(Handle, (int) value); - } - - public int Kills => NativeAPI.PlayerinfoGetKills(Handle); - public int Deaths => NativeAPI.PlayerinfoGetKills(Handle); - - public bool IsConnected => NativeAPI.PlayerinfoIsConnected(Handle); - - public int Armor => NativeAPI.PlayerinfoGetArmor(Handle); - public bool IsHLTV => NativeAPI.PlayerinfoIsHltv(Handle); - public bool IsPlayer => NativeAPI.PlayerinfoIsPlayer(Handle); - public bool IsFakeClient => NativeAPI.PlayerinfoIsFakeclient(Handle); - public bool IsDead => NativeAPI.PlayerinfoIsDead(Handle); - public bool IsInAVehicle => NativeAPI.PlayerinfoIsInVehicle(Handle); - public bool IsObserver => NativeAPI.PlayerinfoIsObserver(Handle); - /*public Angle Origin => NativePINVOKE.IPlayerInfo_GetAbsOrigin(Handle).ToObject(); - public Angle Angles => NativePINVOKE.IPlayerInfo_GetAbsAngles(Handle).ToObject(); - public Angle MinSize => NativePINVOKE.IPlayerInfo_GetPlayerMins(Handle).ToObject(); - public Angle MaxSize => NativePINVOKE.IPlayerInfo_GetPlayerMaxs(Handle).ToObject();*/ - public string WeaponName => NativeAPI.PlayerinfoGetWeaponName(Handle); - public string ModelName => NativeAPI.PlayerinfoGetModelName(Handle); - public int Health => NativeAPI.PlayerinfoGetHealth(Handle); - public int MaxHealth => NativeAPI.PlayerinfoGetMaxHealth(Handle); - //public CBotCmd LastUserCommand => NativePINVOKE.IPlayerInfo_GetLastUserCommand(Handle); - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundAttenuation.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundAttenuation.cs deleted file mode 100644 index be756fa1d..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundAttenuation.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Sound.Constants -{ - public static class SoundAttenuation - { - public const float ATTN_NONE = 0.0f; - public const float ATTN_NORM = 0.8f; - public const float ATTN_IDLE = 2.0f; - public const float ATTN_STATIC = 1.25f; - public const float ATTN_RICOCHET = 1.5f; - public const float ATTN_GUNFIRE = 0.27f; - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundChannel.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundChannel.cs deleted file mode 100644 index 09341440e..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundChannel.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Sound.Constants -{ - public enum SoundChannel - { - CHAN_REPLACE = -1, - CHAN_AUTO = 0, - CHAN_WEAPON = 1, - CHAN_VOICE = 2, - CHAN_ITEM = 3, - CHAN_BODY = 4, - CHAN_STREAM = 5, // allocate stream channel from the static or dynamic area - CHAN_STATIC = 6, // allocate channel from the static area - CHAN_VOICE_BASE = 7, // allocate channel for network voice data - CHAN_USER_BASE = 135 - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundFlags.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundFlags.cs deleted file mode 100644 index c311d6fae..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundFlags.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; - -namespace CounterStrikeSharp.API.Modules.Sound.Constants -{ - [Flags] - public enum SoundFlags - { - SND_NOFLAGS = 0, // to keep the compiler happy - SND_CHANGE_VOL = (1<<0), // change sound vol - SND_CHANGE_PITCH = (1<<1), // change sound pitch - SND_STOP = (1<<2), // stop the sound - SND_SPAWNING = (1<<3), // we're spawning, used in some cases for ambients - // not sent over net, only a param between dll and server. - SND_DELAY = (1<<4), // sound has an initial delay - SND_STOP_LOOPING = (1<<5), // stop all looping sounds on the entity. - SND_SPEAKER = (1<<6), // being played again by a microphone through a speaker - - SND_SHOULDPAUSE = (1<<7), // this sound should be paused if the game is paused - SND_IGNORE_PHONEMES = (1<<8), - SND_IGNORE_NAME = (1<<9), // used to change all sounds emitted by an entity, regardless of scriptname - SND_IS_SCRIPTHANDLE = (1<<10), // server has passed the actual SoundEntry instead of wave filename - - SND_UPDATE_DELAY_FOR_CHOREO = (1<<11), // True if we have to update snd_delay_for_choreo with the IO latency. - SND_GENERATE_GUID = (1<<12), - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundLevel.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundLevel.cs deleted file mode 100644 index 357a1de6d..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundLevel.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Sound.Constants -{ - public enum SoundLevel - { - SNDLVL_NONE = 0, - - SNDLVL_20dB = 20, // rustling leaves - SNDLVL_25dB = 25, // whispering - SNDLVL_30dB = 30, // library - SNDLVL_35dB = 35, - SNDLVL_40dB = 40, - SNDLVL_45dB = 45, // refrigerator - - SNDLVL_50dB = 50, // 3.9 // average home - SNDLVL_55dB = 55, // 3.0 - - SNDLVL_IDLE = 60, // 2.0 - SNDLVL_60dB = 60, // 2.0 // normal conversation, clothes dryer - - SNDLVL_65dB = 65, // 1.5 // washing machine, dishwasher - SNDLVL_STATIC = 66, // 1.25 - - SNDLVL_70dB = 70, // 1.0 // car, vacuum cleaner, mixer, electric sewing machine - - SNDLVL_NORM = 75, - SNDLVL_75dB = 75, // 0.8 // busy traffic - - SNDLVL_80dB = 80, // 0.7 // mini-bike, alarm clock, noisy restaurant, office tabulator, outboard motor, passing snowmobile - SNDLVL_TALKING = 80, // 0.7 - SNDLVL_85dB = 85, // 0.6 // average factory, electric shaver - SNDLVL_90dB = 90, // 0.5 // screaming child, passing motorcycle, convertible ride on frw - SNDLVL_95dB = 95, - SNDLVL_100dB = 100, // 0.4 // subway train, diesel truck, woodworking shop, pneumatic drill, boiler shop, jackhammer - SNDLVL_105dB = 105, // helicopter, power mower - SNDLVL_110dB = 110, // snowmobile drvrs seat, inboard motorboat, sandblasting - SNDLVL_120dB = 120, // auto horn, propeller aircraft - SNDLVL_130dB = 130, // air raid siren - - SNDLVL_GUNFIRE = 140, // 0.27 // THRESHOLD OF PAIN, gunshot, jet engine - SNDLVL_140dB = 140, // 0.2 - - SNDLVL_150dB = 150, // 0.2 - - SNDLVL_180dB = 180, // rocket launching - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundPitch.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundPitch.cs deleted file mode 100644 index 71995e5d2..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundPitch.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Sound.Constants -{ - public static class SoundPitch - { - public const int PITCH_NORM = 100; - public const int PITCH_LOW = 95; - public const int PITCH_HIGH = 120; - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundSource.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundSource.cs deleted file mode 100644 index 60d026fca..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Constants/SoundSource.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -namespace CounterStrikeSharp.API.Modules.Sound.Constants -{ - public static class SoundSource - { - public const int SOUND_FROM_PLAYER = -2; - public const int SOUND_FROM_LOCAL_PLAYER = -1; - public const int SOUND_FROM_WORLD = 0; - } -} \ No newline at end of file diff --git a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Sound.cs b/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Sound.cs deleted file mode 100644 index d14d6d9db..000000000 --- a/managed/CounterStrikeSharp.API/Modules/Disabled/Sound/Sound.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is part of CounterStrikeSharp. - * CounterStrikeSharp is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * CounterStrikeSharp is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CounterStrikeSharp. If not, see . * - */ - -using System; -using System.Runtime.InteropServices; -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Players; -using CounterStrikeSharp.API.Modules.Sound.Constants; -using CounterStrikeSharp.API.Modules.Utils; - -namespace CounterStrikeSharp.API.Modules.Sound -{ - public static class Sound - { - public static bool PrecacheSound(string sound) => NativeAPI.PrecacheSound(sound, true); - - public static bool IsSoundPrecached(string sound) => NativeAPI.IsSoundPrecached(sound); - - public static float GetSoundDuration(string sound) => NativeAPI.GetSoundDuration(sound); - - public static void EmitSound(int client, - string sound, - int entity = SoundSource.SOUND_FROM_PLAYER, - SoundChannel channel = SoundChannel.CHAN_AUTO, - SoundLevel level = SoundLevel.SNDLVL_NORM, - float attenuation = SoundAttenuation.ATTN_NORM, - SoundFlags flags = SoundFlags.SND_NOFLAGS, - float volume = 1.0f, - int pitch = SoundPitch.PITCH_NORM, - Vector origin = null, - Vector direction = null) - { - NativeAPI.EmitSound(client, entity, (int) channel, sound, volume, attenuation, (int) flags, - pitch, origin?.Handle ?? IntPtr.Zero, direction?.Handle ?? IntPtr.Zero); - } - - public static void EmitSoundToAll(string sound, - int entity = SoundSource.SOUND_FROM_PLAYER, - SoundChannel channel = SoundChannel.CHAN_AUTO, - SoundLevel level = SoundLevel.SNDLVL_NORM, - float attenuation = SoundAttenuation.ATTN_NORM, - SoundFlags flags = SoundFlags.SND_NOFLAGS, - float volume = 1.0f, - int pitch = SoundPitch.PITCH_NORM, - Vector origin = null, - Vector direction = null) - { - for (int i = 1; i < 65; i++) - { - var client = Player.FromIndex(i); - if (client?.IsValid == true) - { - Sound.EmitSound(i, sound, entity, channel, level, attenuation, flags, volume, pitch, origin, - direction); - } - } - } - } -} \ No newline at end of file