Feature Indicate that something is running in gCLI

fronobulax

Developer
Staff member
I see it. I fist thought there was an error - it was displaying green when it should have been gray and visa versa but upon further investigation, the two displays do not stay anything close to in synch. Indeed, I just started a script and it turned green. At the moment I am uncomfortable with this because the amount of unsynchronization comes perilously close to "not working". I may get a chance to look at that later. I also assume that someone who is using a jar file will have the html updated/overwritten and the requirement to do so manually only exists because people are building/running from source and not a jar.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
At the moment it should be at most 4 seconds out of sync because that's time interval on refreshing. We'd be very safe in reducing that to 1 or 2 seconds, and I'm pretty sure we'd be safe reducing it even further.
 

AlbinoRhino

Active member
Now that I'm thinking about it, I remember that I initially did that because there was occasionally text missing from the rCLI that was actually present in the gCLI. I haven't noticed that happening for a long time, so I think reducing the interval resolved that issue.

edit:
And now that I've actually looked...it appears I reduced it to 1.5s, rather than 1.0.
 
Last edited:

fronobulax

Developer
Staff member
I found setTimeout( getCLIUpdate, 4000 ) and changed it to setTimeout( getCLIUpdate, 1500 ) in cli.html. If there is a different place to change the timing, tell me and ignore the most of this post.

Running from the jar my version cli.html made it into the relay sub-directory so I assume a jar running user will get the changes. Any one else presumably has the tools and knowledge to get the right file where it needs to be. Bottom line is my concerns about deployment, voiced above, seem to be unfounded.

As for the patch itself, I still don't feel like it is working, or working well. I run mafia, open the relay browser and enable the gCLI in the relay browser. I see a colored oval under the command entry line in the relay gCLI and define success based upon whether that oval is the same color as the character pane on the left of the KoLmafia display or not. Most of the time they don't match. I wondered whether the gray and green colors were reversed but then I get a couple flashes when both places match green or gray.

I note mafia is usually green when I have a script running but the relay cli is gray. This situation can last from three to five minutes with no change.

Entering a command at the relay gCLI does not seem to change the situation.

I admit to a certain laziness in trying to understand what the changed code is doing but something does not seem right. I don't know whether it is my browser/settings, expectations, or whether there are "state changes" that are not being captured and sent to the relay gCLI.
 

fronobulax

Developer
Staff member
I am seeing a lot of debug logs from a horrible relay server failure. Since I tend to close the browser as KoLmafia is logging out, I wonder if this patch has exposed a situation where mafia tries to send something to the relay browser without checking to see that the browser is active?
 

fronobulax

Developer
Staff member
I'm not getting the feedback I hoped for so I am putting this on hold, unimplemented.

I will test and submit when there is code that

a) does not generate a relay failure debug log (which is presumably, but unverified, caused when this feature is active and KoLmafia is shutting down)

and

b) shows the same color consistently in both places with a lag no more than a couple of seconds.

I just don't have time nor interest to resolve those on my own.
 
Top