akiver / cs-demo-manager

Companion application for your Counter-Strike demos.
https://cs-demo-manager.com
MIT License
1.41k stars 195 forks source link

Decoupling demo analyzer from GUI dependency #238

Closed dangmai closed 9 months ago

dangmai commented 7 years ago

Hi,

First of all let me say Thank you for creating the application, it is a wonderful tool that does a lot of things right and clearly has a lot of thoughts put into it.

I'm wondering if you think it would be beneficial if we decouple the Demo Analyzer part (basically the Core project) from the GUI dependency, maybe make it a .Net Standard library instead of .Net framework program, so that it can be used by other programs on different operating systems. Possible use cases may include: Command Line Interface to the program (maybe to print out JSON data for a demo file); cross platform access to the library so that other cross platform GUIs can be developed against the library.

I'm not quite sure how feasible it is to do it yet, but won't mind jumping in the code base to find out. But if you think it's not a good addition to the program I'll understand too 🥂

n1c commented 7 years ago

Just jumping in to say this is a great idea. I started a project to do exactly what you used as an example (command line tool to convert dem -> json but don't really have the .NET experience to make it happen myself.

kpei commented 6 years ago

I've recently started doing this and it isn't particularly hard. The analyzer is isolated within Services/Concrete/Analyzer. The only dependencies being Core and Demoinfo. The AnalyzeDemosAsync method is pretty much all you need to run the analyzer and using the parsed Demo obj to write to file. More sophisticated recordkeeping can be done by overriding the hooks for each analyzer but I haven't gotten around to it yet.

xpekt commented 6 years ago

@kpei can you share what you have so far?

master117 commented 6 years ago

Why don't you just write your own analyzer using demoinfogo?

There is a 100% chances that you don't want exactly the same data from the demo as this program. So you would sacrifice speed and maintainability.

You would also have to write something to convert the data in your own format.

Writing your own customized analyser sounds a lot easier.

kpei commented 6 years ago

@xpekt sure. I used it for a very specific purpose so I'm only extracting parts of the data I'm interested in. The main idea is still there but like @master117 said, the analyzer is outdated, slow and you won't be able to get everything that you want. However, it is still much easier than having to rewrite the parser.

xpekt commented 6 years ago

i ended up doing it myself, but thank you @kpei

akiver commented 9 months ago

A new major version has been released, closing the issue 🧹