Metapyziks / SourceUtils

Source engine file format exporting / WebGL map viewer demo.
MIT License
142 stars 21 forks source link

Can't run debugger on WebExport solution #65

Closed Donkie closed 5 years ago

Donkie commented 5 years ago

I'm having some trouble exporting a Garry's Mod map (CompressedList for MeshData indices creates invalid json numbers like 000006) so I was gonna try look into what's wrong. However I can't run the solution in Debug mode, it gets stuck when exporting leafpage0.json on Export.cs#167 (client.OpenRead) and soon finally times out. It works just fine in Release mode but naturally I can't use breakpoints there so it's abit messy to use.

Metapyziks commented 5 years ago

Thanks for reporting, I'm sorry you're having this problem.

It seems like it's not able to connect to the web server it launches that serves the exported map files. It's definitely odd that it works fine only in Release mode, assuming you have the same command line options for both modes.

You could try adding a try/catch inside the lambda here: https://github.com/Metapyziks/SourceUtils/blob/master/SourceUtils.WebExport/Export.cs#L284

So it becomes:

Task.Run(() =>
{
    try
    {
        server.Run();
    }
    catch (Exception e)
    {
        Console.WriteLine(e);
    }
});

Hopefully that will tell you what's going wrong.

Donkie commented 5 years ago

Thank your for the response. It turns out that the code was running a LOT slower on debug mode (up to a minute on my machine) which lead me to believe it had timed out (and when I paused it always stopped at the client.OpenRead call so that lead me to believe it didn't connect properly).

All in all, it seems to work just fine now.