saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2, written in C#.
MIT License
76 stars 7 forks source link

Expose Server Classes #33

Open in0finite opened 6 months ago

in0finite commented 6 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 6 months ago

This should be simple enough to add.

Out of interest, what do you need this for?

in0finite commented 6 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.