-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeae59e
commit ce9b07b
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
managed/CounterStrikeSharp.API/Modules/Memory/ValveInterface.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using CounterStrikeSharp.API.Core; | ||
|
||
namespace CounterStrikeSharp.API.Modules.Memory; | ||
|
||
public record ValveInterface | ||
{ | ||
enum ValveInterfaceType | ||
{ | ||
Engine, | ||
Server, | ||
} | ||
|
||
private ValveInterface(ValveInterfaceType type, string name) | ||
{ | ||
this.Type = type; | ||
this.Name = name; | ||
} | ||
|
||
private ValveInterfaceType Type { get; } | ||
public string Name { get; } | ||
|
||
public IntPtr Pointer => NativeAPI.GetValveInterface((int)Type, Name); | ||
|
||
public override string ToString() | ||
{ | ||
return this.Pointer.ToString(); | ||
} | ||
|
||
public static ValveInterface Engine => new(ValveInterfaceType.Engine, "Source2EngineToServer001"); | ||
public static ValveInterface CVars => new(ValveInterfaceType.Engine, "VEngineCvar007"); | ||
public static ValveInterface Server => new(ValveInterfaceType.Server, "Source2Server001"); | ||
public static ValveInterface ServerGameClients => new(ValveInterfaceType.Server, "Source2GameClients001"); | ||
public static ValveInterface NetworkServerService => new(ValveInterfaceType.Engine, "NetworkServerService_001"); | ||
public static ValveInterface GameEventSystem => new(ValveInterfaceType.Engine, "GameEventSystemServerV001"); | ||
} |