StatsHelix / demoinfo

A library to analyze CS:GO demos in C#
MIT License
321 stars 78 forks source link

System.Exception: 'Roy said I should throw this.' #168

Closed KilinW closed 3 years ago

KilinW commented 3 years ago

Hello, I'm kind of a beginner to c#. And I'm now trying to familiar with this package. Cause i want to know all the physic info of a player in a demo. But I saw a weird exception in DemoInfo.ST.StringTableParser.ParseStringTable(). That make my extremely simple demo parse code not working. Is this normal?

using System.IO;
using DemoInfo;

namespace csproj
{
    class Program
    {
        static void Main(string[] args)
        {
            DemoParser dem = new DemoParser(File.OpenRead("cyberwave.dem"));
            dem.ParseHeader();
            dem.ParseToEnd();
        }
    }
}
master117 commented 3 years ago

Please see if you have these issues with a mm/gotv demo. And upload the faulty demo so anyone has a chance to actually look at the error.

KilinW commented 3 years ago

Hello master117. I use one of my GOTV demo. steam://rungame/730/76561202255233023/+csgo_download_match%20CSGO-BsMJ8-UG8Lj-oRzSn-x6z5X-Nk2pH And it still has the same issue They all got the exception after 10~30tick.

I change my visual studio to English for screenshot and the exception become

System.NotImplementedException: 'The method or operation is not implemented.'

image

but they got exception at the same tick. I saw someone post the same issue before. But POV demo still got "System.Exception: 'Roy said I should throw this.'"

master117 commented 3 years ago

Try this: https://github.com/StatsHelix/demoinfo/issues/165

You have to build the library yourself since there has been no new release for years.

KilinW commented 3 years ago

I have to apologize. I only write simple language like python. And it don't need to build. We just write code and run it. It looks like that i need to disabling signed assembly when building. But i got these errors when I try to build DemoInfo.

Cycle detected. DemoInfo -> DemoInfo (>= 1.2.0).

The BaseOutputPath/OutputPath property is not set for project

Don't really know how to build. Can you give me some hint? image

KilinW commented 3 years ago

I'm really sorry again for asking such dumb question. But I really can't figure it out...

master117 commented 3 years ago

Cycle means that you have a library twice or that a library is referencing itself. You do not need the NuGet package if you also add the library.

From the beginning.

1, Make a solution

  1. Add your project
  2. Import DemoInfo project
  3. Change settings in DemoInfo project to disable signed assembly
  4. Import DemoInfo project in your project via browse dialog. Do not add DemoInfo via NuGet
KilinW commented 3 years ago

Hello. I appreciate your help and it totally works. I can now parse the whole GOTV demo now. But I still can't parse a POV demo. The POV demo is a random community map. Normally start with record command and stop with stop command. It's pretty weird that before I rebuild, I can parse about 10~30 ticks. But now I can't even parse 1 tick. I can only parse header of demo. image

master117 commented 3 years ago

POV demo parsing is not supported by this library, as they are wildly inconsistent.

You could try https://github.com/akiver/CSGO-Demos-Manager/tree/master/demoinfo (A newer fork of demoinfo that is still being semi maintained) (the readme is wrong, there is no nuget for that as far as I know) Or https://github.com/saul/demofile

But I don't think any public/open source library supports POV demo parsing. Some POV will still parse, but there is no guarantee.

KilinW commented 3 years ago

ok got that. Thank you very much!! I really appreciate your fast reply.