saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2 and Valve's Deadlock, written in C#.
MIT License
111 stars 10 forks source link

Expose Server Classes #33

Closed in0finite closed 1 month ago

in0finite commented 11 months ago

Basically this:

public ServerClass?[] ServerClasses => _serverClasses;

inside of DemoParser.Entities.cs.

Right now, you would need to manually process CDemoClassInfo message to get Server Classes. So this would be more convenient.

saul commented 10 months ago

This should be simple enough to add.

Out of interest, what do you need this for?

in0finite commented 10 months ago

I need it, for example, to identify which weapon the player is holding. Sure, I can use it's class name (which is ~ 20 bytes), or I can just use it's class id (2 bytes). Since I am copying data from external process to my Unity application, the size of data matters. Now, when I send class id to my process, I don't know which class it is, unless I have access to all classes and their names.