nielsvaes / dcs_code_injector

Application to interact with Digital Combat Simulator while a mission is running
http://www.coconutcockpit.com
GNU General Public License v3.0
19 stars 4 forks source link

DCS code injector not opening the log file on a dcs server install #18

Open ChaosRifle opened 2 months ago

ChaosRifle commented 2 months ago

not why but the code injector refuses to open the log file, even when run as administrator. The log file exists, the injection works (i can fire code from the injector, typing to log, and it does appear in the real log file, so all thats working fine) but for some reason it wont show the logs in the log view. Log view is enabled and it has the filepath to the dcs.log image image as you can see, log is there, and generating. code injection is working.. but the log viewer is not actually ever loading the logfile.

my only guess is perhaps uac or file ownership?????

win10 install.

nielsvaes commented 2 months ago

I think I only ever tested running it with a dedicated server a very long time ago, and I don't really remember if I had any issues back then. File permissions might be an issue, although read permissions are usually standard and Administrators should be able to read everything anyway.

I'm in the process of adding some proper logging to a file while the tool is running, but that's not in yet. If you have the possibility, run through tool directly through Python instead of the .exe (https://github.com/nielsvaes/dcs_code_injector?tab=readme-ov-file#-how-to-download) That way you should get any errors printed to the cmd prompt you started it from and that might help us track it down.

Could you also try the following: Open the Code Injector without having the Dedicated Server running. Do you see any log content then? If yes, that probably means that the Dedicated Server process is not letting any other process access the file. If no, that means that the Code Injector process is really not able to read the log file.

nielsvaes commented 2 months ago

Another thing to try is replacing the forward slashes / with backslashes \ in the settings. Forward slashes seem to work fine on Windows 11 and the normal game, but I can't verify how it behaves with Win10 and Dedicated Server.

ChaosRifle commented 2 months ago

Does not appear to be a file permissions issue, as the user account running DCS/code injector is the owner, and system/admin have permissions too. system permissions are full allow except for special permissions, and the file has been deleted to regenerate just in case.

code injector without DCS running still does not show the log at all. while running, only the CTRL+ENTER code execution is shown in the log of what code you just tried to inject.

forward/backward slashes do not fix it.

as for installing via python, python is not my thing, so not sure how to do that.

ChaosRifle commented 2 months ago

Update, I tried different versions of code injector, whatever the issue is, v 1.2.3 works fine, v 1.4.9 doesnt load the logs, and v 1.4.10 doesnt launch at all (shows in task manager but doesnt launch, no splash screen, just terminates itself and vanishes in task manager)

So, whatever the issue is, its not present in v1.2.3 for sure, but is in 1.4.9

as an aside, i tried running v1.4.10 on another machine of mine, also does not launch.

ChaosRifle commented 2 weeks ago

still happening on latest release (1.4.11) with new hook, and totally deleted the code injector files in My Documents to be sure its not corrupted

nielsvaes commented 2 weeks ago

Could you give it a shot running it through Python instead of the .exe? It's really not that complicated:

You should see any errors printed out to the CMD prompt then, maybe there's something there that can help us out with this.

ChaosRifle commented 1 week ago

done this, used the same version of python as yours (3.11.9), however it appears that pip did not set it as an executable command to run the program.

image

nielsvaes commented 2 days ago

Alright, I just managed to replicate the error. Next to your log file, there should be a file called dcs.log.offset. It's probably this file that got corrupted somewhere. Can you try deleting that file and restarting the Code Injector to see if it shows the logs then?

ChaosRifle commented 2 days ago

This has both helped in some regards, and not in others. The log does show up now! However, execution of commands only shows briefly that it tries to execute, and output is not shown (Ie, env.info("test")). Opening the DCS log shows that it did work, but the displayed log on code injector does not display that. So for some reason executed commands still do not show up.

There is also the issue of performance now though: It used to be nearly realtime, very snappy via RDP. However now, while the rest of the machine is still very snappy and nearly realtime in all interactions, interactions with code injector specifically are <1fps, but other applications can be seen working as expected at the same time. Code injector is using ~11.5% cpu load on a 3770k (and system load with the dcs server, srs server, and dcs grpc running idle is ~12-13%) Is hardware accelerated rendering required for it in later versions? (the server currently lacks a GPU) if so, that may explain the poor frame rate

I have tried to recopy the hook with DCS not running, and deleted the code injector myDocuments data to try for a fresh installation. This was done with the exe version of the release, not python

Do you have any troubleshooting info for why the above python install was not working? I would like to help test there too, but am unsure why it did not work.

EDIT: The performance issue seems to only occur once the miz is done loading, and during load the performance is flawless, despite system load being higher from DCS. I am unsure if you want this issue closed, as technically we found why the log file would not open, though have uncovered some new, probably unrelated, issues.