-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: poll external file for console commands #1541
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't decided yet whether this will be added - but if it will the handling of the file name needs to be changed to be Unicode compatible on all platforms. fopen does not support Unicode on Windows.
I have changed the code to use FileReader/FileWriter classes, which use _wfopen if WIN32 is #defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were some problems when attempting to include this in GZDoom. Was this fully compiled on your end?
if (i > 0 && i < (int)Args->NumArgs() - 1) | ||
{ | ||
RefreshFile = Args->GetArgList(i + 1); | ||
RefreshInterval = TICRATE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When trying to merge this into QZDoom, I get the error that TICRATE isn't found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, when doing this just on GZDoom, TICRATE isn't found. Please fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which toolchain are you using? It builds fine on my machine with GCC 11.2.0.
I have just added an #include "doomdef.h"
statement in c_console.cpp, it should fix the problem, TICRATE is defined as enum in this file. Please try to reproduce the issue by building 315e58f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using Visual Studio 2017. I'll try it again in a bit. If it works, then I'll put it in QZDoom.
The commit adds "-refreshfile" and "-refreshinterval" command-line arguments. Every refreshinterval tics (or once a second if not specified) a refreshfile is read and is evaluated if exists and not empty. Then it is truncated. This feature provides a facility for an external program to control the game.
I'm marking this one as "on hold" - I am not going to merge this one until I know for sure that it's okay to do so. |
This one needs an "ok" from Graf. Functionally it seems this was tested and I was going to go ahead and merge it, but considering the nature of this feature it will need that extra layer of approval. |
Yep, I agree. For what it's worth, I tested it more thoroughly than the others, and it performed flawlessly in all cases; I was actually rather impressed, as I even tried it with a few hundred lines, various refresh intervals, etc. That being said, I don't know this is the way to go about bringing in commands from outside; that is entirely up to Graf :) |
Hello everybody |
I'd like to see this resolved as well, the mod's been borked past GZDoom 4.10 as it lost the feature to read a constantly updating .txt file. |
The commit adds "-refreshfile" and "-refreshinterval" command-line
arguments. Every refreshinterval tics (or once a second if not
specified) a refreshfile is read and is evaluated if exists and not
empty. Then it is truncated.
This feature provides a facility for an external program to control
the game.